This page covers the classes that define the UVM report server facility.
UVM Report Server | This page covers the classes that define the UVM report server facility. |
uvm_report_server | uvm_report_server is a global server that processes all of the reports generated by a uvm_report_handler. |
uvm_default_report_server | Default implementation of the UVM report server, as defined in section 6.5.2 of 1800.2-2017 |
uvm_report_server is a global server that processes all of the reports generated by a uvm_report_handler.
The uvm_report_server is an abstract class which declares many of its methods as pure virtual. The UVM uses the uvm_default_report_server class as its default report server implementation.
uvm_report_server | |
uvm_report_server is a global server that processes all of the reports generated by a uvm_report_handler. | |
Methods | |
set_id_count | sets the count of already passed messages with id to count |
execute_report_message | Processes the provided message per the actions contained within. |
compose_report_message | Constructs the actual string sent to the file or command line from the severity, component name, report id, and the message itself. |
report_summarize | Outputs statistical information on the reports issued by this central report server. |
set_server | Sets the global report server to use for reporting. |
get_server | Gets the global report server used for reporting. |
pure virtual function void set_id_count( string id, int count )
sets the count of already passed messages with id to count
pure virtual function void execute_report_message( uvm_report_message report_message, string composed_message )
Processes the provided message per the actions contained within.
Expert users can overload this method to customize action processing.
pure virtual function string compose_report_message( uvm_report_message report_message, string report_object_name = "" )
Constructs the actual string sent to the file or command line from the severity, component name, report id, and the message itself.
Expert users can overload this method to customize report formatting.
pure virtual function void report_summarize( UVM_FILE file = UVM_STDOUT )
Outputs statistical information on the reports issued by this central report server. This information will be sent to the command line if file is 0, or to the file descriptor file if it is not 0.
The run_test method in uvm_top calls this method.
static function void set_server( uvm_report_server server )
Sets the global report server to use for reporting.
This method is provided as a convenience wrapper around setting the report server via the <uvm_coreservice_t::set_report_server> method.
In addition to setting the server this also copies the severity/id counts from the current report_server to the new one
// Using the uvm_coreservice_t: uvm_coreservice_t cs; cs = uvm_coreservice_t::get(); your_server.copy(cs.get_report_server()); cs.set_report_server(your_server); // Not using the uvm_coreservice_t: uvm_report_server::set_server(your_server);
static function uvm_report_server get_server()
Gets the global report server used for reporting.
This method is provided as a convenience wrapper around retrieving the report server via the <uvm_coreservice_t::get_report_server> method.
// Using the uvm_coreservice_t: uvm_coreservice_t cs; uvm_report_server rs; cs = uvm_coreservice_t::get(); rs = cs.get_report_server(); // Not using the uvm_coreservice_t: uvm_report_server rs; rs = uvm_report_server::get_server();
Default implementation of the UVM report server, as defined in section 6.5.2 of 1800.2-2017
uvm_default_report_server | |||
Default implementation of the UVM report server, as defined in section 6.5.2 of 1800.2-2017 | |||
Class Hierarchy | |||
| |||
Class Declaration | |||
| |||
enable_report_id_count_summary | A flag to enable report count summary for each ID | ||
record_all_messages | A flag to force recording of all messages (add UVM_RM_RECORD action) | ||
show_verbosity | A flag to include verbosity in the messages, e.g. | ||
show_terminator | A flag to add a terminator in the messages, e.g. | ||
new | Creates an instance of the class. | ||
The uvm_report_server implements the uvm_object::do_print() such that print method provides UVM printer formatted output of the current configuration. | |||
Quit Count | |||
get_max_quit_count | |||
set_max_quit_count | Get or set the maximum number of COUNT actions that can be tolerated before a UVM_EXIT action is taken. | ||
get_quit_count | |||
set_quit_count | |||
incr_quit_count | |||
reset_quit_count | Set, get, increment, or reset to 0 the quit count, i.e., the number of COUNT actions issued. | ||
is_quit_count_reached | If is_quit_count_reached returns 1, then the quit counter has reached the maximum. | ||
Severity Count | |||
get_severity_count | |||
set_severity_count | |||
incr_severity_count | |||
reset_severity_counts | Set, get, or increment the counter for the given severity, or reset all severity counters to 0. | ||
id Count | |||
get_id_count | |||
set_id_count | |||
incr_id_count | Set, get, or increment the counter for reports with the given id. | ||
message recording | The uvm_default_report_server will record messages into the message database, using one transaction per message, and one stream per report object/handler pair. | ||
set_message_database | sets the uvm_tr_database used for recording messages | ||
get_message_database | returns the uvm_tr_database used for recording messages | ||
Message Processing | |||
execute_report_message | Processes the provided message per the actions contained within. | ||
compose_report_message | Constructs the actual string sent to the file or command line from the report message. | ||
report_summarize | Outputs statistical information on the reports issued by this central report server. |
bit enable_report_id_count_summary=1
A flag to enable report count summary for each ID
@uvm-accellera This API is specific to the Accellera implementation, and is not being considered for contribution to 1800.2
bit record_all_messages = 0
A flag to force recording of all messages (add UVM_RM_RECORD action)
@uvm-accellera This API is specific to the Accellera implementation, and is not being considered for contribution to 1800.2
bit show_verbosity = 0
A flag to include verbosity in the messages, e.g.
”UVM_INFO(UVM_MEDIUM) file.v(3) @ 60: reporter [ID0] Message 0”
@uvm-accellera This API is specific to the Accellera implementation, and is not being considered for contribution to 1800.2
bit show_terminator = 0
A flag to add a terminator in the messages, e.g.
”UVM_INFO file.v(3) @ 60: reporter [ID0] Message 0 -UVM_INFO”
The uvm_report_server implements the uvm_object::do_print() such that print method provides UVM printer formatted output of the current configuration. A snippet of example output is shown here:
uvm_report_server uvm_report_server - @13 quit_count int 32 'd0 max_quit_count int 32 'd5 max_quit_overridable bit 1 'b1 severity_count severity counts 4 - [UVM_INFO] integral 32 'd4 [UVM_WARNING] integral 32 'd2 [UVM_ERROR] integral 32 'd50 [UVM_FATAL] integral 32 'd10 id_count id counts 4 - [ID1] integral 32 'd1 [ID2] integral 32 'd2 [RNTST] integral 32 'd1 enable_report_id_count_summary bit 1 'b1 record_all_messages bit 1 `b0 show_verbosity bit 1 `b0 show_terminator bit 1 `b0
function int get_max_quit_count()
function void set_max_quit_count( int count, bit overridable = 1 )
Get or set the maximum number of COUNT actions that can be tolerated before a UVM_EXIT action is taken. The default is 0, which specifies no maximum.
function int get_quit_count()
function void set_quit_count( int quit_count )
function void incr_quit_count()
function void reset_quit_count()
Set, get, increment, or reset to 0 the quit count, i.e., the number of COUNT actions issued.
function bit is_quit_count_reached()
If is_quit_count_reached returns 1, then the quit counter has reached the maximum.
function int get_severity_count( uvm_severity severity )
function void set_severity_count( uvm_severity severity, int count )
function void incr_severity_count( uvm_severity severity )
function void reset_severity_counts()
Set, get, or increment the counter for the given severity, or reset all severity counters to 0.
function int get_id_count( string id )
function void set_id_count( string id, int count )
function void incr_id_count( string id )
Set, get, or increment the counter for reports with the given id.
The uvm_default_report_server will record messages into the message database, using one transaction per message, and one stream per report object/handler pair.
virtual function void set_message_database( uvm_tr_database database )
sets the uvm_tr_database used for recording messages
virtual function uvm_tr_database get_message_database()
returns the uvm_tr_database used for recording messages
virtual function void execute_report_message( uvm_report_message report_message, string composed_message )
Processes the provided message per the actions contained within.
Expert users can overload this method to customize action processing.
virtual function string compose_report_message( uvm_report_message report_message, string report_object_name = "" )
Constructs the actual string sent to the file or command line from the report message.
The return value is constructed by concatenating the following strings in order, with spaces between.
Severity and verbosity | If show_verbosity is ‘1’, then this value is the concatenation of {S1,”(“,S2,”)”}, where S1 is the severity of the message as returned by uvm_report_message::get_severity, and S2 is the verbosity of the message, as returned by uvm_report_message::get_verbosity. If show_verbosity is ‘0’, then this value is simply the severity of the message. |
File name and line | If uvm_report_message::get_filename returns an empty string (“”), then this value is the empty string (“”). Otherwise this string is formatted as “%s(%0d)”, where %s is the file name, and %0d is the line number. |
Timestamp | This value is the concatenation of {“@”,TIME,”:”}, where TIME is determined by formatting $time as “%0t”. Note that $time is being resolved inside of the <uvm_pkg> scope. |
Full report context | If uvm_report_message::get_context, returns an empty string (“”), then this value is the full name of the report object returned by uvm_report_message::get_report_object. Otherwise this value is the the concatenation of {S1,”@@”,S2}, where S1 is the full name of the report object for the message, and S2 is the context string. |
ID | The concatenation of {“[“, ID, “]”}, where ID is the return value of uvm_report_message::get_id. |
Message | The message string, as determined by uvm_report_message::get_message |
Terminator | If show_terminator is ‘1’, then the terminator string is {“-”, SEV}, where SEV is the severity as determined by uvm_report_message::get_severity. If show_terminator is ‘0’, then this is the empty string (“”). |
For example, the following report messages...
`uvm_info("Example", "Info message", UVM_LOW) uvm_report_info("Example", "No file/line"); uvm_report_info("Example", "With context", UVM_LOW, "demo_pkg.sv", 57, "example_context"); // show_verbosity = 1 `uvm_info("Example", "With verbosity", UVM_LOW) // show_terminator = 1 `uvm_info("Example", "With terminator", UvM_LOW) // show_verbosity = 1, show_terminator = 1 `uvm_info("Example", "With both", UVM_NONE)
...result in the output below
UVM_INFO demo_pkg.sv(55) @ 0: uvm_test_top [Example] Info message UVM_INFO @ 0: uvm_test_top [Example] No file/line UVM_INFO demo_pkg.sv(57) @ 0: uvm_test_top@@example_context [Example] With context // show_verbosity = 1 UVM_INFO(UVM_LOW) demo_pkg.sv(60) @ 0: uvm_test_top [Example] Info message // show_terminator = 1 UVM_INFO demo_pkg.sv(62) @ 0: uvm_test_top [Example] Info message -UVM_INFO // show_verbosity = 1, show_terminator = 1 UVM_INFO(UVM_NONE) demo_pkg.sv(64) @ 0: uvm_test_top [Example] With both -UVM_INFO
@uvm-accellera The details of this API are specific to the Accellera implementation, and are not being considered for contribution to 1800.2
virtual function void report_summarize( UVM_FILE file = UVM_STDOUT )
Outputs statistical information on the reports issued by this central report server. This information will be sent to the command line if file is UVM_STDOUT, or to the file descriptor file if it is not UVM_STDOUT.
The run_test method in uvm_top calls this method.
Default implementation of the UVM report server, as defined in section 6.5.2 of 1800.2-2017
class uvm_default_report_server extends uvm_report_server
sets the count of already passed messages with id to count
pure virtual function void set_id_count( string id, int count )
Processes the provided message per the actions contained within.
pure virtual function void execute_report_message( uvm_report_message report_message, string composed_message )
Constructs the actual string sent to the file or command line from the severity, component name, report id, and the message itself.
pure virtual function string compose_report_message( uvm_report_message report_message, string report_object_name = "" )
Outputs statistical information on the reports issued by this central report server.
pure virtual function void report_summarize( UVM_FILE file = UVM_STDOUT )
Sets the global report server to use for reporting.
static function void set_server( uvm_report_server server )
Gets the global report server used for reporting.
static function uvm_report_server get_server()
Convenience function for uvm_top.run_test().
task run_test ( string test_name = "" )
A flag to enable report count summary for each ID
bit enable_report_id_count_summary=1
A flag to force recording of all messages (add UVM_RM_RECORD action)
bit record_all_messages = 0
A flag to include verbosity in the messages, e.g.
bit show_verbosity = 0
A flag to add a terminator in the messages, e.g.
bit show_terminator = 0
Creates an instance of the class.
function new( string name = "uvm_report_server" )
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.
virtual function void do_print ( uvm_printer printer )
function int get_max_quit_count()
Get or set the maximum number of COUNT actions that can be tolerated before a UVM_EXIT action is taken.
function void set_max_quit_count( int count, bit overridable = 1 )
function int get_quit_count()
function void set_quit_count( int quit_count )
function void incr_quit_count()
Set, get, increment, or reset to 0 the quit count, i.e., the number of COUNT actions issued.
function void reset_quit_count()
If is_quit_count_reached returns 1, then the quit counter has reached the maximum.
function bit is_quit_count_reached()
function int get_severity_count( uvm_severity severity )
function void set_severity_count( uvm_severity severity, int count )
function void incr_severity_count( uvm_severity severity )
Set, get, or increment the counter for the given severity, or reset all severity counters to 0.
function void reset_severity_counts()
function int get_id_count( string id )
function void set_id_count( string id, int count )
Set, get, or increment the counter for reports with the given id.
function void incr_id_count( string id )
sets the uvm_tr_database used for recording messages
virtual function void set_message_database( uvm_tr_database database )
The uvm_tr_database class is intended to hide the underlying database implementation from the end user, as these details are often vendor or tool-specific.
virtual class uvm_tr_database extends uvm_object
returns the uvm_tr_database used for recording messages
virtual function uvm_tr_database get_message_database()
Processes the provided message per the actions contained within.
virtual function void execute_report_message( uvm_report_message report_message, string composed_message )
Constructs the actual string sent to the file or command line from the report message.
virtual function string compose_report_message( uvm_report_message report_message, string report_object_name = "" )
Outputs statistical information on the reports issued by this central report server.
virtual function void report_summarize( UVM_FILE file = UVM_STDOUT )
virtual function uvm_severity get_severity()
virtual function int get_verbosity()
virtual function string get_filename()
virtual function string get_context()
virtual function uvm_report_object get_report_object()
virtual function string get_id()
virtual function string get_message()