[理工] [計組]-Pipeline
請問兩題:
1.(93台大電機)
Identify all of the data dependencies in the following code. Show which
dependencies are data hazards and how they can be resolved via forwarding?
(1) add $2, $5, $4
(2) add $4, $2, $5
(3) sw $5, 110($2)
(4) add $3, $2, $4
書上的解答是:
(1)(2)之間$2會產生data hazard
(1)(3)之間$2會產生data hazard
(2)(4)之間$4會產生data hazard
(1)(4)之間$2會產生data hazard
我想問的是,(1)(4)之間不是可以前半週期寫入、後半週期讀取,這樣還算有data
hazard嗎?
2.(98成大資工)
Consider a pipelined processor. Given a "single" MIPS code to illustrate
RAW, WAR and WAW hazards. Note that the MIPS code can only consist of no
more than four R-type instructions.
我不太懂要怎麼寫... MIPS不是只會出現RAW嗎? 那要怎麼用MIPS指令說明WAR和
WAW hazards?
謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.121.155.245
推
03/05 14:28, , 1F
03/05 14:28, 1F
推
03/05 14:28, , 2F
03/05 14:28, 2F
→
03/05 14:30, , 3F
03/05 14:30, 3F
→
03/05 14:30, , 4F
03/05 14:30, 4F
→
03/05 14:30, , 5F
03/05 14:30, 5F
→
03/05 14:31, , 6F
03/05 14:31, 6F
推
03/05 14:37, , 7F
03/05 14:37, 7F
→
03/05 14:59, , 8F
03/05 14:59, 8F
→
03/05 15:00, , 9F
03/05 15:00, 9F
→
03/05 15:01, , 10F
03/05 15:01, 10F
→
03/05 15:01, , 11F
03/05 15:01, 11F
推
03/05 15:07, , 12F
03/05 15:07, 12F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):
理工
4
12