Formatting $info

534 views Asked by At

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>
2

There are 2 answers

0
jarno On BEST ANSWER

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.

1
dave_59 On

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.