In reply to dave_59:
I am seeing the same result what Ishan is trying to mention.
Here is the sample code
typedef enum bit [1:0] {A, B, C, D} _e;
class c;
_e e, f;
function new();
cg = new();
// cg._cp1.option.weight = 0;
cg.sample();
$display("The coverage is %0d\n", cg.get_coverage());
endfunction
covergroup cg;
_cp : coverpoint e {
bins legal[] = {A, B, C, D};
}
_cp1 : coverpoint f {
bins legal[] = {B, C, D};
}
endgroup
endclass
I have this line
$display(“The coverage is %0d\n”, cg.get_coverage());
which prints out the coverage. This prints 12 as there is 1 in 7 bins getting hit
Now I tried including the line
// cg._cp1.option.weight = 0;
I am still getting the same result (12). I was expecting 25