uvm_report_catcher

The uvm_report_catcher is used to catch messages issued by the uvm report server.  Catchers are uvm_callbacks#(uvm_report_object,uvm_report_catcher) objects, so all factilities in the uvm_callback and uvm_callbacks#(T,CB) classes are available for registering catchers and controlling catcher state.  The uvm_callbacks#(uvm_report_object,uvm_report_catcher) class is aliased to uvm_report_cb to make it easier to use.  Multiple report catchers can be registered with a report object.  The catchers can be registered as default catchers which catch all reports on all uvm_report_object reporters, or catchers can be attached to specific report objects (i.e. components).

User extensions of uvm_report_catcher must implement the catch method in which the action to be taken on catching the report is specified.  The catch method can return CAUGHT, in which case further processing of the report is immediately stopped, or return THROW in which case the (possibly modified) report is passed on to other registered catchers.  The catchers are processed in the order in which they are registered.

On catching a report, the catch method can modify the severity, id, action, verbosity or the report string itself before the report is finally issued by the report server.  The report can be immediately issued from within the catcher class by calling the issue method.

The catcher maintains a count of all reports with FATAL,ERROR or WARNING severity and a count of all reports with FATAL, ERROR or WARNING severity whose severity was lowered.  These statistics are reported in the summary of the uvm_report_server.

This example shows the basic concept of creating a report catching callback and attaching it to all messages that get emitted:

class my_error_demoter extends uvm_report_catcher;
  function new(string name="my_error_demoter");
    super.new(name);
  endfunction
  //This example demotes "MY_ID" errors to an info message
  function action_e catch();
    if(get_severity() == UVM_ERROR && get_id() == "MY_ID")
      set_severity(UVM_INFO);
    return THROW;
  endfunction
endclass

my_error_demoter demoter = new;
initial begin
 // Catchers are callbacks on report objects (components are report
 // objects, so catchers can be attached to components).

 // 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);
end
Summary
uvm_report_catcher
The uvm_report_catcher is used to catch messages issued by the uvm report server.
Class Declaration
typedef class uvm_report_catcher
newCreate a new report object.
Current Message State
get_clientReturns the uvm_report_object that has generated the message that is currently being processes.
get_severityReturns the uvm_severity of the message that is currently being processed.
get_verbosityReturns the verbosity of the message that is currently being processed.
get_idReturns the string id of the message that is currently being processed.
get_messageReturns the string message of the message that is currently being processed.
get_actionReturns the uvm_action of the message that is currently being processed.
get_fnameReturns the file name of the message.
get_lineReturns the line number of the message.
Change Message State
set_severityChange the severity of the message to severity.
set_verbosityChange the verbosity of the message to verbosity.
set_idChange the id of the message to id.
set_messageChange the text of the message to message.
set_actionChange the action of the message to action.
Debug
get_report_catcherReturns the first report catcher that has name.
print_catcherPrints information about all of the report catchers that are registered.
Callback Interface
catchThis is the method that is called for each registered report catcher.
Reporting
uvm_report_fatalIssues a fatal message using the current messages report object.
uvm_report_errorIssues a error message using the current messages report object.
uvm_report_warningIssues a warning message using the current messages report object.
uvm_report_infoIssues a info message using the current messages report object.
issueImmediately issues the message which is currently being processed.
summarize_report_catcherThis function is called automatically by uvm_report_server::summarize().

new

function new( string  name  =  "uvm_report_catcher" )

Create a new report object.  The name argument is optional, but should generally be provided to aid in debugging.

get_client

function uvm_report_object get_client()

Returns the uvm_report_object that has generated the message that is currently being processes.

get_severity

function uvm_severity get_severity()

Returns the uvm_severity of the message that is currently being processed.  If the severity was modified by a previously executed report object (which re-threw the message), then the returned severity is the modified value.

get_verbosity

function int get_verbosity()

Returns the verbosity of the message that is currently being processed.  If the verbosity was modified by a previously executed report object (which re-threw the message), then the returned verbosity is the modified value.

get_id

function string get_id()

Returns the string id of the message that is currently being processed.  If the id was modified by a previously executed report object (which re-threw the message), then the returned id is the modified value.

get_message

function string get_message()

Returns the string message of the message that is currently being processed.  If the message was modified by a previously executed report object (which re-threw the message), then the returned message is the modified value.

get_action

function uvm_action get_action()

Returns the uvm_action of the message that is currently being processed.  If the action was modified by a previously executed report object (which re-threw the message), then the returned action is the modified value.

get_fname

function string get_fname()

Returns the file name of the message.

get_line

function int get_line()

Returns the line number of the message.

set_severity

protected function void set_severity( uvm_severity  severity )

Change the severity of the message to severity.  Any other report catchers will see the modified value.

set_verbosity

protected function void set_verbosity( int  verbosity )

Change the verbosity of the message to verbosity.  Any other report catchers will see the modified value.

set_id

protected function void set_id( string  id )

Change the id of the message to id.  Any other report catchers will see the modified value.

set_message

protected function void set_message( string  message )

Change the text of the message to message.  Any other report catchers will see the modified value.

set_action

protected function void set_action( uvm_action  action )

Change the action of the message to action.  Any other report catchers will see the modified value.

get_report_catcher

static function uvm_report_catcher get_report_catcher( string  name )

Returns the first report catcher that has name.

print_catcher

static function void print_catcher( UVM_FILE  file  =  )

Prints information about all of the report catchers that are registered.  For finer grained detail, the uvm_callbacks #(T,CB)::display method can be used by calling uvm_report_cb::display(uvm_report_object).

catch

pure virtual function action_e catch()

This is the method that is called for each registered report catcher.  There are no arguments to this function.  The Current Message State interface methods can be used to access information about the current message being processed.

uvm_report_fatal

protected function void uvm_report_fatal( string  id,   
string  message,   
int  verbosity,   
string  fname  =  "",
int  line  =  0 )

Issues a fatal message using the current messages report object.  This message will bypass any message catching callbacks.

uvm_report_error

protected function void uvm_report_error( string  id,   
string  message,   
int  verbosity,   
string  fname  =  "",
int  line  =  0 )

Issues a error message using the current messages report object.  This message will bypass any message catching callbacks.

uvm_report_warning

protected function void uvm_report_warning( string  id,   
string  message,   
int  verbosity,   
string  fname  =  "",
int  line  =  0 )

Issues a warning message using the current messages report object.  This message will bypass any message catching callbacks.

uvm_report_info

protected function void uvm_report_info( string  id,   
string  message,   
int  verbosity,   
string  fname  =  "",
int  line  =  0 )

Issues a info message using the current messages report object.  This message will bypass any message catching callbacks.

issue

protected function void issue()

Immediately issues the message which is currently being processed.  This is useful if the message is being CAUGHT but should still be emitted.

Issuing a message will update the report_server stats, possibly multiple times if the message is not CAUGHT.

summarize_report_catcher

static function void summarize_report_catcher( UVM_FILE  file )

This function is called automatically by uvm_report_server::summarize().  It prints the statistics for the active catchers.

typedef class uvm_report_catcher
The uvm_report_catcher is used to catch messages issued by the uvm report server.
function new( string  name  =  "uvm_report_catcher" )
Create a new report object.
function uvm_report_object get_client()
Returns the uvm_report_object that has generated the message that is currently being processes.
class uvm_report_object extends uvm_object
The uvm_report_object provides an interface to the UVM reporting facility.
function uvm_severity get_severity()
Returns the uvm_severity of the message that is currently being processed.
Defines all possible values for report severity.
function int get_verbosity()
Returns the verbosity of the message that is currently being processed.
function string get_id()
Returns the string id of the message that is currently being processed.
function string get_message()
Returns the string message of the message that is currently being processed.
function uvm_action get_action()
Returns the uvm_action of the message that is currently being processed.
Defines all possible values for report actions.
function string get_fname()
Returns the file name of the message.
function int get_line()
Returns the line number of the message.
protected function void set_severity( uvm_severity  severity )
Change the severity of the message to severity.
protected function void set_verbosity( int  verbosity )
Change the verbosity of the message to verbosity.
protected function void set_id( string  id )
Change the id of the message to id.
protected function void set_message( string  message )
Change the text of the message to message.
protected function void set_action( uvm_action  action )
Change the action of the message to action.
static function uvm_report_catcher get_report_catcher( string  name )
Returns the first report catcher that has name.
static function void print_catcher( UVM_FILE  file  =  )
Prints information about all of the report catchers that are registered.
pure virtual function action_e catch()
This is the method that is called for each registered report catcher.
protected function void uvm_report_fatal( string  id,   
string  message,   
int  verbosity,   
string  fname  =  "",
int  line  =  0 )
Issues a fatal message using the current messages report object.
protected function void uvm_report_error( string  id,   
string  message,   
int  verbosity,   
string  fname  =  "",
int  line  =  0 )
Issues a error message using the current messages report object.
protected function void uvm_report_warning( string  id,   
string  message,   
int  verbosity,   
string  fname  =  "",
int  line  =  0 )
Issues a warning message using the current messages report object.
protected function void uvm_report_info( string  id,   
string  message,   
int  verbosity,   
string  fname  =  "",
int  line  =  0 )
Issues a info message using the current messages report object.
protected function void issue()
Immediately issues the message which is currently being processed.
static function void summarize_report_catcher( UVM_FILE  file )
This function is called automatically by uvm_report_server::summarize().
virtual function void summarize( UVM_FILE  file  =  )
See uvm_report_object::report_summarize method.
class uvm_callback extends uvm_object
The uvm_callback class is the base class for user-defined callback classes.
class uvm_callbacks #( type  T  =  uvm_object,
type  CB  =  uvm_callback ) extends uvm_typed_callbacks#(T)
The uvm_callbacks class provides a base class for implementing callbacks, which are typically used to modify or augment component behavior without changing the component class.
uvm_report_server is a global server that processes all of the reports generated by an uvm_report_handler.
static function void display( obj  =  null )
This function displays callback information for obj.