Background
Laundry Example
RISC Pipelines
Pipelining Hazards
Examples
© 2004
|
|
Pipelining Hazards
Data Hazards
A major effect of pipelining is to change the relative timing of
instructions by overlapping their execution.
This introduces data and control hazards. Data hazards occur when the
pipeline changes the order of read/write accesses to operands so that the
order differs from the order seen by sequentially executing instructions on
the unpipelined machine.
- Forwarding - Reduces the effective pipeline latency so that the
certain dependencies do not result in hazards
- Data Hazards Classification (Consider two instructions i and j, with i
occurring before j.) The possible data hazards are:
- RAW (read after write) - j tries to read a source before i writes
it, so j incorrectly gets the old value.
- WAW (write after write) - j tries to write an operand before it is
written by i. The writes end up being performed in the wrong order,
leaving the value written by i rather than the value written by j in the
destination.
- WAR (write after read) - j tries to write a destination before it is
read by i , so i incorrectly gets the new value.
- Pipeline Scheduling - rearranging instructions in order to avoid
hazards
←BACK
Control Hazards
NEXT Examples
→ |