Skip to content
VLSI Mentor

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.

A Wishbone master reaching an APB slave through a bridge. The Wishbone master drives a single coupled request phase carrying CYC, STB, WE, address, data and SEL into the bridge's Wishbone slave port. The bridge's APB master port then drives the two-phase sequence: first a SETUP state asserting PSEL with PENABLE low, then an ACCESS state asserting PENABLE, with the slave answering through PREADY and PSLVERR. The bridge is the only component neither specification describes, and it must add at least one clock because the APB side cannot complete in fewer than two.Wishbonemasteranswered in 1clockwb2apb_bridgedescribed byNOBODYSETUPPENABLE lowACCESSPENABLE highAPB slavePREADY / PSLVERRone phasealwaysPREADYACK / ERR12
Azvya Education Pvt. Ltd.VLSI Mentor
Snippet
// 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.

Azvya Education Pvt. Ltd.VLSI Mentor
Snippet
      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

Azvya Education Pvt. Ltd.VLSI Mentor
Snippet
        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.

Azvya Education Pvt. Ltd.VLSI Mentor
Snippet
  === 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
Azvya Education Pvt. Ltd.VLSI Mentor
Snippet
    CHECKERS REQUIRED:                >= 5
    CHECKERS DECLARED:                6
    CHECKERS PASSING THE CORRECT SYSTEM:      6/6
    EACH CHECKER FAILS ITS OWN TARGET:
      5/5 targeted defects detected

5. The Off-Diagonal Is The Alarming Part

Azvya Education Pvt. Ltd.VLSI Mentor
Snippet
    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 at

EARLY_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_ACKthis is worse, because there the data at least arrived eventually.

6. Which Defects A Conformance Checker Would Catch

Azvya Education Pvt. Ltd.VLSI Mentor
Snippet

    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 a

The 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

Azvya Education Pvt. Ltd.VLSI Mentor
Snippet

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

claimsourcefetched this session
APB interfaces with AHB, AHB-Lite, AXI, AXI4-LiteIHI 0024C §1.1, quotedyes — PDF from Arm's documentation service
APB's master side is named "APB bridge" in the signal tableIHI 0024C §2.1, quotedyes
APB is for "low-bandwidth peripherals" and "programmable control registers"IHI 0024C §1.1, quotedyes
PSLVERR arrived in APB3; PSTRB in APB4IHI 0024C §1.2.2, §1.2.3, quotedyes
Wishbone's purpose is "to foster design reuse"B3 §1, quotedyes — cached source, re-read
Wishbone is "a public domain standard"B3 glossary, quotedyes
Wishbone targets FPGA and ASICB3 §1 objectives, quotedyes

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

ifthenevidence
the peripheral is a register block behind an AMBA bridgeAPB, and the extra clock is the price of fitting§1, 21.3 §1
the slave can answer combinationally and you want that clockWishbone — PERMISSION 3.10 exists and APB has no counterpart21.2 §3
the bus is the system's interconnect, not its last hopWishbone — B3 describes an architecture; APB scopes itself to peripherals§8
you will write many peripherals and one masterAPB's cost lands on the master, not on them21.3 §3 — 27 ports against 27
you need conformance checking to catch integration bugsAPB, 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 otherthe seam is the design, and the slower side sets the floor§3

10. What Module 21 Established

the difference, normativelyIHI 0024C §1.1: "Every transfer takes at least two cycles"; B3 PERMISSION 3.10 permits one
the cost, measuredexactly one clock per transfer, at 0, 1 and 4 wait states
the shaperatio narrows 2.00 → 1.50 → 1.20; absolute gap never moves
what a peripheral author pays27 ports against 27, 54 lines against 53 — one extra &&
the seam3 clocks, of which 1 is APB's and 2 are the bridge's
defects seeded5, of which 2 break a rule and 3 are legal
protocol-checker catchable, Modules 9–214

Continue learning

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.