原语的 SystemVerilog 断言
SystemVerilog assertion for primitive
有没有办法为 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) 中唯一允许的结构是 table。您需要将 UDP 包装在一个模块中以添加任何其他内容。
有没有办法为 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) 中唯一允许的结构是 table。您需要将 UDP 包装在一个模块中以添加任何其他内容。