Summary for H&P Ch. 3

Pipe stage/pipe segment: conceptual stage in a pipeline that does some amount of work on each instruction and eventually forwards the work to the next stage.

Machine cycle: The basic time quantum of the pipeline. The slowest pipe stage generally determines the machine cycle time.

Basic stages of DLX

Pipelining & Hazards

Pipeline registers/pipeline latches Latches that hold intermediate values generated by pipeline stages.

Structural hazard Conflicts between resources such as functional units.

Data hazard An instruction depends on a previous instruction in a way that is exposed by the overlapping of instructions in the pipeline.

Control hazard Branches and other instructions that modify the PC.

Bubble A pipeline stall

ForwardingTechnique to reduce data hazards in pipelines. A result from an earlier instruction is forwarded directly to the execution phase of a later instruction instead of waiting to write the result to the register file.

Data Hazards

For these examples, consider two instructions i and j, where i occurs before j in program order.

Pipeline interlock Control logic that stalls the pipeline to avoid a data hazard.

Pipeline scheduling/instruction scheduling The compiler schedules instructions to reduce the number of stalls.

Basic block A piece of code that has no control transfers except at the begining into it or at the end out of it.

Instruction issue When an instruction moves from the ID stage to the EX stage, it is said to have issued. Instructions can be stalled before issue if data hazards exist

Control Hazards

Branch delay The length of a control hazard.

Reducing pipeline branch penalties

Cancelling branch If the branch is correctly predicted, the instruction(s) in the delay slot are executed. If not correctly predicted, the instruction(s) are nullified.

Static branch prediction Using compile-time information to predict the outcome of a branch. Generally two approaches are used: prediction based on the type of branch (predict all backward branches will be taken and all forward branches will not be taken) or prediction using profiled data.

Exceptions

Characterizations of exceptions:

Restartable The pipeline is able to handle the exception, save its state, and restart the program without affecting the execution of the program.

Precise exceptions The pipeline can be stopped so that the instructions just before the faulting instruction are completed and those after it can be restarted from scratch. Integer piplelines are usually precise in modern processors, while FP pipelines can switch between precise (slow) and imprecise (fast).

Extending DLX to include FP operations

Latency The number of cycles before the result of one instruction is available to another instruction.

Repeat interval the number of cycles that must elapse between issuing two operations of the same type.