Pa9 35522
Pa9 35522
Pa9 35522
Exercise 9-1
Consider the following code segment in MIPS:
lw $t1 , 0( $t0 )
lw $t2 , 4( $t0 )
add $t3 , $t1 , $ t 2
sw $t3 , 12( $t0 )
lw $t4 , 8( $t0 )
add $t5 , $t1 , $ t 4
sw $t5 , 16( $t0 )
a) What is the equivalent C code segment for the above program assuming all variables are in memory
and are addressable as offsets from $t0.
b) What is the problem with the above MIPS code that causes pipeline stalls? Propose a solution that
avoids any pipeline stalls.
Exercise 9-2
The 5 stages of the processor have the following latencies:
Assume that when pipelining, each pipeline stage costs 20ps extra for the registers between the pipeline
stages.
1
• LW: 12%
• SW: 13%
Assuming there are no stalls or hazards, what is the utilization of the data memory? What is the
utilization of the register block’s write port?
- Utilization in percentage of clock cycles used
Exercise 9-3
The critical path latencies for the 6 major blocks in a simple processor are given below:
a) What is the critical path for a MIPS SUB instruction? Justify your answer.
b) If the number of registers is doubled, this increases Regs by 50ps. This results in 20% fewer in-
structions due to fewer load/stores. What is the new critical path for a MIPS SUB instruction?
Why?