Calculate average stalls per instruction.

Consider a CPU contains 2000 instructions, there are 80 misses in L1  cache and 40 misses in the L2 cache. Assume miss penalty from the L2 cache to memory is 200 clock cycles, the hit time of L2 cache is 30 clock cycles, the hit time of L1 cache is 5 clock cycles and these are 1.8 memory references per instruction, then average stall per instruction is ________ ?

1Comment
sajith menon @sajithmenon 11 Jan 2018 07:29 am

1 instruction=1.8 memory reference

2000 instruction=3600 memory reference

# of stall cycle=miss in l1*miss penalty l1 + miss in l2*miss penalty l2

=80*30+40*200

=2400+8000=10400

Avg stall=stall cycle/avg

=10400/3600

=2.88