6.3.5 · D1 · HinglishInterconnects, Buses & SoC

FoundationsCXL (Compute Express Link)

2,402 words11 min read↑ Read in English

6.3.5 · D1 · Hardware › Interconnects, Buses & SoC › CXL (Compute Express Link)

Is page pe assume kiya gaya hai ki aap kuch nahi jaante. Hum har word build karenge jo CXL (Compute Express Link) parent note mein use hota hai — cache, coherency, MESI, PCIe, GT/s, snoop, cache line, address space — ek chip ke memory se baat karne ki picture se shuru karke.


0. Shuruwati picture: ek processor aur uski memory

Koi bhi fancy word se pehle, do boxes aur ek wire imagine karo.

Figure — CXL (Compute Express Link)

CXL mein sab kuch is baare mein hai ki kitne boxes hain, aur woh sab mailboxes ke content pe kaise agree karte hain.


1. Address — mailbox number

Picture: numbered lockers ki ek lambi line. Address = locker number.

Topic ko iske zaroorat kyun hai: parent note mein likha hota hai jaise MemRd to address 0x2_000_0000. Yeh bas itna hai — "locker number do-sau-kuch-crore mein data fetch karo".

CXL ko iske zaroorat kyun hai: CXL memory expanders processor ko woh locker numbers use karne dete hain jo uske apne local RAM se bahar hain. Lockers physically doosre box mein hain, lekin processor unhe same tarah se naam leta hai — figure dekho.

Figure — CXL (Compute Express Link)
0x ka matlab hai "mere baad wala number hexadecimal (base-16) mein hai"
yeh bas ek counting shorthand hai jo engineers use karte hain; 0x1000 decimal number 4096 hai.

2. Cache — worker ke paas ek chhoti fast notebook

Memory wall tak jaana slow hai. Isliye har processor apne paas jo data sabse zyada use karta hai uski ek chhoti, bahut fast copy rakhta hai.

Picture: worker jinhe numbers use karne hain unka ek sticky note rakhta hai. Sticky note padhna instant hai; locker wall tak chalna slow hai.

Topic ko iske zaroorat kyun hai: parent kehta hai "CPU has a 64-byte cache line at address 0x1000". Yeh ek sticky note hai jo locker 4096 se shuru hone wale 64 bytes hold karta hai.


3. Coherency — sab log newest value pe agree karte hain

Picture: Google Docs auto-sync. Do log same document edit kar rahe hain; ek type karte hi, doosre ko dikhai deta hai. Woh instant sync = coherency.

  • Coherent = saari copies hamesha agree karti hain. ✅
  • Incoherent = copies disagree karti hain; koi purana data pad raha hai. ❌ (parent note mein "stale data" bug.)

Poori machinery ke liye Cache-CoherencyProtocols dekho; yahan hume bas idea chahiye.


4. Char states: M, E, S, I (MESI)

Coherency enforce karne ke liye, har sticky-note copy pe ek label hota hai jo describe karta hai ki woh kitni trustworthy aur kitni private hai. Exactly chaar labels hain.

Figure — CXL (Compute Express Link)

In states ka golden rule: single-writer YA multiple-readers. Ya toh exactly ek holder write kar sakta hai (M ya E), ya bahut saare read kar sakte hain lekin koi nahi likh sakta (S). Kabhi do writers nahi.

Topic ko iske zaroorat kyun hai: CXL.cache ka har example in chaar labels ke through ek walk hai — ek locker M → S jaata hai jab GPU use read karna chahta hai, etc. Ek baar labels pata hon, woh walk obvious ho jaati hai.

Kaun si state ka matlab hai "meri copy dirty hai aur memory stale hai"?
Modified (M)
Kaun si state kaafi caches ko reading ke liye same line hold karne deti hai?
Shared (S)

5. Snoop — "aye, kya tumhare paas yeh locker hai?"

Ek processor ko kaise pata chalta hai ki doosre ke paas ek private, possibly-dirty copy hai? Woh poochhta hai. Woh question snoop kehlaata hai.

Picture: worker ek locker number uthata hai aur kamre mein chillaata hai, "Koi #57 hold kar raha hai? Agar dirty hai, toh yahan do!"

Topic ko iske zaroorat kyun hai: parent ke opcodes SnpData, SnpInv exactly yahi chillane hain — Snp = snoop, Data = "mujhe data do", Inv = "apni copy invalidate karo". Ek snoop-based coherency protocol bas yahi chillana hai jo hardware mein nanosecond speed pe hota hai.


6. Wire: PCIe, lanes, aur GT/s

Ab boxes ke beech physical wire. CXL nayi cable nahi banata — woh wahi uthata hai jo GPUs already use karte hain: PCIe.

Picture: lane ek single-file conveyor belt hai bits ke liye. Ek ×16 link 16 belts side by side hain, ek saath 16× bits move karte hain.

130 se divide kyun karte hain aur subtract kyun nahi?
Overhead stream ka ek fraction hai, isliye yeh rate ko multiplicatively scale karta hai, fixed subtraction se nahi.

Picture: ek conveyor belt, lekin teen rangon ke boxes baari-baari ride karte hain. Same belt, cleverly shared.


7. Teen CXL sub-protocols ek nazar mein

Upar di gayi vocabulary ke saath, parent ke teen protocols ek picture mein collapse ho jaate hain: kaun kiska memory cache kar raha hai.

Figure — CXL (Compute Express Link)

Do related standards jaanne wale hain: DMA-(Direct-Memory-Access) (CPU ko pareshan kiye bina data move karna), aur pre-CXL rivals Gen-Z-and-CCIX. CXL ka memory-expansion angle HBM-(High-Bandwidth-Memory) se relate karta hai aur NUMA-(Non-Uniform-Memory-Access) se bhi, jahan alag memory alag distances/latencies pe hoti hai — exactly woh duniya jise CXL manage karta hai.


8. Yeh foundations topic ko kaise feed karte hain

Processor and Memory

Address and Address Space

Cache and Cache Line

CXL.mem grows address space

Cache Coherency problem

MESI states M E S I

Snoop requests SnpData SnpInv

CXL.cache coherent accelerator

PCIe lanes and GT per s

Bandwidth and Flex Bus

CXL runs on PCIe

CXL topic

Ise top-down padho: processor + memory ki plain picture do families mein split hoti hai — addressing/caching (left) aur physical wire (right) — aur dono ko samajhna zaroori hai before ki neeche CXL topic samajh aaye.


Equipment checklist

Khud test karo — aap parent note ke liye ready ho jab aap bina dekhe har sawaal ka jawab de sako.

Ek sentence mein address kya hai?
Memory mein ek mailbox/locker ka number jise processor data fetch karne ke liye naam leta hai.
Cache line kya hai aur aam taur pe kitna bada hota hai?
Memory ka ek fixed chunk (usually 64 bytes) jo memory aur cache ke beech ek unit ke roop mein move karta hai.
Golden coherency rule bolo.
Single-writer YA multiple-readers — same location ke kabhi do writers nahi.
M, E, S, I letters kiske liye stand karte hain?
Modified, Exclusive, Shared, Invalid.
Kaun si MESI state ka matlab hai "meri copy dirty hai aur memory khud stale hai"?
Modified (M).
Snoop kya karta hai?
Broadcast karta hai "kya tumhare paas yeh address hai, aur kis state mein?" taaki caches data hand over karein ya apne labels downgrade karein.
Ek PCIe lane kya hai, aur ×16 ka kya matlab hai?
Lane ek serial bit-stream hai; ×16 ka matlab hai 16 parallel lanes saath mein kaam kar rahe hain.
PCIe 5.0 lane sirf ~3.94 GB/s kyun hai jabki 32 GT/s hai?
Kyunki 128b/130b encoding har 130 bits mein se 2 bits packaging pe spend karti hai, aur 8 bits ek byte banate hain.
Teen CXL sub-protocols ke naam bolo aur kaun kiska memory cache karta hai.
CXL.io (plain PCIe), CXL.cache (accelerator CPU memory cache karta hai), CXL.mem (CPU device memory use karta hai).
Flex Bus / time-multiplexing kya achieve karta hai?
Yeh teeno sub-protocols ko same physical PCIe lanes share karne deta hai baaraa-baari le ke.