AHB-to-APB Bridge Verification – Comprehensive Notes
Overview of AMBA Buses
AMBA (Advanced Micro-controller Bus Architecture)
Created by ARM to standardise on-chip interconnects for its processors.
Widely adopted in commercial System-on-Chips (SoCs) for heterogeneous IP integration.
Three main protocols / tiers:
AHB (Advanced High-performance Bus) – high-bandwidth, high-frequency system backbone.
APB (Advanced Peripheral Bus) – low-power, low-complexity peripheral sub-system.
AXI (Advanced eXtensible Interface) – high-throughput, high-scalability third-generation protocol.
Release timeline & contents
– Introduced AHB + APB.
– Added AXI.
AMBA-Based Microcontroller Architecture
Typical SoC diagram shows:
High-performance domain – ARM core, on-chip SRAM, DMA master, external memory interface (EMI) all connected via AHB / ASB.
Low-speed peripheral domain – UART, timer, GPIO/PIO, keypad etc. attached to APB.
AHB-to-APB (or ASB-to-APB) Bridge couples the two clock / performance domains.
Design motivations
Keep time-critical traffic on AHB while isolating slower peripherals to save power and area.
Simplifies timing closure; APB never needs multi-master arbitration.
Advanced High-Performance Bus (AHB)
Target: high-frequency modules requiring single-cycle access latency & burst transfers.
Key characteristics
Pipelined address & data phases (overlap for higher throughput).
Supports multiple masters and slaves; includes arbitration.
Burst types: single, incrementing, wrapping.
Ease of synthesis & automated test insertion highlighted in spec.
Typical connectivity
CPU → tightly-coupled SRAM
DMA → external SDRAM controller
Advanced Peripheral Bus (APB)
Tailored for low-power and reduced interface complexity.
Serves register-mapped peripherals (keyboard, mouse, UART, GPIO, timers …).
Finite-State-Machine (FSM) with states:
IDLE – No transfer.
SETUP – Address and control stable.
ENABLE – Data transferred; peripheral drives (read) or samples (write).
Throughput latency: always two cycles per transfer (one SETUP + one ENABLE) → slower but deterministic.
Single-master only; avoids arbitration logic.
AHB-to-APB Bridge – Function & Block Diagram
Purpose: translate high-performance AHB transactions into APB protocol for peripheral access.
Inputs (AHB side)
(bus clock)
(active-low reset)
Address / control: \text{HADDR, HTRANS, HWRITE, HSEL_APBif, HREADYin}
Data: (write), (read)
Outputs (APB side)
(often derived from HCLK)
Internal blocks (as per slide)
State machine – implements IDLE/SETUP/ENABLE for APB, asserts .
Address decode – derives for individual slaves.
D-flip-flops (DFF) – pipeline registers for clock-domain alignment.
HREADYout / HRESP – back-pressure to AHB master while bridge completes APB cycle.
Timing – Basic Transfer Waveform
Address Phase (AHB) – + sampled on rising .
**Data Phase (AHB)}\text{PADDR}\text{HADDR}\text{PWRITE}\text{HWRITE}\text{PENABLE}\text{HREADY} de-asserted until ENABLE completes (stalling AHB master).
Write example (slide shows labels A, ctrl, DA, D-1):
Cycle A – Address valid.
Cycle ctrl – Control signals propagate.
Cycle DA – Write data driven.
Cycle D-1 – Previous read data returned (if any).
Verification Environment – UVM-Style Testbench Architecture
Hierarchy (per slide)
TOP / DUT – RTL bridge instance.
Environment encapsulates:
Master Agent (drives AHB)
• Components: SEQR (sequencer), DRV (driver), MON (monitor), CFG DB.Slave Agent (monitors/drives APB peripheral model)
• Similar set: SEQR, DRV, MON, CFG DB.Virtual Sequencer coordinates Master & Slave sequences.
Scoreboard – checks data integrity, timing, protocol compliance.
VIRTUAL SEQUENCE – generates scenario-level transactions (burst, wraps, error-injection, etc.).
Key objects
CNFG DB (configuration database) – parameterizes agents (address map, data width =32\text{PADDR} = (\text{StartAddr} + i) \bmod \text{WrapSize}.
Practical / Design Considerations & Implications
Clock domain – Often \text{PCLK}\text{HCLK}\text{AHB data width} \approx 32 \text{ or } 64 \; \text{bits}\text{APB data width} \approx 8\text{–}32 \; \text{bits}\text{APB states} = 3=2\text{WrapSize} = 2^{\lceil \log_2(\text{BurstLen}) \rceil}.
Connections to Other Courses / Foundations
Relates to computer architecture (memory hierarchy, bus arbitration).
Builds on digital design principles (finite-state machines, pipelining).
Ties into verification methodologies (SystemVerilog, UVM, constrained-random, functional coverage).
Can be extended to AXI-to-APB bridges, where AXI’s multiple IDs & out-of-order completion add complexity.
Summary Cheat-Sheet
AHB = high-speed, pipelined, multi-master.
APB = low-speed, simple, single-master.
Bridge handles protocol conversion, state management, address decoding, back-pressure.
FSM: IDLE → SETUP → ENABLE; each APB access = 2 cycles.
Verification uses UVM with master/slave agents, scoreboard, virtual sequences.
Core tests: single, burst, wrap, unspecified length.
Key signals: \text{HADDR/HWDATA/HWRITE/HTRANS/HREADY}\text{PADDR/PWDATA/PWRITE/PENABLE/PSEL}$$.