[理工] [計組] forwarding signal
問題:(張凡老師課本下冊p39練習)
Problems in this exercise refer to the following sequences of instructions,and
assume that it is executed on a five-stage pipelined datapath:
----------------------------------------------------
| Instruction sequence |
----------------------------------------------------
| | lw $1,40($6) | | add $1,$5,$3 |
| | add $2,$3,$1 | | sw $1,0($2) |
|a.| add $1,$6,$4 |b.| lw $1,4($2) |
| | sw $2,20($4) | | add $5,$5,$1 |
| | and $1,$1,$4 | | sw $1,0($2) |
|---------------------------------------------------
(4)If there is forwarding, for the first five cycles during the execution of
this code,specify which signals are asserted in each cycle by hazard
detection and forwarding units.
解答:
The outputs of the hazard detection unit are PCWrite,IF/IDWrite,and
ID/EXZero.IF/IDWrite is always equal to PCWrite,and ID/EXZero is always
the opposite of PCWrite. We will only show the value of PCWrite for each
cycle. The outputs of the forwarding unit is ALUin1 and ALUin2, which
control Muxes select the first and second input of the ALU.
-----------------------------------------------------------------
| | Instruction sequence | 1 2 3 4 5 | Signals |
-----------------------------------------------------------------
| | lw $1,40($6) | IF ID EX ME WB |1:ALUin1=X,ALUin2=X |
| | add $2,$3,$1 | IF ID ** EX |2:ALUin1=X,ALUin2=X |
|a.| add $1,$6,$4 | IF ** ID |3:ALUin1=0,ALUin2=0 |
| | sw $2,20($4) | IF |4:ALUin1=X,ALUin2=X |
| | and $1,$1,$4 | |5:ALUin1=0,ALUin2=1 |
|----------------------------------------------------------------
| | add $1,$5,$3 | IF ID EX ME WB |1:ALUin1=X,ALUin2=X |
| | sw $1,0($2) | IF ID EX ME |2:ALUin1=X,ALUin2=X |
|b.| lw $1,4($2) | IF ID EX |3:ALUin1=0,ALUin2=0 |
| | add $5,$5,$1 | IF ID |4:ALUin1=0,ALUin2=2 |
| | sw $1,0($2) | IF |5:ALUin1=0,ALUin2=0 |
-----------------------------------------------------------------
想請問解答上Signals的以下四種情況表示什麼意思,如何設定?
(1)ALUin1=X,ALUin2=X
(2)ALUin1=0,ALUin2=0
(3)ALUin1=0,ALUin2=1
(4)ALUin1=0,ALUin2=2
感謝各位耐心看完題目及問題,謝謝。
※ 編輯: numin 來自: 123.193.221.223 (09/15 21:55)
推
09/16 02:08, , 1F
09/16 02:08, 1F
推
09/16 02:11, , 2F
09/16 02:11, 2F
推
09/16 02:16, , 3F
09/16 02:16, 3F
→
09/16 02:18, , 4F
09/16 02:18, 4F
→
09/16 02:20, , 5F
09/16 02:20, 5F
→
09/16 02:20, , 6F
09/16 02:20, 6F
→
09/16 02:22, , 7F
09/16 02:22, 7F
→
09/16 19:09, , 8F
09/16 19:09, 8F
→
09/16 19:10, , 9F
09/16 19:10, 9F
→
09/16 19:11, , 10F
09/16 19:11, 10F
→
09/16 19:14, , 11F
09/16 19:14, 11F
→
09/16 19:14, , 12F
09/16 19:14, 12F
→
09/16 19:16, , 13F
09/16 19:16, 13F
→
09/16 19:18, , 14F
09/16 19:18, 14F
→
09/16 21:13, , 15F
09/16 21:13, 15F
→
09/16 21:15, , 16F
09/16 21:15, 16F
→
09/16 21:16, , 17F
09/16 21:16, 17F
→
09/16 21:19, , 18F
09/16 21:19, 18F
→
09/16 21:21, , 19F
09/16 21:21, 19F
推
09/16 21:33, , 20F
09/16 21:33, 20F
→
09/16 21:34, , 21F
09/16 21:34, 21F
推
09/16 21:37, , 22F
09/16 21:37, 22F
→
09/16 22:29, , 23F
09/16 22:29, 23F
→
09/16 22:30, , 24F
09/16 22:30, 24F
→
09/16 22:32, , 25F
09/16 22:32, 25F
→
09/16 22:35, , 26F
09/16 22:35, 26F
→
09/16 22:36, , 27F
09/16 22:36, 27F
→
09/16 22:39, , 28F
09/16 22:39, 28F
推
09/16 22:49, , 29F
09/16 22:49, 29F
→
09/16 22:49, , 30F
09/16 22:49, 30F
推
09/16 22:52, , 31F
09/16 22:52, 31F
→
09/16 22:52, , 32F
09/16 22:52, 32F
→
09/16 22:53, , 33F
09/16 22:53, 33F
→
09/16 22:55, , 34F
09/16 22:55, 34F
→
09/16 23:03, , 35F
09/16 23:03, 35F
→
09/16 23:04, , 36F
09/16 23:04, 36F
推
09/16 23:04, , 37F
09/16 23:04, 37F
→
09/16 23:05, , 38F
09/16 23:05, 38F
→
09/16 23:06, , 39F
09/16 23:06, 39F
→
09/16 23:06, , 40F
09/16 23:06, 40F
→
09/16 23:07, , 41F
09/16 23:07, 41F
→
09/16 23:08, , 42F
09/16 23:08, 42F
→
09/16 23:10, , 43F
09/16 23:10, 43F
→
09/16 23:10, , 44F
09/16 23:10, 44F
→
09/16 23:11, , 45F
09/16 23:11, 45F
→
09/16 23:13, , 46F
09/16 23:13, 46F