Functional coverage: Transition bins with any number of clock cycles in between

Hello,

I want to create a cover group having transition bins. However I want the bins to get hit when the transitions happen after any number of clock cycles as long as the sequence is maintained. Kindly let me know how to create this coverpoint in SV.


Example: covergroup cg_trans_haz @(posedge clk);
cp_trans_haz_seq: coverpoint haz_val {
bins abc = (4’h0=>4’h8=>4’hc=>4’he);
}

In the above example, I would like the bin “abc” to be hit whenever signal “haz_val” makes these transitions with any number of clock cycles between them.

Regards, Ali

You can’t have an open range with a covergroup. You can cover a sequence.

There is no direct support from the language, however you may write your code as:

covergroup cg_trans_haz @(my_event);
cp_trans_haz_seq: coverpoint haz_val {
bins abc = (4’h0=>4’h8=>4’hc=>4’he);
}

Then generate the my_event as:
forever @(posedge clk)
if ((haz_val==0)||(haz_val==8)||(haz_val==4)||(haz_val==e))
→ my_event;

In reply to sbagwe:

In case you do not wish to create my_event, use sample() method for covergroup.

In reply to dave_59:

Dave, Can you please elaborate on

You can cover a sequence

? Or please point out towards a reference in Cookbook explaining it.

Thanks,
Vikram

In reply to vikram_b:

By this I meant the cover sequence construct described in section 16.14.3 Cover statement of the 1800-2012 LRM. I was not referring to OVM/UVM sequences.