uvm_printer

class uvm.base.uvm_printer.UVMPrinterRowInfo[source]

Bases: object

class uvm.base.uvm_printer.UVMPrinter(name='')[source]

Bases: object

Class: UVMPrinter

The UVMPrinter class provides an interface for printing <uvm_objects> in various formats. Subtypes of UVMPrinter implement different print formats, or policies.

A user-defined printer format can be created, or one of the following four built-in printers can be used:

  • UVMPrinter - provides base printer functionality; must be overridden.

  • UVMTablePrinter - prints the object in a tabular form.

  • UVMTreePrinter - prints the object in a tree form.

  • UVMLinePrinter - prints the information on a single line, but uses the same object separators as the tree printer.

Printers have knobs that you use to control what and how information is printed. These knobs are contained in a separate knob class:

  • <uvm_printer_knobs> - common printer settings

For convenience, global instances of each printer type are available for direct reference in your testbenches.

  • <uvm_default_tree_printer>

  • <uvm_default_line_printer>

  • <uvm_default_table_printer>

  • <uvm_default_printer> (set to default_table_printer by default)

When <uvm_object::print> and <uvm_object::sprint> are called without specifying a printer, the <uvm_default_printer> is used.

emit()[source]
format_row(row)[source]

Returns:

format_header()[source]
print_array_header(name, size, arraytype='array', scope_separator='.')[source]
print_array_range(min_val, max_val)[source]
print_object_header(name, value, scope_separator='.')[source]
Parameters

scope_separator

print_object(name, value, scope_separator='.')[source]
Parameters

scope_separator

istop()[source]
adjust_name(id, scope_separator='.')[source]

#self.adjust_name

param id

param scope_separator

Returns:

print_generic(name, type_name, size, value, scope_separator='.')[source]
print_int(name, value, size, radix=0, scope_separator='.', type_name='')[source]
print_field(name, value, size, radix=0, scope_separator='.', type_name='')[source]
Parameters
  • size

  • radix

  • UVM_NORADIX

  • scope_separator

  • type_name

print_field_int(name, value, size, radix=0, scope_separator='.', type_name='')[source]
print_time(name, value, scope_separator='.')[source]
Parameters

scope_separator

print_string(name, value, scope_separator='.')[source]
print_real(name, value, scope_separator='.')[source]
index_string(index, name='')[source]
class uvm.base.uvm_printer.UVMPrinterKnobs[source]

Bases: object

get_radix_str(radix)[source]
class uvm.base.uvm_printer.UVMTablePrinter[source]

Bases: UVMPrinter

Class: UVMTablePrinter

The table printer prints output in a tabular format.

The following shows sample output from the table printer:

---------------------------------------------------
Name        Type            Size        Value
---------------------------------------------------
c1          container       -           @1013
d1          mydata          -           @1022
v1          integral        32          'hcb8f1c97
e1          enum            32          THREE
str         string          2           hi
value       integral        12          'h2d
---------------------------------------------------
calculate_max_widths()[source]
emit()[source]

Function: emit

Formats the collected information from prior calls to ~print_*~ into table format.

Returns:

class uvm.base.uvm_printer.UVMTreePrinter[source]

Bases: UVMPrinter

Class: uvm_tree_printer

By overriding various methods of the <UVMPrinter> super class, the tree printer prints output in a tree format.

The following shows sample output from the tree printer:

c1: (container@1013) {
  d1: (mydata@1022) {
       v1: 'hcb8f1c97
       e1: THREE
       str: hi
  }
  value: 'h2d
}
emit()[source]
class uvm.base.uvm_printer.UVMLinePrinter[source]

Bases: UVMTreePrinter

Class: UVMLinePrinter

The line printer prints output in a line format.

The following shows sample output from the line printer::

c1: (container@1013) { d1: (mydata@1022) { v1: ‘hcb8f1c97 e1: THREE str: hi } value: ‘h2d }

class uvm.base.uvm_printer.UVMJSONPrinter(name='')[source]

Bases: UVMPrinter