|
发表于 2022-8-1 11:10:58
|
显示全部楼层
本帖最后由 qsh123_123 于 2022-8-1 11:21 编辑
特意查阅了一下关于错误severity级别的函数,其中关于$fatal, $error, $warning, $info有这样的描述(出自《SystemVerilog 3.1a Language Reference Manual--Accellera's Extensions to Verilog》P335, 23.8 Assertion severity system tasks):
---------------------------------------------
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.
----------------------------------------------
而且,$fatal的函数定义和参数定义是这样的:
fatal_message_task ::= $fatal[(finish_number [, message_argument {,message_argument}])];
第一个参数finish_number是输入给$finish函数的参数,而函数$finish的这个参数说明在IEEE Std 1800-2017里面找到如下:
简单来说,$fatal函数会调用$finish函数,而$finish函数一定会结束仿真。。。加啥参数都没用,除非你改写系统函数$fatal或者$finish,或者你的仿真器仿真Verilog/Systemverilog不遵循IEEE的语法。。。
想不结束仿真并且报错,请用$error函数,好么?fatal这个错误级别的函数的存在意义就是为了结束仿真用的。
最后,补充一下IEEE Std 1800-2017里面关于$fatal的说明:
|
|