uvm_report_catcher¶
- class uvm.base.uvm_report_catcher.UVMReportCb(name='uvm_report_cb')[source]¶
Bases:
UVMCallbacks
- classmethod get_first(itr, obj)[source]¶
Function: get_first
Returns the first enabled callback of type CB which resides in the queue for
obj
. Ifobj
isNone
then the typewide queue for T is searched.itr
is the iterator it will be updated with a value that can be supplied toget_next
to get the next callback object.If the queue is empty then
None
is returned.The iterator class
uvm_callback_iter
may be used as an alternative, simplified, iterator interface.- Parameters
cls –
itr –
obj –
CB –
Returns:
- m_b_inst = <uvm.base.uvm_callback.UVMCallbacksBase object>¶
- m_base_inst = <uvm.base.uvm_callback.UVMCallbacks object>¶
- m_cb_typeid = <uvm.base.uvm_callback.UVMTypeID object>¶
- m_inst = <uvm.base.uvm_callback.UVMCallbacks object>¶
- m_pool = <uvm.base.uvm_pool.UVMPool object>¶
- m_t_inst = <uvm.base.uvm_callback.UVMCallbacks object>¶
- m_typeid = <uvm.base.uvm_callback.UVMTypeID object>¶
- class uvm.base.uvm_report_catcher.UVMReportCatcher(name='uvm_report_catcher')[source]¶
Bases:
UVMCallback
The UVMReportCatcher is used to catch messages issued by the uvm report server. Catchers are UVMCallbacks objects, so all facilities in the
UVMCallback
andUVMCallbacks
classes are available for registering catchers and controlling catcher state.The
UVMCallbacks
class is aliased toUVMReportCb
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 allUVMReportObject
reporters, or catchers can be attached to specific report objects (i.e. components).User extensions of
UVMReportCatcher
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(UVMReportCatcher): def __init__(self, name="my_error_demoter"): super().__init__(name) # This example demotes "MY_ID" errors to an info message def catch(self): if self.get_severity() == UVM_ERROR and self.get_id() == "MY_ID": self.set_severity(UVM_INFO) return THROW @cocotb.test() async initial_begin(dut): demoter = my_error_demoter() # 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 UVMReportCb.add(None, demoter) # To affect some specific object use the specific reporter UVMReportCb.add(mytest.myenv.myagent.mydriver, demoter) # To affect some set of components (any "*driver" under mytest.myenv) # using the component name UVMReportCb.add_by_name("*driver", demoter, mytest.myenv)
- m_modified_report_message = <uvm.base.uvm_report_message.UVMReportMessage object>¶
- m_orig_report_message = None¶
- m_set_action_called = False¶
- m_demoted_fatal = 0¶
- m_demoted_error = 0¶
- m_demoted_warning = 0¶
- m_caught_fatal = 0¶
- m_caught_error = 0¶
- m_caught_warning = 0¶
- DO_NOT_CATCH = 1¶
- DO_NOT_MODIFY = 2¶
- m_debug_flags = 0¶
- do_report = False¶
- cb_iter = None¶
- uvm_report_fatal(id, message, verbosity, fname='', line=0, context_name='', report_enabled_checked=0)[source]¶
- uvm_report_error(id, message, verbosity, fname='', line=0, context_name='', report_enabled_checked=0)[source]¶
- uvm_report_warning(id, message, verbosity, fname='', line=0, context_name='', report_enabled_checked=0)[source]¶
- uvm_report_info(id, message, verbosity, fname='', line=0, context_name='', report_enabled_checked=0)[source]¶
- uvm_report(severity, id, message, verbosity, fname='', line=0, context_name='', report_enabled_checked=0)[source]¶
- uvm_process_report_message(msg: UVMReportMessage)[source]¶
- in_catcher = 0¶