Wishbone · Module 21
Integration Trade-offs
APB's own signal table calls the master an APB bridge. Building that bridge from Wishbone costs a clock nothing can remove, and one wrong decision about when a phase may end silently disabled every write and every error.
Chapter 21.3 established from both documents that APB describes itself as a destination and Wishbone as an interconnect. In a real SoC the answer is usually both, and then the design is the seam.
APB's own signal table names the thing upstream of it. This chapter builds that thing and measures what it costs.
1. The Seam APB Expects
IHI 0024C §2.1 lists PADDR, PPROT and PSELx with their source given as "APB bridge", and says of the last:
"The APB bridge unit generates this signal to each peripheral bus slave. It indicates that the slave device is selected and that a data transfer is required."
And §1.1 names what the bridge is expected to come from: AHB, AHB-Lite, AXI, AXI4-Lite. Wishbone is not on that list, so the bridge in this chapter is one nobody has written down — which by now is the familiar situation.
// side "APB bridge" rather than "master", which is the specification
// saying out loud that something is expected to sit here.
//
// ── DIRECTION IS A LOCAL POLICY AND IS STATED ───────────────────────────
// This bridge carries Wishbone requests to an APB slave. The other
// direction is not built and is NOT claimed.
//
// ── THE FOUR THINGS IT HAS TO GET RIGHT ─────────────────────────────────
//
// 1. EVERY TRANSFER GETS A SETUP PHASE.
// "The bus only remains in the SETUP state for one clock cycle and
// always moves to the ACCESS state on the next rising edge of the
// clock." (ARM IHI 0024C, section 4.1)
// A bridge that asserts PSEL and PENABLE together has not shortened
// anything - it has produced a transfer the slave's state machine was
// never defined for. NOTHING IN WISHBONE IS VIOLATED by doing this.
//
// 2. THE ACCESS PHASE IS HELD UNTIL PREADY.
// "Exit from the ACCESS state is controlled by the PREADY signal from
// the slave." (ARM IHI 0024C, section 4.1)
// Dropping PENABLE early abandons a transfer the slave is still
// performing. On a write that means the data may never be committed.
//
// 3. THE BYTE LANES MUST SURVIVE.
// Wishbone RULE 3.60 qualifies [SEL_O()] with [STB_O].
// APB "PSTRB A write strobe signal to enable sparse data
// transfer on the write data bus." (IHI 0024C, s1.2.3)
// One bit to one bit. The easiest thing here to get right and the
// easiest to leave out, because all-ones works for every full word.2. The Bridge Works — Measured, Not Asserted
SIM I runs the same sixteen records through the bridge and, alongside, straight onto a Wishbone RAM with the same latency. The bridge is the only difference between the two.
order signature bridged 0x98b97cbd direct 0x98b97cbd
errors reported bridged 0 direct 0
EVERY VALUE AND EVERY ORDER IDENTICAL. A protocol
translation sat in the middle of all 16 accesses and
nothing the Wishbone master could observe changed.
bridge bookkeeping
Wishbone requests forwarded 16
answers returned 16
SETUP clocks driven 16
ACCESS clocks driven 32
ACCESS phases abandoned 0
APB slave writes / reads 7 / 9
-> exactly one SETUP per forwarded request.Every value identical, every order identical, sixteen forwarded and sixteen answered, and exactly one SETUP phase per request.
3. What The Seam Costs, Decomposed
bridged 5.00 direct 2.00
the seam costs 3.00 clocks per access. DO NOT
ATTRIBUTE ALL OF THAT TO APB - decompose it:
SETUP phases driven 16 clocks = 1.00/xfer
everything else 32 clocks = 2.00/xfer
ONLY THE FIRST ROW IS APB'S. It is the floor from
section 4.1 and no bridge can remove it: the slave is
not consulted during SETUP, so no slave can be fast
enough to skip it.
THE SECOND ROW IS THIS BRIDGE'S OWN. It registers the
Wishbone request before driving PSEL, and its wait
counter runs inside ACCESS where the Wishbone RAM's
runs from the request. A bridge with combinational
outputs would be faster and harder to time-close.
Publishing the split is the difference between
measuring a protocol and measuring one afternoon's
RTL.
What survives the decomposition: a bridge cannot be
faster than the slower side of the seam. Module 20
found depth that could not be used; here it is a
floor that cannot be lowered.
=== errors: 0 ===What survives the decomposition: a bridge cannot be faster than the slower side of the seam. Chapter 20.5 found depth that could not be used; here it is a floor that cannot be lowered.
4. Five Ways To Get The Seam Wrong
A checker that has only ever passed has not been shown to check anything. Six checkers, six complete systems, each differing from the correct one by exactly one parameter.
=== NEGATIVE-CONTROL GATE ===
one workload, six systems. Each broken system differs
from the correct one by exactly one parameter.
checker corr NOSU EDRP STRB EIGN SACT
EVERY TRANSFER HAS A SETUP PASS FAIL PASS PASS PASS PASS
ACCESS HELD UNTIL PREADY PASS PASS FAIL PASS PASS PASS
BYTE LANES SURVIVE PASS PASS PASS FAIL PASS PASS
ERROR SURVIVES TRANSLATION PASS PASS FAIL PASS FAIL PASS
SLAVE ACTS ONLY IN ACCESS PASS PASS FAIL PASS PASS FAIL
ONE TRANSFER PER REQUEST PASS PASS PASS PASS PASS PASS CHECKERS REQUIRED: >= 5
CHECKERS DECLARED: 6
CHECKERS PASSING THE CORRECT SYSTEM: 6/6
EACH CHECKER FAILS ITS OWN TARGET:
5/5 targeted defects detected5. The Off-Diagonal Is The Alarming Part
READ THE OFF-DIAGONAL. EARLY_DROP FAILS THREE CHECKERS
AND THE TWO IT WAS NOT AIMED AT ARE THE ALARMING ONES.
Its slave write count is 0 against the correct
system's 5, and its error count is 0 against 3.
A bridge that drops PENABLE after one ACCESS clock,
without waiting for PREADY, ends every transfer before
the slave has committed anything. NOT ONE WRITE LANDED.
NOT ONE ERROR WAS RAISED. And the Wishbone master was
told all 16 accesses succeeded - fwd 16, answered 16.
ONE WRONG DECISION ABOUT WHEN A PHASE MAY END SILENTLY
DISABLED THE ENTIRE WRITE PATH AND THE ENTIRE ERROR
PATH, and the bus it reported to saw nothing wrong.
Chapter 20.5 found the same shape at an AXI seam with
EARLY_ACK; this is worse, because there the data atEARLY_DROP fails three checkers and the two it was not aimed at are the ones that matter.
A bridge that drops PENABLE after one ACCESS clock without waiting for PREADY ends every transfer before the slave has committed anything. Zero writes landed. Zero errors were raised. And the Wishbone master was told all sixteen accesses succeeded.
One wrong decision about when a phase may end silently disabled the entire write path and the entire error path, and the bus it reported to saw nothing wrong. Chapter 20.5 found the same shape at an AXI seam with EARLY_ACK — this is worse, because there the data at least arrived eventually.
6. Which Defects A Conformance Checker Would Catch
WHICH OF THESE WOULD A CONFORMANCE CHECKER CATCH?
NO_SETUP breaks a rule. Section 4.1 says the bus "only
remains in the SETUP state for one clock cycle and
always moves to the ACCESS state on the next rising
edge of the clock" - a transfer with PENABLE high on
the clock PSEL rose never occupied SETUP at all.
EARLY_DROP breaks one too: "Exit from the ACCESS state
is controlled by the PREADY signal from the slave", and
s3.1.2 lists PENABLE among the signals that "remain
unchanged while PREADY remains LOW".
The other three do not. A bridge that drops byte
strobes, one that discards PSLVERR, and a slave that
acts on PSEL rather than PENABLE all produce perfectly
legal waveforms. Nothing in IHI 0024C says WHEN aThe other three defects break nothing. A bridge that drops byte strobes, one that discards PSLVERR, and a slave that acts on PSEL rather than PENABLE all produce perfectly legal waveforms. Nothing in IHI 0024C says when a register must change, only when the bus may.
7. The Same Invariants As Assertions
// Section 4.1 — "The bus only remains in the SETUP state for one clock
// cycle and always moves to the ACCESS state on the next rising edge of
// the clock." SETUP is PSEL without PENABLE, so a SETUP clock is always
// followed by an ACCESS clock. This is the two-cycle floor, asserted.
property p_setup_is_one_clock;
@(posedge clk_i)
(psel_i && !penable_i) |=> (psel_i && penable_i);
endproperty
a_setup_is_one_clock: assert property (p_setup_is_one_clock);
// The corollary: PENABLE may not rise in the same clock PSEL rises.
// A transfer that does has not occupied SETUP at all.
property p_no_enable_without_setup;
@(posedge clk_i)
$rose(psel_i) |-> !penable_i;
endproperty
a_no_enable_without_setup: assert property (p_no_enable_without_setup);8. The Evidence Behind Every Integration Claim
Ecosystem claims are where fabrication risk lives, so every one in this module is traceable to a primary source read this session.
| claim | source | fetched this session |
|---|---|---|
| APB interfaces with AHB, AHB-Lite, AXI, AXI4-Lite | IHI 0024C §1.1, quoted | yes — PDF from Arm's documentation service |
| APB's master side is named "APB bridge" in the signal table | IHI 0024C §2.1, quoted | yes |
| APB is for "low-bandwidth peripherals" and "programmable control registers" | IHI 0024C §1.1, quoted | yes |
PSLVERR arrived in APB3; PSTRB in APB4 | IHI 0024C §1.2.2, §1.2.3, quoted | yes |
| Wishbone's purpose is "to foster design reuse" | B3 §1, quoted | yes — cached source, re-read |
| Wishbone is "a public domain standard" | B3 glossary, quoted | yes |
| Wishbone targets FPGA and ASIC | B3 §1 objectives, quoted | yes |
NOT CLAIMED anywhere in this module: popularity · market share · maturity · "industry standard" · deployment counts · which vendors prefer which · that either bus is lighter in gates, area or power.
And one caveat that belongs beside every APB row above: the document read was ARM IHI 0024C, not the current issue E. Issue C introduced APB3 and APB4, which is everything measured here, but a later issue may word things differently.
9. Choosing
| if | then | evidence |
|---|---|---|
| the peripheral is a register block behind an AMBA bridge | APB, and the extra clock is the price of fitting | §1, 21.3 §1 |
| the slave can answer combinationally and you want that clock | Wishbone — PERMISSION 3.10 exists and APB has no counterpart | 21.2 §3 |
| the bus is the system's interconnect, not its last hop | Wishbone — B3 describes an architecture; APB scopes itself to peripherals | §8 |
| you will write many peripherals and one master | APB's cost lands on the master, not on them | 21.3 §3 — 27 ports against 27 |
| you need conformance checking to catch integration bugs | APB, and this surprised me — its state machine is checkable in a way B3's phase-and-permission is not | §6 |
| you are bridging one onto the other | the seam is the design, and the slower side sets the floor | §3 |
10. What Module 21 Established
| the difference, normatively | IHI 0024C §1.1: "Every transfer takes at least two cycles"; B3 PERMISSION 3.10 permits one |
| the cost, measured | exactly one clock per transfer, at 0, 1 and 4 wait states |
| the shape | ratio narrows 2.00 → 1.50 → 1.20; absolute gap never moves |
| what a peripheral author pays | 27 ports against 27, 54 lines against 53 — one extra && |
| the seam | 3 clocks, of which 1 is APB's and 2 are the bridge's |
| defects seeded | 5, of which 2 break a rule and 3 are legal |
| protocol-checker catchable, Modules 9–21 | 4 |
Continue learning
Related tutorials
- Related topic
Design Trade-offs
A protocol-to-protocol seam neither specification describes, six ways to get it wrong of which five are legal, and the first defect in twelve modules that a conformance checker actually catches.
- Related topic
Need for Standardized Interconnects
An address map answers where a register lives. It says nothing about which wires carry the request, when they are valid, how the target reports completion, or what happens on an error. Three peripherals with three private interfaces produce three adapters, three verification efforts and three ways to be wrong — which is the argument for standardising the interface rather than the map.
- Related topic
SoC Communication
Six chapters built the pieces; this one assembles them into a working fabric and traces three real accesses through it. The result works, and reading the nine unwritten rules a third party would need is what makes the case for a published protocol concrete rather than theoretical.
- Related topic
Data Flow
One Wishbone access, followed through every block in both directions: what the master drives, where the address changes form, which signals are broadcast and which are decoded, and how read data and termination find their way back to exactly one requester.
Standards & specifications
- Governing standard
- Wishbone SoC Interconnection Architecture (OpenCores)(opens OpenCores in a new tab)
Defines the Wishbone signal set, the bus cycles built from it and the interface rules a portable IP core must follow. It deliberately leaves interconnect topology, address map and arbitration policy to the integrator, so those are system decisions rather than requirements of the specification.
This page also covers RTL structure, verification approach and debugging technique. Those are engineering practice built on the standard, not requirements the standard itself imposes.
Where this fits
Part of the Wishbone curriculum.
