{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

3055q5c - Score Name ECE 3055 Quiz V Wednesday September 28...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Score: Name: ECE 3055 Quiz V, Wednesday, September 28 The program below is executed on the 5 stage pipelined MIPS described in chapter 6. Answer the following questions about this program. loop_top: lw $6,] 00($0) ori $6,$6,4 add $5,$7,$4 slt $7,$6,$3 beq $5,$4,foobar sw $7,200($0) foobar: or $8,$5,$7 addi $5,$S,6 lw $7,100($8) beq $8,$0,loop_top Assume the control unit does not have any hazard detection, forwarding, a new branch compare circuit, or automatic branch flushing, and that the register file will not write and then read a new register value in one clock cycle. Rewrite the code sequence by adding the minimum number of NOP instructions (do not reorder or change instructions) to eliminate all potential data and branch hazards. Assume other non-NOP instructions follow the last branch in the original code sequence above. 1 3’ Total number of NOPs required IW SW \4- ho hm'larok 0n fl”), roof 0 f‘ 11:"; to» all ' hop #3 SW does” no+ change if? or‘. o ORA l/l P 0 W3? EEC lUJ mop m J H “a befi, we]? no P n C )0 5— ‘1’? mop flCrJ Assume the control unit is improved by adding the hazard and forwarding unit as outlined in the text and the current lab assignment, adding a branch compare unit to the decode stage, and the register file writes then reads a new value in a single clock cycle. Determine the number of clock cycles required to complete the first loop execution (Le. executes code in loop and branches back to top of loop and is just ready to fetch 1w again) of the original code sequence. Assume the inner branch is taken. If there were no hazards or branch flushing, the original program would require 2 clock cycles for execution. (do not include the time to initially fill the pipeline alpawer up). 3 7) 1%: But this program will need to stall and/or flush the pipeline an additional 3 clock cycles so a total of i 2 clock cycles is required for execution (do not include the time to initially fill the pipeline). 2 + S‘ This program achieves an average CPI (clocks per instruction) of I . 3 3 .(do not include time rofill the pipeline )0 ' here) i 1/ j ...
View Full Document

{[ snackBarMessage ]}