Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 76

SoC Bus Protocols: AXI, AHB, and APB Explained

Recommended resources

Hello! Welcome to the next lesson in our embedded interview bootcamp.

In our last session, we wrapped up our study of external communication by dissecting UART, focusing on its asynchronous timing and flow control mechanisms. You are now prepared to discuss the full suite of common peripheral interfaces, from I2C and SPI to CAN and UART.

Today, we shift our perspective from communication between chips to communication within a chip. For your target roles at companies like Qualcomm, AMD, and Nvidia, understanding the internal fabric of a System-on-Chip (SoC) is not just important—it's a prerequisite. We will explore the bus protocols that form the data superhighways connecting the CPU, memory, and peripherals.

Your learning outcome for this lesson is to: Explain the roles of different SoC bus protocols (AXI, AHB, APB) in connecting high-speed and low-speed peripherals.


1. The Need for a Bus Hierarchy

A modern SoC is a complex city of diverse components. You have high-speed elements like CPU cores, GPUs, and DDR memory controllers that need massive bandwidth. You also have slow-and-steady peripherals like GPIO controllers, timers, and I2C interfaces that only need to be accessed occasionally.

Connecting all these with a single, ultra-high-performance bus would be wasteful in terms of power, area, and design complexity. Conversely, using a simple, low-speed bus would create a massive performance bottleneck for the CPU and memory.

The solution is a tiered or hierarchical bus architecture. ARM standardized this approach with the Advanced Microcontroller Bus Architecture (AMBA) specification.

SoC Bus Architecture with AXI and APB Interconnect
This diagram illustrates a typical SoC architecture. A high-performance AXI interconnect serves the CPU and memory, while an AXI-to-APB bridge provides a connection to a separate bus for lower-speed peripherals. This is the fundamental concept we will explore today.

To begin, let's get a high-level overview of the main AMBA protocols and their intended roles.

AMBA Protocols APB, AHB, AXI, ACE, CHI | Overview, Applications, Limitations

This video from Explore VLSI provides a concise introduction to the AMBA family of protocols, visually explaining the concept of using different buses for components with different bandwidth requirements.

Please watch from the beginning to 03:13. Focus on: What AMBA is and its purpose in standardizing on-chip communication. The diagram showing a clear distinction between high-bandwidth components (CPU, RAM) on one bus type and low-bandwidth peripherals (UART, Timer) on another, connected by a bridge.

As the video illustrates, AMBA defines a family of protocols, each optimized for a specific performance tier. We will now examine the three most common ones you'll encounter in interviews: APB, AHB, and AXI.



2. The AMBA Protocol Family

Think of the protocols as different types of roads in our SoC city: local streets, main highways, and multi-lane expressways.

APB (Advanced Peripheral Bus): The Local Streets

The APB is designed for simplicity and low power consumption. It's used to connect low-bandwidth peripherals where performance is not a primary concern. Its main job is to provide access to configuration and control registers.

  • Role: Connects peripherals like UART, I2C, SPI, GPIO, timers.
  • Key Characteristics:
    • Simple & Non-pipelined: Every transfer has a distinct address phase and data phase, and completes in at least two clock cycles. There is no overlap.
    • Low Power: The minimal complexity of the bus leads to lower power consumption.
    • Register Access: Ideal for reading status or writing configuration values to peripheral control registers.

The following reading gives a clear look at the simple, two-phase nature of an APB transfer.

[PDF] Lecture 4: On Chip Interfaces

This lecture slide deck from Bar-Ilan University provides excellent diagrams comparing the bus protocols. We'll start with the section on APB.

Please read the slides titled 'The Advanced Peripheral Bus (APB)' and 'APB Write Transfer' (slides 24 and 25). Observe the timing diagram: note the distinct SETUP and ACCESS phases. This two-cycle minimum makes it simple but slow.

AHB (Advanced High-performance Bus): The System Highway

AHB was the workhorse high-performance bus for many generations of ARM processors. It's designed to connect the core components of the system.

  • Role: Connects CPUs, on-chip memory (SRAM), DMA controllers, and bridges to slower buses.
  • Key Characteristics:
    • Pipelined: The address phase of the next transfer overlaps with the data phase of the current transfer. This significantly improves bus throughput compared to APB.
    • Burst Transfers: Allows multiple data transfers to occur after a single address is issued, reducing the overhead of sending an address for every word.
    • Shared Bus Architecture: It is a traditional multi-master bus. Multiple masters (like a CPU and a DMA controller) share the bus and must use an arbiter to gain access. Only one master can use the bus at a time.

This traditional shared-bus nature is a key limitation that led to the development of AXI.

[PDF] Lecture 4: On Chip Interfaces

Now, let's look at the AHB sections in the same slide deck and a related article from Doulos that explains its architecture.

Review the slides 'Advanced High-Performance Bus (AHB)' and 'AHB Basic Transfer' (slides 28 and 30). In the 'Basic Read Transfer' diagram, notice how the address for the next transfer (Addr N+1) is placed on the bus while the data from the current transfer (Data N) is being read. This is pipelining in action.

AXI (Advanced eXtensible Interface): The Multi-Lane Expressway

AXI is the modern, highest-performance AMBA protocol. It was designed to overcome the limitations of AHB and meet the demands of complex, multi-core SoCs. It represents a fundamental shift from a shared bus to a channel-based, point-to-point interface.

  • Role: The backbone interconnect for multi-core CPUs, GPUs, high-bandwidth memory controllers, and other performance-critical IP.
  • Key Characteristics:
    • Channel-Based: AXI separates communication into five independent channels:
      • Write Address (AW)
      • Write Data (W)
      • Write Response (B)
      • Read Address (AR)
      • Read Data (R)
        This allows read and write operations to happen simultaneously and in parallel, dramatically increasing bandwidth.
    • Multiple Outstanding Transactions: A master can issue multiple read or write addresses without waiting for the previous transactions to complete. Each transaction has a unique ID, so the responses can return out of order and be correctly matched up. This is critical for hiding memory latency.
    • Transaction-Oriented: Unlike AHB's transfer-based nature, AXI thinks in terms of full transactions. This enables a much more flexible and efficient interconnect fabric, like a crossbar switch, where a CPU can be writing to memory while a DMA controller is reading from a peripheral simultaneously.

The following article is one of the best resources for understanding the practical differences between AHB and AXI, which is a very common interview topic.

Migrating from AHB to AXI based SoC Designs - Doulos

This Doulos article, 'Migrating from AHB to AXI based SoC Designs', clearly explains why AXI was developed and how it fundamentally differs from AHB.

Please read the sections 'Multi-layer AHB and AHB-Lite' and 'AXI3'. Focus on these key points: The limitations of AHB: it is 'transfer-oriented', and a master can only have one outstanding transaction. The AXI solution: it is 'transaction-oriented', has independent channels, and uses transaction IDs to allow out-of-order completion.



3. AXI-Lite: Bridging the Gap

So if APB is simple but requires a bridge to connect to a high-speed AXI fabric, and full AXI is too complex for a simple peripheral, what's the modern solution?

This is where AXI4-Lite comes in. It's a simplified subset of the full AXI protocol, designed specifically for register access to simple peripherals.

  • Role: To connect low-bandwidth peripherals directly to an AXI interconnect, without needing an APB bridge.
  • Key Characteristics:
    • All bursts are fixed to a length of one.
    • All accesses are the full width of the data bus.
    • Does not support complex features like caching or locked transfers.

By using AXI-Lite, designers can create a more uniform SoC where all components speak a variant of the AXI protocol, simplifying the overall architecture.

Migrating from AHB to AXI based SoC Designs - Doulos

The same Doulos article has an excellent section that directly compares AXI-Lite to the role traditionally filled by APB.

Please read the section 'AXI4-Lite'. The key takeaway is that AXI-Lite 'dumbs down' the AXI protocol to create an interface simple enough for custom IP, addressing the issue of needing a bridge for APB slaves.



4. Summary for Your Interview

To consolidate this knowledge for an interview, it's best to have a clear comparison table in mind.

Feature APB (Advanced Peripheral Bus) AHB (Advanced High-performance Bus) AXI (Advanced eXtensible Interface)
Typical Use Case Low-speed peripherals (GPIO, Timers, UART) CPU, On-chip SRAM, DMA, Bus Bridges Multi-core CPUs, GPUs, DDR Controllers, High-performance DSPs
Architecture Simple, non-pipelined Pipelined, shared multi-master bus Channel-based, point-to-point interface
Key Advantage Low power, simplicity High throughput via pipelining & bursts Massive parallelism, hides latency, high frequency
Burst Support No Yes (4, 8, 16 beat) Yes (up to 256 beat in AXI4)
Outstanding Addresses No (1 active transfer) No (1 active transfer) Yes (multiple, tracked by ID)
Modern Variant Still used for simple IP AHB-Lite: For single-master systems AXI-Lite: Replaces APB+Bridge for direct connection to AXI fabric


Conclusion

Today you have explored the internal communication backbone of modern SoCs. Understanding the roles and trade-offs of the AMBA bus family is fundamental knowledge for any engineer working close to the hardware. You can now confidently explain how a system architect chooses the right bus for the right job, balancing performance, power, and complexity.

Key Takeaways:

  • AMBA provides a hierarchical bus system to efficiently connect components with vastly different performance needs.
  • APB is the simplest protocol, used for low-bandwidth peripherals and register access.
  • AHB is a classic high-performance shared bus that uses pipelining and bursts to improve throughput.
  • AXI is the modern standard for maximum performance, using independent read/write channels and multiple outstanding transactions to enable massive parallelism and hide latency.
  • AXI-Lite is a simplified version of AXI used to connect simple peripherals directly to an AXI fabric, often replacing the need for an APB bus and bridge.

Preview of the Next Lesson:

Now that we understand the hardware 'plumbing' inside the SoC, we will move up a layer of abstraction. In the next lesson, we will begin our module on System Design by learning how to design a portable Hardware Abstraction Layer (HAL). This software layer is what allows your application code to run on different SoCs, regardless of whether a specific peripheral is connected via AXI, AHB, or other bus architectures.