User guide

24-221
SystemVerilog Testbench Constructs
Here the information about when data is 0, 1, 2, 3, 5, 7, 9, and 10 is
in bin1, the information about when data is 4, 6, and 8 is in bin2, and
the information about when data has any other value is in bin3.
When you instantiate the covergroup, you can make the covergroup
a generic covergroup and then pass integers to specify value ranges
in the new method, for example:
covergroup cg1 (int low, int high) @ (posedge clk);
coverpoint data
{
bins bin1 = {[low:high]};
}
endgroup
cg1 cg1_1 = new(0,10); // 0 is the low value
// 10 is the high value
// of the range
Bins for Value Transitions
In a transition bin you can specify a list of sequences for the
coverpoint. Each sequence is a set of value transitions, for example:
coverpoint data
{
bins from0 = (0=>1),(0=>2),(0=>3);
bins tran1234 = (1=>2=>3=>4);
bins bindef = default;
}
In this example, coverage information for the sequences 0 to 1, 0 to
2, or 0 to 3 is in the bin named from0. Coverage information about
when data transitions occurred from 1 to 2 and then 3 and then 4 is
in bin tran1234.