Hazards Flashcards
Occurs when 2 instructions need the same HARDWARE RESOURCE at the same time
Structural hazards
3 approaches in resolving structural hazards
Schedule
Stall
Duplicate hardware
Programmer explicitly avoids scheduling instructions that would create structural hazards
SCHEDULE
Addition of HARDWARE COMPONENTS that STALLS until earlier instructions are no longer using a resource
Stall
Add more hardware so that instructions can independently access the resources at the same time
Duplictae
Occurs when one instruction depends on a data value produced by a preceding instruction still in the pipeline
Data hazard
Approaches to resolve data hazard
Schedule
Stall
Speculate
Bypass
In resolving data hazards, you put in the intsruction nop / no operation
Schedule
In data hazards, this includes control logic that freezes earlier stage until oreceeding instruction has finished producing data
Stall
In data hazard, this allows values to be sent to an earlier stage before preceding instruction has left the pipeline
Bypass
In data hazard, peform operation that may not necessarily be needed
Speculate
Occur when execution of an instruction depends on a CONTROL DECISION made by an earlier instruction
Control hazard
What do we need to calculate next PC for jumps
OPCODE OFSET PC
What do we need to calculate next PC for jump registers
OPCODE & REGISTER VALUE
What do we need to calculate next PC for conditional branches
OPCODE, REGISTER, OFFSET, PC