A given program has load/store instructions. Suppose the ideal (cycles per instruction) without any memory stalls is . The program exhibits miss rate on instruction cache and miss rate on data cache. The miss penalty is cycles. The speedup (rounded off to two decimal places) achieved with a perfect cache (i.e., with NO data or instruction cache misses) is __________.
View worked solution
Answer: 3
To find the speedup achieved with a perfect cache, we compare the execution time (or CPI) of the system with cache stalls to the system with a perfect cache.
1. CPI with a Perfect Cache:With a perfect cache, there are no instruction or data cache misses. Thus, the CPI is simply the ideal CPI:
2. CPI with Cache Stalls:The actual CPI includes stalls from both instruction cache misses and data cache misses.
- Instruction Cache Stalls per Instruction:
Every instruction must be fetched. Therefore, the instruction miss rate applies to all instructions. - Data Cache Stalls per Instruction:
Only load/store instructions (which constitute of the program) access the data cache.
Adding these to the ideal CPI gives the total actual CPI:
3. Speedup Calculation:The speedup achieved by using a perfect cache is:
Free practice · Your answers on this page are not saved.
