Bus systems

Multicolumn

Blank

Purpose and Fundamental concepts

HW interfacing to a peripheral costs time, goal is to reduce latency
➡️ We do this by I/O abstraction and thoughtful topologies
A bus can be serial or parallel
A parallel bus is the fastest way to transfer data. It features three categories of signals: address; data; control. the data
must be addressed before being transferred (what data is required). Memory generally must know whether
data is being read from the device or being written to, therefore control systems are required.

Bottleneck in computing are external peripherals

Memory, Graphics, I/O devices, slow memory

Topologies and history

StageNameKey IdeaExample Bus
1ISA-Driven (Separate I/O & Memory space)CPU has special I/O instructions & separate I/O busOld x86 ISA bus (IN/OUT instructions)
2Memory-Mapped (Single unified address space)I/O devices mapped into memory address spaceARM, RISC-V SoCs, STM32 registers
3Processor-Driven (CPU controls bus timing)Timing of external bus tied directly to CPU clockEarly microcontrollers, 8086 external bus
4Processor-Independent BusA bridge separates CPU bus from external I/O busPCI / PCIe systems, Northbridge/Southbridge
5Multi-Level (Hierarchical)Fast internal bus + slower peripheral bus levelsAMBA (AHB, APB), Wishbone, Tilelink

AMBA - Advanced Microprocessor Bus Architecture

Series of specifications of bus systems for SoC architecture. Originally two parts: a system level bus and a peripheral level bus. Slow peripherals feature a cheaper bus.
Three relevant version :

  • AMBA-2: AHB, APB
  • AMBA-3: AXI, ATB
  • AMBA-4 AXI4, AXU-Lite, AXI-Stream
flowchart TB
  subgraph AHB_MASTERS
    CPU[CPU Core]
    DMA[DMA Controller]
  end

  subgraph AHB_BUS[AHB Bus / Interconnect]
    ARB[Arbiter]
    DEC[Address Decoder]
  end

  subgraph AHB_SLAVES
    SRAM[SRAM]
    FLASH[Flash]
    BRIDGE[AHB to APB Bridge]
  end

  subgraph APB_BUS[APB Bus]
    GPIO[GPIO]
    UART[UART]
    TIMER[Timers]
  end

  %% Connections
  CPU --> ARB
  DMA --> ARB
  ARB --> DEC
  DEC --> SRAM
  DEC --> FLASH
  DEC --> BRIDGE

  BRIDGE --> GPIO
  BRIDGE --> UART
  BRIDGE --> TIMER

Blank

Multicolumn

Blank

AHB
High performance
Pipelined operation
Burst transfer
Multiple bus masters
Split transactions

Blank

APB
Low power and easy to access
Not pipelined (one transfer at a time)
Suitable for many peripherals

Architectures

Multicolumn

Blank

Harvard Architecture

Separate busses for code and data
✅ Avoids mutual exclusion
❌ Higher chip costs

Blank

Modified Harvard

Separate data and code paths internally (different cache), Joined code and data paths externally (RAM, ROM)
✅Best of both world
❌More complex

Blank

von Neumann Architecture

Combines data and code on one bus
✅Cheaper processors
❌Increase risk of mutual exclusion, von Neumann bottleneck (can’t fetch instruction and read/write at same time)

AHB and bus operations

Note

Beat (in bus transfers)

  • One unit of data transferred per clock cycle on the bus.
  • If the bus is 32 bits wide → one beat = 32 bits per cycle.

A bus transaction is simply:

  1. Master puts an address on the address lines.

  2. Master sets read/write control.

  3. Bus decoder selects the target slave.

  4. Slave responds with either:

    • Data (for read), or
    • Acceptance (for write).
  5. Handshake signals confirm completion.
    Short version:
    Master requests → Address decoded → Slave responds → Transfer completes.
    Arbitration → Addressing → Data → Confirmation.

Summary

Bus has its own clock
Bus indicates type of cycle
Bus indicate the size of the transfer
Bus can keep a peripheral active for sequential addressing
Bus can insert wait-cycles
Device can request wait-cycles (to facilitate when busy)
Device can indicate whether the transfer was successful
Devices comply to bus
Bus is a master-slave operation
Bus requires a default-slave when idle


AHB bus instructions

Operation / ModeBus TypeWho InitiatesBehaviorWhen UsedNotes
ReadAHB / APBMasterReads data from selected slaveFetching data / statusStandard single read
WriteAHB / APBMasterWrites data to selected slaveConfig registers / memoryStandard single write
Burst ReadAHBMasterMultiple sequential reads in one transferDMA memory loadingHigh throughput
Burst WriteAHBMasterMultiple sequential writesDMA memory storingReduces bus overhead
Idle CycleAHBMasterNo data transferPause / no operationUses HTRANS=IDLE
Busy CycleAHBMasterMaster keeps bus but does not progressTemporary delayMaintains ownership
Peripheral Register AccessAPBMasterSingle non-pipelined read/writeGPIO, UART, Timers, I2CLow power/low complexity
Wait / StallAHB / APBSlaveSlave delays completionFlash or slow peripheralUses HREADY/PREADY
Cycle-Stealing DMAAHBDMADMA takes one bus cycle at a time between CPU cyclesAudio, UART streamsCPU still runs, slight slowdown
Transparent DMAAHBDMADMA transfers only when bus is idleLow-priority data movementCPU sees zero performance hit
Fly-By TransferAHB / AXIMaster→Slave bypassData goes from source to destination without buffering in DMAHigh-speed peripherals (SDIO/ETH)Reduces latency + buffer requirements
SignalDirection (Master/Slave)Type / PurposeWidthDescription
HCLKGlobalClock1Main bus clock for all transfers
HRESETnGlobalReset (active low)1Resets bus logic and interfaces
HADDRMaster → SlaveAddress lines32Address for read/write transaction
HWDATAMaster → SlaveWrite data32/64Data being written to slave
HWRITEMaster → SlaveControl11 = Write, 0 = Read
HSIZEMaster → SlaveControl3Transfer size (byte/half/word/etc.)
HBURSTMaster → SlaveControl3Burst type (single, incrementing, wrap)
HPROTMaster → SlaveControl4Privilege/cache/security attributes
HTRANSMaster → SlaveControl2Transaction type (IDLE, BUSY, NONSEQ (start of burst), SEQ)
HMASTLOCKMaster → SlaveControl1Locks bus during atomic sequences
HRDATASlave → MasterRead data32/64Data returned by the selected slave
HREADYSlave → MasterHandshake1Indicates slave is ready (0 = wait)
HRESPSlave → MasterResponse1–2Transfer OK/ERROR indication