uvm_report_message¶
-
class
uvm.base.uvm_report_message.UVMReportMessageElementBase(name='')[source]¶ Bases:
uvm.base.uvm_object.UVMObject-
set_name(name)[source]¶ Sets the instance name of this object, overwriting any previously given name.
- Parameters
name (str) – Name for the object.
-
get_name()[source]¶ Returns the name of the object, as provided by the
nameargument in thenewconstructor orset_namemethod.- Returns
Name of the object.
- Return type
-
record(recorder)[source]¶ Group: Recording
The
recordmethod deep-records this object’s properties according to an optionalrecorderpolicy. The method is not virtual and must not be overloaded. To include additional fields in the record operation, derived classes should override thedo_recordmethod.The optional
recorderargument specifies the recording policy, which governs how recording takes place. See uvm_recorder for information.A simulator’s recording mechanism is vendor-specific. By providing access via a common interface, the uvm_recorder policy provides vendor-independent access to a simulator’s recording capabilities.
- Parameters
recorder (UVMRecorder) –
-
copy(rhs)[source]¶ The copy makes this object a copy of the specified object.
The
copymethod is not virtual and should not be overloaded in derived classes. To copy the fields of a derived class, that class should override thedo_copymethod.- Parameters
rhs (UVMObject) – An object to be copied.
-
clone()[source]¶ The
clonemethod creates and returns an exact copy of this object.The default implementation calls
createfollowed bycopy. As clone is virtual, derived classes may override this implementation if desired.- Returns
Clone of the object.
- Return type
-
do_print(printer)[source]¶ The
do_printmethod is the user-definable hook called byprintandsprintthat allows users to customize what gets printed or sprinted beyond the field information provided by the `uvm_field_* macros, <Utility and Field Macros for Components and Objects>.The
printerargument is the policy object that governs the format and content of the output. To ensure correctprintandsprintoperation, and to ensure a consistent output format, theprintermust be used by alldo_printimplementations. That is, instead of using ~$display~ or string concatenations directly, ado_printimplementation must call through the ~printer’s~ API to add information to be printed or sprinted.An example implementation of
do_printis as follows:class mytype (UVMObject): data_obj data int f1 virtual function void do_print (uvm_printer printer) super.do_print(printer) printer.print_field_int("f1", f1, $bits(f1), UVM_DEC) printer.print_object("data", data) endfunctionThen, to print and sprint the object, you could write:
t = mytype() t.print() uvm_report_info("Received",t.sprint())
See
UVMPrinterfor information about the printer API.- Parameters
printer (UVMPrinter) – Printer that is used in printing.
-
do_record(recorder)[source]¶ The
do_recordmethod is the user-definable hook called by therecordmethod. A derived class should override this method to include its fields in a record operation.The
recorderargument is policy object for recording this object. A do_record implementation should call the appropriate recorder methods for each of its fields. Vendor-specific recording implementations are encapsulated in therecorderpolicy, thereby insulating user-code from vendor-specific behavior. See uvm_recorder for more information.A typical implementation is as follows:
class mytype (UVMObject): data_obj data int f1 def do_record (self, recorder): recorder.record_field("f1", f1, sv.bits(f1), UVM_DEC) recorder.record_object("data", data)
- Parameters
recorder (UVMRecorder) – Recorder policy object.
-
do_copy(rhs)[source]¶ The
do_copymethod is the user-definable hook called by thecopymethod. A derived class should override this method to include its fields in acopyoperation.A typical implementation is as follows:
class mytype (UVMObject): ... field_1 = 0 def do_copy(self, rhs): super.do_copy(rhs) # Optionanl type checking field_1 = rhs.field_1
The implementation must call
super().do_copy, and can optionally do type checking before copying.- Parameters
rhs (UVMObject) – Object to be copied.
-
-
class
uvm.base.uvm_report_message.UVMReportMessageIntElement(name='')[source]¶ Bases:
uvm.base.uvm_report_message.UVMReportMessageElementBase
-
class
uvm.base.uvm_report_message.UVMReportMessageStringElement(name='')[source]¶ Bases:
uvm.base.uvm_report_message.UVMReportMessageElementBase
-
class
uvm.base.uvm_report_message.UVMReportMessageObjectElement(name='')[source]¶ Bases:
uvm.base.uvm_report_message.UVMReportMessageElementBase
-
class
uvm.base.uvm_report_message.UVMReportMessageElementContainer(name='element_container')[source]¶ Bases:
uvm.base.uvm_object.UVMObject-
do_print(printer)[source]¶ The
do_printmethod is the user-definable hook called byprintandsprintthat allows users to customize what gets printed or sprinted beyond the field information provided by the `uvm_field_* macros, <Utility and Field Macros for Components and Objects>.The
printerargument is the policy object that governs the format and content of the output. To ensure correctprintandsprintoperation, and to ensure a consistent output format, theprintermust be used by alldo_printimplementations. That is, instead of using ~$display~ or string concatenations directly, ado_printimplementation must call through the ~printer’s~ API to add information to be printed or sprinted.An example implementation of
do_printis as follows:class mytype (UVMObject): data_obj data int f1 virtual function void do_print (uvm_printer printer) super.do_print(printer) printer.print_field_int("f1", f1, $bits(f1), UVM_DEC) printer.print_object("data", data) endfunctionThen, to print and sprint the object, you could write:
t = mytype() t.print() uvm_report_info("Received",t.sprint())
See
UVMPrinterfor information about the printer API.- Parameters
printer (UVMPrinter) – Printer that is used in printing.
-
do_record(recorder)[source]¶ The
do_recordmethod is the user-definable hook called by therecordmethod. A derived class should override this method to include its fields in a record operation.The
recorderargument is policy object for recording this object. A do_record implementation should call the appropriate recorder methods for each of its fields. Vendor-specific recording implementations are encapsulated in therecorderpolicy, thereby insulating user-code from vendor-specific behavior. See uvm_recorder for more information.A typical implementation is as follows:
class mytype (UVMObject): data_obj data int f1 def do_record (self, recorder): recorder.record_field("f1", f1, sv.bits(f1), UVM_DEC) recorder.record_object("data", data)
- Parameters
recorder (UVMRecorder) – Recorder policy object.
-
do_copy(rhs)[source]¶ The
do_copymethod is the user-definable hook called by thecopymethod. A derived class should override this method to include its fields in acopyoperation.A typical implementation is as follows:
class mytype (UVMObject): ... field_1 = 0 def do_copy(self, rhs): super.do_copy(rhs) # Optionanl type checking field_1 = rhs.field_1
The implementation must call
super().do_copy, and can optionally do type checking before copying.- Parameters
rhs (UVMObject) – Object to be copied.
-
-
class
uvm.base.uvm_report_message.UVMReportMessage(name='')[source]¶ Bases:
uvm.base.uvm_object.UVMObject-
classmethod
new_report_message(name='uvm_report_message') → uvm.base.uvm_report_message.UVMReportMessage[source]¶ Creates a new uvm_report_message object. This function is the same as new(), but keeps the random stability.
- Parameters
name (str) – Name of the message
- Returns
Created report message
- Return type
-
do_print(printer)[source]¶ The uvm_report_message implements
UVMObject.do_print()such thatprintmethod provides UVM printer formatted output of the message. A snippet of example output is shown here:- Parameters
printer (UVMPrinter) – Printer used for printing the msg
-
do_copy(rhs)[source]¶ The
do_copymethod is the user-definable hook called by thecopymethod. A derived class should override this method to include its fields in acopyoperation.A typical implementation is as follows:
class mytype (UVMObject): ... field_1 = 0 def do_copy(self, rhs): super.do_copy(rhs) # Optionanl type checking field_1 = rhs.field_1
The implementation must call
super().do_copy, and can optionally do type checking before copying.- Parameters
rhs (UVMObject) – Object to be copied.
-
create(name='') → uvm.base.uvm_report_message.UVMReportMessage[source]¶ Group: Creation
The
createmethod 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_report_object()[source]¶ Function: get_report_object
- Returns
Report object for this msg.
- Return type
-
set_report_object(ro)[source]¶ Get or set the uvm_report_object that originated the message.
- Parameters
ro (UVMReportObject) –
-
get_report_handler()[source]¶ Get the UVMReportHandler that is responsible for checking whether the message is enabled, should be upgraded/downgraded, etc.
- Returns
Report handler for this msg.
- Return type
-
set_report_handler(rh)[source]¶ Set the UVMReportHandler that is responsible for checking whether the message is enabled, should be upgraded/downgraded, etc.
- Parameters
rh –
-
get_report_server()[source]¶ Get the
UVMReportServerthat is responsible for servicing the message’s actions.- Returns
Report server for this object
- Return type
-
set_report_server(rs)[source]¶ Set the
UVMReportServerthat is responsible for servicing the message’s actions.- Parameters
rs (UVMReportServer) – Report server for this object.
-
set_severity(sev)[source]¶ Function: set_severity
Get or set the severity (UVM_INFO, UVM_WARNING, UVM_ERROR or UVM_FATAL) of the message. The value of this field is determined via the API used (`uvm_info(), `uvm_waring(), etc.) and populated for the user. :param sev:
-
set_id(id)[source]¶ Function: set_id
Get or set the id of the message. The value of this field is completely under user discretion. Users are recommended to follow a consistent convention. Settings in the uvm_report_handler allow various messaging controls based on this field. See uvm_report_handler. :param id:
-
set_message(msg)[source]¶ Function: set_message
Get or set the user message content string. :param msg:
-
set_verbosity(ver)[source]¶ Function: set_verbosity
Get or set the message threshold value. This value is compared against settings in the uvm_report_handler to determine whether this message should be executed. :param ver:
-
set_filename(fname)[source]¶ Function: set_filename
Get or set the file from which the message originates. This value is automatically populated by the messaging macros. :param fname:
-
set_line(ln)[source]¶ Function: set_line
Get or set the line in the
filefrom which the message originates. This value is automatically populate by the messaging macros. :param ln:
-
get_context()[source]¶ Get the optional user-supplied string that is meant to convey the context of the message. It can be useful in scopes that are not inherently UVM like modules, interfaces, etc.
- Returns
Context for the msg.
- Return type
-
set_context(cn)[source]¶ Set the optional user-supplied string that is meant to convey the context of the message. It can be useful in scopes that are not inherently UVM like modules, interfaces, etc.
- Parameters
cn (str) – Context for the msg.
-
get_action()[source]¶ Get the action(s) that the
UVMReportServershould perform for this message. This field is populated by theUVMReportHandlerduring message execution flow.Returns:
-
set_action(act)[source]¶ Set the action(s) that the
UVMReportServershould perform for this message. This field is populated by theUVMReportHandlerduring message execution flow.- Parameters
act –
-
get_file()[source]¶ Get or set the file that the message is to be written to when the message’s action is UVM_LOG. This field is populated by the
UVMReportHandlerduring message execution flow.- Returns
Filename associated with this msg.
- Return type
-
set_file(fl)[source]¶ Set the file that the message is to be written to when the message’s action is UVM_LOG. This field is populated by the
UVMReportHandlerduring message execution flow.- Parameters
fl (str) – Filename associated with this msg.
-
get_element_container()[source]¶ Get the element_container of the message
- Returns
Element_container of the message
- Return type
-
classmethod