【发布时间】:2021-01-23 06:53:49
【问题描述】:
我正在为以下结构编写断言检查
基本上,我想检查选择信号为 0 时输出是否等于 d1,选择信号为 1 时输出是否等于 d2。
我做了这样的事情:
property check_mux_out (clk, rst, en, d1, output, d2, select);
@(posedge clk)
if (select)
(rst==0) && (en==1) |-> (output === d2);
else
(rst==0) && (en==1) |-> (output === d1);
endproperty
a1: assert property (check_mux_out(inst1_clk, inst1_rst, latch_en, signal1, inst_out, signal2, inst_select)) else $error("ERROR: output not equal input");
但是我发现了一些来自 https://verificationacademy.com/forums/systemverilog/conditional-statement-assertion-property 和 https://verificationacademy.com/forums/systemverilog/clock-period-checker-sva 这似乎表明 if..else 语句不应在 systemverilog 属性中使用。为什么会这样?我做错了什么,为什么?
【问题讨论】:
标签: verilog system-verilog hdl system-verilog-assertions