UVM Report Server

UVMkit » 1800.2-2017

This page covers the classes that define the UVM report server facility.

Contents
UVM Report ServerThis page covers the classes that define the UVM report server facility.
uvm_report_serveruvm_report_server is a global server that processes all of the reports generated by a uvm_report_handler.
uvm_default_report_serverDefault implementation of the UVM report server, as defined in section 6.5.2 of 1800.2-2017

uvm_report_server

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.

Summary
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_countsets the count of already passed messages with id to count
execute_report_messageProcesses the provided message per the actions contained within.
compose_report_messageConstructs the actual string sent to the file or command line from the severity, component name, report id, and the message itself.
report_summarizeOutputs statistical information on the reports issued by this central report server.
set_serverSets the global report server to use for reporting.
get_serverGets the global report server used for reporting.

set_id_count

pure virtual function void set_id_count( string  id,
int  count )

sets the count of already passed messages with id to count

execute_report_message

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.

compose_report_message

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.

report_summarize

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.

set_server

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);

get_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();

uvm_default_report_server

Default implementation of the UVM report server, as defined in section 6.5.2 of 1800.2-2017

Summary
uvm_default_report_server
Default implementation of the UVM report server, as defined in section 6.5.2 of 1800.2-2017
Class Hierarchy
uvm_default_report_server
Class Declaration
class uvm_default_report_server extends uvm_report_server
enable_report_id_count_summaryA flag to enable report count summary for each ID
record_all_messagesA flag to force recording of all messages (add UVM_RM_RECORD action)
show_verbosityA flag to include verbosity in the messages, e.g.
show_terminatorA flag to add a terminator in the messages, e.g.
newCreates an instance of the class.
printThe 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_countGet 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_countSet, get, increment, or reset to 0 the quit count, i.e., the number of COUNT actions issued.
is_quit_count_reachedIf 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_countsSet, 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_countSet, get, or increment the counter for reports with the given id.
message recordingThe 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_databasesets the uvm_tr_database used for recording messages
get_message_databasereturns the uvm_tr_database used for recording messages
Message Processing
execute_report_messageProcesses the provided message per the actions contained within.
compose_report_messageConstructs the actual string sent to the file or command line from the report message.
report_summarizeOutputs statistical information on the reports issued by this central report server.

enable_report_id_count_summary

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

record_all_messages

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

show_verbosity

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

show_terminator

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”

new

function new( string  name  =  "uvm_report_server" )

Creates an instance of the class.

print

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

get_max_quit_count

function int get_max_quit_count()

set_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.

get_quit_count

function int get_quit_count()

set_quit_count

function void set_quit_count( int  quit_count )

incr_quit_count

function void incr_quit_count()

reset_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.

is_quit_count_reached

function bit is_quit_count_reached()

If is_quit_count_reached returns 1, then the quit counter has reached the maximum.

get_severity_count

function int get_severity_count( uvm_severity  severity )

set_severity_count

function void set_severity_count( uvm_severity  severity,
int  count )

incr_severity_count

function void incr_severity_count( uvm_severity  severity )

reset_severity_counts

function void reset_severity_counts()

Set, get, or increment the counter for the given severity, or reset all severity counters to 0.

get_id_count

function int get_id_count( string  id )

set_id_count

function void set_id_count( string  id,
int  count )

incr_id_count

function void incr_id_count( string  id )

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

virtual function void set_message_database( uvm_tr_database  database )

sets the uvm_tr_database used for recording messages

get_message_database

virtual function uvm_tr_database get_message_database()

returns the uvm_tr_database used for recording messages

execute_report_message

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.

compose_report_message

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 verbosityIf 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 lineIf 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.
TimestampThis 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 contextIf 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.
IDThe concatenation of {“[“, ID, “]”}, where ID is the return value of uvm_report_message::get_id.
MessageThe message string, as determined by uvm_report_message::get_message
TerminatorIf 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

report_summarize

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.

class uvm_default_report_server extends uvm_report_server
Default implementation of the UVM report server, as defined in section 6.5.2 of 1800.2-2017
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.
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.
pure virtual function void report_summarize( UVM_FILE  file  =  UVM_STDOUT )
Outputs statistical information on the reports issued by this central report server.
static function void set_server( uvm_report_server  server )
Sets the global report server to use for reporting.
static function uvm_report_server get_server()
Gets the global report server used for reporting.
task run_test ( string  test_name  =  "" )
Convenience function for uvm_top.run_test().
uvm_report_server is a global server that processes all of the reports generated by a uvm_report_handler.
bit enable_report_id_count_summary=1
A flag to enable report count summary for each ID
bit record_all_messages = 0
A flag to force recording of all messages (add UVM_RM_RECORD action)
bit show_verbosity = 0
A flag to include verbosity in the messages, e.g.
bit show_terminator = 0
A flag to add a terminator in the messages, e.g.
function new( string  name  =  "uvm_report_server" )
Creates an instance of the class.
virtual function void do_print ( uvm_printer  printer )
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.
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.
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.
virtual function void set_message_database( uvm_tr_database  database )
sets the uvm_tr_database used for recording messages
virtual class uvm_tr_database extends uvm_object
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 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.
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.
virtual function void report_summarize( UVM_FILE  file  =  UVM_STDOUT )
Outputs statistical information on the reports issued by this central report server.
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()