A flush accepts and an error rejects, between clock edges: give each attempt's verdict and where it is decided.
Hardware context: A request that a flush cancels and an error fails, between clock edges. Read what asynchronous aborts do to the attempts in flight.
After a request, done is due three edges later. A flush while the request waits cancels it; an err while it waits fails it. Both are asynchronous aborts.
Two pulses happen between clock edges, and no edge samples either one high. Six attempts are asked: give each one's verdict and the edge, or the gap between edges, where it is decided.
The Assertion and the Trace
Read the sampled values as text
req: edge 1 = 1, edge 2 = 0, edge 3 = 1, edge 4 = 0, edge 5 = 0, edge 6 = 0, edge 7 = 1, edge 8 = 0, edge 9 = 1, edge 10 = 0, edge 11 = 0, edge 12 = 0done: edge 1 = 0, edge 2 = 0, edge 3 = 0, edge 4 = 0, edge 5 = 0, edge 6 = 1, edge 7 = 0, edge 8 = 0, edge 9 = 0, edge 10 = 1, edge 11 = 0, edge 12 = 1flush (sampled): edge 1 = 0, edge 2 = 0, edge 3 = 0, edge 4 = 0, edge 5 = 0, edge 6 = 0, edge 7 = 0, edge 8 = 0, edge 9 = 0, edge 10 = 0, edge 11 = 0, edge 12 = 0err (sampled): edge 1 = 0, edge 2 = 0, edge 3 = 0, edge 4 = 0, edge 5 = 0, edge 6 = 0, edge 7 = 0, edge 8 = 0, edge 9 = 0, edge 10 = 0, edge 11 = 0, edge 12 = 0
Standard behaviour: no free simulator runs this construct correctly. The key was derived by hand from IEEE 1800-2017 and checked independently.
Simulator note: Verilator 5.052 checks accept_on and reject_on only at clock edges, so it sees neither pulse (lesson A3.5). The key is the standard behaviour.
How to Answer
For each attempt, choose its verdict and the edge where that verdict is decided. A vacuous attempt is graded on its verdict only. 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
a1: assert property (@(posedge clk) req |-> accept_on(flush) reject_on(err) ##3 done);
| Pulse | High from | Low again at | Between edges |
|---|---|---|---|
| flush | t=17 | t=22 | 2 and 3 |
| err | t=77 | t=82 | 8 and 9 |
The clock rises at 5, 15, 25, ... 115. At every edge both flush and err are sampled low. The run ends at 120.
Hints
Hint 1
accept_on and reject_on are checked at every time step, not only at clock edges.
Hint 2
Which attempts are being evaluated while each pulse is high?
Hint 3
An accepted attempt is a vacuous success. A rejected one is a failure, decided when the pulse is seen.
What is checked: The verdict and decision point of six attempts. The standard key is derived by hand (docs/sva-standard-traces/A3.md, sva-104-b) and checked against the sva-engine evaluator.
More problems on this topic