system-verilog - 原语的 SystemVerilog 断言

标签 system-verilog system-verilog-assertions

有没有办法为 SystemVerilog 原语添加断言或仅在包装原语的模块(单元)中添加断言?简单地添加断言无法编译

   primitive mux (q, d0, d1, s);
   output q;
   input s, d0, d1;

   table
   // d0  d1  s   : q 
      0   ?   0   : 0 ;
      1   ?   0   : 1 ;
      ?   0   1   : 0 ;
      ?   1   1   : 1 ;
      0   0   x   : 0 ;
      1   1   x   : 1 ;
   endtable
   //assert(s != x) else $error("s has value x"); - add this assertion
endprimitive

最佳答案

用户定义原语 (UDP) 中允许的唯一构造是表。您需要将 UDP 包装在模块中才能添加其他内容。

关于system-verilog - 原语的 SystemVerilog 断言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56096689/

相关文章:

verilog - 在verilog中使用 '<='运算符

macros - 何时使用定义宏与生成

verilog - 在递归属性中使用队列

c - 如何使用 DPI-C 嵌入 Systemverilog 解释器?

constants - SystemVerilog 无法识别常量 : Error: Range must be bounded by constant expression

system-verilog - 如何在 SystemVerilog 中存储 $system ("...") 调用的返回值?

system-verilog - SystemVerilog : implies operator vs. |->

system-verilog - 为什么 Quartus Prime 不想忽略用于仿真的 systemverilog 断言?

system-verilog - SVA 假设/断言连续数据输入