LRM Section 19.6.1.2 has following Code ::
logic [0:7] a, b;
parameter [0:7] mask = <Some_Value> ;
covergroup cg;
coverpoint a
{
bins low[] = {[0:127]};
bins high = {[128:255]};
}
coverpoint b
{
bins two[] = b with (item % 2 == 0) ;
bins three[] = b with (item % 3 == 0) ;
}
X: cross a,b
{
bins apple = X with ( a+b < 257 ) matches 127 ; // Meaning of " matches 127 " ?
bins cherry = ( binsof(b) intersect {[0:50]} && binsof(a.low) intersect {[0:50]} ) with ( a == b ) ;
bins plum = binsof(b.two) with (b > 12) || binsof(a.low) with (a & b & mask) ;
}
endgroup
cg cg1 = new() ;
My understanding for the above code is as follows ::
(i) Coverpoint a has 129 bins :: 128 bins for low , 1 bin for high .
(ii) Coverpoint b has 214 bins :: 128 bins for two which vary from two[0] , two[2] to two[254]
86 bins for three which vary from three[0] , three[3] to three[255]
(iii) Cross of a and b gives 129 x 214 i.e 27606 possible cross products
I am trying to understand the following ::
(1) Without matches , the with clause ( a + b < 257 ) would mean sum of bins ::
( a::low / a::high ) + ( b ::two / two::three ) should be less than 257 .
( **The sum would be using 32-bit precision due to 257 , right ?** )
How does the match operator work ?
(2) LRM 19.6.12 :: " When the matches clause is omitted, the selection policy defaults to one " .
What does the above line mean ?
(3) I was trying alternative to bins two via wildcard bins ::
coverpoint b
{
wildcard bins twowild[] = { 8'b?0 } ; // Could be :: 8'bX0 OR 8'bZ0 as well
}
This too generates 128 bins for twowild .
My question is via **8'b?0 / 8'bX0 / 8'bZ0 it seems that the upper 6 bits appended are ? / X/ Z . Shouldn't Six 0's be appended instead ?**
(4) The LRM uses “tuple” in a lot of places .
In python **Tuples are used to store multiple items in a single variable**
So can I say bins high , apple , cherry , plume are all tuples since they cover multiple values in a single bin ?