6.3.10Interconnects, Buses & SoC

IP cores and SoC bus fabric

4,144 words19 min readdifficulty · medium

Overview

Modern System-on-Chip (SoC) designs integrate multiple pre-designed functional blocks called IP (Intellectual Property) cores connected through a bus fabric. This architectural approach enables rapid development of complex systems by reusing verified components rather than designing everything from scratch.

IP Cores: Pre-Designed Functional Blocks

Types of IP Cores

1. Soft IP Cores

  • Delivered as synthesizable RTL (Register Transfer Level) code (Verilog/VHDL)
  • Technology-independent: can be synthesized for different process nodes
  • Most flexible but requires full synthesis and verification
  • Example: A UART controller delivered as Verilog source

WHY soft? Because it's "soft" like clay—you can reshape it during synthesis to fit your specific technology and timing constraints.

2. Firm IP Cores

  • Delivered as netlist (gate-level representation)
  • Partially optimized but still allows some technology mapping
  • Middle ground between flexibility and optimization
  • Example: A gate-level netlist of an encryption engine

3. Hard IP Cores

  • Delivered as physical layout (GDSII files with placed transistors)
  • Optimized for specific process technology
  • Best performance and area but zero flexibility
  • Example: A DDR4 PHY (Physical Layer) with analog components

SoC Bus Fabric: The Interconnection Network

Why Not Just Use a Simple Bus?

Simple bus problems:

  1. Single master limitation: Only one IP can communicate at a time
  2. No paralelism: A CPU reading memory blocks GPU from accessing different memory
  3. No QoS: A low-priority DMA can stall time-critical video processing
  4. Poor scalability: Adding IPs degrades performance linearly

Bus fabric solution: Provides a switching infrastructure with:

  • Multiple concurrent paths
  • Priority and QoS arbitration
  • Bandwidth allocation
  • Address decoding and routing

Bus Fabric Architecture - From First Principles

Let's derive why modern fabrics use the architectures they do.

Starting point: We have NN master IPs (CPU, DMA, GPU) and MM slave IPs (RAM, peripherals).

Requirement 1: Masters must access slaves through addresses. → We need address decoding to route transactions to correct slaves.

Requirement 2: Multiple masters may want different slaves simultaneously. → We need parallel data paths (crossbar switches).

Requirement 3: Multiple masters may want the SAME slave simultaneously. → We need arbitration logic at each slave port.

Derivation: Each of NN masters needs a potential path to each of MM slaves → N×MN \times M connection points (switches). Each slave can receive requests from all NN masters simultaneously → need1 arbiter per slave to choose winner.

Example: 4 masters, 8 slaves

  • Switches: 4×8=324 \times 8 = 32 crosspoints
  • Arbiters: 8
  • Complexity: O(N×M)O(N \times M)

This is why large SoCs use hierarchical fabrics—flat crossbars don't scale beyond ~10-20 ports.

Common Bus Fabric Standards

1. AMBA (Advanced Microcontroller Bus Architecture) by ARM

AXI Channel Structure (from first principles):

Why separate channels? In a transaction, address phase and data phase have different timing. By separating them, we can pipeline: issue address for transaction 2while data for transaction 1 is still transfering.

AXI has 5 independent channels:

  1. Write Address (AW): Master → Slave, carries address + control for writes
  2. Write Data (W): Master → Slave, carries write data
  3. Write Response (B): Slave → Master, acknowledges write completion
  4. Read Address (AR): Master → Slave, carries address + control for reads
  5. Read Data (R): Slave → Master, returns read data + response

Step 1 - Write Address Phase:

  • Master drives: AWADDR = 0x1000, AWLEN = 3 (4 beats of 4bytes), AWSIZE = 2 (4 bytes per beat)
  • Master asserts AWVALID
  • Slave asserts AWREADY when ready
  • Why separate from data? Slave can accept the address and prepare while master is still gathering data.

Step 2 - Write Data Phase (can overlap with Step 1!):

  • Master drives: WDATA = [data0, data1, data2, data3] over 4 clock cycles
  • Master asserts WVALID, slave asserts WREADY for each beat
  • Last beat has WLAST = 1
  • Why burst? Transfering 4 words with 1 address is4× more efficient than 4 separate transactions.

Step 3 - Write Response:

  • Slave drives: BRESP = 0b00 (OKAY)
  • Slave asserts BVALID, master asserts BREADY
  • Why needed? Master knows the write actually completed and didn't error.

Paralelism: While this write proceeds, the same master can issue a read address on AR channel!

2. AHB (AMBA High-performance Bus)

  • Single channel (address + data multiplexed)
  • Simpler than AXI, lower performance
  • Used for lower-bandwidth peripherals
  • Pipelined address/data (2-stage pipeline)

3. APB (Advanced Peripheral Bus)

  • Non-pipelined
  • Minimal complexity for low-speed peripherals
  • 2-cycle protocol: SETUP → ACCESS
  • Used for GPIO, timers, UARTs where speed isn't critical

APB (2 cycles/transfer): Throughput=32 bits2 cycles×100 MHz=1.6 Gb/s=200 MB/s\text{Throughput} = \frac{32 \text{ bits}}{2 \text{ cycles}} \times 100 \text{ MHz} = 1.6 \text{ Gb/s} = 200 \text{ MB/s}

AHB (1 cycle/transfer with pipelining): Throughput=32 bits1 cycle×100 MHz=3.2 Gb/s=400 MB/s\text{Throughput} = \frac{32 \text{ bits}}{1 \text{ cycle}} \times 100 \text{ MHz} = 3.2 \text{ Gb/s} = 400 \text{ MB/s}

AXI (multiple outstanding, burst length 16): Throughput32 bits×1616+2 (overhead cycles)×100 MHz2.8 Gb/s=350 MB/s\text{Throughput} \approx \frac{32 \text{ bits} \times 16}{16 + 2 \text{ (overhead cycles)}} \times 100 \text{ MHz} \approx 2.8 \text{ Gb/s} = 350 \text{ MB/s}

But AXI can have multiple transactions in-flight: With 4 outstanding transactions: Effective4×350=1400 MB/s\text{Effective} \approx 4 \times 350 = 1400 \text{ MB/s}

Why these differences?

  • APB pays 2-cycle overhead per transfer (no pipelining)
  • AHB pipelines address/data (amortizes overhead)
  • AXI amortizes overhead across bursts AND paralelizes multiple transactions

SoC Fabric Topology

1. Single Shared Bus

[Master1] ──┐
[Master2] ──┼─── BUS ───┬─── [Slave1]
[Master3] ──┘           ├─── [Slave2]
                └─── [Slave3]
  • Simplest, lowest cost
  • Only1 transaction at a time
  • Used in simple microcontrollers

2. Multi-layer AHB / Crossbar

[M1] ──┬────┬───────┬── [S1]
[M2] ──┼─X─────┼─X─────┼─── [S2]
[M3] ──┴────┴───────┴── [S3]
  (X = switch/arbiter at each intersection)
  • N×MN \times M switches
  • Full paralelism: M1→S1 concurrent with M2→S2
  • Used in mid-range SoCs

3. Hierarchical Network-on-Chip (NoC)

       ┌─ Router ─ [CPU Cluster]
       │
Router─┼─ Router ─ [GPU]
       │
       └─ Router ─ [Memory Controller]
  • Packet-switched network
  • Scales to hundreds of IPs
  • Used in high-end SoCs (smartphone APs, server chips)

Bus Fabric:

  • High-speed crossbar for CPU↔GPU↔Memory
  • AXI for high-bandwidth paths
  • AHB for mid-speed peripherals
  • APB for low-speed config registers
  • Hierarchical: multiple crossbars interconnected

Why this architecture?

  • CPU needs low-latency to memory → direct crossbar path
  • GPU needs high bandwidth → wide AXI interface
  • DSP processes camera data → dedicated path to ISP
  • USB config registers rarely accessed → cheap APB saves power

Quality of Service (QoS) in Bus Fabrics

QoS Implementation - First Principles

Problem: Video decoder needs 100MB/s sustained or frames drop. Background file copy uses 300 MB/s burst. How do we guarantee video doesn't stall?

Solution components:

1. Priority Levels

  • Assign each master a priority (e.g., 0-15)
  • Arbiter at slave always serves highest priority pending request
  • Video: priority 10, file copy: priority 2

Problem with pure priority: Starvation—priority 2 may never get served if priority 10 constantly requests.

2. Bandwidth Regulation

  • Assign each master a bandwidth allocation (e.g., 40% of slave bandwidth)
  • Use token bucket algorithm: master accumulates tokens, spends them on transactions
  • When out of tokens, master blocks even if high priority

Token Bucket Derivation:

  • Let master require average bandwidth BavgB_{\text{avg}} (bytes/sec)
  • Token bucket fills at rate r=Bavgr = B_{\text{avg}} tokens/sec
  • Bucket capacity bb (tokens) allows bursts
  • Each transaction of size ss bytes consumes ss tokens
  • If bucket empty, transaction blocks until tokens available

Example: Video decoder needs 100 MB/s average, can burst to 150 MB/s for 0.1 sec.

  • Token rate: r=100 MB/sr = 100 \text{ MB/s}
  • Bucket capacity: b=(150100)×0.1=5 MBb = (150 - 100) \times 0.1 = 5 \text{ MB} of burst credit
  • Video accumulates 5 MB tokens, can burst at 150 MB/s for 0.1 sec, then throttles to 100 MB/s

3. Latency Guarantees

  • Track each transaction's age (time since issue)
  • If age exceds threshold, boost priority → age-based escalation
  • Prevents starvation while maintaining QoS

QoS Configuration:

  • Video Priority 15, bandwidth = 100 MB/s guaranteed, age threshold = 10 ms
  • CPU: Priority 12, bandwidth = 50 MB/s guaranteed, age threshold = 1 ms
  • DMA: Priority 5, bandwidth = remaining (opportunistic), age threshold = 100 ms

Scenario: All three simultaneously access memory controller.

  1. Arbiter sees Video (P=15), CPU (P=12), DMA (P=5) → Video wins
  2. Video exhausts 100 MB/s token allocation → blocks
  3. CPU (P=12) now highest → serves CPU
  4. CPU exhausts 50 MB/s allocation → blocks
  5. DMA gets remaining bandwidth opportunistically
  6. After 1 ms, CPU's token bucket refills → CPU can issue again
  7. If Video transaction waits 10 ms, age escalation overides token limits → Video served immediately

Result: Video and CPU get guaranteed service, DMA gets "best effort" with remaining bandwidth.

Address Decoding in Bus Fabrics

Memory Map Example (32-bit addresses):

0x000_0000 - 0x0FFF_FFFF : ROM (256 MB)
0x1000_0000 - 0x1FFF_FFFF : RAM (256 MB)
0x2000_0000 - 0x2000_0FFF : GPIO (4 KB)
0x2000_1000 - 0x2000_1FFF : UART (4 KB)
0x3000_0000 - 0x3FF_FFFF : PCIe (256 MB)

Address Decoder Logic (from scratch):

For each slave ii, define:

  • Base address BiB_i
  • Size SiS_i (must be power of 2 for simple decoding)
  • Address mask Mi=(Si1)M_i = \sim(S_i - 1) (inverted size-1)

Transaction address AA targets slave ii if: $(A \land M_i) = B_i$$

Why this works?

  • Power-of-2 sizes mean all low bits within a region vary, high bits are constant
  • Masking zeros out variable low bits
  • Comparison checks if high bits match base

Example: UART at base 0x2000_1000, size 4KB (0x1000)

  • Mask: M=(0x10001)=0x0FFF=0xFFFF_F000M = \sim(\text{0x1000} - 1) = \sim\text{0x0FFF} = \text{0xFFFF\_F000}
  • Address 0x2000_1234:
    • 0x2000_12340xFFFF_F000=0x2000_1000\text{0x2000\_1234} \land \text{0xFFFF\_F000} = \text{0x2000\_1000} ✓ matches base
  • Address 0x2000_0FF (in GPIO):
    • 0x2000_0FFF0xFFFF_F000=0x2000_000\text{0x2000\_0FFF} \land \text{0xFFFF\_F000} = \text{0x2000\_000} ✗ doesn't match

Why it feels right: The cache overlaps RAM, so accesses to that region hit cache first.

The problem: The address decoder now has two slaves matching the same address range. When a master accesses 0x1000_0040, which slave responds? Both assert chip select → bus conflict, potentially damaging hardware or causing metastability.

The fix: Either:

  1. Non-overlapping regions: Cache is0x0F00_0000-0x0F00_FFFF (separate region), cache controller internally redirects to RAM
  2. Hierarchical decoding: Cache has higher priority decoder that catches0x1000_0000-0x1000_FF BEFORE the RAM decoder sees it
  3. True cache: Don't memory-map the cache; make it a transparent cache on the RAM's slave port

Modern SoCs use option 3—caches are transparent, not separately addressed.

SoC Integration Flow

Step 1: IP Selection

  • Choose CPU core (ARM Cortex-A75, RISC-V, custom)
  • Choose peripherals (USB, Ethernet, etc.)
  • License IP from vendors (ARM, Synopsys, Cadence)

Step 2: Bus Fabric Design

  • Determine bandwidth requirements for each IP
  • Choose bus protocols (AXI for high-speed, APB for low-speed)
  • Design fabric topology (crossbar, hierarchical, NoC)
  • Configure QoS policies

Step 3: Address Map Definition

  • Assign non-overlapping address ranges to each slave
  • Reserve space for future expansion
  • Document in memory map specification

Step 4: RTL Integration

  • Instantiate IP cores in top-level RTL
  • Connect to fabric using appropriate adapters
  • Add clock domain crossing (CDC) logic where needed
  • Add reset distribution logic

Step 5: Verification

  • Functional simulation (testbenches)
  • Formal verification of protocols
  • Emulation on FPGA
  • Silicon bring-up

Solution: Asynchronous FIFO at clock domain boundary:

CPU (2 GHz) → [Async FIFO] → Peripheral (100 MHz)

Why FIFO?

  • Write side clocked by CPU clock
  • Read side clocked by peripheral clock
  • Dual-port RAM with Gray-code pointers prevents metastability
  • Provides buffering to absorb clock rate differences

Sizing the FIFO (from first principles):

  • CPU writes at 2 GHz, peripheral reads at 100 MHz
  • Worst case: CPU bursts 64 words, peripheral can't keep up
  • FIFO must buffer 64×2000100=128064 \times \frac{2000}{100} = 1280 words? No!
  • Peripheral reads 1word per 10 ns, CPU writes 1 word per 0.5 ns
  • During peripheral's read cycle (10 ns), CPU writes 100.5=20\frac{10}{0.5} = 20 words
  • But peripheral also reads1 word, net: +19 words in FIFO
  • For 64-word burst: 64+19×63=126164 + 19 \times 63 = 1261 words? Still no!

Correct analysis:

  • CPU burst time: 64×0.5=3264 \times 0.5 = 32 ns
  • During 32 ns, peripheral reads 3210=3.23\frac{32}{10} = 3.2 \approx 3 words
  • Net FIFO usage: 643=6164 - 3 = 61 words
  • Add margin for read latency (say 5 cycles): 61+5=6661 + 5 = 66 words
  • Round to power of 2: FIFO depth = 128 words

This is why FIFOs are designed with both clock frequency ratio AND burst patterns in mind.


Active Recall Practice

Recall Feynman Explanation (Explain to a 12-year-old)

Imagine you're building a massive Lego city. You don't make every piece yourself—you buy pre-made sets like a police station, fire truck, and houses. These are like IP cores: already-built blocks you snap together.

Now, all these buildings need roads to connect them so people and cars can travel between them. That's the bus fabric—it's the road network connecting all your Lego sets.

But here's the problem: if there's only one road and everyone tries to use it at once, there's a huge traffic jam! So we build multiple roads that go between different places at the same time. A fire truck rushing to an emergency gets the fast lane (high priority), while a delivery truck taking packages can use the slow lane (low priority).

The address decoder is like a GPS: when someone says "I want to go to the police station," it figures out which road leads there and sends them on the right path. Without the GPS, everyone would get lost!

Modern computer chips are like cities with thousands of buildings and roads, all working together to process your games, videos, and apps.


AXI Channels: "AW-W-B, AR-R"

  • Address Write, Write data, Back (response)
  • Address Read, Read data
  • Remember: "Writes need3 (AW, W, B), Reads need 2 (AR, R)"

Connections

  • Interconnect Topologies - Bus fabric topologies (mesh, crossbar, NoC) stem from network topology theory
  • Cache Coherence Protocols - Multi-core SoCs need coherent caches; bus fabric must supportnooping or directory protocols
  • DRAM Controllers - Memory controllers are IP cores; bus fabric must match their bandwidth and timing requirements
  • PCIe - PCIe controller is an IP core that bridges external PCIe bus to internal SoC fabric
  • Power Management - SoC fabric includes clock/power gating logic to disable unused IPs
  • DMA - DMA controllers are bus masters on the fabric; must support burst transfers efficiently
  • Memory-Mapped I/O - Peripherals appear as slaves in the address space; fabric routes accesses to them

Flashcards

#flashcards/hardware

What is an IP core? :: A pre-designed, pre-verified block of logic functionality that can be integrated into a larger chip design, licensed with defined interfaces for reuse across SoC designs.

What are the three types of IP cores and their key difference?
Soft IP (RTL source, technology-independent), Firm IP (gate netlist, partially optimized), Hard IP (physical layout, technology-specific, best performance).
What is a bus fabric in an SoC?
An interconnection infrastructure that allows multiple IP cores (masters and slaves) to communicate with support for multiple simultaneous transactions, arbitration, and QoS management.
Why do modern SoCs use bus fabrics instead of simple shared buses?
Simple buses allow only one transaction at a time (single master), provide no paralelism or QoS, and scale poorly. Fabrics enable concurrent transactions, priority arbitration, and better scalability.
What are the 5 independent channels in the AXI protocol?
Write Address (AW), Write Data (W), Write Response (B), Read Address (AR), Read Data (R). Separate channels enable pipelining and parallel read/write operations.
What is the purpose of separating address and data channels in AXI?
It enables pipelining: a master can issue the address for transaction2 while data for transaction 1 is still transfering, increasing throughput by overlapping operations.
What is Quality of Service (QoS) in bus fabrics?
Mechanisms that prioritize certain traffic to guarantee latency or bandwidth for time-critical applications, preventing low-priority transfers from starving real-time streams.

Describe the token bucket algorithm for bandwidth regulation :: A master accumulates tokens at rate (target bandwidth). Each transaction of size s consumes s tokens. When out of tokens, transactions block. Bucket capacity b allows controlled bursts above average rate.

How does address decoding determine which slave receives a transaction?
For each slave with base address B and size S (power of 2), compute mask M = ~(S-1). Transaction address A targets the slave if (A & M) = B, checking if high-order bits match.
Why must slave address ranges be non-overlapping in bus fabric design?
Overlapping ranges cause multiple slaves to respond to the same address, creating bus conflicts that can damage hardware or cause metastability. Each address must map to exactly one slave.
What is the complexity of a full crossbar fabric connecting N masters to M slaves?
O(N × M) switches (one per master-slave pair) and M arbiters (one per slave). This is why large SoCs use hierarchical fabrics—flat crossbars don't scale beyond ~10-20 ports.
How do you size an asynchronous FIFO at a clock domain crossing?
Calculate maximum burst size minus words read during burst time, plus margin for read latency. For 64-word burst, 2 GHz write, 100 MHz read: 64 - (64×0.5ns / 10ns) + margin≈ 61 + 5 = 66, round to 128.

Compare throughput of APB vs AH AXI protocols :: At 100 MHz, 32-bit: APB (2 cycles/xfer) = 200 MB/s, AHB (pipelined) = 400 MB/s, AXI (burst + multiple outstanding) ≈ 1400 MB/s with 4concurrent transactions due to amortized overhead.

What is the role of priority arbitration in bus fabrics? :: When multiple masters request the same slave, the arbiter selects the highest-priority pending request. Combined with age-based escalation to prevent starvation of low-priority masters.

Why are caches transparent rather than memory-mapped in modern SoCs?
Memory-mapped caches would create overlapping address regions (cache and RAM at same addresses), causing decode conflicts. Transparent caches sit on the RAM slave port and intercept accesses without appearing in the address map.

Concept Map

integrates

connects via

licensed by

type

type

type

most

best

connects

supports

improves on

limited by

System-on-Chip

IP Cores

Bus Fabric

IP Vendors

Soft IP - RTL

Firm IP - Netlist

Hard IP - Layout

Flexibility

Performance and Area

Masters and Slaves

Arbitration, QoS, Parallelism

Simple Bus

Single Master, No Parallelism

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho beta, jab hum ek modern chip banate hain—jaise tumhare phone ka processor—toh humein ek hi chip par CPU, GPU, memory controller, USB, sab kuch daalna hota hai. Isko bolte hain System-on-Chip ya SoC. Ab yahan core intuition ye hai ki ye saare components hum zero se design nahi karte. Jaise ek city banate waqt tum har brick aur window khud nahi banate, tum ready-made standardized parts kharidte ho aur unko roads se connect karte ho. Bilkul waise hi, engineers pre-designed aur verified blocks use karte hain jinko bolte hain IP cores (Intellectual Property cores)—jaise ARM ka CPU, ya ek USB controller. Aur inko aapas mein jodne wala jo road system hai, use bolte hain bus fabric.

Ab IP cores teen flavours mein aate hain, aur ye samajhna important hai. Soft IP matlab RTL code (Verilog/VHDL) mein milta hai—ye "clay" jaisa flexible hota hai, tum kisi bhi technology ke liye ise reshape kar sakte ho. Firm IP netlist form mein aata hai, thoda optimize kiya hua, beech ka option. Aur Hard IP toh full physical layout ke saath aata hai—best performance dega par bilkul flexible nahi hota. Yahan trade-off simple hai: jitni flexibility zyada, utni optimization kam, aur ulta bhi. Fabric ki baat karein toh simple bus se kaam nahi chalta kyunki usme ek time par sirf ek master baat kar sakta hai—matlab agar CPU memory read kar raha hai toh GPU wait karega. Isliye bus fabric aata hai jo multiple parallel paths, arbitration aur QoS deta hai, taaki sab components ek saath smoothly kaam kar sakein.

Ye topic tumhare liye kyun matter karta hai? Kyunki aaj har device—mobile, car, smartwatch—SoC par chalta hai, aur industry mein chip design ka pura funda hi reusability aur fast development par based hai. IP cores ki wajah se design time saalon se ghatke mahino tak aa jaata hai. Agar tum hardware ya VLSI field mein jaana chahte ho, toh ye concept—ki components ready-made hote hain aur fabric unko intelligently connect karta hai—tumhare career ka foundation banega. Isliye ye ratne ki cheez nahi, samajhne ki cheez hai.

Go deeper — visual, from zero

Test yourself — Interconnects, Buses & SoC

Connections