I guess, the only advise is to avoid writing big properties. It is very easy to mess up the code. if/else just add to size and have a potential to further obfuscate it.
Your code has syntactic errors. You cannot use the keyword outptut
as a variable name. there is also an extra ;
in your code, after the if clause.
property check_mux_out (clk, rst, en, d1, out, d2, select);
@(posedge clk)
if (select)
(rst==0) && (en==1) |-> (out === d2) // << no ';'
else
(rst==0) && (en==1) |-> (out === d1);
endproperty
You can re-write it in a different way as well:
property check_mux_out (clk, rst, en, d1, out, d2, select);
@(posedge clk)
(rst==0) && (en==1) |-> if (select) (out === d2) else (out === d1);
endproperty
or even without if/else
property check_mux_out (clk, rst, en, d1, out, d2, select);
@(posedge clk)
(rst==0) && (en==1) |-> (select) ? (out === d2) : (out === d1);
endproperty
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…