6.5.11 · D3 · Hardware › Advanced & Emerging Architectures › RISC-V custom extensions for accelerators
Is topic ke har problem ka ek case class hota hai. Neeche ke worked examples har cell ke saath
tagged hain, aur milke poora grid cover karte hain.
| # |
Case class |
Kya cheez tricky hai |
Covered by |
| A |
Encoding budget — normal |
field widths se ops count karo |
Ex 1 |
| B |
Encoding — degenerate / zero |
ek slot, zero free bits, "kitne bacha" |
Ex 2 |
| C |
Bit-assembling a real instruction |
funct7/rs2/rs1/funct3/rd/opcode ko 32 bits mein pack karo |
Ex 3 |
| D |
Speedup — normal (Amdahl) |
fraction accelerated < 1 |
Ex 4 |
| E |
Speedup — limiting case |
fraction → 1, ya infinite hardware speed |
Ex 5 |
| F |
Coupling choice — small data |
tight vs loose decision |
Ex 6 |
| G |
Coupling choice — large streaming data |
RoCC / DMA regime |
Ex 6 |
| H |
Real-world word problem |
crypto/AI kernel, pehle profile karo |
Ex 7 |
| I |
Exam twist / trap |
"unimplemented op" behaviour, saturating result ka sign |
Ex 8 |
| J |
Boundary of the opcode space |
saare 4 slots use ho gaye, khatam ho raha hai |
Ex 9 |
Dekho ki grid counting, bit-packing, performance, architecture choice, aur traps sab span karti hai.
Ab hum har cell cover karte hain.
Recall Humne kaun se cells cover kiye, aur kya tum har family mein se ek reproduce kar sakte ho?
- Counting (A/B/J): 210 per slot, 4096 total, used subtract karo, immediate se escape karo.
- Bit-packing (C): funct7|rs2|rs1|funct3|rd|opcode → hex.
- Performance (D/E/H): T=(1−f)+f/s, ceiling 1/(1−f).
- Architecture (F/G): data volume vs latency → tight ya RoCC.
- Traps (I): unimplemented ⇒ trap; saturate clamps karta hai, wraps nahi.
Recall Quick self-tests
Ek custom slot ka encoding budget? ::: 23×27=1024 ops.
Overall speedup agar f=0.6, s=8? ::: 1/(0.4+0.075)=1/0.475≈2.11×.
Absolute ceiling jab f=0.6? ::: 1/(1−0.6)=2.5×.
100+20⋅3 ka saturating signed-8? ::: clamp(160)=127, −96 nahi.
Standard core tumhara custom op mile? ::: illegal-instruction trap, kabhi silent wrong result nahi.
Ek opcode slot mein kitne custom R-type ops fit hote hain?
210=1024.
mac x5,x6,x7 ka hex encoding (custom-0, funct3=000, funct7=0)?
0x0073028B.