AHB Protocol Explained: Architecture, Signals and Transfers
Master/slave architecture, pipelined address and data phases, HREADY, HRESP, and burst transfer types — the mid-performance backbone that came before AXI.
AHB introduced the idea that made all later high-performance AMBA protocols possible: pipelining. While one transaction's data phase is completing, the next transaction's address phase can already be underway. It's a single shared bus, so only one transaction is in flight at a time — but overlapping address and data phases still meaningfully increases throughput over APB's fully sequential model.
In This Article
1.Master/Slave Topology and the Arbiter
Unlike APB, AHB supports multiple masters (e.g., CPU, DMA controller) sharing the same bus. Since only one master can drive the address/data bus at a time, an arbiter grants bus ownership one master at a time, based on each master's HBUSREQ request and a configurable priority/round-robin scheme. A central decoder uses the address to generate the correct HSELx for the target slave.
2.Key AHB Signals
| Signal | Driven By | Purpose |
|---|---|---|
| HADDR | Master | Transfer address |
| HTRANS | Master | Transfer type: IDLE, BUSY, NONSEQ, SEQ |
| HWRITE | Master | 1 = write, 0 = read |
| HSIZE | Master | Transfer size (byte/halfword/word...) |
| HBURST | Master | Burst type and length (SINGLE, INCR4, WRAP8...) |
| HWDATA / HRDATA | Master / Slave | Write / read data buses |
| HREADY | Slave | 1 = previous transfer complete, bus ready for next address phase |
| HRESP | Slave | OKAY, ERROR, RETRY, or SPLIT response |
3.Address and Data Phase Pipelining
Every AHB transfer has two phases: an address phase (one cycle, where HADDR/HTRANS/HWRITE/HSIZE are driven) and a data phase (one or more cycles, extended by HREADY). Pipelining means the address phase of transfer N+1 happens during the data phase of transfer N — the two overlap rather than running strictly back-to-back, which is what makes AHB faster than APB despite still sharing a single bus.
4.HREADY and HRESP
HREADY, driven by the currently selected slave, is the single most important control signal on AHB. When low, it stalls the entire bus — extending the current data phase and freezing the next transfer's address phase from advancing. When high, the current data phase completes and the pipeline advances.
HRESP reports the transfer status once HREADY finally goes high: OKAY (success), ERROR (failed transfer, master must decide how to respond), RETRY and SPLIT (used by slaves needing to release the bus temporarily while completing a slow access — an advanced, less commonly implemented feature).
5.Burst Transfer Types
| HBURST Value | Meaning |
|---|---|
| SINGLE | Single transfer, not part of a burst |
| INCR | Incrementing burst of undefined length |
| WRAP4 / INCR4 | 4-beat wrapping or incrementing burst |
| WRAP8 / INCR8 | 8-beat wrapping or incrementing burst |
| WRAP16 / INCR16 | 16-beat wrapping or incrementing burst |
WRAP bursts are address-aligned and wrap back to the start of the aligned block once they hit the boundary — useful for cache-line-fill traffic, where the critical word can be fetched first.
6.Transaction Walkthrough
Recap: What We Covered Today
- AHB supports multiple masters through a central arbiter; only one transaction is in flight on the shared bus at a time.
- Address and data phases pipeline: the next address phase overlaps the current data phase.
- HREADY (from the slave) stalls or advances the entire bus; HRESP reports OKAY/ERROR/RETRY/SPLIT.
- HBURST defines INCR (incrementing) and WRAP (wrapping) burst types of fixed lengths.
AXI4 Protocol Explained: The Complete Beginner's Guide
Tomorrow we move into AXI4: the five independent channels, the VALID/READY handshake that governs every one of them, and why this architecture removes AHB's single-shared-bus bottleneck.
Comments
Post a Comment