Explain AMBA, AXI, AHB and APB bus architectures.
AMBA (Advanced Microcontroller Bus Architecture) is an open standard developed by Arm for communication between hardware components inside a System-on-Chip (SoC).
It defines how the CPU, GPU, DMA, memory controller and peripherals communicate with each other.
AMBA is a family of bus protocols, including:
- AXI: Advanced eXtensible Interface.
- AHB: Advanced High-performance Bus.
- APB: Advanced Peripheral Bus.
- ACE: AXI Coherency Extensions.
- CHI: Coherent Hub Interface.
1. AMBA SoC architecture
| Protocol | Performance | Typical usage |
|---|---|---|
| AXI | Very high | CPU, GPU, DMA, DDR |
| AHB | High | SRAM, Flash, microcontrollers |
| APB | Low | UART, GPIO, I2C, timers |
2. AXI — Advanced eXtensible Interface
AXI is a high-performance protocol designed for high-bandwidth, low-latency communication.
It is commonly used between:
- CPU and DDR controller.
- GPU and memory.
- DMA and memory.
- Display controller and framebuffer.
- High-performance hardware accelerators.
AXI has five independent channels
| Channel | Purpose |
|---|---|
| AW | Write address |
| W | Write data |
| B | Write response |
| AR | Read address |
| R | Read data and response |
Each channel uses an independent VALID and READY handshake. A transfer occurs on a rising clock edge when both signals are asserted.
Example: CPU reads from DDR
uint32_t value = *ptr;
ARM assembly:
LDR W0, [X1]
Assuming a cache miss requiring an external AXI transaction:
- MMU translates the virtual address into a physical address.
- CPU memory subsystem generates an AXI read request.
ARADDRcontains the physical address.ARVALIDis asserted.- The receiving interface asserts
ARREADY. - The DDR controller retrieves the requested data.
RDATAcontains the returned data.RVALIDandRREADYcomplete the data transfer.- CPU receives the data and completes the load instruction.
Example: AXI burst transfer
Suppose a DMA controller reads 64 bytes using a 64-bit AXI data bus.
Data bus width = 8 bytes
Burst length = 8 transfers
ARLEN = 7
ARSIZE = 3
ARBURST = INCR
The starting address is transmitted once, followed by eight data transfers.
Advantages of AXI:
- Independent read and write channels.
- Multiple outstanding transactions.
- Burst transfers.
- Out-of-order completion where ordering rules permit.
- High bandwidth and scalability.
AXI4-Lite is a simplified AXI protocol commonly used for control register access without burst transfers.
3. AHB — Advanced High-performance Bus
AHB is a high-performance pipelined bus commonly used in Cortex-M microcontrollers and embedded systems.
Typical connections include CPU, DMA, SRAM, Flash and peripheral bridges.
Important AHB signals
| Signal | Purpose |
|---|---|
HADDR |
Address |
HWRITE |
Read or write selection |
HTRANS |
Transfer type |
HSIZE |
Transfer size |
HBURST |
Burst type |
HWDATA |
Write data |
HRDATA |
Read data |
HREADY |
Transfer completion |
HRESP |
Transfer response |
How AHB pipelining works
AHB overlaps the address phase of the next transaction with the data phase of the current transaction.
In cycle 2, the bus transfers data for address A1 while simultaneously transmitting address A2.
If the slave is not ready, HREADY is deasserted, extending the transfer.
AHB-Lite simplifies AHB by supporting a single master per bus interface.
4. APB — Advanced Peripheral Bus
APB is a simple, low-power protocol designed primarily for accessing peripheral registers.
It is commonly used for:
- UART.
- I2C and SPI controllers.
- GPIO.
- Timers.
- Watchdog.
- RTC.
APB does not support pipelining or burst transactions.
Important APB signals
| Signal | Purpose |
|---|---|
PADDR |
Peripheral register address |
PSEL |
Peripheral selection |
PENABLE |
Access phase enable |
PWRITE |
Read/write selection |
PWDATA |
Write data |
PRDATA |
Read data |
PREADY |
Peripheral ready |
PSLVERR |
Peripheral error response |
APB transfer has two phases
- Setup phase:
PSEL = 1,PENABLE = 0. - Access phase:
PSEL = 1,PENABLE = 1.
The transfer completes when PREADY is asserted during the access phase.
Minimum transfer duration is two APB clock cycles. Additional wait states are possible.
5. Real-world example: CPU writes to a GPIO register
Consider an embedded C program:
#define GPIO_REG (*(volatile uint32_t *)0x40020014U)
GPIO_REG = 0x20;
Representative ARM assembly:
LDR R0, =0x40020014
MOV R1, #0x20
STR R1, [R0]
Assuming the GPIO is connected through an APB bridge:
At the hardware level:
- CPU executes the
STRinstruction. - The interconnect decodes the physical address.
- The appropriate bridge converts the transaction into APB signals.
PADDR = 0x40020014(or the corresponding local peripheral address).PWDATA = 0x20.PWRITE = 1.PSEL = 1.PENABLE = 1in the next phase.- GPIO controller accepts the data.
PREADYcompletes the APB transaction.- GPIO output register is updated.
The addresses and bridge arrangement are illustrative and depend on the actual SoC memory map.
6. How AMBA supports ARM TrustZone
This is particularly important in Secure Touch and Secure Display implementations.
AXI contains protection signals:
ARPROT[1] — Read security attribute
AWPROT[1] — Write security attribute
0 = Secure
1 = Non-secure
For example, if the non-secure Linux kernel tries to access a protected I2C controller:
value = readl(i2c_base + offset);
LDR W0, [X1]
The transaction flows as:
Non-secure CPU
↓
AXI read transaction
ARPROT[1] = 1
↓
Hardware security controller
↓
Access denied to secure peripheral
The hardware firewall checks the security attribute and can reject unauthorized transactions.
APB4 and later also support protection attributes through PPROT.
AMBA carries security attributes; the hardware access-control logic enforces security permissions.
7. AXI vs AHB vs APB
| Feature | AXI4 | AHB / AHB-Lite | APB |
|---|---|---|---|
| Performance | Very high | High | Low |
| Complexity | High | Medium | Low |
| Pipelining | Yes | Yes | No |
| Burst transfer | Yes | Yes | No |
| Independent read/write channels | Yes | No | No |
| Multiple outstanding transactions | Yes | No, AXI-style | No |
| Out-of-order completion | Supported | No | No |
| Power/area overhead | Generally higher | Moderate | Generally lower |
| Typical processor | Cortex-A | Cortex-M | Peripheral interfaces |
| Typical usage | DDR, GPU, DMA | SRAM, Flash | GPIO, UART, I2C |
8. ACE and CHI
Two additional AMBA protocols are important in multicore systems.
| Protocol | Purpose |
|---|---|
| ACE | Extends AXI with hardware cache coherency support. |
| CHI | Scalable, packet-based coherent communication for complex multicore SoCs. |
Standard AXI alone does not provide full hardware cache coherency. ACE and CHI provide mechanisms for coherent transactions between processors and other participating components.
9. Important interview points
- AMBA: Family of on-chip communication protocols.
- AXI: Five independent channels for high-performance communication.
- AHB: Overlapping address and data phases through pipelining.
- APB: Simple two-phase peripheral register access.
- Bridge: Converts one bus protocol into another.
- Interconnect: Performs address decoding, transaction routing and arbitration.
- ACE/CHI: Hardware cache coherency.
Official reference: Arm AMBA Protocol Specifications.