如何覆盖一个fifo rd/wt 属性?
How to cover a fifo rd/wt property?
我正在尝试写一个 fiford 写封面点。
module M;
bit stop; bit clk; initial while (!stop) #5 clk = ~clk;
bit A, B, rst;
initial rst = 0;
initial begin
A = 0;
#20 A = 1;
#10 A = 0;
// #10 B = 1;
#10 B = 0;
#50 stop = 1;
end
// sequence fifo_rd_wt_s(reg sig);
// ((|A === 1) |-> s_eventually (|B === 1));
// endsequence: fifo_rd_wt_s
property fifo_rd_wt_p(reg sig_clk, reg sig_rst);
@(posedge sig_clk) disable iff(sig_rst)
((|A === 1) |-> s_eventually (|B === 1));
endproperty: fifo_rd_wt_p
cover_fifo_read_write: cover property(fifo_rd_wt_p(clk, rst)) $error($sformatf("%0t hit fifo read write", $time));
// else $error($sformatf("%0t did not hit", $time));
final
$display("Finished!");
endmodule: M
在 运行 日志中,我看到它在每个周期都被触发,但这不是我想要的。我希望它在每次看到 A
后跟 B
.
时触发
不确定我错过了什么。
我发现了类似的东西
代码存在于code
我认为你的问题在于暗示。我使用了您的示例并替换为 strong((|A === 1) ##[1:$] (|B === 1));它工作正常。
用暗示覆盖可能会有一些意想不到的行为(在你的情况下它覆盖了先行词),用序列覆盖总是更安全
我正在尝试写一个 fiford 写封面点。
module M;
bit stop; bit clk; initial while (!stop) #5 clk = ~clk;
bit A, B, rst;
initial rst = 0;
initial begin
A = 0;
#20 A = 1;
#10 A = 0;
// #10 B = 1;
#10 B = 0;
#50 stop = 1;
end
// sequence fifo_rd_wt_s(reg sig);
// ((|A === 1) |-> s_eventually (|B === 1));
// endsequence: fifo_rd_wt_s
property fifo_rd_wt_p(reg sig_clk, reg sig_rst);
@(posedge sig_clk) disable iff(sig_rst)
((|A === 1) |-> s_eventually (|B === 1));
endproperty: fifo_rd_wt_p
cover_fifo_read_write: cover property(fifo_rd_wt_p(clk, rst)) $error($sformatf("%0t hit fifo read write", $time));
// else $error($sformatf("%0t did not hit", $time));
final
$display("Finished!");
endmodule: M
在 运行 日志中,我看到它在每个周期都被触发,但这不是我想要的。我希望它在每次看到 A
后跟 B
.
不确定我错过了什么。
我发现了类似的东西
代码存在于code
我认为你的问题在于暗示。我使用了您的示例并替换为 strong((|A === 1) ##[1:$] (|B === 1));它工作正常。
用暗示覆盖可能会有一些意想不到的行为(在你的情况下它覆盖了先行词),用序列覆盖总是更安全