In the below assertion what is the reason of comparing the $past with 0? If i dont do that assertion fails. i can workaround it by specifying the number of clocks to do the match. just want to understand.
reg [3:0] cnt=0;
always @ (posedge clk) begin
cnt <= cnt+1;
((cnt==3) |=> $past (cnt==2)==0);
a20: assert property (p2)
$display ("Assertion passed at %d\n",$time);
$display("Assertion Failed at %d\n",$time);
It means, the expression "cnt==2" must be false previous clock. In other words, in previous clock, the cnt value is not 2.