作者da0910cc (da0910cc)
看板Grad-ProbAsk
標題[理工] [計組] 效能的問題
時間Wed Jan 11 23:14:31 2012
1.(12%) Consider a program is executed on a computer. In the program 20% of
the instructions are branch instructions, and the other 30% are memory access
instructions. The computer has CPI of 2 for perfect cache and perfect branch
prediction. The penalty for each cache miss is 20 cycles, and for each branch
prediction miss is 1 cycle. If there are 1% of instruction cache miss, 10%
data cache miss, and 10% branch prediction miss, what is the actual CPI?
【解答】
Actual CPI=ideal CPI+missrate*misspennalty=2+0.01*20+0.3*0.1*20+0.2*0.1*1
想請問,最後一個branch,為何不是0.2*0.1*(1+1)....miss時要額外多一個cycle,
然後instruction cache miss 是 (100%-20%-30%)*1%*20 .... 這樣對嗎?
^^^^^^^^^^^^^ ^^ ^^
inst.占的比例*missrate*misspenalty
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.252.106.38
推 ceo890710:因為只有算penalty的部分.只有1.不需要把原本的算進去 01/11 23:22
→ ceo890710:因為指令存取是每個指令都有所以是100%*1%*20 01/11 23:23
→ da0910cc:3Q! 01/11 23:27