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

how to disable file name and line numbers in reports

how to disable file name and line numbers in reports

UVM has this nice feature of being able to print the line number and file name from where a reporting task is called. This is very helpful during the early days of testbench debug, but it can soon clutter the log reports. Just imagine having the file name occupy most of the screen space, true in most projects because of the long path to a file, only to make it difficult for you to find the actual report message. Good News ! There's a way to disable this.

There are two ways to print a message.

Using report functions

uvm_report_info  ("MYINFO", "Informational Message", UVM_HIGH);
uvm_report_error ("MYERR", $sformatf ("Oops, Our rabbit was never designed to jump rbt=%0h", rbt));
 

This will not print the FILE and LINE information.


Using report macros

`uvm_info  ("MYINFO", "Informational Message", UVM_HIGH)
`uvm_error ("MYERR", $sformatf ("Oops, Our rabbit was never designed to jump rbt=%0h", rbt))    
 

This will print FILE and LINE information.



The report macros `uvm_* eventually call uvm_report_* functions, and provide the FILE and LINE information to them. You can disable it by using the compile time option +define+UVM_REPORT_DISABLE_FILE_LINE.

`ifdef UVM_REPORT_DISABLE_FILE_LINE
  `define UVM_REPORT_DISABLE_FILE
  `define UVM_REPORT_DISABLE_LINE
`endif
 
`ifdef UVM_REPORT_DISABLE_LINE
  `define uvm_line 0
`else
  `define uvm_line `__LINE__
`endif
 
`ifdef UVM_REPORT_DISABLE_FILE
  `define uvm_file ""
`else
  `define uvm_file `__FILE__
`endif
 
`define uvm_info(ID, MSG, VERBOSITY) \
   begin \
     if (uvm_report_enabled(VERBOSITY,UVM_INFO,ID)) \
       uvm_report_info (ID, MSG, VERBOSITY, `uvm_file, `uvm_line, "", 1); \
   end
 

You can also disable them individually by providing the compiler with +define+UVM_REPORT_DISABLE_LINE or +define+UVM_REPORT_DISABLE_FILE to disable reporting of line and file respectively.

what is the m_sequencer ?
what happens when you register a component with fa...
 

Comments 2

Guest - dsgadesr on Tuesday, 20 February 2018 05:07

where should i use +define+UVM_REPORT_DISABLE_FILE ?(in makefile or where)

where should i use +define+UVM_REPORT_DISABLE_FILE ?(in makefile or where)
Aravind Prakash on Tuesday, 20 February 2018 17:24

+define option is required to be given during compilation. As you might already know, the tool essentially needs to do three things to run a simulation - compile, elaborate and simulate. The tool may or may not call the same executable to do all the three steps. You can set this switch in the makefile if you have one, but you need to add this switch to the tool's compiler command. If you are directly calling the tool in the shell, you can simply add this to the end of the command.

[b]+define[/b] option is required to be given during compilation. As you might already know, the tool essentially needs to do three things to run a simulation - compile, elaborate and simulate. The tool may or may not call the same executable to do all the three steps. You can set this switch in the makefile if you have one, but you need to add this switch to the tool's compiler command. If you are directly calling the tool in the shell, you can simply add this to the end of the command.
Already Registered? Login Here
Guest
Monday, 18 June 2018

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