I am trying to self educate myself about assertions in System Verilog. I have written a code to understand implication operator. The code can be found at Eda Play Ground
Code Summary
- In my code I have defined states corresponding to each count of a counter.
- I have defined a sequence s2_7 which is a sequence starting at (count == 2) and ending at (count == 7).
sequence s2_7;
(state == 2) ##1 (state == 3) ##1 (state == 4) ##1 (state == 5) ##1 (state == 6) ##1 ((state == 7));
endsequence
- I have defined a property directive with label ‘test_3:’ which asserts the sequence s2_7.
- My code prints below line when the antecedent of the property is true.
35, Start property sequence s2_7 , state = STATE3
- My code prints below line when the sequence s2_7 has started.
45, Starting sequence s2_7 , state = STATE4
Below is the output from my code.
0, state = STATE1
25, state = STATE2
35, Start property sequence s2_7 , state = STATE3
35, state = STATE3
45, Starting sequence s2_7 , state = STATE4
45, state = STATE4
55, state = STATE5
65, state = STATE6
75, state = STATE7
Issue
I have trouble understanding below line of the output.
45, Starting sequence s2_7 , state = STATE4
Here I had never expected the consequent of the property to get evaluated . This is because the value of state after one clock cycle of the antecedent is STATE3. So the sequence s2_7 will never be started.
Plz someone explain this.