Operand forwarding
Operand forwarding (or data forwarding) is an optimization in pipelined CPUs to limit performance deficits which occur due to pipeline stalls.[1][2] A data hazard can lead to a pipeline stall 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 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.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
---|---|---|---|---|---|---|---|
Fetch ADD | Decode ADD | Read Operands ADD | Execute ADD | Write result | |||
Fetch SUB | Decode SUB | stall | stall | Read Operands SUB | Execute SUB | Write result |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|
Fetch ADD | Decode ADD | Read Operands ADD | Execute ADD | Write result | ||
Fetch SUB | Decode SUB | stall | Read Operands SUB: use result from previous operation | Execute SUB | Write result |
In some cases all stalls from such read-after-write data hazards can be completely eliminated by operand forwarding:[3][4][5]
1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|
Fetch ADD | Decode ADD | Read Operands ADD | Execute ADD | Write result | |
Fetch SUB | Decode SUB | Read Operands SUB: use result from previous operation | Execute SUB | Write result |
Technical realization
The CPU control unit must implement logic to detect dependencies where operand forwarding makes sense. A multiplexer can then be used to select the proper register or flip-flop to read the operand from.
See also
- Feed forward (control)
References
- ^ "CMSC 411 Lecture 19, Pipelining Data Forwarding". University of Maryland Baltimore County Computer Science and Electrical Engineering Department. Retrieved 2020-01-22.
- ^ "High performance computing, Notes of class 11". hpc.serc.iisc.ernet.in. September 2000. Archived from the original on 2013-12-27. Retrieved 2014-02-08.
- ^ Gurpur M. Prabhu. "Computer Architecture Tutorial". Sections "Forwarding". and "Data Hazard Classification".
- ^ Dr. Orion Lawlor. "Pipelining, Pipeline Stalls, and Operand Forwarding".
- ^ Larry Snyder. "Pipeline Review".
External links
- Introduction to Pipelining
- v
- t
- e
- Abstract machine
- Stored-program computer
- Finite-state machine
- with datapath
- Hierarchical
- Deterministic finite automaton
- Queue automaton
- Cellular automaton
- Quantum cellular automaton
- Turing machine
- Alternating Turing machine
- Universal
- Post–Turing
- Quantum
- Nondeterministic Turing machine
- Probabilistic Turing machine
- Hypercomputation
- Zeno machine
- Belt machine
- Stack machine
- Register machines
architectures
Types | |
---|---|
Instruction sets |
|
Instruction pipelining |
|
---|---|
Hazards | |
Out-of-order | |
Speculative |
Level |
|
---|---|
Multithreading | |
Flynn's taxonomy |
performance
- Transistor count
- Instructions per cycle (IPC)
- Cycles per instruction (CPI)
- Instructions per second (IPS)
- Floating-point operations per second (FLOPS)
- Transactions per second (TPS)
- Synaptic updates per second (SUPS)
- Performance per watt (PPW)
- Cache performance metrics
- Computer performance by orders of magnitude
- Central processing unit (CPU)
- Graphics processing unit (GPU)
- Vector
- Barrel
- Stream
- Tile processor
- Coprocessor
- PAL
- ASIC
- FPGA
- FPOA
- CPLD
- Multi-chip module (MCM)
- System in a package (SiP)
- Package on a package (PoP)
By application | |
---|---|
Systems on chip |
|
Hardware accelerators |
Functional units | |
---|---|
Logic | |
Registers | |
Control unit | |
Datapath | |
Circuitry |
management
This computer-engineering-related article is a stub. You can help Wikipedia by expanding it. |
- v
- t
- e