返回介绍

23.8 断言严重性系统任务

发布于 2020-09-09 22:55:57 字数 2140 浏览 1099 评论 0 收藏 0

assert_severity_task ::=   // not in Annex A
    fatal_message_task
  | nonfatal_message_task

fatal_message_task ::= $fatal[(finish_number[, message_argument{, message_argument}])];

nonfatal_message_task ::= severity_task[([message_argument{, message_argument]}])];

severity_task ::= $error | $warning | $info

finish_number ::= 0 | 1 | 2

message_argument ::= string | expression

Syntax 23-6—Assertion severity system task syntax (not in Annex A)

SystemVerilog assertions have a severity level associated with any assertion failures detected. By default, the severity of an assertion failure is “error”. The severity levels can be specified by including one of the following severity system tasks in the assertion fail statement:

  • $fatal shall generate a run-time fatal assertion error, which terminates the simulation with an error code. The first argument passed to $fatal shall be consistent with the corresponding argument to the Verilog $finish system task, which sets the level of diagnostic information reported by the tool. Calling $fatal results in an implicit call to $finish.
  • $error shall be a run-time error.
  • $warning shall be a run-time warning, which can be suppressed in a tool-specific manner.
  • $info shall indicate that the assertion failure carries no specific severity.
All of these severity system tasks shall print a tool-specific message, indicating the severity of the failure, and specific information about the failure, which shall include the following information:
  • The file name and line number of the assertion statement,
  • The hierarchical name of the assertion, if it is labeled, or the scope of the assertion if it is not labeled.
For simulation tools, these tasks shall also report the simulation run-time at which the severity system task is

called.

Each of the severity tasks can include optional user-defined information to be reported. The user-defined message shall use the same syntax as the Verilog $display system task, and can include any number of arguments.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文