these slides explains hazards in instruction pipeline. Types of hazards and how to avoid it.
Size: 217.1 KB
Language: en
Added: Aug 17, 2021
Slides: 9 pages
Slide Content
Hazards in Pipeline
Prepared by : Ms. Snehalata Agasti
CSE department
Hazards
Hazards means problem occurs in instruction pipeline (or) if two or more
microoperations occurred at same time than hazards occurs.
It isofthreetypes.
-Data hazards
-Control hazards
-Structural hazards
e.g. multiple instructions wants to access single ALU or memory. These are
called stall in pipeline.
➢Hazards can be avoided by using operand forwarding, renaming , branch
prediction technique or by introducing some stall cycles.
Structural hazards
Structural hazards occurs when more than one instructions in pipeline and
they need same resource.
It is also known as resource hazards.
This problemcanbesolvedbyincreasingtheresources.
F D W
F D W
F D W
t
0 t
1 t
2
I
1
I
2
I
3
Both micro
operations need
memory
operations
Control hazards
Whenbranchinstructionisexecutedandsomewrongpredictionshappened
thensomeinstructionsbroughtintopipeliningcanbediscarded,thatis
calledcontrolhazards/branchhazards.E.g.
100:gotolb:
101:Instruction1;
102:Instruction2;
103:Instruction3;
104lb:
Instruction4;
Byusingbranchpredictionsorbyincreasinglatency,controlhazardscanbe
avoided.
Instruction1 and
Instruction2 is
loaded in pipeline
Wrong
prediction
Data hazards
When data dependency is present in instructions that is called data hazards.
Data is modified in different stages.
It isofthreetypes
-RAW
-WAR
-WAW
E.g.instruction-1: C=A+B;
instruction-2: E=C+D
Data hazards can be avoided by using Operand forwarding.