[source]

Class uvm_printer

uvm_pkg::uvm_printer + knobs : uvm_printer_knobs + m_scope : uvm_scope_stack + m_string : string + emit(): string + format_footer(): string + format_header(): string + format_row(): string + index_string(): string + istop(): bit + print_array_footer(): void + print_array_header(): void + print_array_range(): void + print_field(): void + print_field_int(): void + print_generic(): void + print_int(): void + print_object(): void + print_object_header(): void + print_real(): void + print_string(): void + print_time(): void uvm_pkg::uvm_table_printer uvm_pkg::uvm_tree_printer

Inheritance Diagram of uvm_printer

The uvm_printer class provides an interface for printing uvm_objects in various formats. Subtypes of uvm_printer 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:

uvm_printer

provides base printer functionality; must be overridden.

uvm_table_printer

prints the object in a tabular form.

uvm_tree_printer

prints the object in a tree form.

uvm_line_printer

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.

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

Variables

Name

Type

Description

knobs

uvm_printer_knobs

The knob object provides access to the variety of knobs associated with a specific printer instance.

Functions

virtual function void print_field ( string name, uvm_bitstream_t value, int size, uvm_radix_enum radix, byte scope_separator, string type_name ) [source]

Prints an integral field (up to 4096 bits).

name

The name of the field.

value

The value of the field.

size

The number of bits of the field (maximum is 4096).

radix

The radix to use for printing. The printer knob for radix is used if no radix is specified.

scope_separator

is used to find the leaf name since many printers only print the leaf name of a field. Typical values for the separator are . (dot) or [ (open bracket). Print_field

virtual function void print_int ( string name, uvm_bitstream_t value, int size, uvm_radix_enum radix, byte scope_separator, string type_name ) [source]

backward compatibility

virtual function void print_field_int ( string name, uvm_integral_t value, int size, uvm_radix_enum radix, byte scope_separator, string type_name ) [source]

Prints an integral field (up to 64 bits).

name

The name of the field.

value

The value of the field.

size

The number of bits of the field (maximum is 64).

radix

The radix to use for printing. The printer knob for radix is used if no radix is specified.

scope_separator

is used to find the leaf name since many printers only print the leaf name of a field. Typical values for the separator are . (dot) or [ (open bracket). Print_field_int

virtual function void print_object ( string name, uvm_object value, byte scope_separator ) [source]

Prints an object. Whether the object is recursed depends on a variety of knobs, such as the depth knob; if the current depth is at or below the depth setting, then the object is not recursed.

By default, the children of uvm_components are printed. To turn this behavior off, you must set the uvm_component::print_enabled bit to 0 for the specific children you do not want automatically printed. Print_object

virtual function void print_object_header ( string name, uvm_object value, byte scope_separator ) [source]

Print_object_header

virtual function void print_string ( string name, string value, byte scope_separator ) [source]

Prints a string field. Print_string

virtual function void print_time ( string name, time value, byte scope_separator ) [source]

Prints a time value. name is the name of the field, and value is the value to print.

The print is subject to the $timeformat system task for formatting time values. Print_time

virtual function void print_real ( string name, real value, byte scope_separator ) [source]

Prints a real field. Print_real

virtual function void print_generic ( string name, string type_name, int size, string value, byte scope_separator ) [source]

Prints a field having the given name , type_name , size , and value . Print_generic

virtual function string emit ( ) [source]

Emits a string representing the contents of an object in a format defined by an extension of this object. Emit

virtual function string format_row ( uvm_printer_row_info row ) [source]

Hook for producing custom output of a single field (row). Format_row

virtual function string format_header ( ) [source]

Hook to override base header with a custom header.

virtual function string format_footer ( ) [source]

Hook to override base footer with a custom footer.

virtual function void print_array_header ( string name, int size, string arraytype, byte scope_separator ) [source]

Prints the header of an array. This function is called before each individual element is printed. print_array_footer is called to mark the completion of array printing. Print_array_header

virtual function void print_array_range ( int min, int max ) [source]

Prints a range using ellipses for values. This method is used when honoring the array knobs for partial printing of large arrays, uvm_printer_knobs::begin_elements and uvm_printer_knobs::end_elements.

This function should be called after begin_elements have been printed and before end_elements have been printed. Print_array_range

virtual function void print_array_footer ( int size ) [source]

Prints the header of a footer. This function marks the end of an array print. Generally, there is no output associated with the array footer, but this method let's the printer know that the array printing is complete. Print_array_footer

function bit istop ( ) [source]

Utility methods. Istop

function string index_string ( int index, string name ) [source]

Index_string