uvm_report_message

class uvm.base.uvm_report_message.UVMReportMessageElementBase(name='')[source]

Bases: 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 name argument in the new constructor or set_name method.

Returns

Name of the object.

Return type

str

set_action(action)[source]
get_action()[source]
set_val(val)[source]
get_val()[source]
pprint(printer)[source]
record(recorder)[source]

Group: Recording

The record method deep-records this object’s properties according to an optional recorder policy. The method is not virtual and must not be overloaded. To include additional fields in the record operation, derived classes should override the do_record method.

The optional recorder argument 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 copy method is not virtual and should not be overloaded in derived classes. To copy the fields of a derived class, that class should override the do_copy method.

Parameters

rhs (UVMObject) – An object to be copied.

clone()[source]

The clone method creates and returns an exact copy of this object.

The default implementation calls create followed by copy. As clone is virtual, derived classes may override this implementation if desired.

Returns

Clone of the object.

Return type

UVMObject

do_print(printer)[source]

The do_print method is the user-definable hook called by print and sprint that 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 printer argument is the policy object that governs the format and content of the output. To ensure correct print and sprint operation, and to ensure a consistent output format, the printer must be used by all do_print implementations. That is, instead of using ~$display~ or string concatenations directly, a do_print implementation must call through the ~printer’s~ API to add information to be printed or sprinted.

An example implementation of do_print is 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)
  endfunction

Then, to print and sprint the object, you could write:

t = mytype()
t.print()
uvm_report_info("Received",t.sprint())

See UVMPrinter for information about the printer API.

Parameters

printer (UVMPrinter) – Printer that is used in printing.

do_record(recorder)[source]

The do_record method is the user-definable hook called by the record method. A derived class should override this method to include its fields in a record operation.

The recorder argument 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 the recorder policy, 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_copy method is the user-definable hook called by the copy method. A derived class should override this method to include its fields in a copy operation.

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.

do_clone()[source]
class uvm.base.uvm_report_message.UVMReportMessageIntElement(name='')[source]

Bases: UVMReportMessageElementBase

class uvm.base.uvm_report_message.UVMReportMessageStringElement(name='')[source]

Bases: UVMReportMessageElementBase

class uvm.base.uvm_report_message.UVMReportMessageObjectElement(name='')[source]

Bases: UVMReportMessageElementBase

class uvm.base.uvm_report_message.UVMReportMessageElementContainer(name='element_container')[source]

Bases: UVMObject

size()[source]
delete(index)[source]
delete_elements()[source]
get_elements()[source]
add(name, val, action=66)[source]
do_print(printer)[source]

The do_print method is the user-definable hook called by print and sprint that 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 printer argument is the policy object that governs the format and content of the output. To ensure correct print and sprint operation, and to ensure a consistent output format, the printer must be used by all do_print implementations. That is, instead of using ~$display~ or string concatenations directly, a do_print implementation must call through the ~printer’s~ API to add information to be printed or sprinted.

An example implementation of do_print is 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)
  endfunction

Then, to print and sprint the object, you could write:

t = mytype()
t.print()
uvm_report_info("Received",t.sprint())

See UVMPrinter for information about the printer API.

Parameters

printer (UVMPrinter) – Printer that is used in printing.

do_record(recorder)[source]

The do_record method is the user-definable hook called by the record method. A derived class should override this method to include its fields in a record operation.

The recorder argument 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 the recorder policy, 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_copy method is the user-definable hook called by the copy method. A derived class should override this method to include its fields in a copy operation.

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: UVMObject

The UVMReportMessage is the basic UVM object message class. It provides the fields that are common to all messages. It also has a message element container and provides the APIs necessary to add integral types, strings and uvm_objects to the container. The report message object can be initialized with the common fields, and passes through the whole reporting system (i.e. report object, report handler, report server, report catcher, etc) as an object. The additional elements can be added/deleted to/from the message object anywhere in the reporting system, and can be printed or recorded along with the common fields.

classmethod new_report_message(name='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

UVMReportMessage

do_print(printer)[source]

The uvm_report_message implements UVMObject.do_print() such that print method 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_copy method is the user-definable hook called by the copy method. A derived class should override this method to include its fields in a copy operation.

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='') UVMReportMessage[source]

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_report_object()[source]

Function: get_report_object

Returns

Report object for this msg.

Return type

UVMReportObject

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

UVMReportHandler

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 UVMReportServer that is responsible for servicing the message’s actions.

Returns

Report server for this object

Return type

UVMReportServer

set_report_server(rs)[source]

Set the UVMReportServer that is responsible for servicing the message’s actions.

Parameters

rs (UVMReportServer) – Report server for this object.

get_severity()[source]

Function: get_severity Returns:

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:

get_id()[source]

Function: get_id Returns:

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:

get_message()[source]

Function: get_message Returns:

set_message(msg)[source]

Function: set_message

Get or set the user message content string. :param msg:

get_verbosity()[source]

Function: get_verbosity Returns:

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:

get_filename()[source]

Function: get_filename Returns:

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:

get_line()[source]

Function: get_line Returns:

set_line(ln)[source]

Function: set_line

Get or set the line in the file from 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

str

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 UVMReportServer should perform for this message. This field is populated by the UVMReportHandler during message execution flow.

Returns:

set_action(act)[source]

Set the action(s) that the UVMReportServer should perform for this message. This field is populated by the UVMReportHandler during 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 UVMReportHandler during message execution flow.

Returns

Filename associated with this msg.

Return type

str

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 UVMReportHandler during 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

UVMReportMessageElementContainer

set_report_message(severity, id, message, verbosity, filename, line, context_name)[source]

Set all the common fields of the report message in one shot.

Parameters
  • severity

  • id

  • message

  • verbosity

  • filename

  • line

  • context_name

add(name, value, action=66) None[source]

Group: Message Element APIs

Parameters
  • name (str) – Name of the element

  • value

  • action