Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider a program that can execute with no stalls and a CPI of 1 if the underly

ID: 3704845 • Letter: C

Question

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?

Explanation / Answer

Consider the data:

The load instructions suffer from L1 cache miss is 5%. Then the miss rate is 0.05 and hit rate is 0.95.

The load instructions suffer from L2 cache miss is 2%. Then the miss rate is 0.02 and hit rate is 0.98.

The of load instructions suffer from L3 cache miss is 1%. Then the miss rate is 0.01 and hit rate is 0.99.

The L1 cache miss stalls the processor for 10 cycles L2 is looked up

The L2 cache miss stalls the processor for 20 cycles L3 is looked up

The L3 cache miss stalls the processor for 300 cycles, data is fetched from memory.

CPI can be calculated as follows:

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 = 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

Then, for 30% CPI is

CPI = 0.3 * 2.046

Therefore, the effective CPI= 0.6138

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote