[Ben_Q] Why the ( ps != S1 )[->1] ?
[UR_A] Assume the sampled states on each posedge of clock are S1 , S1 , S1 , S3 , S3 , S3 , S3 , S6
So using ( ps != S1 ][->1] it state thereby ignoring the same state S1 across multiple clocks.
[Ben_A] ( ps != S1 ][->1] is same as !(ps!=S1)[*0:$] ##1 ps!=S1
YES on “waits for state to transition from S1 to non-S1”.
NO on “ignoring the same state S1 across multiple clocks.”
[Ben_Q] Why not using ( ps == S3 )[->1])?
[UR_A] Using this I would observe assertion failure if the sampled states were S1 , S1 , S2 , S3 , S3 , S3 , S6.
Via ( ps != S1 )[->1] ## 0( ps == S3 ) , ‘ap2’ checks that after S1 the next non-S1 state is S3. So for above state transition there would be a vacuous pass due to transition to S2.
[Ben_A] I generally do not recommend the verification of FSM with assertions between states. FSMs should be verified thru assertions of the requirements. For example,
$rose(tlight==YELLOW) |=> tlight==YELLOW[*1:4] ##1 tlight == RED;
[Ben_Q] I don’t like the not( ( ps != S3 )[->1] ## 0 (ps == S6) );
[UR_A] Go-to repetition would wait for the non-S3 state after S3. If the non-S3 state is S6 the assertion fails as per intention
[Ben_A] As a matter of preference, I prefer to write assertions that define what SHOULD be true instead of what should NOT be true. I sometimes use the “not” operator, but not too often.
[UR_Q] A few questions of mine ::In general, I do not like these of multiple implication operators.
An alternative I tried edalink2 .
(a) Would like to hear your thoughts on it
In general, I do not like these of multiple implication operators.
[Ben_A] With nultiple implication operators you have multiple cases of vacuity; it makes the assertion more complex IMHO.
I prefer multiple simple assertions over complex ones.
(b) This particular question was the 1st case that I thought could use multiple non-overlapping implication.
If the sample states over posedge of clock is S1 , S1 , S2 there would be a vacuous pass due to 2nd |=>
[Ben_A] You are referring to:
( ps == S1 ) |=> ( ps != S1 )[->1] ##0( ps == S3 ) |=> not( ( ps != S3 )[->1] ##0 (ps == S6) );
if (ps==S1) is false, the property is vacuous.
It would also be vacuous if under the dame condition you wrote:
( ps == S1 ) ##1 ( ps != S1 )[->1] ##0( ps == S3 ) |=> …
Thus, the first “|=>” does nothing for you, just makes it harder to read.
The antecedent is a precondition to test the consequent. Mutiple ones makes it more complex IMHO
Ben Cohen
Ben@systemverilog.us
Link to the list of papers and books that I wrote, many are now donated.