An and of two rules, one of them an or. Give the verdict and decision edge of each attempt, the way the standard reads them.
Hardware context: A request that needs a grant and then either a done or a retry. Read the verdict and decision edge of an and of rules with an or inside it.
Every request must get a grant at the next edge. It must also get either done two edges after the request or retry three edges after it.
The trace gives the sampled values at ten rising edges. Every edge starts an attempt; the first eight are asked. For each, choose its verdict and the edge 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 = 1, edge 6 = 0, edge 7 = 1, edge 8 = 0, edge 9 = 0, edge 10 = 0gnt: edge 1 = 0, edge 2 = 1, edge 3 = 0, edge 4 = 1, edge 5 = 0, edge 6 = 0, edge 7 = 0, edge 8 = 1, edge 9 = 0, edge 10 = 0done: edge 1 = 0, edge 2 = 0, edge 3 = 1, edge 4 = 0, edge 5 = 0, edge 6 = 0, edge 7 = 1, edge 8 = 0, edge 9 = 0, edge 10 = 0retry: 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 = 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 gets property and/or failures wrong: it reports 1 failure here, where the standard has 2. The key is the standard behaviour, checked against an independent evaluator.
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 |=> gnt) and ((req |-> ##2 done) or (req |-> ##3 retry)));
| Side | Holds when |
|---|---|
| req |=> gnt | no request, or gnt one edge after it |
| req |-> ##2 done | no request, or done two edges after it |
| req |-> ##3 retry | no request, or retry three edges after it |
The clock rises at 5, 15, 25, ... 95. The run ends at 100.
Hints
Hint 1
An and fails as soon as one side fails. It passes when both sides have passed.
Hint 2
An or passes as soon as one side passes, and fails only when both have failed.
Hint 3
All three sides start from req, so an attempt without a request is vacuous as a whole.
What is checked: The verdict and decision edge of eight attempts, against the standard key derived in docs/sva-standard-traces/A3.md (sva-074-075).
More problems on this topic