How to use set_report_severity_id_override for a UVM_WARNING within base test?

Hi,

I have a base test class that has a task which does the following:

task base_test::wait_message(..)

`uvm_warning(get_type_name(),$psprintf("Waiting for message = %0x, received message = %0x", AA, BB))

endtask

Then, in my test which extends from base_test, I would like to switch off the above message to UVM_INFO.
I have done this within my test,

virtual function void end_of_elaboration_phase(uvm_phase phase);

    super.end_of_elaboration_phase(phase);
    uvm_top.set_report_severity_id_override(UVM_WARNING,"Waiting for message",UVM_INFO);
 
endfunction : end_of_elaboration_phase

But the switching off is not working. I am still seeing the UVM_WARNINGs.
Have I used the function incorrectly?

In reply to EE:

You did not pass the ID to the override command.
The correct usage is here:
function void set_report_severity_id_override(uvm_severity cur_severity, string id,
uvm_severity new_severity);
The ID is the first argument in your UVM_WARNING.

In reply to chr_sue:

Hi Thanks for your comments.
Since `uvm_warning is using “get_type_name()” as the first argument, based on my logs, the warning displayed the ID of “[my_test]”, which is essentially my test name.

For example:
UVM_WARNING xxx.sv(123) @ 123 ns: uvm_test_top [my_test] Waiting for message …


I have tried with the following but it is still not masking this UVM_WARNING:

virtual function void end_of_elaboration_phase(uvm_phase phase);

super.end_of_elaboration_phase(phase);
uvm_top.set_report_severity_id_override(UVM_WARNING,“my_test”,UVM_INFO);

endfunction : end_of_elaboration_phase

Could you help point out what is missing here?

In reply to EE:

Your remaining problem is you calling
**uvm_top.**set_report_severity_id_override()
which is one level higher than my_test. Drop the
uvm_top
. prefix. Note: uvm_top is deprecated in UVM 1.2 and removed from IEEE UVM 1800.1. You would now use uvm_root::get().

it will be like below?

virtual function void end_of_elaboration_phase(uvm_phase phase);

super.end_of_elaboration_phase(phase);
get_root.set_report_severity_id_override(UVM_WARNING,“my_test”,UVM_INFO);

## endfunction : end_of_elaboration_phase

No, thats not correct, instead you have to use
uvm_root::get().set_report_severity_id_override(UVM_WARNING,“my_test”,UVM_INFO);