Recursion 如何在Systemverilog中使用递归属性
要验证的模块如下所示。。。 该模块有一个输入in1和一个输出out1,在交替的时钟周期中,out1是in1的缓冲和反转值 我尝试使用递归属性对checker模块进行编码Recursion 如何在Systemverilog中使用递归属性,recursion,properties,system-verilog,assertion,system-verilog-assertions,Recursion,Properties,System Verilog,Assertion,System Verilog Assertions,要验证的模块如下所示。。。 该模块有一个输入in1和一个输出out1,在交替的时钟周期中,out1是in1的缓冲和反转值 我尝试使用递归属性对checker模块进行编码 module check (input in1, out1, clk); property p1(bit state); bit nxt; @(posedge clk) (1 ,nxt=!state) |-> (out1 == (nxt) ? !in1 : in1
module check (input in1, out1, clk);
property p1(bit state);
bit nxt;
@(posedge clk)
(1 ,nxt=!state) |-> (out1 == (nxt) ? !in1 : in1) and
nexttime p1(nxt);
endproperty
initial assert property(p1(0)) else $fatal(3, "Failed!");
endmodule
但是,在运行代码时会抛出此错误
错误VCP2000“语法错误。意外标记:nexttime[\u nexttime]。错误
“nexttime”是SystemVerilog关键字,不能用作
标识符
我知道这个断言可以在没有递归的情况下完成,但我想使用递归来编写它。错误表明您使用了
nexttime
,这是一个systemverilog属性关键字。该运算符检查“如果时钟再次滴答作响,那么a
将在下一个时钟滴答作响时为真“在以下代码中
property p1;
nexttime a;
endproperty
默认情况下,应在每个时钟脉冲上检查并发断言,因此这里不需要递归大致上,您可以执行以下操作:
module check (input in1, out1, clk);
bit o_nxt;
function bit update(input bit nxt);
o_nxt = nxt;
return 1;
endfunction
property p1(bit state);
bit nxt;
@(posedge clk)
(1 ,nxt=!state) |-> (out1 == (nxt) ? !in1 : in1) and
update(nxt);
endproperty
initial assert property(p1(o_nxt)) else $fatal(3, "Failed!");
endmodule