Interconnects, Buses & SoC
Chapter: 6.3 Interconnects, Buses & SoC Level: 5 — Mastery (cross-domain: math + physics + coding, build/prove) Time limit: 90 minutes Total marks: 60
Instructions: Answer all three questions. Show derivations fully. Where code is requested, pseudocode or valid Python is acceptable. State all assumptions.
Question 1 — PCIe / SerDes Bandwidth & Encoding (20 marks)
A GPU is attached over a PCIe Gen5 x16 link. Gen5 signals at 32 GT/s per lane using 128b/130b encoding. Gen3 signals at 8 GT/s using 8b/10b encoding.
(a) Derive the effective usable unidirectional bandwidth of a Gen5 x16 link in GB/s (base‑10, 1 GB = bytes). Show the encoding-overhead factor explicitly. (5)
(b) By what factor did per‑lane effective throughput improve from Gen3 to Gen5? Explain why the ratio is not simply . (4)
(c) A serial (SerDes) lane at 32 GT/s replaces a hypothetical 32‑bit parallel bus that would need to run at the same aggregate data rate. Give two physical-layer reasons (grounded in signal physics) why the serial link is preferred at these speeds, and quantify one: if PCB trace skew tolerance is of a unit interval (UI), compute the maximum allowable inter-lane skew (in ps) for a parallel bus clocked so that one 32‑bit word transfers per 1 ns. (6)
(d) CXL runs on the PCIe Gen5 PHY. Explain in 3–4 sentences why CXL.mem/CXL.cache can offer lower effective latency for accelerator memory access than tunneling the same traffic as ordinary PCIe DMA transactions. (5)
Question 2 — NoC Topology, Arbitration & Analysis (22 marks)
You are architecting the on-chip fabric of a 64-core SoC. Two candidate NoC topologies: a 2D mesh () and a crossbar, both connecting 64 nodes.
(a) For an mesh with bidirectional links, derive: (i) the number of links, (ii) the network diameter (max hop count), and (iii) the bisection bandwidth in units of link-bandwidth . For a 64-port crossbar give the equivalent (i)–(iii). (8)
(b) Show that for an mesh the average distance between a uniformly random source–destination pair scales as , while the number of links scales as . State the crossbar's link/switch cost scaling and explain the fundamental trade-off (cost vs latency vs bisection). (6)
(c) A shared AXI bus uses round-robin arbitration among 4 masters. Masters M0–M3 request in the pattern below over 8 cycles (1 = requesting). Assuming last-granted master was M3, and each grant lasts one cycle, produce the grant sequence. Then compute the worst-case waiting time (cycles) a continuously-requesting master can experience with round-robin vs fixed-priority arbitration for masters, and prove round-robin is starvation-free. (8)
cycle: 0 1 2 3 4 5 6 7
M0: 1 1 0 0 1 1 1 0
M1: 0 1 1 1 0 0 1 1
M2: 1 0 1 1 1 1 0 0
M3: 1 1 1 0 0 1 1 1
Question 3 — DMA Throughput Model & Build (18 marks)
A DMA controller moves a buffer of bytes from device to host memory over a bus with peak bandwidth bytes/s. Each descriptor covers a contiguous chunk of bytes; per-descriptor setup overhead (fetch + program) costs a fixed seconds during which no payload moves.
(a) Derive a closed-form expression for the achieved effective bandwidth as a function of chunk size , and show . Compute for B/s, ns, B. (7)
(b) Find the chunk size at which reaches 90% of . Give the general formula and the numeric value for the parameters above. (5)
(c) Write a short function plan_dma(S, C, to, B) that returns the total transfer time and effective bandwidth for a scatter-gather transfer of bytes split into descriptors (overheads may pipeline: assume the last descriptor's overhead overlaps nothing, others fully overlap payload of the previous descriptor). State how overlapping changes the effective bandwidth versus the non-overlapped model of part (a). (6)
Answer keyMark scheme & solutions
Question 1
(a) Effective bandwidth (5)
- Raw rate per lane: transfers/s, 1 bit/transfer. (1)
- 128b/130b overhead factor . (1)
- Usable bits/lane/s bit/s. (1)
- ×16 lanes, ÷8 bits/byte: . (1)
- B/s per direction. (1)
(b) Improvement factor (4)
- Gen3 effective/lane GB/s. (1)
- Gen5 effective/lane GB/s. (1)
- Ratio . (1)
- Not 4 because Gen3 wastes 20% (8b/10b) while Gen5 wastes only ~1.5% (128b/130b); the encoding efficiency also improved, multiplying the raw 4× by . (1)
(c) Serial vs parallel (6)
- Reason 1: No inter-lane skew constraint — parallel bus requires all bits arrive within one UI; at multi-GHz the trace-length matching becomes physically impossible. Serial embeds clock in data (CDR). (1.5)
- Reason 2: Reduced crosstalk / EMI and fewer pins; a single differential pair has controlled impedance and better SI than 32 aggressor lines. (Also lower simultaneous-switching noise.) (1.5)
- Quantification: 32-bit word per 1 ns ⇒ per-bit UI on the parallel bus (all bits parallel, one word/ns). of UI . Max skew ps. (3)
(d) CXL latency (5)
- CXL.mem/.cache use load/store (coherent) semantics rather than descriptor-based DMA. (1.5) No descriptor fetch/ring-buffer/doorbell round-trips. (1.5) The host memory controller / coherence engine handles the access as a native cacheable transaction, so latency approaches that of a memory access rather than an I/O transaction; and cache coherence avoids explicit software-managed copies. (2)
Question 2
(a) Topology metrics (8)
- Mesh : links per dimension summed bidirectional links. (2) Diameter hops. (1) Bisection: cut the into two halves ⇒ links crossing (one column), each bidir ⇒ bisection BW . (1)
- Crossbar (64-port): internally a full switch ⇒ crosspoints ; "links" = 64 ports; effectively any-to-any. (2) Diameter hop. (1) Bisection (32 ports on each side can all communicate) — full non-blocking. (1)
(b) Scaling proof (6)
- Average Manhattan distance in mesh: mean of over points is ; two dimensions ⇒ avg hops . (2)
- Links (nodes , so links — linear in node count). (2)
- Crossbar: switch cost crosspoints, diameter , bisection . Trade-off: mesh has cheap cost but latency and bisection; crossbar gives constant latency & full bisection but area — infeasible at large . (2)
(c) Arbitration (8)
- Round-robin, last granted M3 ⇒ priority order restarts after M3: M0,M1,M2,M3. Grant lowest-index requesting master after the last granted, cyclically. Grant sequence (one per cycle):
| cycle | requesters | last grant | grant |
|---|---|---|---|
| 0 | M0,M2,M3 | M3 → start M0 | M0 |
| 1 | M0,M1,M3 | M0 → start M1 | M1 |
| 2 | M1,M2,M3 | M1 → start M2 | M2 |
| 3 | M1,M2 | M2 → start M3,none,→M1 | M1 |
| 4 | M0,M2 | M1 → start M2 | M2 |
| 5 | M0,M2,M3 | M2 → start M3 | M3 |
| 6 | M0,M1,M3 | M3 → start M0 | M0 |
| 7 | M1,M3 | M0 → start M1 | M1 |
Grant sequence: M0, M1, M2, M1, M2, M3, M0, M1. (4)
- Worst-case wait, round-robin: a continuously-requesting master waits at most cycles (all others served once). (1.5)
- Fixed priority: a low-priority master can wait unbounded (∞) if higher-priority masters continuously request → starvation. (1)
- Starvation-free proof: after a master is passed over, the pointer advances past it only when it is granted or not requesting; a continuously-requesting master's position becomes highest-priority within grants, guaranteeing service — bounded wait ⇒ no starvation. (1.5)
Question 3
(a) Effective bandwidth model (7)
- Time per chunk (overhead + payload transfer). (1)
- Effective BW . (2) (1)
- Limit: as , ⇒ . ✓ (1)
- Numeric: B. GB/s. (2)
(b) 90% target (5)
- Set : . (2)
- . (1)
- General: for fraction . (1)
- Numeric: . (1)
(c) Code + overlap discussion (6)
import math
def plan_dma(S, C, to, B):
n = math.ceil(S / C)
payload_time = S / B # total bytes / bandwidth
# non-last overheads overlap payload; only last overhead is exposed
exposed_overhead = to # one un-overlapped overhead
total_time = payload_time + exposed_overhead
beff = S / total_time
return total_time, beff(3)
- Discussion: In the non-overlapped model total time , so overhead is paid times and . With overlap (descriptor prefetch while previous payload streams), only one overhead is exposed, giving much faster — near-full bandwidth even for small , provided (else overhead cannot be fully hidden). (3)
[
{"claim":"Gen5 x16 effective BW ~63.0 GB/s","code":"beff=32e9*(128/130)*16/8; result = abs(beff-63.0e9) < 0.1e9"},
{"claim":"Gen3->Gen5 per-lane improvement ~4.923x","code":"g3=8e9*(8/10)/8; g5=32e9*(128/130)/8; result = abs(g5/g3-4.923) < 0.01"},
{"claim":"Parallel bus max skew is 50 ps for 1ns UI at 5%","code":"skew=0.05*1e-9; result = abs(skew-50e-12) < 1e-15"},
{"claim":"B_eff at C=4096 is ~8.982 GB/s","code":"B=16e9; to=200e-9; C=4096; beff=B/(1+B*to/C); result = abs(beff-8.982e9) < 0.01e9"},
{"claim":"C* for 90% is 28800 bytes","code":"B=16e9; to=200e-9; Cstar=9*B*to; result = abs(Cstar-28800) < 1e-6"},
{"claim":"8x8 mesh diameter is 14","code":"n=8; result = (n-1)+(n-1)==14"},
{"claim":"8x8 mesh bidirectional link count is 112","code":"n=8; result = 2*n*(n-1)==112"}
]