Level 5 — MasteryInterconnects, Buses & SoC

Interconnects, Buses & SoC

90 minutes60 marksprintable — key stays hidden on paper

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 = 10910^9 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 32/8=432/8 = 4. (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 ±5%\pm 5\% 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 (8×88\times8) and a crossbar, both connecting 64 nodes.

(a) For an 8×88\times8 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 BB. For a 64-port crossbar give the equivalent (i)–(iii). (8)

(b) Show that for an n×nn\times n mesh the average distance between a uniformly random source–destination pair scales as Θ(n)\Theta(n), while the number of links scales as Θ(n2)\Theta(n^2). 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 NN 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 SS bytes from device to host memory over a bus with peak bandwidth BB bytes/s. Each descriptor covers a contiguous chunk of CC bytes; per-descriptor setup overhead (fetch + program) costs a fixed tot_o seconds during which no payload moves.

(a) Derive a closed-form expression for the achieved effective bandwidth Beff(C)B_{\text{eff}}(C) as a function of chunk size CC, and show limCBeff=B\lim_{C\to\infty} B_{\text{eff}} = B. Compute BeffB_{\text{eff}} for B=16×109B = 16\times10^9 B/s, to=200t_o = 200 ns, C=4096C = 4096 B. (7)

(b) Find the chunk size C\*C^\* at which BeffB_{\text{eff}} reaches 90% of BB. 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 SS bytes split into S/C\lceil S/C\rceil 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: 32GT/s=32×10932\,\text{GT/s} = 32\times10^9 transfers/s, 1 bit/transfer. (1)
  • 128b/130b overhead factor =128/130=0.98462= 128/130 = 0.98462. (1)
  • Usable bits/lane/s =32×109×128130=31.5077×109= 32\times10^9 \times \tfrac{128}{130} = 31.5077\times10^9 bit/s. (1)
  • ×16 lanes, ÷8 bits/byte: 32×109×128130×168\frac{32\times10^9 \times \frac{128}{130}\times 16}{8}. (1)
  • =63.015×109= 63.015\times10^9 B/s 63.0 GB/s\approx \mathbf{63.0\ GB/s} per direction. (1)

(b) Improvement factor (4)

  • Gen3 effective/lane =8×109×810/8=0.8= 8\times10^9 \times \tfrac{8}{10}/8 = 0.8 GB/s. (1)
  • Gen5 effective/lane =32×109×128130/8=3.938= 32\times10^9 \times \tfrac{128}{130}/8 = 3.938 GB/s. (1)
  • Ratio =3.938/0.8=4.923= 3.938/0.8 = 4.923. (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 0.98460.8=1.23\frac{0.9846}{0.8}=1.23. (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 =1ns=1\text{ns} (all bits parallel, one word/ns). ±5%\pm5\% of UI =0.05×1ns=50ps=0.05\times1\,\text{ns}=50\,\text{ps}. Max skew =±50=\pm50 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 8×88\times8: links =2n(n1)= 2\cdot n\cdot(n-1) per dimension summed =2×8×7=112= 2\times8\times7 = 112 bidirectional links. (2) Diameter =(n1)+(n1)=7+7=14=(n-1)+(n-1)=7+7=\mathbf{14} hops. (1) Bisection: cut the 8×88\times8 into two halves ⇒ 88 links crossing (one column), each bidir ⇒ bisection BW =8B=8B. (1)
  • Crossbar (64-port): internally a full 64×6464\times64 switch ⇒ crosspoints =642=4096=64^2=4096; "links" = 64 ports; effectively any-to-any. (2) Diameter =1=1 hop. (1) Bisection =32B=32B (32 ports on each side can all communicate) — full non-blocking. (1)

(b) Scaling proof (6)

  • Average Manhattan distance in n×nn\times n mesh: mean of x1x2|x_1-x_2| over nn points is n213nn/3\frac{n^2-1}{3n}\approx n/3; two dimensions ⇒ avg hops 2(n21)3n=Θ(n)\approx \frac{2(n^2-1)}{3n}=\Theta(n). (2)
  • Links =2n(n1)=Θ(n2)=2n(n-1)=\Theta(n^2) (nodes N=n2N=n^2, so links =Θ(N)=\Theta(N) — linear in node count). (2)
  • Crossbar: switch cost Θ(N2)\Theta(N^2) crosspoints, diameter Θ(1)\Theta(1), bisection Θ(N)\Theta(N). Trade-off: mesh has cheap Θ(N)\Theta(N) cost but Θ(N)\Theta(\sqrt N) latency and Θ(N)\Theta(\sqrt N) bisection; crossbar gives constant latency & full bisection but Θ(N2)\Theta(N^2) area — infeasible at large NN. (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 N1N-1 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 N1\le N-1 grants, guaranteeing service — bounded wait ⇒ no starvation. (1.5)

Question 3

(a) Effective bandwidth model (7)

  • Time per chunk =to+C/B= t_o + C/B (overhead + payload transfer). (1)
  • Effective BW =Cto+C/B= \dfrac{C}{t_o + C/B}. (2) Beff(C)=Cto+C/B=B1+BtoC.B_{\text{eff}}(C) = \frac{C}{t_o + C/B} = \frac{B}{1 + \frac{B\,t_o}{C}}. (1)
  • Limit: as CC\to\infty, BtoC0\frac{B t_o}{C}\to0BeffBB_{\text{eff}}\to B. ✓ (1)
  • Numeric: Bto=16×109×200×109=3200B t_o = 16\times10^9 \times 200\times10^{-9} = 3200 B. Beff=16×1091+3200/4096=16×1091.78125=8.982×109 B/s8.98B_{\text{eff}}=\frac{16\times10^9}{1+3200/4096}=\frac{16\times10^9}{1.78125}= \mathbf{8.982\times10^9\ B/s}\approx 8.98 GB/s. (2)

(b) 90% target (5)

  • Set Beff=0.9BB_{\text{eff}}=0.9B: B1+Bto/C=0.9B1+BtoC=10.9\frac{B}{1+Bt_o/C}=0.9B \Rightarrow 1+\frac{Bt_o}{C}=\frac{1}{0.9}. (2)
  • BtoC=10.91=19C\*=9Bto\frac{Bt_o}{C}=\frac{1}{0.9}-1=\frac{1}{9}\Rightarrow C^\*=9\,B\,t_o. (1)
  • General: C\*=f1fBtoC^\* = \dfrac{f}{1-f}\,B\,t_o for fraction ff. (1)
  • Numeric: C\*=9×3200=28800 BC^\* = 9\times3200 = \mathbf{28800\ B}. (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 =n(to+C/B)= n(t_o + C/B), so overhead is paid nn times and Beff=B1+Bto/CB_{\text{eff}}=\frac{B}{1+Bt_o/C}. With overlap (descriptor prefetch while previous payload streams), only one overhead is exposed, giving Beff=SS/B+toBB_{\text{eff}}=\frac{S}{S/B + t_o}\to B much faster — near-full bandwidth even for small CC, provided toC/Bt_o \le C/B (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"}
]