作者liataian (T-PANY FOREVER)
看板Grad-ProbAsk
標題Re: [理工] 計組 -計算CPI
時間Thu Nov 3 14:12:05 2011
※ 引述《SiriusCloud (古月小楓)》之銘言:
: for a pipeline impelementation,assume that one-quarter of the
: load instructions are immediately followed by an instruction
: that uses the result ,
: that the branch delay on misprediction is
: 1 clock cycle, and that half of the branches are mispredicted.
: Assume that jumps always pay 1 full clock cycle of delay,
: so their average time is 2 clock cycles.
: If the instruction mix is
: 25% loads,10% stories,52% ALU instructions,11% branches,2% jumps.
: Calculate the average CPI.
: (95元智 資工) ---張凡-p.136
: ------------------------------------
: Answer:
: CPI = 1 + (0.25 * 0.25 * 1 + 0.11 * 0.5 + 0.2 * 1) = 1.1375
: 以上 不太懂題目的意思 跟 解答說明
CPI(effective)=CPI(base)+CPI(extra)
以下只要題目提到的項目我們都要算進去
1. 題目提到會有1/4的load-use指令
(NOTE:load-use的miss penalty都是一個clock)
2. 題目提到會有1/2的beq指令會猜錯且miss penalty為一個clock
3. 題目提到有jump指令且jump指令一定會有miss penalty為一個clock
綜合起來
CPI(effective)
= 1 + (0.25 * 0.25 * 1 + 0.11 * 0.5 + 0.2 * 1) = 1.1375
= CPI(base) + (lw% * Load-use% * miss penalty
+ beq% * misspredict% * miss penalty
+ jump% * 100% * miss penalty)
如果講得不清楚或有錯還請高手幫忙補充
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.73.237.17
推 SiriusCloud:在研究中 感謝^^~ 11/03 22:03
推 RoyalCh:可以麻煩原po可以幫我解我po的題目嗎? 11/03 22:52
推 timygt:應該是0.02 * 1 11/04 21:27