Report catcher to remove UVM_WARNINGs

In reply to sharatk:

Maybe I dont return THROW?

Return CAUGHT, conditionally when its a UVM_WARNING otherwise THROW. That works in a toy example. You can also add/try return CAUGHT if you convert a warning to info and a specific verbosity, and then return caught if the overall verbosity level is lower than the converted verbosity level. That I have not tried in my toy example.

class my_report_catcher extends uvm_report_catcher;
  `uvm_object_utils(my_report_catcher)
  typedef struct {
   string id;
   uvm_severity in_sev;
   uvm_severity out_sev;
   uvm_verbosity out_verb;
  } req_s;
  req_s reqs[$];
  
  function new(string name = "mrc");
    super.new(name);
  endfunction
  
  function void add_req(req_s r);
    reqs.push_back(r);
  endfunction
  
  function action_e catch();
    bit nothrow=0;
    string loc_id=get_id();
    uvm_severity loc_sev=get_severity();
    foreach(reqs[r]) begin
      if(loc_id==reqs[r].id && loc_sev==reqs[r].in_sev) begin
        set_severity(reqs[r].out_sev);
        if (reqs[r].out_sev==UVM_INFO) set_verbosity(reqs[r].out_verb);
        if (loc_sev==UVM_WARNING) nothrow=1;
        break;
      end
    end
    return nothrow?CAUGHT:THROW;
  endfunction
  
endclass

Then in the env -

my_report_catcher mrc
mrc=new("mrc");
mrc.add_req('{"WARNING_ID", UVM_WARNING, UVM_INFO, UVM_DEBUG});
uvm_report_cb::add(your_agent.your_component, mrc);