Pipelining Flashcards
What is the maximum amount of stages in a pipeline ?
14 after that it is too complex
what are the stages of a pipeline cycle?
fetch decode execute
how do you calculate the time for
instruction execution?
non-pipelined fetch-decode-execute cycle, the time for
instruction execution is the sum of the stage times
With a pipelined fetch-decode-execute cycle, the rate of instruction execution is multiplied by the number of stages.
What are the ARM7 fetch-decode-execute cycle stages?
The ARM7 fetch-decode-execute cycle has 3 stages:
Fetch — read an instruction from memory;
Decode — identify the instruction;
Execute — carry out the instruction.
The performance gains through pipelining are limited by:
control hazards;
data hazards.
When do you have a control hazard?
when a branch instruction changes
the next instruction
How do you deal with a control hazard?
There are four ways to deal with it: ∙ stall the pipeline; ∙ assume branch not taken; ∙ branch prediction; ∙ branch delay slots
How does stalling a pipeline work?
By squashing instructions.
So the instructions are terminated and replaced with bubbles
What is the problem with stalling the pipeline?
It wastes time and power
How does assuming branch not taken work?
assumes branch not taken, squashing instructions if wrong.
How does assuming branch prediction work?
The processor may try branch prediction based on past
branches, squashing instructions if wrong.
What does branch delay mean?
branch delay slots are inserted after a branch. It gives the programmers time to solve the problem.
When do you have a data hazard?
when one instruction immediately uses
the result of another.
ARM7 3-stage pipeline does not exhibit data hazards.