AMBA AXI · Module 10
Register Access with AXI4-Lite
A step-by-step walkthrough of a control/status-register write and read over AXI4-Lite — the single-beat write (AW+W→B) and read (AR→R) sequences, address decode to a register map, WSTRB for byte fields, and response codes.
Chapter 10.1 explained why AXI4-Lite exists; this chapter shows it in action — the concrete sequences for reading and writing a peripheral's control/status registers (CSRs). This is the bread-and-butter of the control plane: software does a memory-mapped load or store, which becomes a single-beat AXI4-Lite read or write to a register address. We'll walk the write path (AW + W → B), the read path (AR → R), how the slave decodes the address to a register, how WSTRB handles byte fields, and what the response codes mean. Everything is single-beat, in-order — the simplicity 10.1 promised, made concrete.
1. The Write Sequence (AW + W → B)
A register write uses three channels. The master presents the address on AW and the data on W; the slave accepts both (in either order, or together), performs the write, and returns a single response on B:
- Master drives
AWADDR(the register's address) withAWVALID; slave accepts withAWREADY. - Master drives
WDATAandWSTRBwithWVALID; slave accepts withWREADY. - Once both
AWandWare accepted, the slave writes the register and drivesBVALIDwithBRESP(OKAYon success); master accepts withBREADY.
It's one beat each — no WLAST needed (single beat), no burst, no ID. The B response confirms the write landed.
2. The Read Sequence (AR → R)
A register read uses two channels. The master presents the address on AR; the slave decodes it, fetches the register value, and returns the data plus response on R:
- Master drives
ARADDRwithARVALID; slave accepts withARREADY. - Slave returns
RDATA(the register value) andRRESP(OKAY) withRVALID; master accepts withRREADY.
One address, one data beat. No RLAST distinction matters for a single beat; no burst. The read is complete when the master captures the R beat.
3. On the Wire
A write of 0xABCD to register 0x10, followed by a read back of 0x10:
lite-rw — write 0x10 = 0xABCD, then read 0x10
8 cycles4. Address Decode and the Register Map
The slave's job is to map the address to a register. A register block exposes a register map — each register at a fixed address offset within the block's address window (e.g., 0x00 = control, 0x04 = status, 0x08 = data, …). When AWADDR/ARADDR arrives, the slave decodes it to select the target register, then reads or writes it.
Software sees this as memory-mapped I/O: a store to the register's address becomes an AXI4-Lite write; a load becomes a read. WSTRB lets software update a byte field of a register without disturbing the rest (e.g., writing one byte of a packed config register), and the slave honors the strobes byte-by-byte (Chapter 6.7). Invalid accesses get error responses: writing a read-only register or hitting a reserved offset typically returns SLVERR; an unmapped address returns DECERR (from the interconnect's default slave).
5. The Software View — MMIO
From software, register access is just load and store to the peripheral's address window, which the system turns into AXI4-Lite transactions:
A driver typically: writes config registers to set up the peripheral, writes a "start" bit, then polls a status register (repeated reads) until a "done" bit is set — every one of those a single AXI4-Lite transaction. Because it's the control plane, latency per access is fine; what matters is correctness and simplicity.
6. Common Misconceptions
7. Debugging Insight
8. Verification Insight
9. Interview Questions
10. Summary
AXI4-Lite register access is the control plane made concrete. A write uses three channels — AW (address) + W (data + WSTRB) → B (response) — where AW and W arrive in any order and the B response confirms the write landed. A read uses two — AR (address) → R (data + response). Both are single-beat, in-order. The slave decodes the address against its register map (each register at an offset), software sees it as memory-mapped load/store, WSTRB enables byte-field writes, and response codes report status (OKAY; SLVERR for read-only/reserved; DECERR for unmapped).
The recurring care points carry over from the core protocol: honor WSTRB for byte fields, and respect read-after-write ordering (wait for B before a dependent read-back — the only ordering discipline a driver needs, since Lite is in-order single-beat). Bugs are decode/response (SLVERR/DECERR), strobe (field corruption), and RAW (stale read-back) issues. Verification concentrates on register-map completeness, access policy, reset values, and byte-strobe correctness — the semantics unique to register blocks. Next: a direct comparison of the two low-bandwidth control interconnects — APB vs AXI4-Lite.
11. What Comes Next
You've seen Lite register access; next, the comparison with the other control interconnect:
- 10.3 — APB vs AXI4-Lite (coming next) — contrasting APB and AXI4-Lite for low-bandwidth control, and when to use each.
Previous: 10.1 — Why AXI4-Lite Exists. Related: 6.7 — WSTRB Write Strobes for byte fields, 6.8 — RESP & LAST Signals for response codes, and 9.2 — Read/Write Independence for the read-after-write rule. For the broader protocol catalog, see the AMBA family overview doc.