Overcoming
Data Hazards with Dynamic Scheduling:
The
Dynamic Scheduling is used handle some cases when dependences are unknown at a
compile time. In which the hardware rearranges the instruction execution to
reduce the stalls while maintaining data flow and exception behavior.
It
also allows code that was compiled with one pipeline in mind to run efficiently
on a different pipeline. Although a dynamically scheduled processor cannot
change the data flow, it tries to avoid stalling when dependences, which could
generate hazards, are present.
Dynamic
Scheduling:
A
major limitation of the simple pipelining techniques is that they all use in
-order instruction issue and execution: Instructions are issued in program
order and if an instruct ion is stalled in the pipeline, no later instructions
can proceed. Thus, if there is a dependence between two closely spaced
instructions in the pipeline, this will lead to a hazard and a stall. If there
are multiple functional units, these units could lie idle. If instruction j depends
on a long-running instruction i, currently in execution in the pipeline,
then all instructions after j must be stalled until i is finished
and j can execute. For example, consider this code:
DIV.D
F0,F2,F4 ADD.D F10,F0,F8 SUB.D F12,F8,F14
Out-of-order
execution introduces the possibility of WAR and WAW hazards, which do not exist
in the five-stage integer pipeline and its logical extension to an in-order
floating-point pipeline.
Out-of-order
completion also creates major complications in handling exceptions. Dynamic
scheduling with out-of-order completion must preserve exception behavior in the
sense that exactly those exceptions that would arise if the program were
executed in strict program order actually do arise.
Imprecise
exceptions can occur because of two possibilities:
1.
The pipeline may have already completed instructions that are later in
program order than the instruction causing the exception, and