110 likes | 240 Views
CDA 3101 Discussion Section 09. Pipelining(2). Question 1. Identify all of the data dependencies and necessary forwarding in the following code. No branch prediction, No Delayed Slot. addi $t1,$0,0 addi $t2,$0,100 LOOP: lw $t4, 200($t2) add $t1, $t1, $t4 addi $t2, $t2, -4
E N D
CDA 3101 Discussion Section 09 Pipelining(2)
Question 1 Identify all of the data dependencies and necessary forwarding in the following code. No branch prediction, No Delayed Slot. addi $t1,$0,0 addi $t2,$0,100 LOOP: lw $t4, 200($t2) add $t1, $t1, $t4 addi $t2, $t2, -4 bne $t2, $0,LOOP
Question 2 Rewrite the following code with delay slot: addi $t1,$0,0 addi $t2,$0,100 LOOP: lw $t4, 200($t2) add $t1, $t1, $t4 addi $t2, $t2, -4 bne $t2, $0,LOOP
Question 2 Rewrite the following code with delay slot: addi $t1,$0,0 addi $t2,$0,100 LOOP: lw $t4, 200($t2) addi $t2, $t2, -4 bne $t2, $0,LOOP Delay Slot: add $t1, $t1, $t4
Question 3 • Assume we have 10 branch outcomes as{T T T NT T T T NT NT T} , simulate the sequence on: • 1-Bit predictor: (assume the original state is predict_bit =0) • 2-Bit predictor: (assume the original state is predict_bit =01(weakly not taken)