Skip to content

AMBA APB · Module 2

APB Bus Topology

APB as a point-to-multipoint bus — one shared address/control/data bus, one PSEL per subordinate, a decoder selecting exactly one, and why a non-one-hot select is a bug.

You already know APB has a manager and subordinates and that the manager drives every transfer. This chapter answers the question that role-naming leaves open: how are the many subordinates physically wired to the one manager, and how is exactly one of them picked? The answer is APB's topology — point-to-multipoint: one manager drives a single shared bus broadcast to every subordinate, with one dedicated PSEL per subordinate, and a decoder that asserts exactly one PSEL at a time. The single idea to carry: the lifecycle's "selected subordinate" is only well-defined when PSEL is one-hot — exactly one high — and a select that is not one-hot is a hardware bug, not a slow transfer.

1. What problem is being solved?

The problem is connecting one manager to many slow subordinates on a single cheap bus, while keeping exactly one of them the unambiguous target of each transfer.

A real APB subsystem hangs a fan-out of peripherals — a UART, a couple of timers, some GPIO — off one bridge. Giving each peripheral its own private point-to-point link back to the manager would multiply wires and logic across the whole fan-out, which is exactly the cost APB exists to avoid. So APB shares: address, control, and write data are driven once and broadcast to every subordinate in parallel. But broadcasting creates a new problem — if all subordinates see the same address and write strobe, which one should actually respond? APB solves this with a per-subordinate select line, PSEL, and a decoder that turns the address into exactly one asserted select. The topology, then, is two ideas working together:

  • One shared bus, broadcast to all. PADDR, PWRITE, and PWDATA are common signals every subordinate observes.
  • One dedicated PSEL per subordinate, exactly one high. The decoder reads the address and selects a single target; only that subordinate acts and drives the return.

2. Why the previous mental model is not enough

Knowing the manager/subordinate roles tells you who drives — but it does not tell you how many subordinates share the wires or how exactly one is chosen, and without those the lifecycle has no defined target.

The role view answers "the manager initiates, the subordinate responds." It is silent on the structural facts a real bus turns on: there is not one subordinate but many, they share one set of broadcast signals, and something must resolve the broadcast down to a single responder. If you skip the topology, the very first step of the transfer lifecycle — "the selected subordinate is presented the access" — becomes undefined, because selected has no meaning until you know how selection works. Two facts only the topology makes precise:

  • The selected subordinate is named by a one-hot PSEL. "The subordinate" in any APB sentence is shorthand for "the one subordinate whose PSEL is currently high." If zero or two are high, there is no single selected subordinate and the lifecycle's contract breaks.
  • The shared return path has exactly one legal driver. Because every subordinate's PRDATA and PREADY feed a shared return back to the manager, exactly one subordinate may drive it at a time — which is the same as saying PSEL must be one-hot. Topology and correctness are the same statement.

3. APB transfer mental model

The model: APB is one address being called out over a public-address system, with each subordinate wearing a numbered badge — and only the subordinate whose number is called steps forward.

The manager broadcasts the same announcement (PADDR, PWRITE, PWDATA) into a room full of subordinates; everyone hears it. What makes the system work is the badge check: a decoder reads the address, matches it to exactly one badge, and lights exactly that subordinate's select line. Only the called subordinate steps forward to act and to answer back; everyone else stays seated. Call out an address that matches no badge and nobody steps forward; accidentally light two badges and two people step forward at once and start talking over each other — which is precisely the failure this chapter is about.

Three refinements make the model precise:

  • Broadcast is shared; selection is dedicated. One set of address/control/data wires is heard by all; the PSEL lines are private, one per subordinate. Sharing keeps the bus cheap; the dedicated selects keep the target unambiguous.
  • Exactly one badge lights — one-hot. The decoder's job is to guarantee that the asserted-PSEL count is always exactly one when a transfer is in progress. That one-hot guarantee is the definition of "the selected subordinate."
  • Only the called subordinate answers. The return path (PRDATA, PREADY) is shared too, so only the selected subordinate may drive it. One badge lit means one driver — clean. Two badges lit means two drivers — contention.
A manager on the left driving a shared address/control/write-data bus broadcast to three subordinates on the right, plus three dedicated PSEL lines (one per subordinate), with the subordinates' PRDATA and PREADY muxed back to the manager.
Figure 1 — APB's point-to-multipoint topology. One manager (the bridge) drives a single shared bus — PADDR, PWRITE, PWDATA — that is broadcast in parallel to every subordinate (UART, Timer, GPIO). Separately, the manager drives one dedicated PSEL line to each subordinate, so exactly one subordinate is requested at a time. On the return path, every subordinate could drive PRDATA and PREADY, but these are muxed back so only the selected subordinate's response reaches the manager. Shared, broadcast signals and per-subordinate dedicated selects are what make APB point-to-multipoint rather than a bundle of point-to-point links.

4. Real SoC / hardware context

In a real chip this topology is built by an address decoder sitting at the bridge, between the shared PADDR and the fan-out of PSEL lines. The decoder examines a field of the address — a per-peripheral "page" — and asserts exactly one psel_* line, the one whose page matches the address map. Everything else about the topology is just wires: the shared bus fans out to every subordinate, and the per-subordinate selects fan out one-to-one.

The decode itself is small combinational logic. From an incoming bus-level select and a page field, it asserts one and only one per-subordinate select — a one-hot output. Here is the focused shape of that decode (a teaching sketch, not a full decoder or production bridge):

Azvya Education Pvt. Ltd.VLSI Mentor
Snippet
// One-hot PSEL decode (teaching sketch). From the address page, assert exactly
// ONE psel_* line, gated by the incoming bus-level select. Not a full module.
module apb_psel_decode (
  input  logic        sel,        // bus-level: a transfer is targeting APB
  input  logic [3:0]  page,       // PADDR[15:12] — the per-peripheral page
  output logic        psel_uart,
  output logic        psel_timer,
  output logic        psel_gpio
);
  localparam logic [3:0] UART_PAGE = 4'h0, TIMER_PAGE = 4'h1, GPIO_PAGE = 4'h2;
 
  // Each select is the gated match of one page. Because the page values are
  // mutually exclusive, AT MOST ONE psel_* is ever high — the one-hot property.
  assign psel_uart  = sel & (page == UART_PAGE);
  assign psel_timer = sel & (page == TIMER_PAGE);
  assign psel_gpio  = sel & (page == GPIO_PAGE);
endmodule

The one-hot property here is not enforced by extra logic — it falls out of the address map. Because UART_PAGE, TIMER_PAGE, and GPIO_PAGE are distinct values, at most one equality holds for any page, so at most one psel_* is high. That is also where the bug comes from: if two peripherals were assigned overlapping address windows, two equalities could hold at once and two selects would assert together — the topology would no longer be one-hot. The correctness of the bus rests on the discipline of the address map, not on a runtime check.

A decoder reading a page field of PADDR and comparing it to a three-entry address map, asserting PSEL_uart high while PSEL_timer and PSEL_gpio are held low because the page value is 0.
Figure 2 — the decoder asserting exactly one PSEL (one-hot) from PADDR. The decoder examines a page field of the address (here bits 15 down to 12), compares it against the address map, and drives high the single PSEL line whose page matches — holding every other PSEL low. In the worked example the page equals 0, so PSEL_uart is high while PSEL_timer and PSEL_gpio stay low. That single high line names the one selected subordinate, the active target of the transfer; if no page matches, no PSEL is asserted and the bridge completes the access harmlessly.
Two panels — a correct one-hot case with a single asserted PSEL and a clean return, and a bug case with two asserted PSEL lines and two subordinates driving the shared PRDATA and PREADY into contention, marked in red.
Figure 3 — one-hot select versus the multi-select bug. Correct (one-hot): the decoder asserts exactly one PSEL, so a single subordinate drives the shared PRDATA and PREADY and the return is well-defined. Bug (multi-select): two PSEL lines are asserted at once — usually from overlapping address windows — so two subordinates drive the shared return signals simultaneously, causing contention: corrupted read data or X's in simulation and an unpredictable PREADY. The shared return path is only safe when PSEL is strictly one-hot.

5. Engineering tradeoff table

The point-to-multipoint topology is a set of deliberate choices that keep the fan-out cheap at the cost of capabilities the control plane does not need.

Topology choiceWhat it gives upWhat it buysWhy it is correct for APB
Shared broadcast busPer-subordinate isolationOne set of wires for the whole fan-outSlow, sparse traffic does not need private links
One dedicated PSEL per subordinateA few extra select wiresAn unambiguous, decoded targetA single select line per peripheral is nearly free
One-hot select (exactly one high)Multi-target broadcast writesA single legal driver of the shared returnTwo drivers on shared PRDATA/PREADY is contention
Shared, muxed return pathConcurrent responsesCheap return wiring; one answer at a timeAPB serializes anyway — only one transfer is live
Decode lives at the bridgeDistributed addressingOne place owns the address mapCentralizing the map makes one-hot easy to guarantee

The throughline: APB shares everything it safely can — address, data, and the return path — and pays only for the one thing sharing cannot provide, an unambiguous target. That one paid-for thing is the per-subordinate PSEL, and keeping it one-hot is what makes the whole shared structure correct.

6. Common RTL / architecture / waveform mistakes

7. Interview framing

This is where an interviewer checks whether you understand APB as a structure, not just a signal list. The classic prompts are "draw how three peripherals connect to one APB manager" and "what happens if two PSEL lines are high at once?" — both probing the one-hot idea.

The strong answer names the topology and then the invariant. Topology: point-to-multipoint — one manager drives a single shared address/control/write-data bus broadcast to all subordinates, plus one dedicated PSEL per subordinate; the return (PRDATA, PREADY) is shared and muxed back. Invariant: a decoder reads the address and asserts exactly one PSEL — one-hot — so a single subordinate is the target and the single legal driver of the shared return. Then deliver the depth point: a non-one-hot PSEL (two high) is contention on the shared return, usually caused by overlapping address windows, and the fix is in the address map, not in adding logic. What the interviewer is really testing is whether you connect "shared return path" to "must be one-hot" — the realization that the topology and its correctness condition are the same statement.

8. Q&A

9. Practice

  1. Label the wires. Draw one manager and three subordinates. Mark which signals are shared/broadcast and which are per-subordinate, and draw the muxed return path back to the manager.
  2. Decode by hand. Given pages 0x0 → UART, 0x1 → Timer, 0x2 → GPIO and an address with page 0x1, state which PSEL is high and which are low, and name the selected subordinate.
  3. Break the map. Assign UART and Timer overlapping address windows. For an address in the overlap, state how many PSEL lines assert, what happens on the shared PRDATA/PREADY, and what the manager reads.
  4. Spot the bug. A waveform shows PSEL_uart and PSEL_gpio both high in the same cycle and PRDATA reading X. Explain, in topology terms, exactly what is wrong and where the fix belongs.
  5. No-match behavior. An address matches no page in the map. State which PSEL lines assert and describe how a well-designed bridge completes the access without hanging the bus.

10. Key takeaways

  • APB is point-to-multipoint: one manager drives one shared bus broadcast to many subordinates, not a bundle of private point-to-point links.
  • Address, control, and write data are shared; PSEL is per-subordinate. Sharing keeps the fan-out cheap; one dedicated select per subordinate keeps the target unambiguous.
  • A decoder asserts exactly one PSEL — one-hot — from the address. That single high line names the selected subordinate; selection is an address decode, not a race.
  • The shared return path has exactly one legal driver, which is the same statement as "PSEL must be one-hot." Topology and correctness are one idea.
  • A non-one-hot PSEL is a bug, not a slow path. Two PSEL high means two subordinates drive the shared PRDATA/PREADY at once — contention and an X on the return.
  • One-hot correctness lives in the address map. It usually breaks because of overlapping address windows, so the fix is mutually exclusive page assignments, not extra logic.