In this problem, we will explore how deepening the pipeline affects performance in two ways: faster clock cycle and increased stalls due to data and control hazards. Assume that the original machine is a 5-stage pipeline with a 1 ns clock cycle. The second machine is a 12-stage pipeline with a 0.6 ns clock cycle. The 5-stage pipeline experiences a stall due to a data hazard every five instructions, whereas the 12-stage pipeline experiences three stalls every eight instructions. In addition, branches constitute 20% of the instructions, and the misprediction rate for both machines is 5%.

a. What is the speedup of the 12-stage pipeline over the 5-stage pipeline, taking into account only data hazards?

b. If the branch mispredict penalty for the first machine is 2 cycles but the second machine is 5 cycles, what are the CPIs of each, taking into account the stalls due to branch mispredictions?

Respuesta :

Answer:

a) the speed up is 1.45

b) the speed up is 1.42

Explanation:

Given

5 stage pipeline = 1 ns clock cycle

12 stage pipeline = 0.6 ns clock cycle

a) The speed up is

[tex]speed-upx_{pipeline} =\frac{CPI_{unpipelined} }{CPI_{pipelined} } (\frac{cycle-time_{unpipelined} }{cycle-time_{pipelined} } )[/tex] (eq. 1)

The CPIpipelined is

[tex]CPI_{pipelined} =CPI_{ideal} +average-stall-cycle/instructions[/tex] (eq. 2)

The execution time is

[tex]execution-time=instruction*CPI_{pipelined} *cycle-time_{unpipelined}[/tex] (eq. 3)

The CPI for 5-stage pipeline is

CPI = 6/5

cycle time = 1 s

The CPI for 12-stage pipeline is

CPI = 11/8

cycle time = 0.6 s

Replacing values in equation 1

[tex]speed-up_{pipeline} =\frac{I*\frac{6}{5}*1 }{I*\frac{11}{8}*0.6 } =\frac{1.2}{1.375*0.6} =1.45[/tex]

b) The equation for CPI instruction in 5-stage is

[tex]CPI_{5} =CPI_{time} +instructions-of-5-stage*cycletime*number-of-cycles=\frac{6}{5} +(\frac{20}{100} )*0.05*2=1.22[/tex]

For CPI instruction in 12-stage is

[tex]CPI_{12} =\frac{11}{8} +(\frac{20}{100} )*0.05*5=1.43[/tex]

The speed up is using the equation 1

[tex]speed-up=\frac{1*1.22*1}{1*1.43*0.6} =1.42[/tex]

ACCESS MORE
EDU ACCESS
Universidad de Mexico