【问题标题】:SystemVerilog assertion for primitive原语的 SystemVerilog 断言
【发布时间】:2019-05-12 06:22:04
【问题描述】:

有没有办法为 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

【问题讨论】:

    标签: system-verilog system-verilog-assertions


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2016-01-12
      • 1970-01-01
      • 1970-01-01
      • 2018-07-29
      • 1970-01-01
      • 1970-01-01
      • 2023-01-30
      • 1970-01-01
      • 2015-03-04
      相关资源
      最近更新 更多