FVO — Formal Verification Online
Lesson 15.4 · Waveform Problems: Pass or Fail?

Handshake and credit puzzles

These puzzles use the protocols of Chapter 14.

Puzzle 13
property
assert property (@(posedge clk) valid && !ready |=> valid);
012345clkvalidready

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.

Puzzle 14
property
assert property (@(posedge clk) send |-> credits != 0);
012345clkcredits2107send

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.

Puzzle 15
property
assert property (@(posedge clk) $fell(ack) |-> !req);   // four-phase
0123456789clkreqack

What 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.

Puzzle 16
property
assert property (@(posedge clk) $changed(ack) |-> $past(req != ack));   // two-phase
0123456clkreqack

What 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.

Discussion

No comments yet.

Was this page helpful?

Tip: select any text on the page before clicking Report and it will be quoted in your report.