Operand forwarding (or data forwarding) is an optimization in
pipelined CPUs to limit performance deficits which occur due to
pipeline stall
In the design of pipelined computer processors, a pipeline stall is a delay in execution of an instruction in order to resolve a hazard.
Details
In a standard five-stage pipeline, during the decoding stage, the control unit will determine whe ...
s. A
data hazard
In the domain of central processing unit (CPU) design, hazards are problems with the instruction pipeline in CPU microarchitectures when the next instruction cannot execute in the following clock cycle, and can potentially lead to incorrect compu ...
can lead to a
pipeline stall
In the design of pipelined computer processors, a pipeline stall is a delay in execution of an instruction in order to resolve a hazard.
Details
In a standard five-stage pipeline, during the decoding stage, the control unit will determine whe ...
when the current operation has to wait for the results of an earlier operation which has not yet finished.
Example
ADD A B C #A=B+C
SUB D C A #D=C-A
If these two
assembly
Assembly may refer to:
Organisations and meetings
* Deliberative assembly, a gathering of members who use parliamentary procedure for making decisions
* General assembly, an official meeting of the members of an organization or of their representa ...
pseudocode instructions run in a pipeline, after fetching and decoding the second instruction, the pipeline stalls, waiting until the result of the addition is written and read.
In some cases all stalls from such read-after-write data hazards can be completely eliminated by operand forwarding:
[
Larry Snyder]
"Pipeline Review"
Technical realization
The CPU
control unit
The control unit (CU) is a component of a computer's central processing unit (CPU) that directs the operation of the processor. A CU typically uses a binary decoder to convert coded instructions into timing and control signals that direct the op ...
must implement logic to detect dependencies where operand forwarding makes sense. A
multiplexer
In electronics, a multiplexer (or mux; spelled sometimes as multiplexor), also known as a data selector, is a device that selects between several analog or digital input signals and forwards the selected input to a single output line. The sel ...
can then be used to select the proper
register
Register or registration may refer to:
Arts entertainment, and media Music
* Register (music), the relative "height" or range of a note, melody, part, instrument, etc.
* ''Register'', a 2017 album by Travis Miller
* Registration (organ), th ...
or
flip-flop to read the operand from.
See also
*
Feed forward (control)
A feed forward (sometimes written feedforward) is an element or pathway within a control system that passes a controlling signal from a source in its external environment to a load elsewhere in its external environment. This is often a command ...
References
External links
Introduction to Pipelining
Instruction processing
{{Comp-eng-stub