Question: 3. Pipeline Performance and Stalls [30 marks] a) [15 marks] Consider the following code segment: daddi r5,r0,#3 lw r1,0(r3) dadd r6,r1,r5 lw r2,0(r4) dadd r7,r2,r5

3. Pipeline Performance and Stalls [30 marks]

a) [15 marks] Consider the following code segment:

daddi r5,r0,#3

lw r1,0(r3)

dadd r6,r1,r5

lw r2,0(r4)

dadd r7,r2,r5

Draw a space-time diagram of the code and show the cycle of the 'w' stage

of each 'dadd'. Indicate the number of stalls. Next, replace the m-box

with a pipelined 3-cycle m-box (drawn as three m-boxes). That is, assume

a 7-stage pipeline, viz., 'f d x m m m w'. Draw a space-time diagram of

the code and show the cycle of the 'w' stage of each 'dadd'. Indicate the

number of stalls. How many more stalls are there? How many more stalls

per instruction? Express the number of stalls as a function of the number

of m-boxes, i.e., the pipeline depth of the new m-box.

b) [15 marks] Consider the following code fragment:

loop: lw r1,0(r3)

lw r2,0(r4)

dadd r1,r1,r2

sw 0(r3),r1

daddi r3,r3,#4

daddi r4,r4,#4

dsub r6,r5,r3

bnez r6, loop

The loop iterates 90 times. Draw a space-time diagram of this code.

Calculate the total execution time of the loop.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!