Change severity from UVM_ERROR to UVM_INFO

  • Sometimes in you will face situation where you need some of your components from your environment to don’t show error message. You want to disable error from some component.
  • of course you don’t change every uvm_error message to uvm_info..
  • It will take care by one awesome functionality of uvm_report_catcher class.
  • The uvm_report_catcher is used to catch messages issued by the uvm report server.
  • It means all four message of `uvm_info , `uvm_error , `uvm_warning , `uvm_fatal can be registered and controlled by this class.
  • It will catch messages using callbacks.
  • The uvm_callbacks#(<uvm_report_object>,uvm_report_catcher) class is aliased to “uvm_report_cb” to make it easier to use.

Here is how it’s done..


class my_error_demoter extends uvm_report_catcher;


// This function you should write as it is..


endclass  : my_error_demoter

  • It’s done yes..uvm makes life of verification engineer easier…
  • Now you just need a instant of this class on the top or test class
  • Below I describe the method how to use this class

//Take a Instance of above class

my_error_demoter demote;

function void build_phase(uvm_phase phase);

// create a instance of this class
demote = my_error_demoter::type_id::create(“demote”,this);

// Now you need to add this class by simple callback to the component that you want to demote errors..

// To affect all reporters, use null for the object
uvm_report_cb::add(null, demoter);

// To affect some specific object use the specific reporter
uvm_report_cb::add(mytest.myenv.myagent.mydriver, demoter);

// To affect some set of components using the component name
uvm_report_cb::add_by_name(“*.*driver”, demoter);

endfunction : build_phase

  •  You can add any component that you like from top and change severity to UVM_ERROR to UVM_INFO


According to me, there are four things in a message:
Message Id: The Id used to print message. Usually we prefer some key string representing class or get_type_name() function.
Message string: Actual message string.
Mesage Verbosity: Defines how much verbose a message is. UVM_NONE is most verbose message and must be printed/displayed each time. While the verbosity decreases going towards UVM_DEBUG (generally debug messages).
Message severity: Describes how severe action can it cause on the simulation. UVM_INFO is just for users information. UVM_ERROR for unexpected behavior and so on.

Coming to the function, set_report_severity_id_override(<some_verbosity>,”<some_id>”,<some_other_verbosity>) replaces any verbosity messages with the given id to some other verbosity message. This means a UVM_ERROR can be converted to UVM_INFO. This works similar as the one shown above.

But, here the user would not get any freedom to control ALL the messages simultaneously. For example, you want to demote error to info for multiple; lets say 50  components. Or, each time the user demotes an error, user needs to display some string. In this scenario, callback method is suitable.

One major difference is CATCH and THROW. By using callbacks, you can either CATCH the message (catch message, don’t display it) or THROW it (make necessary changes and display message).

So, overall I guess both the methods are suitable. Simply use set_report_severity_id_override to override message, use callback method when you want dynamic control over a large and dynamic environment.

I will add some extra post on this UVM_MESSAGING soon ..

If you have any query please comment below




2 responses

  1. Hi,

    Have you used “set_report_severity_id_override” & “set_report_severity_override
    ” function for same ?


  2. Hello Ravindra. Good pointers, seems like author forgot those functions. I have edited the post accordingly. Kindly go through it and share your views. Thanks again. Have a nice day.

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: