请输入您要查询的百科知识:

 

词条 Pipeline stall
释义

  1. Examples

     Timeline  Classic RISC pipeline 

  2. See also

  3. References

{{refimprove|date=August 2012}}

In the design of pipelined computer processors, a pipeline stall is a delay in execution of an instruction in order to resolve a hazard.[1]

During the decoding stage, the control unit will determine if the decoded instruction reads from a register that the instruction currently in the execution stage writes to. If this condition holds, the control unit will stall the instruction by one clock cycle. It also stalls the instruction in the fetch stage, to prevent the instruction in that stage from being overwritten by the next instruction in the program.

To prevent new instructions from being fetched when an instruction in the decoding stage has been stalled, the value in the PC register and the instruction in the fetch stage are preserved to prevent changes. The values are preserved until the instruction causing the conflict has passed through the execution stage.[2] Such an event is often called a bubble, by analogy with an air bubble in a fluid pipe.

In some architectures, the execution stage of the pipeline must always be performing an action at every cycle. In that case, the bubble is implemented by feeding NOP ("no operation") instructions to the execution stage, until the bubble is flushed past it.

Examples

Timeline

The following is two executions of the same four instructions through a 4-stage pipeline but, for whatever reason, a delay in fetching of the purple instruction in cycle #2 leads to a bubble being created delaying all instructions after it as well.

Normal execution Execution with a bubble

Classic RISC pipeline

{{see|Classic RISC pipeline#Hazards}}

The below example shows a bubble being inserted into a classic RISC pipeline, with five stages (IF = Instruction Fetch, ID = Instruction Decode, EX = Execute, MEM = Memory access, WB = Register write back). In this example, data available after the MEM stage (4th stage) of the first instruction is required as input by the EX stage (3rd stage) of the second instruction. Without a bubble, the EX stage (3rd stage) only has access to the output of the previous EX stage. Thus adding a bubble resolves the time dependence without needing to propagate data backwards in time (which is impossible).

Bypassing backwards in timeProblem resolved using a bubble

See also

  • Branch predication
  • Delay slot
  • Pipeline flush
  • Wait state

References

1. ^{{citation | title= Computer Organization and Design | edition= 4 | last1= Patterson | first1= David A. | last2= Hennessey | first2= John L. | publisher= Morgan Kaufmann | page=338 }}
2. ^{{citation | title= Computer Organization and Design | edition= 4 | last1= Patterson | first1= David A. | last2= Hennessey | first2= John L. | publisher= Morgan Kaufmann | page=373 }}
{{CPU technologies}}

1 : Instruction processing

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/21 1:32:36