6.5.10 · D3 · HinglishAdvanced & Emerging Architectures

Worked examplesFPGA-based acceleration

3,005 words14 min read↑ Read in English

6.5.10 · D3 · Hardware › Advanced & Emerging Architectures › FPGA-based acceleration

Kuch bhi compute karne se pehle, chaliye symbols ko naam dete hain taaki koi confused na ho. Yeh sab diagrams mein bhi dikhenge.

Woh ek formula jiske around poora page revolve karta hai, phir se stated taaki hum usse own kar sakein:


The scenario matrix

Har FPGA-timing question inn cells mein se ek hai. Neeche ke worked examples mein har ek [C#] tag carry karta hai jo batata hai ki woh kaunsi cell cover karta hai.

# Case class Isme kya extreme hai Example
C1 Large (streaming limit) , speedup Ex 1
C2 Tiny (, single item) Fill cost dominate karta hai, koi speedup nahi Ex 2
C3 Degenerate pipeline () Pipeline karne ko kuch nahi — sanity floor Ex 3
C4 Balanced vs unbalanced stages Ek slow stage set karta hai Ex 4
C5 Compute-bound roofline side Ex 5
C6 Memory-bound roofline side ; zyada logic useless Ex 6
C7 Real-world word problem Latency budget se device choose karo Ex 7
C8 Exam twist Clock unit trap + efficiency Ex 8

Related vault topics jo padhte waqt open rakhne chahiye: Pipelining and Throughput, Roofline Model & Arithmetic Intensity, Configurable Logic Blocks (LUTs & Flip-Flops), GPU vs FPGA vs ASIC trade-offs, High-Level Synthesis (HLS), Dataflow architectures.

Figure — FPGA-based acceleration

Upar ke conveyor ko dekho: pehla item (amber) sabhi benches ke upar crawl karta hai — yahi fill hai. Jab woh exit karta hai, cyan items ek per tick follow karte hain. Yahi ek tasveer hai kyun neeche ke har case ka behavior waise hi hota hai.


C1 — The streaming limit (large )

  1. Pipelined cycles compute karo. . Yeh step kyun? Conveyor picture: pehle item ko pure pipe mein crawl karne ke liye sabhi ticks chahiye (the fill), aur baaki items mein se har ek ek aur tick add karta hai jaise woh uske peechhe pop out hote hain. .
  2. Speedup compute karo. . Yeh step kyun? Serial CPU se compare kar rahe hain jo ticks spend karta hai.
  3. Interpret karo. Hum ceiling ke ke andar hain. Yeh step kyun? Limit as confirm karta hai.
Recall Verify

Jab , top aur bottom dono ko se divide karo: . aur ke saath, hum par hain — essentially . Units: dimensionless (times ka ratio). ✓


C2 — Ek akela item ()

  1. Pipeline ke liye cycles. ticks. Yeh step kyun? ke saath item ke peechhe overlap karne ke liye kuch nahi hai; woh bas full length crawl karta hai.
  2. Serial CPU ke liye cycles. ticks. Yeh step kyun? Ek item, aath serial operations.
  3. Speedup. . Yeh step kyun? Dono machines same time lete hain — pipeline ne zero benefit diya.
Recall Verify

at gives for any . Speedup exactly hai. ✓


C3 — Degenerate pipeline ()

  1. Plug in karo. . Yeh step kyun? Ek stage matlab har item poore datapath ko akele occupy karta hai — doosre item ko overlap karne ki jagah nahi.
  2. Ceiling interpret karo. par limit hai. Yeh step kyun? Agar sirf ek stage ho to se aage nahi ja sakte. Ceiling hi stage count hai.
Recall Verify

for all . Degenerate case correctly "no speedup" report karta hai. ✓


C4 — Unbalanced stages clock set karte hain

Figure — FPGA-based acceleration
  1. Bottleneck dhundho (a). Clock slowest bench se tez tick nahi kar sakti: . Yeh step kyun? Har stage ek clock share karta hai; agar se tez tick karta to slow stage tick aane par finish nahi hota → galat data (ek timing-closure violation, parent note dekho).
  2. Split se pehle total time (b). . Yeh step kyun? Pipeline-time formula ka seedha use.
  3. Split ke baad (c). Ab , : . Yeh step kyun? Do aur stages se do extra fill ticks lagte hain, lekin har tick teen guna chhota hai — ek bada net win.
  4. Re-balancing se speedup. faster. Yeh step kyun? Intuition confirm karta hai: slowest stage sabko throttle kar rahi thi; usse slice karne par clock breathe kar sakta hai.
Recall Verify

Before: . After: . Ratio . Units sab ns mein → ratio dimensionless. ✓


C5 — Compute-bound (roofline, right side)

  1. Memory ceiling compute karo. . Yeh step kyun? Yeh wo fastest rate hai jis par memory tumhe feed kar sakti hai.
  2. Min lo. . Yeh step kyun? Memory feed kar sakti thi, lekin silicon sirf chew kar sakta hai — compute wall hai.
  3. Verdict: compute-bound. Zyada BRAM caching add karne se madad nahi milegi; tumhe aur DSP slices / deeper pipeline chahiye. Yeh step kyun? Tum binding constraint fix karte ho, slack wala kabhi nahi.
Recall Verify

, , . Compute-bound kyunki . ✓


C6 — Memory-bound (roofline, left side)

Figure — FPGA-based acceleration
  1. Ceiling (a). ; . Memory-bound. Yeh step kyun? Memory sirf feed karti hai; ka compute zyaadatar idle baitha rehta hai.
  2. Compute double karo (b). unchanged. Yeh step kyun? Tumne slack side wide ki; bottleneck (memory) kabhi nahi hila. Yahi "more logic used ≠ faster" wali galti hai parent note se.
  3. BRAM se intensity raise karo (c). Naya ; . Yeh step kyun? Cached data reuse karne ka matlab per op fewer DRAM trips → higher → tum diagonal ke upar slide ho ke compute roof par aa jaate ho. faster.
Recall Verify

(a) . (b) (no change). (c) ; . ✓


C7 — Real-world word problem: device choose karo

  1. FPGA latency (a). Pehla result ticks ke baad: . Yeh step kyun? Latency = pipeline fill = . budget se compare karo → vast margin ke saath pass.
  2. FPGA throughput (b). Pipe full hone ke baad har tick mein ek sample emit hota hai, isliye samples ka frame leta hai. ✓ Yeh step kyun? Throughput sustained rate hai; frame size (problem mein given) ko tick se multiply karne par per-frame time milta hai, aur deadline meet karta hai.
  3. GPU check (c). Throughput lekin latency ✗. Yeh step kyun? GPU throughput pane ke liye batch karta hai, latency budget blow karta hai. Reject karo.
  4. Decision. FPGA dono meet karta hai; GPU latency fail karta hai. FPGA choose karo — classic low-latency streaming win.
Recall Verify

FPGA latency ✓; frame time ✓; GPU latency ✗. FPGA hi ek device hai jo dono pass karta hai. ✓


C8 — Exam twist: clock-unit trap + efficiency

  1. Clock convert karo (the trap). . Yeh step kyun? MHz millions of ticks per second hai; invert karna bhool jaane par nonsense milta hai. Time formula mein plug karne se pehle hamesha frequency ko period mein turn karo.
  2. Pipeline time (a). . Yeh step kyun? Seedha pipeline-time formula mein correct ke saath: 11 fill ticks plus pops, sab .
  3. CPU time (b). . Yeh step kyun? Serial machine mein koi overlap nahi: items mein se har ek ko apne poore operations ka cost lagta hai, har ek , toh total .
  4. Efficiency (c). ? Nahi — efficiency yahan speedup matlab hai . Yeh step kyun? Efficiency honest speedup ratio hai (same total work pipe ke actual ticks ke upar). par hum ceiling ke par hain, kyunki -tick fill cost streamed items ke against negligible hai — yeh exactly limit hai jo approach karta hai.
Recall Verify

; pipe ; CPU ; efficiency . Parent note ke numbers se match karta hai. ✓


Recall check

Kisi bhi -stage pipeline mein ek single item () ke liye FPGA speedup kya hoga?
Exactly — koi overlap possible nahi, isliye pipelining kuch nahi kharidta.
Memory-bound kernel extra compute units kyun ignore karta hai?
Kyunki aur binding term hai; wide karne par min unchanged rehta hai. Iske bajaye raise karo (BRAM reuse).
Pipeline ka clock period kya set karta hai?
Sabse slow single stage, — kabhi average nahi; ise violate karne par timing closure break ho jaati hai.
ko period mein convert karo.
.
par -stage pipeline ka speedup ceiling?
— ek complete computation har cycle finish hoti hai jab pipe full ho jaata hai.