0

How can I format the output of $info, $warning, etc. of Verilog code?

By default (at least Questa) shows messages on two lines, and I need to get rid of line changes, file paths, and other stuff that is basically just causing noise in my logs.

Questa's modelsim.ini offers these:

MessageFormatNote      = "%S: %R\n   Time: %T  Iteration: %D%I\n"
MessageFormatWarning   = "%S: %R\n   Time: %T  Iteration: %D%I\n"
MessageFormatError     = "%S: %R\n   Time: %T  Iteration: %D  %K: %i File: %F\n"
MessageFormatFail      = "%S: %R\n   Time: %T  Iteration: %D  %K: %i File: %F\n"
MessageFormatFatal     = "%S: %R\n   Time: %T  Iteration: %D  %K: %i File: %F\n"
MessageFormatBreakLine = "%S: %R\n   Time: %T  Iteration: %D  %K: %i File: %F Line: %L\n"
MessageFormatBreak     = "%S: %R\n   Time: %T  Iteration: %D  %K: %i File: %F\n"
MessageFormat          = "%S: %R\n   Time: %T  Iteration: %D%I\n"

..but they don't seem to affect the prints.

Edit: Currently the default message style is something like this::

# ** Info: @ 0.000us <message>
#    Time: 0000000 ps  Scope: /path/to/file.sv Line: 666
# ** Info: @ 0.000us <message>
#    Time: 0000000 ps  Scope: /path/to/file.sv Line: 666
# ** Info: @ 0.000us <message>
#    Time: 0000000 ps  Scope: /path/to/file.sv Line: 666

The goal would be to get it into:

# ** Info: 0.000us - <message>
# ** Info: 0.000us - <message>
# ** Info: 0.000us - <message>
jarno
  • 137
  • 1
  • 10

2 Answers2

0

Questasim has $messagelog system function that allows complete control and formatting of severity messages. You would use function this instead of $display/$info/.../$fatal

These messages get recorded in the waveform database and you can look at messages in the GUI or waveform display. BTW, this is what the Questa UVM package does to record the severity of uvm_info/uvm_error messages instead of using $display. Check the QuestaSim User Manual for more details.

dave_59
  • 39,096
  • 3
  • 24
  • 63
  • The problem is that most of the time we're not in control of the code itself, since in a simulation there can be dozens of modules that are not your own. I.e. imagine doing a full SOC simulation and you just have a small module of your own in it, and then you see line after line of $infos and $warnings that have nothing to do with out - but they hide your own messages into noise. It might be that there's simply no way to change the message format. I tried googling and found nothing, StackOverflow was my last resort :D – jarno Oct 24 '22 at 05:30
0

I contacted the Mentor support team, and they were able to give me a hint how to achieve close to what I wanted. Just add (or uncomment the default) SVAPrintOnlyUserMessage = 1 into modelsim.ini file.

From the Questa documentation:

Do not print any additional information from Severity System tasks. Only the message provided by the user is printed along with severity information.

I.e. time, filepath, line number etc. are not printed anymore. You still get them green message markers in the wlf file.

jarno
  • 137
  • 1
  • 10