Hello in UVM RAL ,
i have R1 in the reg model , and i have one covergroup called R1_COV
when i am checking coverage report
it has two instance of R1_Cover and i catch it by using option.per_instance = 1
i want to know who create the second instance !!, here are snaps of my R1 and Register model code related to coverage
R1 code
class my_R1 extends uvm_reg; // object class
`uvm_object_utils(my_R1) // step register to factory
uvm_reg_field F1; // instatinaite feield1
uvm_reg_field F2; // instatinaite feield2
//function new (string name = “”, int unsigned n_bits, int has_coverage)
covergroup R1_COV;
option.per_instance = 1;
F1_cp: coverpoint F1.value [15:0];
F2_cp: coverpoint F2.value [15:0];
endgroup :R1_COV
function new(string name = “my_R1”);
super.new(name, 32, UVM_CVR_FIELD_VALS); // constructor (name , size , coverage)
if(has_coverage(UVM_CVR_FIELD_VALS)) begin
R1_COV = new();
end
endfunction
function void sample(uvm_reg_data_t data, uvm_reg_data_t byte_en, bit is_read, uvm_reg_map map);
R1_COV.sample();
endfunction :sample
function void sample_values();
super.sample_values();
R1_COV.sample();
endfunction :sample_values
Reg Model code
class my_reg_block extends uvm_reg_block;
`uvm_object_utils(my_reg_block)
my_R1 R1;
uvm_reg_map my_reg_map;
function new(string name = “my_reg_block”);
super.new(name, UVM_NO_COVERAGE);
endfunction
virtual function void build();
uvm_reg::include_coverage("*", UVM_CVR_ALL);
R1 = my_R1::type_id::create("R1");
R1.build();
R1.configure(this);
R1.add_hdl_path_slice("Dual_RF[0]", 0, 32);
R1.set_coverage(UVM_CVR_FIELD_VALS);
EDA Playground link:
note i check covergroups from questaSIM not EDAPLAYGROUND :)