In Introduction, we saw that most of the verification components are inherited from uvm_report_object and hence they already have functions and methods to display messages.

Calling Functions

There are four basic reporting functions that can be used with different verbosity levels.

	uvm_report_* ("TAG", $sformatf ("[Enter the display message]"), VERBOSITY_LEVEL);

where * can be either info, error, warning, fatal. UVM has six levels of verbosity with each one represented by an integer.

typedef enum {
   UVM_NONE    = 0,
   UVM_LOW     = 100,
   UVM_MEDIUM  = 200,
   UVM_HIGH    = 300,
   UVM_FULL    = 400,
   UVM_DEBUG   = 500
} uvm_verbosity;

Note that the VERBOSITY_LEVEL is only required for uvm_report_info. Usage of uvm_report_fatal will exit the simulation.

uvm_report_info (get_type_name (), $sformatf ("None level message"), UVM_NONE);
uvm_report_info (get_type_name (), $sformatf ("Low level message"), UVM_LOW);
uvm_report_info (get_type_name (), $sformatf ("Medium level message"), UVM_MEDIUM);
uvm_report_info (get_type_name (), $sformatf ("High level message"), UVM_HIGH);
uvm_report_info (get_type_name (), $sformatf ("Full level message"), UVM_FULL);
uvm_report_info (get_type_name (), $sformatf ("Debug level message"), UVM_DEBUG);

uvm_report_warning (get_type_name (), $sformatf ("Warning level message"));
uvm_report_error (get_type_name (), $sformatf ("Error level message"));
uvm_report_fatal (get_type_name (), $sformatf ("Fatal level message"));

We can also display the filename and line number of the display message by using `__FILE__ and `__LINE__, which will be useful for debug purposes. This can be disabled from command-line by defining +UVM_REPORT_DISABLE_FILE_LINE

uvm_report_info (get_type_name (), $sformatf ("None level message - Display File/Line"), UVM_NONE, `__FILE__, `__LINE__);

Calling Macros

UVM reporting macros will automatically display the file and line information without explicitly mentioning the `__FILE__ and `__LINE__ arguments.

`uvm_info (get_type_name (), $sformatf ("[Driver] None level message"), UVM_NONE)
`uvm_info (get_type_name (), $sformatf ("[Driver] Low level message"), UVM_LOW)
`uvm_info (get_type_name (), $sformatf ("[Driver] Medium level message"), UVM_MEDIUM)
`uvm_info (get_type_name (), $sformatf ("[Driver] High level message"), UVM_HIGH)
`uvm_info (get_type_name (), $sformatf ("[Driver] Full level message"), UVM_FULL)
`uvm_info (get_type_name (), $sformatf ("[Driver] Debug level message"), UVM_DEBUG)

`uvm_warning (get_type_name (), $sformatf ("[Driver] Warning level message"))
`uvm_error (get_type_name (), $sformatf ("[Driver] Error level message"))
`uvm_fatal (get_type_name (), $sformatf ("[Driver] Fatal level message"))

Verbosity Levels

In simple terms, this controls whether a uvm_report_* statement gets displayed or not. If we have configured the verbosity settings to UVM_HIGH, then it means that we expect every uvm_report_* or `uvm_* message with a verbosity level less than UVM_HIGH to be printed out. If you have configured it to UVM_LOW, then only UVM_LOW and UVM_NONE lines will be dumped out. Default configuration is UVM_MEDIUM.