Re: [理工] [計組] pipeline 的執行時間算法
※ 引述《lexa ( )》之銘言:
: Consider a MIPS machine with a 5-stage pipeline with a cycle time of 10ns.
: Assume that you are executing a program where a fraction,f,of all instructions
: immediately follow a load upon which they are dependent.
: (2)Consider a scenario where the MEM stage, along with its pipeline registers,
: needs 12 ns. There are now two options: add another MEM stage so that
: there are MEM1 and MEM2 stages or increase the cycle time to 12 ns so that
: the MEM stage fits within the new cycle time and the number of pipeline
: stages remain unaffected. For a program mix with the above characteristics,
: when is the first option better than the second. Your answer should be based
: on the value of f.
: 解答:Option1:Time1 = [ (6-1) + N + 2*N*f ]*10 ns
: ~~~~~~~~~~~~~~~~~~~~~
: 這應該是clock cycles對吧?
: 我想問這 (6-1) cycles 是從哪理來的?
: 還有為什麼多了一個MEM階段後 要比 5-stage pipeline 多 stall N*f cycles?
: 我想破頭還是不知道 請各位版友告訴我吧 感謝~
(6-1)是因為加了一個MEM變6-stage pipeline (原先公式是[(5-1)+N])
IF=>ID=>EX=>MEM1=>MEM2=>WB
因為多了一個MEM2 所以lw正確的值要等到lw指令跑完MEM2這個stage才會出來
因此每個lw指令會變成 2個stall 才能得到lw正確的值
沒記錯應該是這樣子... 有錯誤請高手指教
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 124.6.23.64
推
10/12 02:46, , 1F
10/12 02:46, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):