Re: [理工] 計組 -計算CPI
看板Grad-ProbAsk作者liataian (T-PANY FOREVER)時間14年前 (2011/11/03 14:12)推噓3(3推 0噓 0→)留言3則, 3人參與討論串2/2 (看更多)
※ 引述《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
推
11/03 22:03, , 1F
11/03 22:03, 1F
推
11/03 22:52, , 2F
11/03 22:52, 2F
推
11/04 21:27, , 3F
11/04 21:27, 3F
討論串 (同標題文章)