【问题标题】:Formatting $info格式化 $info
【发布时间】: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。那只是准确地输出您要求的内容,仅此而已。

标签: system-verilog questasim


【解决方案1】:

Questasim 具有$messagelog 系统功能,允许完全控制和格式化严重性消息。您将使用函数 this 而不是 $display/$info/.../$fatal

这些消息记录在波形数据库中,您可以在 GUI 或波形显示中查看消息。顺便说一句,这就是 Questa UVM 包用来记录 uvm_info/uvm_error 消息的严重性而不是使用 $display 的方法。查看 QuestaSim 用户手册了解更多详情。

【讨论】:

  • 问题是大多数时候我们无法控制代码本身,因为在模拟中可能有几十个模块不是你自己的。 IE。想象一下,做一个完整的 SOC 模拟,你只有一个自己的小模块,然后你会看到一行又一行的 $infos 和 $warnings 与 out 无关 - 但它们将你自己的消息隐藏在噪音中。可能根本无法更改消息格式。我尝试谷歌搜索并没有发现任何东西,StackOverflow 是我最后的手段:D
【解决方案2】:

我联系了导师支持团队,他们能够给我一个提示,如何实现接近我想要的目标。只需添加(或取消注释默认)SVAPrintOnlyUserMessage = 1模型sim.ini文件。

从 Questa 文档中:

不要从严重性系统任务中打印任何附加信息。 仅打印用户提供的消息以及严重性 信息。

IE。不再打印时间、文件路径、行号等。您仍然可以在 wlf 文件中获得绿色消息标记。

【讨论】:

    猜你喜欢
    • 2013-02-18
    • 2018-08-15
    • 1970-01-01
    • 2015-06-07
    • 1970-01-01
    • 2023-04-10
    • 2011-02-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多