AMBA AXI · Module 12
Mux/Demux & ID-Based Routing
How the AXI interconnect routes the forward path by address (demux) and the response path back by ID (mux) — ID extension with source bits, response demultiplexing to the right manager, ID-width budgeting, and order preservation.
The interconnect has two routing directions to get right: the forward path (a manager's request → the correct subordinate) and the response path (a subordinate's response → the correct manager). These use different keys: the forward path routes by address (decode → demux), and the response path routes by ID (mux back to the originating manager). The mechanism that makes response routing work with multiple managers is ID extension — appending source bits so responses can be demultiplexed home. This chapter ties together the demux/mux structure, ID-based return routing, ID-width budgeting, and order preservation (building on Chapters 8.2 and 8.5).
1. Forward by Address, Back by ID
The two directions route on two different keys:
- Forward (request) — demux by address: a manager's request enters the interconnect, the decoder (Chapter 12.3) maps
AxADDRto a subordinate port, and the request is demultiplexed to that port. One manager fans out to many possible subordinates; the address selects which. - Response — mux by ID: subordinates return responses (
BID/RIDcarrying the transaction's ID); the interconnect multiplexes responses from many subordinates back to the managers, using the ID to route each response to the originating manager. Many subordinates fan in to many managers; the ID selects which manager.
So routing is asymmetric in key: address forward, ID backward. The address says where a request goes; the ID says where a response came from (and thus must return to). Both must be correct for a transaction to complete end-to-end.
2. The Round Trip
A transaction's full path through the interconnect, both directions:
3. ID Extension — How Responses Find Home
The response mux works because of ID extension (Chapter 8.2). When a manager's transaction enters the interconnect, the interconnect appends source-identifying bits to its AxID — encoding which manager/port it came from. The subordinate sees this wider ID and echoes it on the response (BID/RID). On the way back, the interconnect reads those source bits to demultiplex the response to the correct originating manager, then strips them so the manager sees its original ID.
This is what lets multiple managers reuse the same ID value (e.g., two masters both using ARID=0) without collision: the appended source bits keep them distinct internally, and they're the routing key for the response mux. So ID extension is the mechanism behind response routing — without it, the interconnect couldn't tell whose response is whose when managers share ID values. The original ID is preserved end-to-end (extended going in, stripped coming out), so each manager's view of its own IDs is unchanged.
4. ID-Width Budgeting and Order Preservation
Two consequences of ID extension:
ID-width budgeting. Because the interconnect appends source bits, the ID width grows toward the subordinate — the subordinate (and the path to it) must carry the full extended width: roughly subordinate_ID_width ≥ manager_ID_width + ceil(log2(number_of_managers/ports)). If the subordinate's ID width is too narrow to hold the manager ID plus source bits, the extra bits are lost, and responses misroute to the wrong manager (a silent multi-master data-corruption bug, Chapter 8.5). So ID width must be budgeted across the interconnect hierarchy at integration time.
Order preservation. The response mux must preserve same-ID ordering (Chapter 8.3): responses with the same (full) ID must return to the manager in issue order, while different-ID responses may interleave. So the mux isn't a simple combinational select — it must respect per-ID ordering as it merges responses, including across subordinates (which can force the serialization of Chapter 8.5). The demux/mux logic is where the interconnect's ordering guarantees are physically enforced.
5. Common Misconceptions
6. Debugging Insight
7. Verification Insight
8. Interview Questions
9. Summary
The interconnect routes in two directions with two keys: forward by address (decode AxADDR → demultiplex the request to the target subordinate) and response back by ID (multiplex responses to the originating manager using BID/RID). The response mux works via ID extension (Chapter 8.2): the interconnect appends source bits to each manager's AxID so transactions stay distinct (letting managers reuse ID values), the subordinate echoes the extended ID, and the interconnect routes responses home by those bits and strips them so each manager sees its original ID. Two consequences: the ID width grows toward the subordinate — which must carry manager_width + source_bits or responses misroute (budget it) — and the response mux must preserve same-ID ordering while letting different IDs interleave.
The defining insight is the address-forward / ID-backward asymmetry: address says where a request goes (destination in address space), ID says where a response returns (origin manager), and ID extension bridges them by capturing the origin on the way in. Forward bugs are address-side (wrong slave); backward bugs are ID-side (wrong manager, misrouting, ordering) — and the response/ID bugs only surface with multiple managers and ID collisions, so that's the essential verification stress. Next: putting it all together — a full multiple-managers-and-subordinates topology end-to-end.
10. What Comes Next
You've got the routing mechanism; next, the full multi-master/multi-slave picture:
- 12.6 — Multiple Managers & Subordinates (coming next) — a complete multi-master, multi-slave topology end-to-end, combining decode, arbitration, and ID routing.
- 12.7 — Clock & Reset in Interconnect (coming soon) — clock/reset domains and width/protocol converters in the fabric.
Previous: 12.4 — Arbiter & Arbitration. Related: 8.2 — Transaction IDs and 8.5 — Interconnect Implications for the ID-extension foundation. For the broader protocol catalog, see the AMBA family overview doc.