Class uvm_report_catcher
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
Name |
Type |
Description |
---|---|---|
DO_NOT_CATCH |
int |
Flag counts |
DO_NOT_MODIFY |
int |
Constructors
Enums
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 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 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 int process_all_report_catchers ( uvm_report_message rm ) [source]
process_all_report_catchers method called by report_server.report to process catchers
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: