Maano instruction I ko operands src1,src2 chahiye. Har operand ya toh:
Ready hai: value reservation station mein hai
Waiting hai: producer instruction Pj ke tag ke saath
Ready(I)=Ready(src1)∧Ready(src2)
Jab producer Pj complete hota hai, woh CDB par (tag: Pj, value: V) broadcast karta hai. Sare reservation stations CDB snoop karte hain aur:
∀I:(srci=Pj)⇒(srci←V,Ready(srci)←true)
Broadcast kyun? Multiple instructions ek hi result ka wait kar sakti hain. Sare stations ko parallel mein broadcast karna sequential wakeup delays se bachata hai.
OoOE multi-core ke saath kaise interact karta hai:
Har core ka OoOE engine single-threaded illusion maintain karta hai. Lekin caches shared/coherent hain. Memory consistency model define karta hai ki kaunse reorderings cores ke beech visible hain.
x86 TSO ke liye, allowed aur forbidden reorderings yeh hain:
Loads older loads ke saath reorder NAHI hote (Load→Load order preserved)
Loads alag address par older stores ko pass KAR SAKTE hain (Store→Load reordering allowed; yeh woh ek relaxation hai jo TSO permit karta hai)
Stores older stores ke saath reorder NAHI hote (Store→Store order preserved, commit par enforce hota hai)
Stores older loads ke saath reorder NAHI hote (Load→Store order preserved)
Yeh rules kyun? Performance balance karna (common Store→Load relaxation ko store buffer ke through allow karna) vs. programmer sanity (baaki jagah intuitive ordering preserve karna).
ILP wall: typical programs mein average ~2-3 independent instructions per cycle hoti hain. Perfect OoOE bhi is limit ko hit karta hai. Modern CPUs ise compensate karte hain:
Socho tum homework kar rahe ho 5 problems ke saath. Problem 1 ke liye library se ek book chahiye (tumhare parent 10 minute mein laayenge). Problem 2, 3, 4 easy math hai jo tum abhi kar sakte ho. Problem 5 ko problem 1 ka answer chahiye.
Buri strategy (in-order): Problem 1 ka wait karo (10 min), karo, phir 2, 3, 4, phir 5. Total: 10 + 1 + 1 + 1 = 14 minutes.
Tum 3× faster finish karte ho! CPU bhi yahi karta hai: slow memory ka wait karte waqt ("library book"), woh dusri instructions par kaam karta hai ("easy math"). Final answers sahi order mein rakhta hai taaki teacher (programmer) ko kabhi pata na chale ki tumne out-of-order kiya.
In-order instructions ko strictly program order mein execute karta hai, dependencies par stall karta hai. Out-of-order execution ko dynamically reorder karta hai taaki instructions tab issue hon jab operands ready hon, saath mein correct architectural state ke liye in-order commit maintain karta hai.
Teen types ke hazards kya hain, aur register renaming kaun se eliminate kar sakta hai?
RAW (Read-After-Write) = true dependency, eliminate nahi ho sakta. WAR (Write-After-Read) aur WAW (Write-After-Write) = false dependencies jo register reuse se hoti hain, alag physical registers par rename karke eliminate ho jaati hain.
Reorder buffer (ROB) ka purpose kya hai?
ROB in-order commit maintain karta hai chahe execution out-of-order ho. Yeh precise exceptions enable karta hai fault ke baad speculative instructions flush karke, aur ensure karta hai ki architectural state program order mein update ho.
Ek reservation station ko kaise pata chalta hai ki instruction execute ke liye ready hai?
Ek instruction ready hoti hai jab sab source operands ya toh (1) values ke saath already present hain, ya (2) unke producer tags Common Data Bus (CDB) par broadcast ho chuke hain. Station CDB snoop karta hai aur results aane par operands update karta hai.
x86 TSO ke under, kaun sa ek reordering allowed hai?
Sirf alag addresses par Store→Load reordering: ek load ek older store ko alag address par pass kar sakta hai (store buffer ke through). Load→Load, Store→Store, aur Load→Store orderings sab preserve hote hain.
Infinite instruction window size ke saath bhi IPC scaling ko kya limit karta hai?
Critical path (longest dependency chain) aur Amdahl's law. Programs mein data dependencies ki wajah se limited instruction-level parallelism hoti hai, isliye unlimited resources bhi serial bottlenecks ko parallelize nahi kar sakta. Typical saturation IPC ≈ 2-4 par hoti hai.