User guide

24-225
SystemVerilog Testbench Constructs
The binsof construct supplies the coverage bins for the expression
argument, which can be either a coverpoint or a coverpoint bin.
covergroup cg1 @(posedge clk);
cp1 : coverpoint bit1
{
bins lowcp1vals = {[0:7]};
bins hicp1vals = {[8:15]};
}
cp2 : coverpoint bit2
{
bins lowcp2vals = {[0:7]};
bins hicp2vals = {[8:15]};
}
cp1Xcp2 : cross cp1, cp2
{
bins bin1 = binsof(cp1) intersect {[0:7]};
bins bin2 = binsof(cp1.hicp1vals) ||
binsof(cp2.hicp2vals);
bins bin3 = binsof(cp1) intersect {[0:1]} &&
binsof(cp2) intersect {[0:3]};
}
endgroup
In this example, the respective cross coverage bins, bin1, bin2, and
bin3 receive data whenever the corresponding right hand side binsof
expressions are satisfied. For example, bin1 receives data when
any bin of cp1 whose value range overlaps with the range [0:7]
receives data. In this case bin1 receive data whenever bin
lowcp1vals of coverpoint cp1 receives data.