作者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
1F:推 ceo890710:因为只有算penalty的部分.只有1.不需要把原本的算进去 01/11 23:22
2F:→ ceo890710:因为指令存取是每个指令都有所以是100%*1%*20 01/11 23:23
3F:→ da0910cc:3Q! 01/11 23:27