5.2.12 · D1 · HinglishProcessor Datapath & Pipelining

FoundationsPrecise exceptions in pipelines

2,176 words10 min read↑ Read in English

5.2.12 · D1 · Hardware › Processor Datapath & Pipelining › Precise exceptions in pipelines

Is page par yeh maana jaata hai ki aapko kuch nahi pata. Isse pehle ki hum "precise exceptions" ki baat karein (the parent topic), hume har woh word aur symbol banana hoga jo woh topic aap par phenkhta hai. Hum order mein jaenge — har idea sirf pehle se define kiye gaye ideas use karta hai.


1. Instruction kya hota hai

Hum instructions ko kahenge — subscript sirf unki program order mein position hai (jis order mein likhe gaye hain). , ke baad aur se pehle aata hai. Yahi ordering is poore page par sabse important idea hai; ise pakde rakho.


2. Architectural state — "official" picture

Figure — Precise exceptions in pipelines

Figure s01 dekho: blue cups architectural state hain (visible), grey scratch pad mein temporary results hain jo program nahi dekh sakta. Ek instruction tabhi "count" hota hai jis pal uska result grey se blue mein cross karta hai.


3. Stages — ek instruction ko steps mein kaatna

Ek instruction execute karna instant nahi hota. Hum kaam ko 5 stages mein todte hain, har ek alag hardware piece karta hai:

Notice karo: WB last hai, aur WB wahi hai jahan "official score" move hota hai. Parent note ka har mechanism really WB ko control karne ke baare mein hai.

Stages par prerequisite depth 5.2.1-Pipelining-basics mein hai.


4. Pipelining — instructions overlap kyun karte hain

Figure — Precise exceptions in pipelines

Figure s02 poore subject ka core diagram hai. Time left se right chalti hai. Har row ek instruction hai; har coloured block ek stage hai. Ek vertical slice (ek clock cycle) padho aur tum paanch alag instructions ko paanch alag stages mein simultaneously dekhte ho.

Ab s02 mein Cycle 5 marked vertical dashed line ko dekho:

Yahi woh snapshot hai jo parent note use karta hai. Is ke baad sab kuch yeh hai: kya hoga agar yahan blast kare?


5. Exception — "kuch galat ho gaya" event

Handler apna kaam karne ke liye ek clean, believable machine dekhna chahta hai — jaise program ek ek instruction chalata gaya ho aur exactly culprit par ruka ho. Woh clean view produce karna hi precise ki definition hai.


6. PC aur EPC — bookmarks


7. Precise vs imprecise — punchline picture

Ab hum finally topic precisely state kar sakte hain.

Figure — Precise exceptions in pipelines

Figure s03 mein fault karne ke baad ka target state dikhta hai. Green instructions () done hain. Red wale () erase hain — jaise kabhi chale hi nahi. "Done" aur "never happened" ke beech ek clean dividing line hai, koi half-finished instruction uss par straddling nahi kar raha. Wahi clean line precision hai.


8. Bubble / NOP — eraser


9. In-order vs out-of-order, aur Reorder Buffer

Overlapping instructions ke beech WB se pehle flow hone wala data forwarding se handle hota hai — yahan mention kiya taaki aapko pata ho woh hidden scratch values kahan se aati hain.


Yeh sab topic ko kaise feed karta hai

Instruction and program order

Architectural state

Five stages IF ID EX MEM WB

Pipelining overlap

Out of order completion problem

Exception event

Handler needs clean state

Precise exception goal

PC and EPC bookmarks

Bubble and flush eraser

ROB commit in order

Speculation bit

Precise exceptions in pipelines

Har box ek term hai jo ab aapke paas hai. Parent note simply unhe combine karta hai.


Equipment checklist

Right side cover karo aur khud se test karo. Agar koi bhi jawab surprise kare, woh section dobara padho.

mein subscript ka kya matlab hai?
Program order mein uski position — teen waan instruction hai jaise likha gaya hai.
Kaunsa single pipeline stage architectural state change karta hai?
WB (Write Back) — kuch bhi official nahi hota WB tak.
Architectural state ko ek line mein define karo.
Registers aur memory jo program dekhne ki ijazat rakhta hai; "official score."
Overlapping pipeline stages precision ko kyun threaten karte hain?
Out-of-order completion — ek younger instruction ek older se pehle khatam ho sakti hai, ek straddling done/not-done line deti hai.
Precise exception ki teen guarantees kya hain?
Earlier instructions fully done, faulting-aur-baad waale kuch nahi change karte, EPC culprit par point karta hai.
EPC kya store karta hai aur kyun?
Faulting instruction ka PC, taaki hume crime scene pata ho aur handler ke baad resume kahan karna hai.
Bubble / NOP yahan kis liye use hota hai?
Ek eraser — ek instruction ko NOP mein flush karna taaki woh harmlessly WB tak pahunche, koi state change na kare.
Reorder Buffer mein "commit" kya hai?
Woh in-order moment jab ek result hidden ROB se official architectural state mein move hota hai.
Speculation bit kuch faults ignore karne deta hai kyun?
Galat guess wali instruction kabhi chalni hi nahi chahiye thi, isliye flush hone par uska exception discard ho jaata hai.