【发布时间】:2022-10-25 14:41:02
【问题描述】:
如何格式化 Verilog 代码的 $info、$warning 等的输出?
默认情况下(至少 Questa)在两行上显示消息,我需要删除行更改、文件路径和其他基本上只会在我的日志中引起噪音的东西。
Questa 的 modelsim.ini 提供这些:
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"
..但它们似乎不影响打印。
编辑:目前默认的消息样式是这样的::
# ** 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
目标是让它进入:
# ** Info: 0.000us - <message>
# ** Info: 0.000us - <message>
# ** Info: 0.000us - <message>
【问题讨论】:
-
请改用
$display。那只是准确地输出您要求的内容,仅此而已。