Professional Documents
Culture Documents
ch17 1 PDF
ch17 1 PDF
Chapter 17
S. Dandamudi
Outline
• Introduction • Types of cache misses
• How cache memory works • Types of caches
• Why cache memory works • Example implementations
• Cache design basics ∗ Pentium
∗ PowerPC
• Mapping function
∗ MIPS
∗ Direct mapping
∗ Associative mapping • Cache operation summary
∗ Set-associative mapping • Design issues
• Replacement policies ∗ Cache capacity
∗ Cache line size
• Write policies
∗ Degree of associatively
• Space overhead
2003 S. Dandamudi Chapter 17: Page 2
To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer, 2003.
Introduction
• Memory hierarchy
∗ Registers
∗ Memory
∗ Disk
∗ …
• Cache memory is a small amount of fast memory
∗ Placed between two levels of memory hierarchy
» To bridge the gap in access times
– Between processor and main memory (our focus)
– Between main memory and disk (disk cache)
∗ Expected to behave like a large amount of fast memory
300
250
Execution time (ms
200 Column-order
150
100
Row-order
50
0
500 600 700 800 900 1000
Matrix size
B = 4 bytes
b = 2 bits
Direct mapping
Reference pattern:
0, 4, 0, 8, 0, 8,
0, 4, 0, 4, 0, 4
Hit ratio = 0%
Direct mapping
Reference pattern:
0, 7, 9, 10, 0, 7,
9, 10, 0, 7, 9, 10
Associative
mapping
Reference pattern:
0, 4, 0, 8, 0, 8,
0, 4, 0, 4, 0, 4
Set-associative mapping
Set-associative
mapping
Reference pattern:
0, 4, 0, 8, 0, 8,
0, 4, 0, 4, 0, 4
Figure 17.3a
Write-back
PowerPC placement
policy (incl. PLRU)
Last slide