In reply to dineshrajendiran0510:
Works for me. Maybe you have a problem capturing the first or last samples. It might help to show the complete code example that can be run. For example:
module top;
typedef enum {S0,S1,S2,S3} state_e;
covergroup st_cg with function sample(state_e curr_state);
STATE_TRANSITIONS : coverpoint curr_state
{
bins S0_S2_S1_S3_S0 = (S0 => S2 => S1 => S3 => S0); // not working
}
endgroup // st_cg
st_cg cg;
initial begin
cg = new;
cg.sample(S1);
cg.sample(S0);
cg.sample(S2);
cg.sample(S1);
cg.sample(S3);
cg.sample(S0);
end
endmodule // top