Removing a UVM_ERROR from log entirely

Hi,
Given some special circumstances I need to remove a repeated UVM_ERROR from the log entirely.

I’ve made 2 attempts so far.

So before removing it entirely, we already had code to demote it.

function uvm_report_catcher::action_e prj_report_catcher::catch();
  string error_message, error_id, demoted_id;

  error_message   = get_message();
  error_id        = get_id();
  demoted_id      = {error_id, " *DEMOTED*"};

  if(get_severity() == UVM_ERROR && (error_message == "I'm the error message that needs to be deleted") && (error_id == "I'm the error ID that needs to be deleted") ) begin
    set_severity(UVM_INFO);
    set_id(demoted_id);
    return THROW;
  end

  return THROW;  //returns to report catcher queue
endfunction : catch

my first attempt to remove it was to add to this code


set_verbosity(UVM_FULL)

while we were running on UVM_HIGH, thinking that it would lead to not printing it.
That did no work, so I figured that for demoted errors the verbosity is ignored.
So from the test I added this code:

set_report_severity_id_action_hier( UVM_INFO , "I'm the error ID that needs to be deleted *DEMOTED*", .action(0));

But that also did not work…

What is the correct way to achieve this goal?

Thanks,
Nimrod

In reply to nimrodw:

Your 1st attempt is not complete. It should be like this:

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_ERROR)   // set UVM_ERROR to UVM_INFO
      set_severity(UVM_INFO);

    if (severity == UVM_WARNING)
      return CAUGHT;

    return THROW;
  endfunction

Additionally you have to construct your own report_catcher like this:

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

In reply to chr_sue:

Sorry I don’t understand what components are present in your code that are missing from mine.

We both have set_severity(UVM_INFO) as well as return THROW;

Mine also has the addition of set_verbosity() which doesn’t help.

You have more “get_*()” functions but you aren’t using the information from them anyway.

Thanks,
Nimrod

In reply to nimrodw:

The thing you are missing is your own report_catcher. You have to constrct it and add the corresponding callback. See the 2nd code box.

In reply to chr_sue:

OK, sorry I didn’t mention it, but we do in our top environment have this code as part of the build phase.


function void prj_top_env::build_phase(uvm_phase phase);
  m_prj_report_catcher = prj_report_catcher::type_id::create("m_prj_report_catcher");
  uvm_report_cb::add(null, m_prj_report_catcher);
endfunction

In reply to nimrodw:

Your problem might be caused through

return THROW;

In your catch method you use this statement in any case. It indicates you are throwing it reports to the existing report catcher. You do not pass it to your specific report catcher.