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)