Pipelining Flashcards
1
Q
What are the 3 kinds of pipeline hazards?
A
- Structural
- Data
- Control
2
Q
Explain structural hazards and give 2 solutions.
A
Simultaneous use of a hardware resource
- Stall the pipeline
- Use separate memory (Instruction/Data)
3
Q
What is RAW? (Data Dependency)
A
Read-After-Write.
- Occurs when a later instruction reads from the destination register in an earlier instruction.
add $2, $1, $3
add $4, $2, $1
Solution:
Using data forwarding.
4
Q
What is Control Dependency? What are the 3 solutions?
A
An instruction j that is control dependent on i if i controls whether or not j executes. (typically a branch instruction)
beq $3, $5, label
add $1, $2, $4
Solutions:
- Early branching (decision made in stage 2)
- Branch prediction (Fetches the next instruction)
- Delayed branching