I want to use an old value of a signal in a SystemVerilog assertion.
This is what I am currently doing
logic [ADDRESS_WIDTH-1:0] old_address [1:0];
always_ff@(posedge rdclock) begin
old_address[0] <= rdaddress;
old_address[1] <= old_address[0];
end
property FooBar;
@(posedge rdclock) rden |-> ##2 q == mem[old_address[1]];
endproperty
Baz: assert property (FooBar);
Is this how is should be done, or can I somehow use an old version of rdaddress
directly in the assertion?