Download presentation

Presentation is loading. Please wait.

Published byJulio Youngman Modified over 2 years ago

1
1 Pipelining(2) CDA 3101 Discussion Section 09

2
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

3
3 Question 1 InstructionCC1CC2CC3CC4CC5CC6CC7CC8CC9CC 10 addi $t1,$0,0 IFIDEXMEMWB addi $t2,$0,100 IFIDEXMEMWB lw $t4, 200($t2) IFIDEXMEMWB add $t1, $t1, $t4 IFIDEXMEMWB addi $t2, $t2, -4 IFIDEXMEMWB bne $t2, $0,LOOP IFID

4
4 Question 1(cont) InstructionCC8CC9CC 10 CC 11 CC 12 CC 13 CC 14 CC 15 CC 16 CC 17 bne $t2, $0,LOOP IFID lw $t4, 200($t2) IFIDEXMEMWB add $t1, $t1, $t4 IFIDEXMEMWB addi $t2, $t2, -4 IFIDEXMEMWB bne $t2, $0,LOOP IFID

5
5 Question 1(cont) InstructionCC 15 CC 16 CC 17 CC 18 CC 19 CC 20 CC 21 CC 22 CC 23 CC 24 bne $t2, $0,LOOP IFID lw $t4, 200($t2) IFIDEXMEMWB add $t1, $t1, $t4 IFIDEXMEMWB addi $t2, $t2, -4 IFIDEXMEMWB bne $t2, $0,LOOP IFID

6
6 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

7
7 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

8
8 Question 2 InstructionCC 1 CC 2 CC 3 CC 4 CC 5 CC 6 CC 7 CC 8 CC 9 CC 10 CC 11 CC 12 addi $t1,$0,0 IFIDEXME M WB addi $t2,$0,10 0 IFIDEXME M WB lw $t4, 200($t2) IFIDEXME M WB addi $t2, $t2, -4 IFIDEXME M WB bne $t2, $0,LOOP IFID add $t1, $t1, $t4 IFIDEXME M WB lw $t4, 200($t2) IFIDEXME M WB

9
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) 9

10
1-Bit predictor 10 OutcomePredict bit(before ) PredictionPrediction bit (after) T0NTWrong1 T1TRight1 T1T 1 NT1TWrong0 T0NTWrong1 T1TRight1 T1T 1 NT1TWrong0 NT0 Right0 T0NTWrong1

11
2-Bit predictor 11 OutcomePredict bit(before ) PredictionPrediction bit (after) T01NTWrong11 T TRight11 T TRight11 NT11TWrong10 T TRight11 T TRight11 T TRight11 NT11TWrong10 NT10TWrong00 T NTWrong01

Similar presentations

OK

Comp Sci 251 -- pipelining 1 Ch. 13 Pipelining. Comp Sci 251 -- pipelining 2 Pipelining.

Comp Sci 251 -- pipelining 1 Ch. 13 Pipelining. Comp Sci 251 -- pipelining 2 Pipelining.

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google