I am hopelessly stuck on a homework problem, and I would love some help understanding it better. Here is what I was given:
- CPU base CPI = 2, clock rate = 2GHz
- Primary Cache, Miss Rate/Instruction = 7%
- L-2 Cache access time = 15ns
- L-2 Cache, Local Miss Rate/Instruction = 30%
- L-3 Cache access time = 30ns
- L-3 Cache, Global Miss Rate/Instruction = 3%, Main memory access time = 150ns
What is the effective CPI?
It is my understanding that I need to calculate the miss penalty for each cache level.
- L1 miss penalty = Access time of L2 = 15ns / (1ns/2cc) = 30 clock cycles
- L2 miss penalty = Access time of L3 = 30ns / (1ns/2cc) = 60 clock cycles
- L3 miss penalty = Access time of MM = 150ns / (1ns/2cc) = 300 clock cycles
Now I need to calculate the effective CPI. This is where I am a bit confused.
I believe the formula should be:
CPI = BaseCPI + (%L1 MR/Instr * L1 Miss Penalty) + (%L1 MR/Instr * %L2 MR/Instr * L2 Miss Penalty) + (%Global MR/Instr * L3 Miss Penalty)
If I do this, I get
CPI = 2.0 + (0.07 * 30) + (0.07 * 0.3 * 60) + (0.03 * 300) = 14.36
After emailing my instructor because no one in the class understood the 1-2 minute explanation of global and local, I was told that my answer is close, but wrong. If anyone could provide some insight, or even point me towards a good tutorial, I would be grateful. I can understand how to figure out effective CPI for 1 and 2 level caches. Making the jump to 3 confuses me.