Re: [理工] [計組] pipeline 的執行時間算法

看板Grad-ProbAsk作者 (幻夜)時間12年前 (2011/10/11 23:17), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
※ 引述《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
原來是這樣@@ 公式說清空管線花S-1 可是我想問管線幹嘛清空??
10/12 02:46, 1F
文章代碼(AID): #1Eb5ttY8 (Grad-ProbAsk)
文章代碼(AID): #1Eb5ttY8 (Grad-ProbAsk)