AMBA APB · Module 6
PREADY Interaction in Reads
How PREADY gates PRDATA capture on a read — it completes the transfer and signals that read data is valid now, so the manager captures PRDATA on the same edge PREADY is high; the multi-cycle read mechanics.
On a write, PREADY only governs when the data you already drove gets taken. On a read it does something extra and read-specific: it also tells the manager that PRDATA is now valid to sample. The same rising edge that completes the transfer is the edge that licenses the capture — they are not two events, they are one. The single idea to carry: on a read, PREADY does double duty — it completes the access and declares PRDATA valid — so the manager captures PRDATA on the same edge PREADY is high, and not one cycle before. Everything in this chapter is that coupling, drawn out into waveform, RTL, and the multi-cycle mechanics that make it matter.
1. What problem is being solved?
The problem is deciding the exact cycle on which the manager is allowed to capture PRDATA, given that the value travels back from the subordinate and is not real until the subordinate says so.
A read returns data the manager did not produce — so the manager faces a question a write never poses: when is the value on PRDATA the real one? It cannot sample on a fixed cycle, because slow sources push the valid value later. It needs a per-transfer signal that means precisely "the value on PRDATA is valid this cycle — take it now." APB does not add a second signal for that. It reuses PREADY:
PREADYhigh on the access cycle means the read is complete andPRDATAis valid — the manager captures on this edge.PREADYlow means the read is held —PRDATAis still in transit and must not be sampled.
So the capture decision is solved by folding "data valid" into the existing completion handshake. The manager does not need to know why the value arrived late; it only watches PREADY and captures on the one cycle it is high.
2. Why the previous model is not enough
Module 3's PREADY handshake taught PREADY as backpressure — the subordinate's one lever over timing: high completes, low stretches the access phase. That is the general contract, and it is correct. But it is direction-agnostic — it describes completion the same way for a write and a read. This chapter drills the part the general contract leaves implicit: on a read specifically, PREADY carries a second meaning that has no analogue on a write.
PREADYgatesPRDATAcapture, not just transfer completion. On a write, completion means "the subordinate captured what I drove." On a read, completion also means "the value I am about to read offPRDATAis valid now." Module 3 told youPREADYends the access; this chapter tells you it simultaneously unlocks the read-data sample.- The multi-cycle mechanics are read-specific. While
PREADYis low, a held write just keeps its already-drivenPWDATAwaiting. A held read is different:PRDATAis not yet valid — it is in transit through the subordinate's read path — so the wait cycles are cycles on which sampling would latch garbage. The hold protects the capture, not just the timing. - The completion condition gains a data term. Module 3's completion is
PSEL & PENABLE & PREADY. The read-capture enable adds& ~PWRITE: capture only when this completing transfer is a read. That extra term is the read-specific shape of the same handshake.
So this is not a re-run of Module 3. It is the same PREADY, viewed down the read direction, where it quietly becomes the data-valid strobe for PRDATA.
3. Mental model
The model: PREADY on a read is the cashier sliding your change across the counter and saying "here it is" in the same motion. The act of finishing the transaction is the act of handing you the value — you reach for the change exactly when it lands, never while the drawer is still open.
On a write, the cashier just takes your note and nods "done"; you handed over the value already. On a read you are owed something back, and PREADY high is the instant it is placed in your hand. Reach earlier — while PREADY is low — and you are grabbing at an empty counter; the change (PRDATA) is still being counted out inside the subordinate's read path.
Three refinements make the coupling precise:
- One edge, two facts. The cycle
PREADYis high is simultaneously "transfer complete" and "PRDATAvalid." The manager does not wait an extra cycle to read the data — it samples on the very edge that completes the read. - Low means "not counted yet." While
PREADYis low the read is held andPRDATAis in-transit don't-care. The hold is what gives the subordinate's read path (or its slow source) time to put the real value on the bus. - The manager only watches, then grabs once. The manager keeps
PADDRandPWRITElow stable, samplesPREADYeach access cycle, and registersPRDATAon the single cyclePREADYis high. It captures once, on the handoff.
4. Real SoC / hardware context
In silicon, the read-capture coupling is a single registered edge in the manager: a read-data flop whose enable is the read-completion condition. The manager does not gate on PREADY alone — it gates on the full term PSEL & PENABLE & PREADY & ~PWRITE, so the flop captures PRDATA only on the cycle a read actually completes. While PREADY is low, that enable is low, the flop holds its previous value, and the in-transit PRDATA is never latched.
// Manager-side read capture, gated on the read-completion condition.
// read_commit is high on exactly one cycle: the read's completion edge.
wire read_commit = psel & penable & pready & ~pwrite;
// While PREADY is low the access is HELD and PRDATA is not yet valid, so the
// capture must wait for PREADY high. The flop's enable is read_commit, so it
// registers PRDATA on — and only on — the cycle PREADY (and the rest) is high.
always_ff @(posedge pclk or negedge presetn) begin
if (!presetn) read_data <= '0;
else if (read_commit) read_data <= prdata; // capture valid PRDATA, once
// else: PREADY low (or not a read) -> hold; PRDATA in transit, do not sample
endTwo facts make this robust. First, because the enable carries ~pwrite, the same capture logic is inert on a write — PWDATA flows the other way and no spurious PRDATA latch occurs even when a write completes on identical PSEL/PENABLE/PREADY. Second, the multi-cycle mechanics are handled for free: if the read takes wait states, read_commit is simply low for those cycles and the flop holds — the manager needs no wait-counter of its own, because PREADY already encodes "valid now." The detailed cycle-by-cycle stretching is read wait states; the precise window in which PRDATA is required valid is PRDATA timing.
5. Engineering tradeoff table
Reusing PREADY as the read-data-valid strobe is a deliberate economy. Each property trades a capability APB does not need for the simplicity it does.
| Read-capture property | What it gives up | What it buys | Why it is correct for APB |
|---|---|---|---|
PREADY doubles as data-valid | A dedicated read-valid line | One signal, one capture edge | Completion and data-valid coincide by construction |
Capture enable & ~PWRITE | A shared write/read latch | A read-only capture, inert on writes | PRDATA is meaningless on a write — never latch it |
PRDATA sampled on the completion edge | A separately-timed data sample | No manager-side capture timing logic | The valid cycle is exactly the completion cycle |
| Wait cycles hold the capture | A speculative early sample | No garbage latched from in-transit PRDATA | While PREADY is low the value is not yet real |
| No manager-side wait counter | Manager knowledge of source latency | A trivial enabled flop | PREADY already encodes "valid now" |
The throughline: a read spends a dedicated data-valid signal to buy a manager that captures PRDATA with a single enabled flop, correct at any source speed, because PREADY high already means both "done" and "valid."
6. Common RTL / waveform mistakes
7. Interview framing
A sharp interviewer separates "how does PREADY work" (Module 3 material) from "what is special about PREADY on a read." The second question is this chapter, and the strong answer leads with the double duty: on a read, PREADY high both completes the transfer and declares PRDATA valid — so the manager captures PRDATA on the same edge PREADY is high.
Then deliver the mechanics: while PREADY is low the read is held and PRDATA is in-transit don't-care, so the capture is gated until PREADY rises — a wait state on a read is a wait on the data being valid, not just on completion. Close with the RTL shape: the manager's read-data flop is enabled by PSEL & PENABLE & PREADY & ~PWRITE, and volunteering the ~PWRITE term — "so a completing write never spuriously latches PRDATA" — signals you have actually built the capture path, not just memorised the waveform. If you can also note that APB reuses PREADY rather than adding a data-valid line, because completion and data-valid coincide by construction, you have shown you understand why the protocol is shaped this way.
8. Q&A
9. Practice
- State the double duty. In one sentence, say the two things
PREADYhigh tells the manager on a read, and on which edge the manager capturesPRDATA. - Hold the capture. On a two-wait read waveform, mark every cycle the manager must not sample
PRDATA, state whatPRDATAis on each, and mark the one cycle it captures. - Write the enable. Write the read-capture enable expression and explain why each term — including
~PWRITE— is necessary. - Find the bug. A manager captures
PRDATAwheneverPSEL & PENABLE & PREADYis high, with no~PWRITE. Describe the failure on a back-to-back write-then-read and what wrong value the read-data register can hold. - Defend the reuse. In two sentences, explain why APB reuses
PREADYas the read-data-valid strobe instead of adding a separate valid line.
10. Key takeaways
- On a read,
PREADYdoes double duty — it completes the transfer and declaresPRDATAvalid in the same instant. The two events coincide by construction. - The manager captures
PRDATAon the same edgePREADYis high — never a cycle before (in transit) and never a cycle after (bus moved on). - While
PREADYis low the read is held andPRDATAis in-transit don't-care — the wait cycles protect the capture, and sampling then latches garbage. - The read-capture enable is
PSEL & PENABLE & PREADY & ~PWRITE— the~PWRITEterm keeps a completing write from spuriously latchingPRDATA. - The manager needs no wait counter —
PREADYalready encodes "valid now," so one enabled flop captures correctly at any source speed. - APB reuses
PREADYrather than adding a data-valid line — completion and data-valid always coincide on a read, so one signal carries both meanings.