Search code examples
system-verilogquestasim

Formatting $info


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>

Solution

  • 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.