Suppress warning in uvm_reg

I would like to suppress as specifically as possible some warnings in uvm_reg.svh.
E.g. the warning

  `uvm_warning("RegModel", {"Unable to locate field '",name,
                        "' in register '",get_name(),"'"})

in get_field_by_name.

I am considering using

+uvm_set_action=<comp>,<id>,<severity>,<action>

But wonder what

comp

should be in this case?

Any other method? The above one isn’t very specific as it will suppress all warnings in uvm_reg.svh I believe…

In reply to Nico75:

comp is the component in which you want to supress this warning. See the UVM Reference Manual example:
+uvm_set_action=uvm_test_top.env0.*,ALL,UVM_ERROR,UVM_NO_ACTION

In reply to chr_sue:

UVM registers or reg blocks are uvm_objects, no uvm_components, no?

In reply to Nico75:

You are right. But I believe you are looking into the wrong direction. What you can do is writing your own report catcher and demoting the UVM_WARNING, i.e. changing it to UVM_INFO.

In reply to chr_sue:

But how do I then link it to the UVM source code?

In reply to Nico75:

You have to implement your own report catcher by extending the base class uvm_report_catcher.
This requires your own catch method.

In reply to chr_sue:

Yes, but then I need to add it to each uvm_reg in some way.

I assume for every uvm_reg I could do someting like:

uvm_report_cb::add(reg1, demoter);
uvm_report_cb::add(reg2, demoter);
etc...

But that is quite some work. I am not even sure I can pass a uvm_object to add?

Perhaps I could use something as follows:

uvm_report_cb::add_by_name("my_reg_model.*", demoter);

so that it gets added to everything in my registermodel (very brute force though)

In reply to Nico75:

It is something like this:

function void end_of_elaboration_phase(uvm_phase phase);
  catcher_h = new("catcher_h");
  uvm_report_cb::add(null, catcher_h);
endfunction

where the first argument in the add method is the report object or null for all objects.
Additionally you have to implement your own catcher class.

class my_report_catcher extends uvm_report_catcher; 
  
  function new (string name = "");
    super.new(name);
  endfunction

  function action_e catch; 
    uvm_severity severity  = get_severity();
    string       id        = get_id();
    uvm_action   action    = get_action();
    string       message   = get_message();
    int          verbosity = get_verbosity();
    if (severity == UVM_WARNING)
      set_severity(UVM_INFO);
    if (severity == UVM_ERROR)
      return CAUGHT;
    return THROW;
  endfunction
endclass

In reply to chr_sue:

is using ‘null’ a bit drastic? I would need to make sure I filter correctly in the catch method.

In reply to Nico75:

I’d say in your case yes. My intention was to show the options.