作者bigrat2 (MrEric)
看板Grad-ProbAsk
标题[理工] [计组] pipeline hazard 成大
时间Mon Jan 25 14:13:53 2010
consider a pipelined processor that executes the MIPS code shown in figure
1 using the logic of hazard detection and data forwarding unit shown in
figure 2. if the MIPS code cannot be excuted correctly,then how do we revise
the logic shown in Figure 2 such that the code can be correctly executed?
add $1 ,$1 ,$2
add $1 ,$1 ,$3
add $1 ,$1 ,$4
if (MEM/WB.RegWrite
and (MEM/WB.RegisterRD =! 0)
and (MEM/WB.RegisterRD =ID/EX.RegisterRS)
then
Forward A=01
if (MEM/WB.RegWrite
and (MEM/WB.RegisterRD =! 0)
and (MEM/WB.RegisterRD =ID/EX.RegisterRt)
then
Forward B=01
我买的两本书上分别有此题但是答案不一样想请教个位高手
哪个答案是正确的呢?另外可以请问一下答案一的 (EX/MEM.Register!=ID/EX.Register
RS为甚麽要这样写嘛?谢谢大家 :)
答案1.
if (MEM/WB.RegWrite
and (MEM/WB.RegisterRD =! 0)
and (EX/MEM.RegisterRD =! ID/EX.Register RS)
and (MEM/WB.RegisterRD =ID/EX.RegisterRS)
then Forward A=01
if (MEM/WB.RegWrite
and (MEM/WB.RegisterRD =! 0)
and (EX/MEM.RegisterRD =! ID/EX.Register Rt)
and (MEM/WB.RegisterRD =ID/EX.RegisterRt)
then Forward B=01
答案2.
if (EX/MEM.RegWrite
and (EX/MEM.RegisterRD!= 0)and
(EX/MEM.RegsiterRD= ID/Ex.Register RS))
then Forward A =01
if (EX/MEM.RegWrite
and (EX/MEM.RegisterRD!= 0)and
(EX/MEM.RegsiterRD= ID/Ex.Register Rt))
then Forward B =01
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.46.138.104
1F:推 sean456:我认为是答案一 01/25 15:06
2F:→ sean456:而且答案二跟题目还不是一样= = 01/25 15:07
3F:→ sean456:看错了 01/25 15:21
4F:推 sean456:不过张凡是答案一 01/25 15:23
5F:推 keithkeith20:高民是答案一 01/25 15:36
※ 编辑: bigrat2 来自: 114.46.138.104 (01/25 15:39)
6F:→ bigrat2:是的答案一是高明的解答 :) 01/25 15:40
7F:→ bigrat2:不过对於答案一的步骤我有点疑问 麻烦请个位高手指教谢谢 01/25 15:54