Work it through
Count handshakes, not signal transitions
There is one VALID rising edge but three accepted beats in this trace.
accepted = Σ(VALID && READY) = 3
Your next page is on its way.
Chapter 1 · Transfer contracts
Count acceptance on exact clock edges and reconstruct phase-oriented protocols without inventing transfers or losing pipeline history.

A worked mechanism
Each column below is a distinct rising sampling edge on a ready/valid interface.
V=1 R=1 DATA=A → accept A
The source may replace A after this accepted edge.
V=1 R=1 DATA=B → accept B
VALID never needed to fall between accepted beats.
V=1 R=0 DATA=C → no transfer
Hold C, including all qualifiers, until a later accepted edge.
V=1 R=1 DATA=C → accept C
The monitor publishes C exactly once.
Work it through
There is one VALID rising edge but three accepted beats in this trace.
accepted = Σ(VALID && READY) = 3
A monitor triggered only by posedge VALID misses back-to-back traffic. A monitor publishing on every VALID cycle duplicates stalled traffic.
Compare accepted input and output identities under continuous flow and alternating backpressure. Reset follows its separate cancellation contract.
Question-first preparation
Each question maps directly to one of the sections below, so you can test the contract before reading the explanation.
One representative prompt from each major mechanism. Open any card in the live question bank.
One sampled contract
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
The source presents beat A without waiting for the destination.
No transfer occurs. VALID and every field of beat A remain stable.
Beat A transfers once at this rising edge; both endpoints may advance.
After acceptance, the source may present beat B immediately or deassert VALID.
The source presents beat A without waiting for the destination.
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.
Sample VALID, READY and the complete payload at rising edges; distinguish offered cycles, stalled cycles and accepted beats.
Assign ownership: the source owns VALID and payload persistence, while the destination owns READY and backpressure.
Data is dropped, duplicated or changed under stall because logic advanced on VALID alone or treated a cycle as a transaction.
Assert stall stability, count only accepted beats, compare monitor transactions and cover sustained backpressure plus full-throughput traffic.
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.
| 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. |
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.
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;
endHandshake 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.
Explain it out loud
Yes. A destination may assert READY whenever it has capacity. No transfer occurs until VALID and READY are sampled high together.
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.
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.
This distinguishes protocol safety from forward-progress reasoning.
Writing an unconditional bounded-response assertion that fails legal backpressure or silently assuming fairness.
Deliberately unpipelined
Every transfer uses a SETUP cycle followed by one or more ACCESS cycles, with request information frozen while a peripheral extends the transfer.
APB lifecycle
No peripheral transfer is selected.
Address, direction and write information become valid.
The selected peripheral evaluates the request.
ACCESS repeats and every request field remains stable.
Read data or error is sampled on this ACCESS edge.
No peripheral transfer is selected.
APB is intentionally simple and unpipelined. A peripheral can add any required ACCESS wait cycles, but it cannot remove the SETUP phase or ask the master to change a request mid-transfer.
Track PSEL, PENABLE, PREADY, address, direction, write data, strobes, protection and response at each edge.
Model IDLE, SETUP and ACCESS explicitly; sample read data and errors only on the completing ACCESS edge.
A master skips SETUP, changes controls during a wait, drops PSEL early or treats a wait-state response as complete.
Assert legal phase transitions and wait-state stability, publish only completed transfers and cover no-wait, multi-wait, error and back-to-back accesses.
A monitor should create a pending transaction in SETUP and publish it only when ACCESS completes. Keeping those two events separate makes waits, errors and back-to-back traffic unambiguous.
| Phase | Required signals | What may change next |
|---|---|---|
| IDLE | PSEL low | A selected transfer may enter SETUP. |
| SETUP | PSEL high, PENABLE low, request valid | Next cycle must enter ACCESS for that request. |
| ACCESS wait | PSEL and PENABLE high, PREADY low | Only the peripheral response may progress; request stays stable. |
| ACCESS complete | PSEL, PENABLE and PREADY high | Next cycle is IDLE or a new SETUP. |
The most valuable APB properties target errors that directed software-style accesses rarely expose: skipped setup, unstable controls and an early select drop.
property p_setup_enters_access;
@(posedge PCLK) disable iff (!PRESETn)
PSEL && !PENABLE |=>
PSEL && PENABLE &&
$stable({PSEL, PADDR, PWRITE, PWDATA, PSTRB, PPROT});
endproperty
property p_hold_during_wait;
@(posedge PCLK) disable iff (!PRESETn)
PSEL && PENABLE && !PREADY |=>
PSEL && PENABLE &&
$stable({PSEL, PADDR, PWRITE, PWDATA, PSTRB, PPROT});
endproperty
assert property (p_setup_enters_access);
assert property (p_hold_during_wait);An active agent drives phase-accurate transfers and models configurable waits on the peripheral side. A passive monitor remains the source of truth for scoreboards and coverage.
Explain it out loud
During an ACCESS wait, the master keeps PSEL, PENABLE and the complete request—address, direction and write-side attributes—stable until completion.
This tests sampled protocol ownership and whether the candidate can write a meaningful stability assertion.
Checking only PADDR while allowing PWRITE, PWDATA, PSTRB, PPROT or the selected peripheral to change.
No. After one ACCESS completes, the next transfer uses a fresh SETUP cycle with PENABLE low, even if PSEL remains asserted.
The question reveals implementations that mistake a held select for a continuously pipelined bus.
Toggling address while PENABLE remains high and calling it a new APB transaction.
PSLVERR is consumed with the final ACCESS cycle, when PSEL, PENABLE and PREADY are all high.
This tests whether the candidate qualifies response signals with the real transaction event.
Reporting an error seen during a wait cycle or forgetting that a completed error is still a completed transfer.
Overlapped phases
The address and control phase of transfer N+1 can overlap the data phase of transfer N; HREADY determines when the current data phase and the next address acceptance may advance.
AHB phase pipeline
Capture HADDR and controls when the prior transfer permits advance.
The payload belongs to the preceding accepted address phase.
The next address may overlap data N.
Data N remains active and the address/control pipeline cannot advance.
Sample data and HRESP, then promote the accepted next phase.
Capture HADDR and controls when the prior transfer permits advance.
AHB performance comes from overlapping phases rather than independent AXI-style channels. A checker must retain accepted address/control information until its later data phase completes.
Track HTRANS, HADDR and controls at accepted address phases, then pair HWDATA or HRDATA and HRESP at the corresponding completed data phase.
Use a one-entry phase pipeline or queue, with explicit handling for IDLE, BUSY, NONSEQ and SEQ.
A monitor pairs current-cycle address and data, advances through an HREADY stall or treats BUSY/IDLE as real transfers.
Assert control and write-data stability through waits, compare completed transfers and cover bursts, inserted BUSY cycles, wait states, errors and bridge backpressure.
HTRANS distinguishes real address phases from bus occupancy. NONSEQ starts a transfer or burst, SEQ continues a burst, BUSY preserves burst ownership without transferring data, and IDLE carries no transfer.
| HTRANS | Meaning | Monitor behavior |
|---|---|---|
| IDLE | No transfer required | Do not enqueue a request. |
| BUSY | Manager pauses within a burst | Preserve burst context but do not enqueue data. |
| NONSEQ | First or standalone transfer | Capture address/control when accepted. |
| SEQ | Following transfer in a burst | Capture and validate burst progression. |
HREADY reports completion of the active data phase and qualifies when address/control can advance. Integration logic commonly combines a selected subordinate's HREADYOUT into the bus-level HREADY seen by the manager.
An AHB-to-APB bridge captures the accepted AHB address/control phase, later captures or supplies its data phase, emits APB SETUP and ACCESS, and holds the upstream AHB transfer until the APB result is available.
| Boundary | State retained | Proof target |
|---|---|---|
| AHB address acceptance | Address, size, direction and controls | Exactly one legal upstream request is captured. |
| APB SETUP | Translated peripheral request | Correct decode and field mapping. |
| APB ACCESS | Stable request through waits | No early upstream completion. |
| AHB response | Read data or mapped error | One response corresponds to the captured request. |
Explain it out loud
Because AHB pipelines them. The current data phase normally belongs to the previously accepted address/control phase.
This is the central AHB observation problem and a frequent bridge-checker bug.
Building a transaction from every signal visible in one clock column.
HREADY is the bus-level completion seen by the manager and all phase logic. A selected subordinate drives its own HREADYOUT, which interconnect logic contributes to HREADY.
The distinction tests whether the candidate understands an integrated AHB bus rather than only a subordinate port.
Treating HREADYOUT as an unrelated ready signal or using it without accounting for subordinate selection.
AHB-Lite is the single-manager subset, so it removes multi-manager arbitration while retaining the pipelined address/data transfer model.
This checks whether the candidate can identify the defining architectural simplification without claiming the bus becomes APB-like.
Saying AHB-Lite is unpipelined or has no bursts simply because it has one manager.