原始的SystemVerilog断言

Mei*_*eir 1 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
Run Code Online (Sandbox Code Playgroud)

dav*_*_59 5

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