5.3.5 · D1 · HinglishAdvanced Microarchitecture

FoundationsReorder buffer (ROB)

2,141 words10 min read↑ Read in English

5.3.5 · D1 · Hardware › Advanced Microarchitecture › Reorder buffer (ROB)

Is page mein koi assumption nahi hai. Reorder buffer (ROB) padhne se pehle tumhare paas kuch words aur pictures honi chahiye. Hum har ek ko ground up se build karte hain, ek aisi order mein jahan har symbol use hone se pehle earn kiya ja chuka ho.


0. "Instruction" kya hota hai?

Hum instructions aise likhenge:

Isko padhein: "box ki value lo, box ki value se add karo, sum ko box mein rakho." Boxes ko registers kehte hain — unhe hum aage define karte hain.


1. Registers aur register file

Figure — Reorder buffer (ROB)

Figure dekho: register file sirf labelled cups ki ek row hai. cup ke andar ki value ko point karta hai. Jab ek program ek instruction ko sach mein "finish" karta hai, toh answer in cups mein se ek mein daal diya jaata hai — aur ek baar daal diya, toh woh permanent aur program ko visible ho jaata hai.

Register file ke contents ko hum architectural state kehte hain: woh state jo program ko honi chahiye. Related reading: Register-file-management.


2. Program order vs. execution order

Figure — Reorder buffer (ROB)

Figure mein, left column program order hai (I1, I2, I3, I4 upar se neeche). Right column mein hai jab har instruction finish hoti hai: dekho I3 pehle finish hoti hai kyunki woh fast hai, chahe woh teesre number par likhi gayi thi. Yahi mismatch ROB ke existence ki poori wajah hai — dekhein Speculative-execution aur Superscalar-processors yeh samajhne ke liye ki processors out of order finish karne ki taklif kyun uthate hain.


3. In-flight instructions


4. Ek instruction ki teen life stages

Har instruction teen named moments se guzarti hai. Teeno tumhein verbatim pata honi chahiye.

Yeh trio Instruction-retirement mein puri tarah aata hai aur parent note ki backbone hai.


5. Queue, FIFO, aur "circular"

ROB ek FIFO hai kyunki retirement program order mein honi chahiye — pehle issue, pehle retire.

Figure — Reorder buffer (ROB)

Figure mein slots ek ring ki tarah dikhaye gaye hain. Is ring par do arrows rehte hain:

Jaise instructions retire hoti hain, Head aage badhta hai. Jaise naye issue hote hain, Tail aage badhta hai. Dono ring ke around loop karte hain.


6. Ek hi math piece: modulo

Parent note mein mathematics se sirf ek hi symbol use hota hai — mod. Hum ise zero se define karte hain.


7. Full vs. empty

Do conditions decide karti hain ki ring kaam accept ya release kar sakti hai ya nahi.


8. Ek slot ki status

Ek completed instruction jo head par nahi hai use wait karna padega — uska answer ROB slot mein baitha hai, register file mein nahi. Yeh waiting hi in-order retirement ka essence hai.


9. Tag / physical register name


10. Prerequisite map

Instruction = one recipe line

Register and register file

Architectural state = official values

Program order vs execution order

In-flight instructions

Issue Execute Retire stages

FIFO queue

Circular buffer with Head and Tail

Modulo wrap-around counter

Full and empty conditions

Slot status pending completed exception

Tag = slot number as temporary name

Reorder Buffer

Har arrow ka matlab hai "target samajhne se pehle source samajhna zaroori hai." Poora graph Reorder buffer (ROB) node mein funnel hota hai. Downstream topics jo in foundations ko reuse karte hain inmein Precise-exceptions, Branch-prediction, Memory-ordering, aur Instruction-retirement shamil hain.


Equipment checklist

Self-test: kya tum reveal karne se pehle har ek ka jawab de sakte ho?

Ek program ki ek line ek instruction kya represent karti hai?
Ek chhota sa command, jaise "R2 aur R3 add karo, R1 mein store karo".
Register file kya hai?
Permanent named boxes ki shelf jo program ki official (architectural) values hold karti hai.
kya denote karta hai?
Box mein abhi stored number.
Program order vs execution order?
Program order = likha hua top-to-bottom order; execution order = woh order jisme instructions actually computing finish karti hain.
Ek instruction ki teen life stages ke naam batao, aur kaun si in-order hain.
Issue (in order), Execute (out of order), Retire/commit (in order).
FIFO ka full form kya hai aur ROB ise kyun use karta hai?
First In First Out; retirement program order follow karni chahiye, toh sabse purana pehle nikalta hai.
Head pointer kya point karta hai?
Sabse purani in-flight instruction, jo retire hone ki line mein agli hai.
Tail pointer kya point karta hai?
Agli free slot jahan newly issued instruction place hogi.
plain words mein kya hai?
ko se divide karne ke baad remainder — ek wrap-around clock counter.
compute karo.
— pointer slot 0 par wapas wrap ho jaata hai.
ROB ki empty condition?
.
ROB ki full condition?
(ek spacer slot hamesha empty rakha jaata hai).
Ek slot hamesha empty kyun rakhte hain?
Taaki full aur empty dono na padhen; spacer ambiguity door karta hai.
Teen slot statuses kya hain?
pending, completed, exception.
Ek completed instruction register file mein kyun nahi likh sakti abhi bhi?
Agar woh head par nahi hai, toh purani instructions abhi retire nahi hui hain; in-order commit isse forbid karta hai.
Tag kya hai?
ROB slot number jo ek in-progress result ke liye unique temporary naam ki tarah use hota hai.