User guide

24-233
SystemVerilog Testbench Constructs
end
end
initial
cov1 = new(2);
endprogram
The output of the program is:
va1r=010 coverage=0.000000
va1r=011 coverage=25.000000
va1r=100 coverage=50.000000
va1r=101 coverage=75.000000
va1r=110 coverage=100.000000
set_inst_name(string)
The instance name is set to string. Return type: void.
In the example below, cov1 is the name of an instance that is of type
covType, declared as such (covType cov1; cov1 = new(2);).
The name is changed to new_cov1 after calling
set_inst_name("new_cov1").
program test();
reg clk = 0;
reg [2:0] var = 3'b001;
covergroup covType (input integer param1) @(clk);
cp1: coverpoint var {
bins s0 = { [ 0 : param1] } ;
bins s1 = { 3 };
}
endgroup
covType cov1;