我的模块有 2 个输入,即 sig_1 和 sig_2(均为多位)。每当 sig1_1 发生变化时,我想使用断言检查 sig_2 是否是 sig_1 的 2 个时钟周期延迟版本。 我尝试了以下逻辑:
property delay_verif;
@(sig_1)
@(posedge clk)
(sig_1 |-\> ##2 (sig_2 == sig_1);
endproperty
Assertion1: assert property(delay_verif)
$display("value match successful at time: %t", $time);
else $display("value not matches at time: %t",$time);
但是不起作用
仅使用一个事件
@(posedge clk)
property delay_verif;
@(posedge clk)
$changed(sig_1) |-> ##2 sig_2 == $past(sig_1,2);
endproperty
Assertion1: assert property(delay_verif)
$info("value match successful at time: %t", $time);
else $error("value not matches at time: %t",$time);
请注意,当
sig_2
不改变时,这允许 sig_1
改变。你可能想要这个。
property delay_verif;
@(posedge clk)
always ##2 sig_2 == $past(sig_1,2);
endproperty