Hi all,
I’m new to System Verilog Assertions concept, so i’m in learning stage of SVA.
I know the functionality of @past(,).
I mean in this case “a|-> ($past(b,2) == 1)” , ‘b’ should be high for 2 clock cycles before assertion of ‘a’.
but still I have one query on $past() operation in SVA.
Here is my code:
…
…
module asrt_exmpl();
bit a,b, clk;
initial clk=1;
always
#5 clk = ~ clk;
initial begin
a=0; b=1;
#10 a=0;
#20 a=1;b=1;
#10 a=1;b=0;
#10 b=1;a=1;
end
initial begin
$dumpfile(“dump.vcd”);
$dumpvars;
#100 $finish();
end
property past_p;
@(posedge clk) a|-> ($past(b,2) == 1);
endproperty
past_p_check: assert property (past_p);
endmodule
…
…
Simulation Result:
…
“testbench.sv”, 34: asrt_exmpl.past_p_check: started at 70ns failed at 70ns
Offending ‘($past(b, 2) == 1)’
$finish called from file “testbench.sv”, line 25.
…
As per the definition of $past(variable/signal, no.of cycles), the simulator is giving correct result only. I Mean the above result is correct, because @70ns assertion is not valid so for this reason it is throwing an assertion failure error .
but my query is @60 ns the value of ‘a’ is high, but ‘b’ is not high for two clock cycles before @60ns(means @40 it is high, @50 it is low). It is high only for one cycle.
@60ns it is not meeting this condition “a|-> ($past(b,2) == 1)”, so simulator should throw an assertion failure error right? but it is not giving such kind of error.
Could anyone of you kindly clarify my question.
Thanks & Regards,
Prathyusha