IP cores and SoC bus fabric
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:
- Single master limitation: Only one IP can communicate at a time
- No paralelism: A CPU reading memory blocks GPU from accessing different memory
- No QoS: A low-priority DMA can stall time-critical video processing
- 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 master IPs (CPU, DMA, GPU) and 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 masters needs a potential path to each of slaves → connection points (switches). Each slave can receive requests from all masters simultaneously → need1 arbiter per slave to choose winner.
Example: 4 masters, 8 slaves
- Switches: crosspoints
- Arbiters: 8
- Complexity:
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:
- Write Address (AW): Master → Slave, carries address + control for writes
- Write Data (W): Master → Slave, carries write data
- Write Response (B): Slave → Master, acknowledges write completion
- Read Address (AR): Master → Slave, carries address + control for reads
- 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
AWREADYwhen 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 assertsWREADYfor 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 assertsBREADY - 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):
AHB (1 cycle/transfer with pipelining):
AXI (multiple outstanding, burst length 16):
But AXI can have multiple transactions in-flight: With 4 outstanding transactions:
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)
- 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 (bytes/sec)
- Token bucket fills at rate tokens/sec
- Bucket capacity (tokens) allows bursts
- Each transaction of size bytes consumes 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:
- Bucket capacity: 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.
- Arbiter sees Video (P=15), CPU (P=12), DMA (P=5) → Video wins
- Video exhausts 100 MB/s token allocation → blocks
- CPU (P=12) now highest → serves CPU
- CPU exhausts 50 MB/s allocation → blocks
- DMA gets remaining bandwidth opportunistically
- After 1 ms, CPU's token bucket refills → CPU can issue again
- 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 , define:
- Base address
- Size (must be power of 2 for simple decoding)
- Address mask (inverted size-1)
Transaction address targets slave 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:
- Address 0x2000_1234:
- ✓ matches base
- Address 0x2000_0FF (in GPIO):
- ✗ 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:
- Non-overlapping regions: Cache is0x0F00_0000-0x0F00_FFFF (separate region), cache controller internally redirects to RAM
- Hierarchical decoding: Cache has higher priority decoder that catches0x1000_0000-0x1000_FF BEFORE the RAM decoder sees it
- 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 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 words
- But peripheral also reads1 word, net: +19 words in FIFO
- For 64-word burst: words? Still no!
Correct analysis:
- CPU burst time: ns
- During 32 ns, peripheral reads words
- Net FIFO usage: words
- Add margin for read latency (say 5 cycles): 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?
What is a bus fabric in an SoC?
Why do modern SoCs use bus fabrics instead of simple shared buses?
What are the 5 independent channels in the AXI protocol?
What is the purpose of separating address and data channels in AXI?
What is Quality of Service (QoS) in bus fabrics?
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?
Why must slave address ranges be non-overlapping in bus fabric design?
What is the complexity of a full crossbar fabric connecting N masters to M slaves?
How do you size an asynchronous FIFO at a clock domain crossing?
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?
Concept Map
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.