01 · One sampled contract
Ready/valid is simple only when every edge is counted correctly.
A source offers one beat with VALID, a destination accepts it with READY, and state changes only when both are sampled high on the same rising edge.
Handshake trace
One offer can wait for several cycles but transfers exactly once.
- 01OfferVALID=1
The source presents beat A without waiting for the destination.
- 02StallREADY=0
No transfer occurs. VALID and every field of beat A remain stable.
- 03AcceptVALID && READY
Beat A transfers once at this rising edge; both endpoints may advance.
- 04ContinueNext beat or idle
After acceptance, the source may present beat B immediately or deassert VALID.
The source presents beat A without waiting for the destination.
- Acceptance
- VALID ∧ READY
- Both signals are sampled high on one edge.
- Source obligation
- Persist
- VALID and payload remain stable while stalled.
- Peak rate
- 1 beat / cycle
- Continuous VALID and READY sustain full throughput.
- Progress
- Separate policy
- The base handshake does not guarantee READY eventually arrives.
READY may be high before VALID, and either endpoint may sustain its signal. The only architectural event is the sampled conjunction; waveform appearance between edges does not create an extra transfer.
Observe
Sample VALID, READY and the complete payload at rising edges; distinguish offered cycles, stalled cycles and accepted beats.
Decide
Assign ownership: the source owns VALID and payload persistence, while the destination owns READY and backpressure.
Failure
Data is dropped, duplicated or changed under stall because logic advanced on VALID alone or treated a cycle as a transaction.
Prove
Assert stall stability, count only accepted beats, compare monitor transactions and cover sustained backpressure plus full-throughput traffic.
Separate an offer, a stall and an accepted beat
Most protocol bugs come from collapsing three different states into one. VALID says a source has a meaningful beat. READY says a destination has capacity. Their sampled conjunction commits the beat.
- Source state, counters, addresses and payload generators advance only on VALID && READY.
- Destination occupancy advances only when an offered beat is accepted.
- READY-before-VALID is legal and reduces latency; it is not an unsolicited transaction.
- Back-to-back transfers require VALID && READY on each edge, even when neither signal toggles.
| VALID | READY | Meaning | Next-cycle obligation |
|---|---|---|---|
| 0 | 0 | Idle or both sides unavailable | Neither endpoint commits a beat. |
| 0 | 1 | Destination is ready early | Source may offer later; no transfer has occurred. |
| 1 | 0 | Offered beat is stalled | Source holds VALID and payload stable. |
| 1 | 1 | Beat is accepted | Both sides may advance after this edge. |
Prove persistence, not merely coincidence
A useful assertion starts when an offered beat is not accepted and checks the next sampled state. Include every field that identifies or qualifies the beat, not only DATA.
- Do not require payload stability after an accepted edge; a new beat may legally appear immediately.
- A driver calls item_done only after acceptance, not when it first asserts VALID.
- A passive monitor publishes one transaction per accepted edge and never from VALID alone.
property p_hold_while_stalled;
@(posedge clk) disable iff (!rst_n)
valid && !ready |=> valid &&
$stable({data, keep, id, last});
endproperty
assert property (p_hold_while_stalled);
always_ff @(posedge clk or negedge rst_n) begin
if (!rst_n)
accepted_beats <= '0;
else if (valid && ready)
accepted_beats <= accepted_beats + 1'b1;
endTreat latency and forward progress as separate questions
Handshake safety can be proven locally. Eventual acceptance needs an environmental assumption, an architectural bound or a watchdog policy; otherwise READY may legally remain low forever.
- Measure latency from first offer to accepted edge, and state whether the first offered cycle counts as zero or one.
- Cover zero-wait acceptance, long stalls, READY toggling before VALID and continuous throughput.
- Use a skid buffer when a registered READY path needs one-beat elasticity; verify occupancy, bypass, stall stability and no loss or duplication.
Explain it out loud
Interview reasoning checkpoints
Yes. A destination may assert READY whenever it has capacity. No transfer occurs until VALID and READY are sampled high together.
- READY describes destination capacity, not a request.
- Early READY permits a zero-wait transfer when VALID arrives.
- The prohibited dependency is the source waiting for READY before asserting VALID, because two waiting endpoints can deadlock.
This tests whether the candidate understands independent endpoint ownership rather than memorizing one preferred waveform.
Calling READY-before-VALID a protocol violation or counting it as an empty transaction.
No. Once VALID advertises a beat, the source must preserve VALID and its payload until an edge accepts that beat.
- The destination is allowed to sample on any later edge where it raises READY.
- Changing or withdrawing the offer makes the observed transaction phase-dependent.
- After the accepted edge, the source may deassert VALID or replace the payload with the next beat.
Interviewers use this to expose off-by-one drivers and pipelines that advance their source pointer too early.
Holding DATA but dropping VALID, or holding VALID while changing LAST, ID, KEEP or another qualifier.
Not by itself. The handshake defines safe acceptance; eventual READY needs a system-level fairness assumption, service bound or timeout policy.
- The destination may apply indefinite backpressure unless the surrounding specification forbids it.
- A liveness property must encode the relevant assumption or architectural bound.
- Age monitors and latency coverage reveal starvation without confusing a long legal stall with data corruption.
This distinguishes protocol safety from forward-progress reasoning.
Writing an unconditional bounded-response assertion that fails legal backpressure or silently assuming fairness.
