138k views
1 vote
Calculate the performance of a processor taking into account stalls due to data cache and instruction cache misses. The data cache (for loads and stores) is the same as described previously and 30% of instructions are loads and stores. The instruction cache has a hit rate of 90% with a miss penalty of 50 cycles and hit time is 1 cycle. Assume the base CPI using a perfect memory system is 1.0. Calculate the CPI of the pipeline, assuming everything else is working perfectly. Assume the load never stalls a dependent instruction and assume the processor must wait for stores to finish when they miss the cache. Finally, assume that instruction cache misses and data cache misses never occur at the same time.

1 Answer

2 votes

Final answer:

The effective CPI of the processor pipeline is calculated by including the additional cycles from instruction cache and data cache misses, resulting in a total CPI of 7.5, assuming similar data cache miss rates and penalties as the instruction cache.

Step-by-step explanation:

To calculate the CPI of the processor pipeline with stalls due to data cache and instruction cache misses, we consider the following given information:

  • Base CPI (without memory stalls) is 1.0.
  • Data cache miss penalty is not given, but 30% of the instructions are load/store operations.
  • The instruction cache hit rate is 90%, so the miss rate is 10%.
  • The instruction cache miss penalty is 50 cycles.
  • The hit time for both data cache and instruction cache is 1 cycle (since the miss penalty is given and hit time is generally 1 in such problems).

In the absence of other relevant data, we make the following assumptions:

  • The data cache has a similar hit rate to the instruction cache.
  • Instruction cache misses and data cache misses do not overlap.

Using these data, we can calculate the effective CPI as follows:

  1. Instruction Cache Misses contribution to CPI: 10% miss rate * 50 cycles miss penalty = 5.0 extra cycles per instruction.
  2. Data Cache Misses contribution to CPI: Since it is not specified, we assume a similar miss rate and penalty for data cache misses as the instruction cache. This means 30% of instructions are loads/stores and, with a 10% miss rate with a 50-cycle penalty, the data cache would contribute an additional 1.5 extra cycles per instruction (10% of 30% is 3%, and 3% of 50 cycles is 1.5 cycles).
  3. The total CPI is the sum of the base CPI, the instruction cache contribution, and the data cache contribution.

Therefore, the total CPI calculation will be:

CPI = Base CPI + Instruction cache misses CPI contribution + Data cache misses CPI contribution
CPI = 1.0 + 5.0 + 1.5
CPI = 7.5

The effective CPI of the processor pipeline, taking into account stalls from both data cache and instruction cache misses, is 7.5.

User Joe Pamer
by
4.6k points