Welcome ! This website will help YOU (recent graduates/professionals) learn verification languages like SystemVerilog and UVM. Register for free and access more content !

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.


GitHub

You can download/clone the lab for reporting functions from our repository @ GitHub.


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.

Was this article helpful ?

We use cookies to personalize content and ads, to provide social media features and to analyze our traffic. You consent to our cookies if you continue to use our website. To find out more about the cookies we use and how to delete them, see our privacy policy.

  I accept cookies from this site.
Agree
EU Cookie Directive plugin by www.channeldigital.co.uk