uvm_printer | |
knobs | The knob object provides access to the variety of knobs associated with a specific printer instance. |
Methods for printer usage | |
print_field | Prints an integral field (up to 4096 bits). |
print_object | Prints an object. |
print_string | Prints a string field. |
print_time | Prints a time value. |
print_real | Prints a real field. |
print_generic | Prints a field having the given name, type_name, size, and value. |
Methods for printer subtyping | |
emit | Emits a string representing the contents of an object in a format defined by an extension of this object. |
format_row | Hook for producing custom output of a single field (row). |
format_header | Hook to override base header with a custom header. |
format_footer | Hook to override base footer with a custom footer. |
adjust_name | Prints a field’s name, or id, which is the full instance name. |
print_array_header | Prints the header of an array. |
print_array_range | Prints a range using ellipses for values. |
print_array_footer | Prints the header of a footer. |
uvm_table_printer | The table printer prints output in a tabular format. |
uvm_tree_printer | By overriding various methods of the uvm_printer super class, the tree printer prints output in a tree format. |
uvm_line_printer | The line printer prints output in a line format. |
m_uvm_printer_knobs | The m_uvm_printer_knobs class defines the printer settings available to all printer subtypes. |
m_uvm_printer_knobs knobs
The knob object provides access to the variety of knobs associated with a specific printer instance.
virtual function void print_field ( string name, uvm_bitstream_t value, int size, uvm_radix_enum radix = UVM_NORADIX, byte scope_separator = ".", string type_name = "" )
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). |
virtual function void print_object ( string name, uvm_object value, byte scope_separator = "." )
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.
virtual function void print_string ( string name, string value, byte scope_separator = "." )
Prints a string field.
virtual function void print_time ( string name, time value, byte scope_separator = "." )
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.
virtual function void print_real ( string name, real value, byte scope_separator = "." )
Prints a real field.
virtual function void print_generic ( string name, string type_name, int size, string value, byte scope_separator = "." )
Prints a field having the given name, type_name, size, and value.
virtual function string emit ()
Emits a string representing the contents of an object in a format defined by an extension of this object.
virtual function string format_row ( uvm_printer_row_info row )
Hook for producing custom output of a single field (row).
virtual function string format_header()
Hook to override base header with a custom header.
virtual function string format_footer()
Hook to override base footer with a custom footer.
virtual protected function string adjust_name ( string id, byte scope_separator = "." )
Prints a field’s name, or id, which is the full instance name.
The intent of the separator is to mark where the leaf name starts if the printer if configured to print only the leaf name of the identifier.
virtual function void print_array_header( string name, int size, string arraytype = "array", byte scope_separator = "." )
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.
virtual function void print_array_range ( int min, int max )
Prints a range using ellipses for values. This method is used when honoring the array knobs for partial printing of large arrays, m_uvm_printer_knobs::begin_elements and m_uvm_printer_knobs::end_elements.
This function should be called after begin_elements have been printed and before end_elements have been printed.
virtual function void print_array_footer ( int size = 0 )
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.
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 ---------------------------------------------------
@uvm-accellera The details of this API are specific to the Accellera implementation, and are not being considered for contribution to 1800.2
uvm_table_printer | |||
The table printer prints output in a tabular format. | |||
Class Hierarchy | |||
| |||
Class Declaration | |||
| |||
Methods | |||
emit | Formats the collected information from prior calls to print_* into table format. | ||
get_default | Implementation of uvm_table_printer::get_default as defined in section 16.2.10.2.3 of 1800.2-2017. |
virtual function string emit()
Formats the collected information from prior calls to print_* into table format.
static function uvm_table_printer get_default()
Implementation of uvm_table_printer::get_default as defined in section 16.2.10.2.3 of 1800.2-2017.
Note: The library implements get_default as described in IEEE 1800.2-2017 with the exception that this implementation will instance a uvm_table_printer if the most recent call to set_default() used an argument value of null.
@uvm-contrib This API is being considered for potential contribution to 1800.2
By overriding various methods of the uvm_printer 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 }
uvm_tree_printer | |||
By overriding various methods of the uvm_printer super class, the tree printer prints output in a tree format. | |||
Class Hierarchy | |||
| |||
Class Declaration | |||
| |||
Variables | |||
new | Creates a new instance of uvm_tree_printer. | ||
Methods | |||
get_default | Implementation of uvm_tree_printer::get_default as defined in section 16.2.11.2.4 of 1800.2-2017. |
static function uvm_tree_printer get_default()
Implementation of uvm_tree_printer::get_default as defined in section 16.2.11.2.4 of 1800.2-2017.
Note: The library implements get_default as described in IEEE 1800.2-2017 with the exception that this implementation will instance a uvm_tree_printer if the most recent call to set_default() used an argument value of null.
@uvm-contrib This API is being considered for potential contribution to 1800.2
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 }
uvm_line_printer | ||||
The line printer prints output in a line format. | ||||
Class Hierarchy | ||||
| ||||
Class Declaration | ||||
| ||||
Variables | ||||
new | Creates a new instance of uvm_line_printer. | |||
Methods | ||||
get_default | Implementation of uvm_line_printer::get_default as defined in section 16.2.12.2.3 of 1800.2-2017. |
function new( string name = "" )
Creates a new instance of uvm_line_printer. It differs from the uvm_tree_printer only in that the output contains no line-feeds and indentation.
static function uvm_line_printer get_default()
Implementation of uvm_line_printer::get_default as defined in section 16.2.12.2.3 of 1800.2-2017.
Note: The library implements get_default as described in IEEE 1800.2-2017 with the exception that this implementation will instance a uvm_line_printer if the most recent call to set_default() used an argument value of null.
@uvm-contrib This API is being considered for potential contribution to 1800.2
The m_uvm_printer_knobs class defines the printer settings available to all printer subtypes.
m_uvm_printer_knobs | ||
The m_uvm_printer_knobs class defines the printer settings available to all printer subtypes. | ||
Class Declaration | ||
| ||
Variables | ||
header | Indicates whether the <uvm_printer::format_header> function should be called when printing an object. | |
footer | Indicates whether the <uvm_printer::format_footer> function should be called when printing an object. | |
full_name | Indicates whether <uvm_printer::adjust_name> should print the full name of an identifier or just the leaf name. | |
identifier | Indicates whether <uvm_printer::adjust_name> should print the identifier. | |
type_name | Controls whether to print a field’s type name. | |
size | Controls whether to print a field’s size. | |
depth | Indicates how deep to recurse when printing objects. | |
reference | Controls whether to print a unique reference ID for object handles. | |
begin_elements | Defines the number of elements at the head of a list to print. | |
end_elements | This defines the number of elements at the end of a list that should be printed. | |
prefix | Specifies the string prepended to each output line | |
indent | This knob specifies the number of spaces to use for level indentation. | |
show_root | This setting indicates whether or not the initial object that is printed (when current depth is 0) prints the full path name. | |
mcd | This is a file descriptor, or multi-channel descriptor, that specifies where the print output should be directed. | |
separator | For tree printers only, determines the opening and closing separators used for nested objects. | |
show_radix | Indicates whether the radix string (‘h, and so on) should be prepended to an integral value when one is printed. | |
default_radix | This knob sets the default radix to use for integral values when no radix enum is explicitly supplied to the <uvm_printer::print_field> or <uvm_printer::print_field_int> methods. | |
dec_radix | This string should be prepended to the value of an integral type when a radix of UVM_DEC is used for the radix of the integral object. | |
bin_radix | This string should be prepended to the value of an integral type when a radix of UVM_BIN is used for the radix of the integral object. | |
oct_radix | This string should be prepended to the value of an integral type when a radix of UVM_OCT is used for the radix of the integral object. | |
unsigned_radix | This is the string which should be prepended to the value of an integral type when a radix of UVM_UNSIGNED is used for the radix of the integral object. | |
hex_radix | This string should be prepended to the value of an integral type when a radix of UVM_HEX is used for the radix of the integral object. | |
Methods | ||
get_radix_str | Converts the radix from an enumerated to a printable radix according to the radix printing knobs (bin_radix, and so on). |
bit header = 1
Indicates whether the <uvm_printer::format_header> function should be called when printing an object.
bit footer = 1
Indicates whether the <uvm_printer::format_footer> function should be called when printing an object.
bit full_name = 0
Indicates whether <uvm_printer::adjust_name> should print the full name of an identifier or just the leaf name.
bit identifier = 1
Indicates whether <uvm_printer::adjust_name> should print the identifier. This is useful in cases where you just want the values of an object, but no identifiers.
int depth = -1
Indicates how deep to recurse when printing objects. A depth of -1 means to print everything.
bit reference = 1
Controls whether to print a unique reference ID for object handles. The behavior of this knob is simulator-dependent.
int begin_elements = 5
Defines the number of elements at the head of a list to print. Use -1 for no max.
int end_elements = 5
This defines the number of elements at the end of a list that should be printed.
int indent = 2
This knob specifies the number of spaces to use for level indentation. The default level indentation is two spaces.
bit show_root = 0
This setting indicates whether or not the initial object that is printed (when current depth is 0) prints the full path name. By default, the first object is treated like all other objects and only the leaf name is printed.
int mcd = UVM_STDOUT
This is a file descriptor, or multi-channel descriptor, that specifies where the print output should be directed.
By default, the output goes to the standard output of the simulator.
string separator = "{}"
For tree printers only, determines the opening and closing separators used for nested objects.
bit show_radix = 1
Indicates whether the radix string (‘h, and so on) should be prepended to an integral value when one is printed.
uvm_radix_enum default_radix = UVM_HEX
This knob sets the default radix to use for integral values when no radix enum is explicitly supplied to the <uvm_printer::print_field> or <uvm_printer::print_field_int> methods.
string unsigned_radix = "'d"
This is the string which should be prepended to the value of an integral type when a radix of UVM_UNSIGNED is used for the radix of the integral object.
function string get_radix_str( uvm_radix_enum radix )
Converts the radix from an enumerated to a printable radix according to the radix printing knobs (bin_radix, and so on).
The knob object provides access to the variety of knobs associated with a specific printer instance.
m_uvm_printer_knobs knobs
Prints an integral field (up to 4096 bits).
virtual function void print_field ( string name, uvm_bitstream_t value, int size, uvm_radix_enum radix = UVM_NORADIX, byte scope_separator = ".", string type_name = "" )
Prints an object.
virtual function void print_object ( string name, uvm_object value, byte scope_separator = "." )
Prints a string field.
virtual function void print_string ( string name, string value, byte scope_separator = "." )
Prints a time value.
virtual function void print_time ( string name, time value, byte scope_separator = "." )
Prints a real field.
virtual function void print_real ( string name, real value, byte scope_separator = "." )
Prints a field having the given name, type_name, size, and value.
virtual function void print_generic ( string name, string type_name, int size, string value, byte scope_separator = "." )
Emits a string representing the contents of an object in a format defined by an extension of this object.
virtual function string emit ()
Hook for producing custom output of a single field (row).
virtual function string format_row ( uvm_printer_row_info row )
Hook to override base header with a custom header.
virtual function string format_header()
Hook to override base footer with a custom footer.
virtual function string format_footer()
Prints a field’s name, or id, which is the full instance name.
virtual protected function string adjust_name ( string id, byte scope_separator = "." )
Prints the header of an array.
virtual function void print_array_header( string name, int size, string arraytype = "array", byte scope_separator = "." )
Prints a range using ellipses for values.
virtual function void print_array_range ( int min, int max )
Prints the header of a footer.
virtual function void print_array_footer ( int size = 0 )
The table printer prints output in a tabular format.
class uvm_table_printer extends uvm_printer
By overriding various methods of the uvm_printer super class, the tree printer prints output in a tree format.
class uvm_tree_printer extends uvm_printer
The line printer prints output in a line format.
class uvm_line_printer extends uvm_tree_printer
The m_uvm_printer_knobs class defines the printer settings available to all printer subtypes.
class m_uvm_printer_knobs
The library implements the following public API beyond what is documented in 1800.2.
virtual class uvm_component extends uvm_report_object
This bit determines if this component should automatically be printed as a child of its parent object.
bit print_enabled = 1
Defines the number of elements at the head of a list to print.
int begin_elements = 5
This defines the number of elements at the end of a list that should be printed.
int end_elements = 5
Formats the collected information from prior calls to print_* into table format.
virtual function string emit()
Implementation of uvm_table_printer::get_default as defined in section 16.2.10.2.3 of 1800.2-2017.
static function uvm_table_printer get_default()
Creates a new instance of uvm_tree_printer.
function new( string name = "" )
Implementation of uvm_tree_printer::get_default as defined in section 16.2.11.2.4 of 1800.2-2017.
static function uvm_tree_printer get_default()
Creates a new instance of uvm_line_printer.
function new( string name = "" )
Implementation of uvm_line_printer::get_default as defined in section 16.2.12.2.3 of 1800.2-2017.
static function uvm_line_printer get_default()
Indicates whether the uvm_printer::format_header function should be called when printing an object.
bit header = 1
Indicates whether the uvm_printer::format_footer function should be called when printing an object.
bit footer = 1
Indicates whether uvm_printer::adjust_name should print the full name of an identifier or just the leaf name.
bit full_name = 0
Indicates whether uvm_printer::adjust_name should print the identifier.
bit identifier = 1
Controls whether to print a field’s type name.
bit type_name = 1
Controls whether to print a field’s size.
bit size = 1
Indicates how deep to recurse when printing objects.
int depth = -1
Controls whether to print a unique reference ID for object handles.
bit reference = 1
Specifies the string prepended to each output line
string prefix = ""
This knob specifies the number of spaces to use for level indentation.
int indent = 2
This setting indicates whether or not the initial object that is printed (when current depth is 0) prints the full path name.
bit show_root = 0
This is a file descriptor, or multi-channel descriptor, that specifies where the print output should be directed.
int mcd = UVM_STDOUT
For tree printers only, determines the opening and closing separators used for nested objects.
string separator = "{}"
Indicates whether the radix string (‘h, and so on) should be prepended to an integral value when one is printed.
bit show_radix = 1
This knob sets the default radix to use for integral values when no radix enum is explicitly supplied to the uvm_printer::print_field or uvm_printer::print_field_int methods.
uvm_radix_enum default_radix = UVM_HEX
This string should be prepended to the value of an integral type when a radix of UVM_DEC is used for the radix of the integral object.
string dec_radix = "'d"
This string should be prepended to the value of an integral type when a radix of UVM_BIN is used for the radix of the integral object.
string bin_radix = "'b"
This string should be prepended to the value of an integral type when a radix of UVM_OCT is used for the radix of the integral object.
string oct_radix = "'o"
This is the string which should be prepended to the value of an integral type when a radix of UVM_UNSIGNED is used for the radix of the integral object.
string unsigned_radix = "'d"
This string should be prepended to the value of an integral type when a radix of UVM_HEX is used for the radix of the integral object.
string hex_radix = "'h"
Converts the radix from an enumerated to a printable radix according to the radix printing knobs (bin_radix, and so on).
function string get_radix_str( uvm_radix_enum radix )