1. Consider a program that can execute with no stalls and a CPI of 1 if the unde
ID: 3710097 • Letter: 1
Question
1. Consider a program that can execute with no stalls and a CPI of 1 if the underlying processor can somehow magically service every load instruction with a 1-cycle L1 cache hit. In practice, 5% of all load instructions suffer from an L1 cache miss, 2% of all load instructions suffer from an L2 cache miss, and 1% of all load instructions suffer from an L3 cache miss (and are serviced by the memory system). An L1 cache miss stalls the processor for 10 cycles while the L2 is looked up. An L2 cache miss stalls the processor for 20 cycles while the L3 is looked up. An L3 cache miss stalls the processor for an additional 300 cycles while data is fetched from memory. What is the CPI for this program if 30% of the program's instructions are load instructions? (40 points)Explanation / Answer
Given,
5% of load instructions suffer from L1 cache miss
2% of load instructions suffer from L2 cache miss
1% of load instructions suffer from L3 cache miss
L1 cache miss stalls the processor for 10 cycles L2 is looked up
L2 cache miss stalls the processor for 20 cycles L3 is looked up
L3 cache miss stalls the processor for 300 cycles, data is fetched from memory.
CPI is given as;
Number of cycles taken by L1 in case of hit = 1
Hit rate for L1 is given as = 0.95
Number of cycles taken by L2 in case of hit = 10
Hit rate for L2 is given as = 0.98
Number of cycles taken by L3 in case of hit = 20
Hit rate for L1 is given as = 0.99
The time for L1 cache miss, L2 cache miss, L3 cache miss/ memory = 300 cycles
percentage of load instructions = 30% = 0.3
Rest of the instructions = 70% = 0.7
CPI is given as;
CPI = L1 cache hit rate L1 cycle Time +L1 miss rate (L2 hit rate (L2 cycle time+ L1 cycle time) + L2 miss rate (L3 hit rate L3 cycle time + L3 miss rate (L3 cycle time + L2 cycle time+ L1 cycle time + main memory access time)))
CPI = 0.9*1 + 0.1*(0.98 * (1+10) + 0.02*(0.99*(1+10+20) + 0.01*(1+10+20+300)) = 2.046
So, for 30% CPI is
CPI = 0.3 * 2.046
The effective CPI= 0.6138
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.