I’m trying to write a SVA for the following scenario :
I want to ignore the value of a signal ‘a’ for the the first 36 cycles and after that if signal ‘a’ goes high, signal ‘b’ should go high in the same cycle.
The signal ‘a’ which could potentially glitch for about 36 clocks and hence want to ignore it.
I couldn’t construct a reliable assertion model but I attempted to do this in the following way :
Immediately there were several problems with this.
The signal ‘a’ could potentially never happen as per the design which is okay. I want to check signal ‘b’ going high only if ‘a’ goes high. In my above assertion, I expect my assertion to fail if ‘a’ never toggles.
Even when the signal ‘a’ toggles, the assertion is always in active state (never finishes)
Can you please explain what is going on with the above assertion and how to effectively write this?
The above assertion works, but it fails to express the true intent. Assertions should be made more readable In the above case:
After the 1st attempt, it requires that at the 37th cycle a==b
After the 2nd attempt, it requires that at the 38th cycle a==b
… and so on
But the requirements are that the value of a signal ‘a’ be ignored for the first 36 cycles (after init), and after that (and forever), if signal ‘a’ goes high, signal ‘b’ should go high in the same cycle.
One can express this using the initialand the always property_expr statements.
initial ap_ab36: assert property(@ (posedge clk) ##36 1'b1 |-> always(a == b); );
// the "alwways property_expr" evaluates to true (vacuous or nonvacuous true) if
// property_expr holds at every current or future clock tick.
// In that case, there is only ONE attempt starting at the very first posedge.