






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







This simplifies to CPU time = (CPU execution cycles + Memory-stall cycles) x Clock cycle time Memory-stall cycles = x Read miss rate x Read miss penalty Memory-stall cycles = x x Read miss penalty Mem accesses Program Instructions Program Misses Instruction
Nobody’s perfect CPU time = (CPU execution cycles + Memory-stall cycles) x Clock cycle time Memory-stall cycles = x x Read miss penalty For a given program we assume: o An instruction cache miss rate of 2%; o a data cache miss rate of 4%; o a CPI of 2 without memory stalls; o a miss penalty of 100 cycles; and o the the frequency of loads and stores is SPECint2000 of 36%. Determine how much faster the processor would run with a perfect cache. Instructions Program Misses Instruction
Faster CPI & clock rate deliver a double whammy *The processor vs DRAM speed disparity continues to grow. **0.
1 10 100 1000 VAX/1980 PPro/1996 2010+ Processor DRAM** Clocks per instruction (CPI) Clocks per DRAM access
We seek to decrease miss rate, while not increasing hit time o We may be able to reduce cache misses by more flexible placement of blocks. o In direct mapped cache, a block can go in exactly one place. o That makes it easy to find, but...
Memory references 0 1 2 3 4 3 4 15
00 Mem(0) 00 Mem(0) 00 Mem(1) 00 Mem(0) (^00) Mem(0) 00 Mem(1) 00 Mem(2)
00 Mem(0) 00 Mem(1) 00 Mem(2) 00 Mem(3) 01 Mem(4) 00 Mem(1) 00 Mem(2) 00 Mem(3) 01 Mem(4) 00 Mem(1) 00 Mem(2) 00 Mem(3) 01 Mem(4) 00 Mem(1) 00 Mem(2) 00 Mem(3)
00 Mem(1) 00 Mem(2) 00 Mem(3) *Start with an empty cache - all blocks initially marked as not valid.
Memory references 0 4 0 4 0 4 0 4 0 4 0 4 0 4 0 4 miss miss miss miss miss miss miss miss 00 Mem(0) 00 Mem(0) (^01 ) 01 Mem(4) (^000) 00 Mem(0) 01 4 00 Mem(0) (^01 ) 00 Mem(0) 01 4 01 Mem(4) (^000) 01 Mem(4) (^000) *Start with an empty cache - all blocks initially marked as not valid.
Memory references 0 1 2 3 4 3 4 15 (^0 1 ) 3 4 3 4 15 00 Mem(1) Mem(0) miss 00 Mem(1) Mem(0) hit 00 Mem(3) Mem(2) 00 Mem(1) Mem(0) miss hit 00 Mem(3) Mem(2) 00 Mem(1) Mem(0) miss 00 Mem(3) Mem(2) 00 Mem(1) Mem(0) (^01 5 ) hit 00 Mem(3) Mem(2) 01 Mem(5) Mem(4) hit 00 Mem(3) Mem(2) 01 Mem(5) Mem(4) 00 Mem(3) Mem(2) 01 Mem(5) Mem(4) miss (^11 15 )
Performance of set-associative caches Associativity 0 One-way Two-way 3 % 6 % 9 % 12 % 15 % Four-way Eight-way 1 KB 2 KB 4 KB 8 KB 16 KB 32 KB (^64) KB 128 KB
Implementing a 4-way set-associative cache Address 22 8 Index V Tag 0 (^12) 253 (^225545) Data V Tag Data V Tag Data V Tag Data 22 32 4 - to- 1 multiplexor Hit Data
Choosing which block to replace o When a miss occurs in a direct-mapped cache, the requested block can only go in one place. o In an associative cache we have a choice. o The most commonly scheme least recently used (LRU).
If only things were that simple Radix sort Quicksort Size (K items to sort)
Radix sort Quicksort Size (K items to sort)
Theoretical behavior of Radix sort vs. Quicksort Observed behavior of Radix sort vs. Quicksort
The real scoop o Memory system performance is often critical factor o Multilevel caches, pipelined processors, make it harder to predict outcomes Radix sort Quicksort Size (K items to sort)