A rule with a mode and a reset: say which attempts were real, vacuous or switched off, and where each ended.
Hardware context: A mode-gated request, grant and completion handshake with a reset. Tell real checks from vacuous and disabled attempts before trusting a pass count.
In mode 1, a request granted at the next edge must see done one edge after the grant. Reset switches the rule off.
The trace gives the sampled values at ten rising edges. Eight attempts are asked. For each, choose its verdict and the edge where it is decided, for vacuous and disabled attempts too.
The Assertion and the Trace
Read the sampled values as text
rst: edge 1 = 0, edge 2 = 0, edge 3 = 0, edge 4 = 0, edge 5 = 0, edge 6 = 0, edge 7 = 1, edge 8 = 0, edge 9 = 0, edge 10 = 0mode: edge 1 = 1, edge 2 = 1, edge 3 = 0, edge 4 = 0, edge 5 = 1, edge 6 = 1, edge 7 = 1, edge 8 = 1, edge 9 = 1, edge 10 = 1req: edge 1 = 1, edge 2 = 1, edge 3 = 1, edge 4 = 0, edge 5 = 1, edge 6 = 1, edge 7 = 1, edge 8 = 1, edge 9 = 1, edge 10 = 0gnt: edge 1 = 0, edge 2 = 1, edge 3 = 0, edge 4 = 1, edge 5 = 0, edge 6 = 1, edge 7 = 1, edge 8 = 0, edge 9 = 1, edge 10 = 0done: edge 1 = 0, edge 2 = 0, edge 3 = 1, edge 4 = 0, edge 5 = 0, edge 6 = 0, edge 7 = 0, edge 8 = 0, edge 9 = 0, edge 10 = 0
Standard behaviour: no free simulator runs this construct correctly. The key was derived by hand from IEEE 1800-2017 and checked independently.
How to Answer
For each attempt, choose its verdict and the edge where that verdict is decided. A vacuous attempt is decided at the edge where its antecedent can no longer match: give that edge too. A pending one is still running at the end of the run.
- Answer every attempt: its verdict, and the edge where that verdict is decided.
- Read the values the assertion samples at each edge (the dots), not the values after the edge.
- Run grades the first attempt and says whether it is right. Submit grades every attempt and says only whether all are right.
Full specification
a2: assert property (@(posedge clk) disable iff (rst) if (mode) req ##1 gnt |=> done);
The clock rises at 5, 15, 25, ... 95, and the run ends at 100. Stimulus changes at the falling edges, at 10, 20, 30, and so on. So a reset sampled high at one edge rose between that edge and the one before.
Hints
Hint 1
An if without else checks nothing when its condition is false at the start edge.
Hint 2
The antecedent needs req at one edge and gnt at the next. Where is a request without a grant known to be vacuous?
Hint 3
disable iff reads the current value of rst at every time step of an attempt, not only at clock edges.
What is checked: The verdict and decision edge of eight attempts, vacuous and disabled ones included. The key is sva-033-b in docs/sva-standard-traces/A1.md, checked by its oracle.
More problems on this topic