Is there a way I can disable checking for a specific register in a register map defined using uvm_reg?

Hi, I’m looking to selectively turn off checking on read for certain registers belonging to a register map I have defined using uvm_reg_map. I see there is a function called set_check_on_read() but looks like this will disable checking for all registers in the map. Is there anything similar to this to disable a specific register?

Thanks

In reply to spicy_dice:

Assuming you have some sort of list/queue of register names you want to skip the checking you could use uvm_reg_field::set_compare
Maybe something like this, probably there are more efficient ways to do this

I was not able to see any other mechanism to do this in the uvm_reg_map class or the uvm_reg class as you pointed in your post, only in the uvm_reg_field class the set_compare() method

“Sets the compare policy during a mirror update. The field value is checked against its mirror only when both the check argument in uvm_reg_block::mirror, uvm_reg::mirror, or uvm_reg_field::mirror and the compare policy for the field is UVM_CHECK.”



uvm_map my_map;
uvm_reg all_regs[$];
uvm_reg filtered_regs[$];
uvm_reg_field fields_to_be_skipped[$];

string regs_to_be_skipped[$] = '{"MY_REG1", "MY_REG2"};
//get the all the regs in map
my_map.get_registers(all_regs);

//get the regs you want to skip comparison
filtered_regs = all_regs.find(it) with (it.get_name() inside {regs_to_be_skipped});

// iterate over the regs and set_compare for every field to UVM_NO_CHECK
foreach(filtered_regs[i]) begin
  filtered_regs[i].get_fields(fields_to_be_skipped);
  foreach(fields_to_be_skipped[j]) begin
     fields_to_be_skipped[j].set_compare(UVM_NO_CHECK);
  end
end

HTH,
-R

In reply to rgarcia07:

Thanks! I think this should work for my purpose!