How to change severity of a message in OVM

Is it possible to change the severity of a debug message dynamically in the run phase i.e.

based up on the value of a signal, I want to change the severity of a block OVM_ERROR messages to OVM_INFO and then back to OVM_ERROR?

In reply to SKUPPAM:
You can’t change the severity of messages in OVM (you can using UVM).

You can suppress the message through either its verbosity, or by the action associated with a message.

In reply to SKUPPAM:

In UVM this is easy - there is a set_report_severtiy API. I did a quick look in OVM, I don’t find it (I don’t use OVM that much nowadays, so maybe I am missing). However you can change the action via the below API:

function void set_report_severity_id_action_hier(	ovm_severity 	severity,
string 	id,
ovm_action 	action	)

HTH
Srini
www.verifworks.com

In reply to dave_59:

Thanks for the quick response. is there a way with some OVM hack code to achieve the same UVM feature?

In reply to SKUPPAM:

You can extend ovm_report_server class and then ovverride the process_report virtual function.
Here’s how I done it.


class my_report_server extends ovm_report_server;
   virtual function void process_report( ovm_severity severity,
                                         string name,
                                         string id,
                                         string message,
                                         ovm_action action,
                                         OVM_FILE file,
                                         string filename,
                                         int line,
                                         string composed_message,
                                         int verbosity_level,
                                         ovm_report_object client
                                        );
        
        //compare id or message for which you want to change severity
        if(id == "your_id")
          severity = OVM_INFO;
      super.process_report(severity,name,id,message,action,file,filename,line,composed_message,verbosity_level,client);
   endfunction: process_report

endclass: my_report_server

  //Then you have to set your class as default report server in your testcase
  function void start_of_simulation();
    ovm_report_handler report_handler = get_report_handler();
    my_report_server my_server = new();
    report_handler.m_glob.set_server(my_server);
  endfunction



Hope this works for you

In reply to M_Dave:

Thanks Dave. Looks it is working.