Pipelining Flashcards
What is a pipeline stall?
When a pipelining steps fails and must be repeated, causing a stall in the instructions behind it, and a gap between it and the instruction ahead
What causes pipeline stalls?
Control dependencies and data dependencies
What are the types of data dependencies?
RAW (true), WAW, WAR
What is a WAW?
when two instructions write to the same register, the second one must be written second, otherwise subsequent reads to that address will see the wrong value
What is a WAR?
When an instruction writes over an address read by another instruction, the write must happen second
What is a hazard? Who causes them?
When a dependency in the pipeline can cause an incorrect execution. This is a property of the processor
Are dependencies hazards?
not necessarily, they are a property of the program.
What are our options when we detect a hazard?
- flush dependent instructions (control deps only)
- stall dependent instructions
- Fix values read by dependent instructions (“forward”, and doesn’t always work)
What is the relationship between number of stages and performance?
More stages == higher CPI (more hazards), but lower cycle time (less work per stage)