One CPU manufacturer proposed the 10-stage pipeline below for a 500MHz (2ns cloc
ID: 3781007 • Letter: O
Question
One CPU manufacturer proposed the 10-stage pipeline below for a 500MHz (2ns clock cycle) machine Here are the correspondences between this and the MIPS pipeline: Instructions are fetched in the FET stage Register reading is performed in the REG stage. ALU operations and memory access are both done in the EXE stage. Branches are resolved in the DET stage. WRB is the write back stage. How much time is required to execute one million instructions on this processor, assuming there are no dependencies or branches in the code? (3%) Without forwarding, how many Assume that the register file could be written and read in the same clock cycle. What is this hazard called? (3%) If a branch is mispredicted, how many instructions would have to be flushed from the (3%) pipeline? Assume that a program executes one million instructions. Of these, 15% are load instructions which stall, and 10% of the instructions are branches. The CPU predicts branches correctly 75% of the time, How much time will it take to execute this program?Explanation / Answer
5 (A)
Cycles to fill pipeline = 9
Total Instructions = 1,000,000
So total cycles needed = 1,000,000 + 9 = 1000009
Time taken = 1000009*2ns = 2000018 ns.
5 (B)
The instruction lw will store result into $t0 only from WRB stage onwards and is required by next ADD instruction in its REG stage.
So total of 2 stall cycles will be needed
lw IPG FET ROT EXP REN WLD REG EXE DET WRB
add IPG FET ROT EXP REN WLD REG EXE DET WRB
5 (C)
Branches are resolved only in DET stage (stage 9) at which point there will be 8 instruction in pipeline and all might have to be flushed on a misinterpreted branch.
5 (D)
From part (A) number of cycles when all goes well is 1,000,009
Now 25 % are misdirected branch causing extra cycles = (1000000*25/100)*8 = 2,000,000
Also each stalled instruction cause 2 cycles meaning total of = ((1000000*15)/100)*2 = 300000
Total cycles = 1,000,009+2,000,000+300,000 = 3,300,009
Time = 6,600,018 ns
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.