uvm_report_handler¶
- class uvm.base.uvm_report_handler.UVMReportHandler(name='')[source]¶
Bases:
UVMObject
The UVMReportHandler is the class to which most methods in
UVMReportObject
delegate. It stores the maximum verbosity, actions, and files that affect the way reports are handled.The report handler is not intended for direct use. See
UVMReportObject
for information on the UVM reporting mechanism.The relationship between
UVMReportObject
(a base class for UVMComponent) and UVMReportHandler is typically one to one, but it can be many to one if several uvm_report_objects are configured to use the sameUVMReportHandler
object. SeeUVMReportObject.set_report_handler
.The relationship between UVMReportHandler and
UVMReportServer
is many to one.- do_print(printer)[source]¶
The uvm_report_handler implements the <uvm_object::do_print()> such that
print
method provides UVM printer formatted output of the current configuration. A snippet of example output is shown here:uvm_test_top uvm_report_handler - @555 max_verbosity_level uvm_verbosity 32 UVM_FULL id_verbosities uvm_pool 3 - [ID1] uvm_verbosity 32 UVM_LOW severity_id_verbosities array 4 - [UVM_INFO:ID4] int 32 501 id_actions uvm_pool 2 - [ACT_ID] uvm_action 32 DISPLAY LOG COUNT severity_actions array 4 - [UVM_INFO] uvm_action 32 DISPLAY [UVM_WARNING] uvm_action 32 DISPLAY RM_RECORD COUNT [UVM_ERROR] uvm_action 32 DISPLAY COUNT [UVM_FATAL] uvm_action 32 DISPLAY EXIT default_file_handle int 32 'h1
- Parameters
printer –
- process_report_message(report_message)[source]¶
This is the common handler method used by the four core reporting methods (e.g.
uvm_report_error
) in uvm_report_object.- Parameters
report_message (UVMReportMessage) – Message to process
- classmethod format_action(action)[source]¶
Function: format_action
Returns a string representation of the
action
, e.g., “DISPLAY”.- Parameters
cls –
action –
Returns:
- get_severity_id_file(severity, id)[source]¶
Function- get_severity_id_file
Return the file id based on the severity and the id
- Parameters
severity –
id –
Returns:
- set_verbosity_level(verbosity_level: int)[source]¶
Internal method called by uvm_report_object. :param verbosity_level:
- get_verbosity_level(severity=0, id='') int [source]¶
Returns the verbosity associated with the given
severity
andid
.First, if there is a verbosity associated with the ~(severity,id)~ pair, return that. Else, if there is a verbosity associated with the
id
, return that. Else, return the max verbosity setting. :param severity: :param id:- Returns
Verbosity level of this handler.
- Return type
- get_action(severity, id)[source]¶
Function- get_action
Returns the action associated with the given
severity
andid
.First, if there is an action associated with the ~(severity,id)~ pair, return that. Else, if there is an action associated with the
id
, return that. Else, if there is an action associated with theseverity
, return that. Else, return the default action associated with theseverity
. :param severity: :param id:Returns:
- get_file_handle(severity, id)[source]¶
Function- get_file_handle
Returns the file descriptor associated with the given
severity
andid
.First, if there is a file handle associated with the ~(severity,id)~ pair, return that. Else, if there is a file handle associated with the
id
, return that. Else, if there is an file handle associated with theseverity
, return that. Else, return the default file handle. :param severity: :param id:Returns:
- set_severity_action(severity, action)[source]¶
Function- set_severity_action
- Parameters
severity –
action –
- set_severity_id_action(severity, id, action)[source]¶
Function- set_severity_id_action
- Parameters
severity –
id –
action –
- set_severity_id_verbosity(severity, id, verbosity)[source]¶
Function- set_severity_id_verbosity
- Parameters
severity –
id –
verbosity –
- set_severity_id_file(severity, id, file)[source]¶
Function- set_severity_id_file
- Parameters
severity –
id –
file –
- report(severity, name, id, message, verbosity_level=200, filename='', line=0, client=None)[source]¶
Function- report
This is the common handler method used by the four core reporting methods (e.g., uvm_report_error) in uvm_report_object. :param severity: :param name: :param id: :param message: :param verbosity_level: :param filename: :param line: :param client:
- create(name='')¶
Group: Creation
The
create
method allocates a new object of the same type as this object and returns it via a base uvm_object handle. Every class deriving from uvm_object, directly or indirectly, must implement the create method.A typical implementation is as follows:
class mytype (UVMObject): ... def create(self, name=""): mytype t = mytype(name) return t
- Parameters
name (str) – Name of the created object.
- Returns
New object.
- Return type
obj
- get_object_type()¶
Function: get_object_type
Returns the type-proxy (wrapper) for this object. The uvm_factory’s type-based override and creation methods take arguments of
uvm_object_wrapper
. This method, if implemented, can be used as convenient means of supplying those arguments. This method is the same as the staticget_type
method, but uses an already allocated object to determine the type-proxy to access (instead of using the static object).The default implementation of this method does a factory lookup of the proxy using the return value from
get_type_name
. If the type returned byget_type_name
is not registered with the factory, then aNone
handle is returned.For example:
class cmd (UVMObject): type_id = UVMObjectRegistry() @classmethod def type_id get_type(cls): return type_id.get() def get_object_type(self): return cmd.type_id.get()
This function is implemented by the `uvm_*_utils macros, if employed.
Returns:
- classmethod get_type()¶
Returns the type-proxy (wrapper) for this object. The
UVMFactory
’s type-based override and creation methods take arguments ofuvm_object_wrapper
. This method, if implemented, can be used as convenient means of supplying those arguments.The default implementation of this method produces an error and returns
None
. To enable use of this method, a user’s subtype must implement a version that returns the subtype’s wrapper.For example:
class cmd(UVMObject): type_id = None @classmethod def get_type(cls): return cls.type_id.get()
Then, to use:
factory.set_type_override(cmd.get_type(), subcmd.get_type())
This function is implemented by the uvm_*_utils functions, if employed.
Returns:
- get_type_name()¶
This function returns the type name of the object, which is typically the type identifier enclosed in quotes. It is used for various debugging functions in the library, and it is used by the factory for creating objects.
This function must be defined in every derived class.
A typical implementation is as follows:
class mytype (UVMObject): ... type_name = "mytype" def get_type_name(self): return my_type.type_name
We define the
type_name
static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.- Returns
Type name of the object.
- Return type
- type_id = <uvm.base.uvm_registry.UVMObjectRegistry object>¶
- type_name = 'UVMReportHandler'¶