[source]

Class uvm_report_catcher

uvm_pkg::uvm_report_catcher + DO_NOT_CATCH : int + DO_NOT_MODIFY : int + catch(): action_e + debug_report_catcher(): void + get_action(): uvm_action + get_client(): uvm_report_object + get_context(): string + get_element_container(): uvm_report_message_element_container + get_fname(): string + get_id(): string + get_line(): int + get_message(): string + get_report_catcher(): uvm_report_catcher + get_severity(): uvm_severity + get_verbosity(): int + print_catcher(): void + process_all_report_catchers(): int + summarize(): void

Inheritance Diagram of 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 facilities 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 (any "*driver" under mytest.myenv)
 // using the component name
 uvm_report_cb::add_by_name("*driver", demoter, mytest.myenv);
end
Variables

Name

Type

Description

DO_NOT_CATCH

int

Flag counts

DO_NOT_MODIFY

int

Constructors

function new ( string name ) [source]

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

Enums

action_e [source]

Enum Items :
  • UNKNOWN_ACTION
  • THROW
  • CAUGHT

Functions

function uvm_report_object get_client ( ) [source]

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

function uvm_severity get_severity ( ) [source]

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

function string get_context ( ) [source]

Returns the context name of the message that is currently being processed. This is typically the full hierarchical name of the component that issued the message. However, if user-defined context is set from a uvm_report_message, the user-defined context will be returned.

function int get_verbosity ( ) [source]

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

function string get_id ( ) [source]

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

function string get_message ( ) [source]

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

function uvm_action get_action ( ) [source]

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

function string get_fname ( ) [source]

Returns the file name of the message.

function int get_line ( ) [source]

Returns the line number of the message.

function uvm_report_message_element_container get_element_container ( ) [source]

Returns the element container of the message.

static function uvm_report_catcher get_report_catcher ( string name ) [source]

Returns the first report catcher that has name .

static function void print_catcher ( UVM_FILE file ) [source]

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).

static function void debug_report_catcher ( int what ) [source]

Turn on report catching debug information. what is a bitwise AND of

  • DO_NOT_CATCH -- forces catch to be ignored so that all catchers see the the reports.

  • DO_NOT_MODIFY -- forces the message to remain unchanged

virtual function action_e catch ( ) [source]

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.

static function int process_all_report_catchers ( uvm_report_message rm ) [source]

process_all_report_catchers method called by report_server.report to process catchers

static function void summarize ( ) [source]