Exercises — System-on-Chip (SoC) integration
6.3.9 · D4· Hardware › Interconnects, Buses & SoC › System-on-Chip (SoC) integration
Yeh page ek self-test ladder hai. Har rung ek cognitive level upar chadhti hai — "kya tum term pehchaan sakte ho?" se lekar "kya tum poora subsystem design kar sakte ho?" tak. Har problem ka ek full worked solution hai jo ek collapsible callout ke andar chhupa hua hai — pehle khud try karo, phir reveal karo.
Parent topic: System-on-Chip (SoC) integration। Agar kisi concept par atke, toh linked notes dekhlo: AXI Protocol, Clock Domain Crossing Techniques, Power Management in SoCs, Network-on-Chip (NoC), AMBA Bus Standards, Physical Design Flow, Formal Verification Methods।
Shuru karne se pehle, teen symbols baar baar use hote hain. Hum inhe abhi plain words mein define karte hain taaki baad mein kuch "assume" na karna pade:
Level 1 — Recognition
Exercise 1.1 (L1)
Har block ko match karo ki woh interconnect par normally master hai ya slave: (a) ARM Cortex CPU core, (b) DDR memory controller, (c) DMA engine, (d) UART register block।
Recall Solution 1.1
Ek master apni marzi se read/write requests bhejta hai; ek slave sirf tab jawab deta hai jab uske address range par koi request aaye।
- (a) CPU — master (instructions fetch karta hai, data read/write karta hai)।
- (b) DDR controller — slave (ise ek address se target kiya jaata hai; yeh respond karta hai)।
- (c) DMA engine — master (yeh data move karta hai apne khud ke reads/writes issue karke — DMA ka poora maqsad yehi hai)।
- (d) UART registers — slave (CPU iski config registers ko poke karta hai)।
Jawab: master = a, c ; slave = b, d।
Exercise 1.2 (L1)
Parent note mein mentioned teen AMBA bus flavours ke naam batao aur unhe highest performance se simplest/lowest-speed tak order karo।
Recall Solution 1.2
AMBA Bus Standards family se:
- AXI — high performance, out-of-order, burst, aur separate read/write channels support karta hai।
- AHB — mid-tier shared bus।
- APB — sabse simple, low-speed, UART jaise peripheral registers ke liye ideal।
Level 2 — Application
Exercise 2.1 (L2)
Ek crossbar mein masters aur slaves hain। Har link GB/s par run karta hai। Best-case total bandwidth compute karo is formula se:
Recall Solution 2.1
KYA karna hai: formula mein plug karo। KYUN hai: zyada se zyada ek transfer har slave port mein enter ho sakti hai per cycle, aur zyada se zyada ek har master port se nikal sakti hai — isliye simultaneous transfers ki sankhya us side se cap hoti hai jiske paas kam ports hain। Neeche diye figure mein dekho — teen coloured paths parallel mein run karte hain, 4th master ko wait karna padta hai।

Exercise 2.2 (L2)
Ek UART IP ka APB slave port hai; tumhara CPU AXI bolta hai। Uske registers 0x4000_0000 par ek 4 KB window occupy karte hain। (a) Tumhe kaunsa glue block insert karna hoga? (b) Interconnect ke liye top address bits use karke decode rule do।
Recall Solution 2.2
(a) Ek AXI-to-APB bridge — yeh AXI ke channelled protocol ko APB ke simple enable/select handshake mein translate karta hai। Iske bina dono protocols kabhi agree nahi karte aur bus hang ho jaata hai।
(b) 4 KB window ka matlab hai ki neeche ke 12 bits () peripheral ke andar ka offset hain, isliye decoder address[31:12] inspect karta hai:
Dhyan raho: 0x4000_0000 >> 12 = 0x40000 (5 hex digits) hai, 0x4000 nahi।
Exercise 2.3 (L2)
CPU 1 GHz par run karta hai; UART ko 50 MHz clock chahiye। Tum kaunsa integer divider program karoge, aur dono clocks ke beech control signals cross karne par kaunsa extra hardware mandatory hai?
Recall Solution 2.3
Toh uart_clk = cpu_clk / 20। Kyunki 1 GHz aur 50 MHz effectively asynchronous domains hain, har control signal crossing ko ek CDC synchroniser chahiye (dekho Clock Domain Crossing Techniques) — single-bit signals ke liye ek two-flop synchroniser।
Level 3 — Analysis
Exercise 3.1 (L3)
Wahi crossbar jaise 2.1 mein tha (, , GB/s)। Char saare masters ab ek hi slave (DRAM) ko target kar rahe hain। Delivered bandwidth kya hogi, aur best case se kitne factor mein girift?
Recall Solution 3.1
Ek slave ka ek port hota hai। Agar sab DRAM chahte hain, toh transactions us single port se serialise ho jaate hain: Best case ke mukable drop factor: Lesson: crossbar slow nahi hua — access pattern ne parallelism collapse kar di। Isliye hot-spot slaves (DRAM) ko often multiple ports / banks milte hain।
Exercise 3.2 (L3)
Ek engineer ek slower domain mein cross karne wali AXI data bus ke 32 bits mein se har ek par ek plain two-flop synchroniser lagata hai। Precisely explain karo ki receiver garbage kyun padh raha hai, aur correct fix ka naam batao।
Recall Solution 3.2
Kyun toot ta hai: har bit ka synchroniser metastability independently resolve karta hai। Kisi bhi given crossing cycle par kuch bits settle ho chuki ho sakti hain aur kuch abhi bhi resolve ho rahi ho sakti hain, isliye receiver jo 32-bit word latch karta hai woh purane aur naye bits ka mix hota hai — ek aisi value jo kabhi exist hi nahi ki। Yeh bit skew hai, aur single-bit signals par yeh dikhayi nahi deta।
Correct fixes: (i) ek handshake — 32-bit data ko static rakho jabki ek synchronised valid pulse receiver ko bataye "ab sample karo, saare bits stable hain"; ya (ii) ek async FIFO jo Gray-coded pointers use kare (har step par sirf ek pointer bit badalta hai, isliye pointer khud synchronise karna safe hai)। Dekho Clock Domain Crossing Techniques।
Exercise 3.3 (L3)
Ek GPU power domain idle par 2 W draw karta hai (almost sab leakage) aur active par 10 W, aur sirf 10% time active hota hai। Agar tum ise idle hone par power-gate karo, toh hamesha powered on rakhne ke mukable average power saved kya hogi?
Recall Solution 3.3
Baseline (kabhi gate nahi): idle 90% at 2 W, active 10% at 10 W: Gated: idle mein domain fully off hai (0 W); active period unchanged: Average saved: Yeh parent note ke shortcut W se match karta hai, kyunki humne exactly idle-leakage term bachaya। Dekho Power Management in SoCs।
Level 4 — Synthesis
Exercise 4.1 (L4)
Tum ek Image Signal Processor (ISP) ko ek mobile SoC mein integrate kar rahe ho। Yeh: (a) ek AXI master port rakhta hai (pixels DRAM ko stream karta hai), (b) apne power domain mein hai jo camera idle hone par off ho jaata hai, (c) 400 MHz par run karta hai jabki CPU 1.2 GHz par run karta hai। Har integration mechanism list karo jo tumhe add karna hoga, aur batao ki har ek kya rokta hai।
Recall Solution 4.1
Parent note ke chaar integration axes par chalo:
- Interconnect: ISP ek AXI master hai → ise AXI crossbar par ek naye master port ke roop mein wire karo; decoder mein DRAM (iska target) ko ek address range assign karo। Rokta hai: protocol mismatch / mis-routing।
- Power domain plumbing (Power Management in SoCs):
- Power switches jo PMU se gate hote hain (ISP domain ko on/off karte hain)।
- Isolation cells ISP outputs ko ek known value par clamp karti hain jab woh off ho। Rokta hai: floating outputs se live neighbours mein current leak होना।
- Level shifters agar ISP AXI fabric se alag voltage par run karta ho। Rokta hai: low-domain "high" ka higher-voltage domain mein high register na होना।
- Retention flops (hamesha-on rail par) kisi bhi config registers ke liye jo power-down survive karne chahiye। Rokta hai: wake par configuration kho देना।
- Clock Domain Crossing (Clock Domain Crossing Techniques): 400 MHz ↔ 1.2 GHz asynchronous hain। AXI stream crossing ko ek async AXI bridge / async FIFO chahiye (multi-bit → handshake, raw two-flop nahi)। Rokta hai: metastability aur 32-bit bit-skew।
- Interrupt wiring:
isp_irq(frame-done) ko ek free interrupt-controller input se connect karo taaki CPU ko notify ho। Rokta hai: CPU polling / missed frames।
Exercise 4.2 (L4)
ISP clock hai। Integer divider nikalo, aur confirm karo ki dono clocks asynchronous hain chahe integer ho — ek sentence mein batao ki CDC abhi bhi kyun required hai।
Recall Solution 4.2
Exact integer divide ke baad bhi, divided clock ke edges ek alag PLL/divider path se apne khud ke phase aur jitter ke saath generate hote hain; tool inhe asynchronous treat karta hai jab tak poora clock tree provably phase-locked na ho, isliye boundary par CDC synchronisers abhi bhi mandatory hain।
Level 5 — Mastery
Exercise 5.1 (L5)
Ek many-core accelerator mein 16 masters hain। (a) Kaunsa interconnect architecture (shared bus / crossbar / NoC) choose karoge aur kyun? (b) 16 slaves ke liye ek full crossbar ka area cost karta hai। Crossbar area growth ko shared-bus se compare karo aur quantitatively argue karo ki is scale par NoC kyun jeetta hai।
Recall Solution 5.1
(a) 16 masters ke saath hum crossbar sweet spot (3–8) se aage nikal gaye hain। Network-on-Chip (Network-on-Chip (NoC)) choose karo — packet-switched routers 100+ cores tak scale karte hain। (b) Crossbar area full connectivity matrix ki tarah badhti hai: Ek shared bus wire-bundle hai lekin sab ko serialise karta hai → 16 masters par useless bandwidth। Ek NoC routers par area spend karta hai jo roughly linearly badhta hai ( nodes ki sankhya) jabki abhi bhi kai simultaneous packet flows allow karta hai। Toh: crossbar ka quadratic blow-up hi use yahan uneconomical banata hai, jabki shared bus ka single serial path throughput throttle karta hai। NoC ek hi option hai jo dono area aur bandwidth mein scale karta hai।
Exercise 5.2 (L5)
Estimate karo ki crossbar switch-cell count 4 masters/4 slaves se 16/16 tak jaate waqt kaise badhta hai, aur growth factor batao। Phir general rule batao ki kyun fabrics "scale nahi karte"।
Recall Solution 5.2
Dono dimensions double karne par cells quadruple ho jaate hain; har dimension mein increase se overall increase hota hai। Rule: area product ki tarah scale karta hai (quadratic jab ), isliye node count har doubling se fabric cost ko se multiply kar deti hai। Yahi superlinear cost theek woh reason hai jis wajah se industry kuch masters ke baad crossbars se packet-switched NoCs (linear-ish scaling) par switch karti hai।
Recall Quick numeric recap (self-check)
Crossbar best case ::: GB/s
Crossbar worst case (shared slave) ::: GB/s, ek drop
UART divider (1 GHz → 50 MHz) ::: 20
ISP divider (1.2 GHz → 400 MHz) ::: 3
Decode bits for a 4 KB window ::: top 20 bits, address[31:12] == 0x40000
GPU power-gating average saving ::: 1.8 W
Crossbar area 4×4 → 16×16 ::: 16 → 256 cells, growth