Handshake and credit puzzles
These puzzles use the protocols of Chapter 14.
assert property (@(posedge clk) valid && !ready |=> valid);What does a formal tool report for this assertion on this trace?
Show answer
Answer A: Passes
valid must stay high only until a transfer. Ticks 1 and 2 are stalls and are followed by valid. At tick 3 both are high — a transfer — so the producer may drop valid at tick 4. It raises it again at tick 5 for new data. Everything is legal.
assert property (@(posedge clk) send |-> credits != 0);What does a formal tool report for this assertion on this trace?
Show answer
Answer C: Fails at tick 4
Sends at ticks 1 and 2 use the two credits (2 → 1 → 0). At tick 4 the sender sends with zero credits: an overdraft. The 3-bit counter then wraps to 7 at tick 5 — so a ceiling check (credits <= MAX) would also catch this one tick later, but the overdraft check pinpoints the exact cycle.
assert property (@(posedge clk) $fell(ack) |-> !req); // four-phaseWhat does a formal tool report for this assertion on this trace?
Show answer
Answer C: Fails at tick 6
ack falls at tick 6 while req is high, so this assertion fails at tick 6. But look at who caused it: the requester raised req again at tick 5 while ack was still high — it broke the four-phase rule "no new request until ack drops". The requester-side assertion !req && ack |=> !req would fail earlier, at tick 5. The failing assertion is not always the one that names the culprit.
assert property (@(posedge clk) $changed(ack) |-> $past(req != ack)); // two-phaseWhat does a formal tool report for this assertion on this trace?
Show answer
Answer C: Fails at tick 6
A request is pending while req != ack. ack toggles at tick 4, answering the request made at tick 2 — legal. It toggles again at tick 6, but at tick 5 req == ack: nothing was pending. An unsolicited acknowledge at tick 6.