I am trying to create a parameterized covergroup
in my testbench as follows:
covergroup CG (input int id);
cp1 : coverpoint tb.gen_block_mem[id].var_x[3:0];
endgroup : CG
CG CG_0 = new(0);
CG CG_1 = new(1);
This fails in elaboration as the id
variable is not a constant. Is there a SystemVerilog workaround for this so that I can instantiate covergroups just like parameterized modules?