I have added an immediate assertion to test that two registers are not programmed to the same value at any given time. I get a failure at time 0fs because all values are uninitialized and are 'x'.
always @(*) begin
assert_reg_val_cmp:
assert (reg != 1'b1) else $error("...error msg...");
end
Is there a way to cleanly disable this assertion only at initial time? I could use reg !== 1'b1
comparison, which compares 'x' too, but I want to catch any 'x' states after 0fs.
disable iff (reset !== 1'b1)
go? - Wildernessdisable iff
doesn't work an immediate assertion. You can use:assert (reset === 1'b1 || reg != 1'b1) else $error("...error msg...");
orif (reset == 1'b1) assert (reg != 1'b1) else $error("...error msg...");
- Greg