module trial ();
logic [1:0] connection_rate[8:1];// = 'hx;
logic [1:0] cnnctn_rate = 2'bx;
covergroup conn_cg ();
connection_rate_cp : coverpoint cnnctn_rate
{
bins connection_rate_link_3 = {0};
bins connection_rate_link_6 = {1};
bins connection_rate_link_12 = {2};
bins connection_rate_link_22_5 = {3};
}
endgroup
conn_cg conn_cg_i[8] ;
initial begin
foreach (conn_cg_i[k]) begin
conn_cg_i[k] = new();
$display("created for %0d",k);
end
end
initial begin
#5ns;
for(int i = 0 ; i < 8 ; i++) begin
connection_rate[i+1] = 2'bx;
if (`Test.MaxRate == 4'h9)
connection_rate[i+1] = 2'b0;
else if (`Test.MaxRate == 4'hA)
connection_rate[i+1] = 2'b1;
else if (`Test.MaxRate == 4'hB)
connection_rate[i+1] = 2'b10;
else if (`Test.MaxRate == 4'hC)
connection_rate[i+1] = 2'b11;
cnnctn_rate = connection_rate[i+1];
conn_cg_i[i].sample();
end
end
endmodule
In the above code i am not able to generate multiple instance of conn_cg.
i tried declaring the cover group outside module too , referring to some post in the same forum but that too didn’t work. how can i generate multiple instances of cover group in module
thanks,
samir