• retagged by
879 views
0 0 votes
What is the idea behind introducing pipeline stalls ?

On getting some instructions and stages How can one construct pipeline cycle

Eg:

I1 : LOAD R0,loc
I2  : ADD r0,r0

I3 : Add r2 , r0

Stages

Instruction Fectch
Instruction Decode
Execute
Memory Access
Write Back

1 Answer

Best answer
0 0 votes
That's the simplest way to take care of dependency. For pipeline to run without any problem for any instruction, it should not have any dependency with 'k' neighboring instructions where 'k' is the number of pipeline stages. If there is a dependency from ith stage to jth stage (i < j), j-i-1 delay slots (pipeline stalls during these) are introduced so that ith stage eventually gets the required data from jth one.

 

For the given code, I2 depends on I1 for R0. More specifically ID stage (during which register is read) of I1 depends on WB stage of I0. So, (5 - 2 -1) = 2 delay slots are needed.

I3 also depends on I2. More specifically ID stage depends on WB stage (when registers are updated) of I2. So, again 2 delay slots are needed.

If we can do operand forwarding- where the required data is directly passed from a stage to a stage of new instruction, we can avoid stalls in many cases. For this example, we can pass data from Memory Access Stage to EX stage for I1-I2 (this still requires 1 delay) and from the output of EX stage of I2 to EX stage of I3 (no more stalls required).
• selected by
Position:
Show:

Related questions

0 0 votes
0 0 answers
751
751 views
Na462 asked Mar 12, 2018
751 views
I am very Confused to how to calculate Delay SLOTS in a given Pipeline.Can anybody explain the technique for finding the number of delay slots and Stalls in A pipelined p...
80 80 votes
11 answers 11 answers
34.1k
34.1k views
go_editor asked Sep 28, 2014
34,111 views
Consider a $6$-stage instruction pipeline, where all stages are perfectly balanced. Assume that there is no cycle-time overhead of pipelining. When an application is exec...
200 200 votes
9 answers 9 answers
79.3k
79.3k views
Kathleen asked Sep 22, 2014
79,322 views
A $5$ stage pipelined CPU has the following sequence of stages:IF – instruction fetch from instruction memoryRD – Instruction decode and register readEX – Execute: ALU op...
74 74 votes
4 answers 4 answers
36.1k
36.1k views
Kathleen asked Sep 12, 2014
36,077 views
Which of the following are NOT true in a pipelined processor?Bypassing can handle all RAW hazardsRegister renaming can eliminate all register carried WAR hazardsControl h...