memory hierarchy and cache design (4). reducing hit time 1. small and simple caches 2. avoiding...
DESCRIPTION
Small and Simple Caches Alpha AXP has –Direct-mapped 8-KB ( byte blocks) L1 instruction cache and date cache –Direct-mapped 128-KB to 8-MB L2 cache Becomes increasing important due to the pressure of a fast clock cycleTRANSCRIPT
![Page 1: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/1.jpg)
Memory Hierarchy and Cache Design (4)
![Page 2: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/2.jpg)
Reducing Hit Time
1. Small and Simple Caches
2. Avoiding Address Translation During Indexing of the Cache
– Using virtual caches– Accessing physical caches without address translation
3. Pipelining Writes for Write Hits
![Page 3: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/3.jpg)
Small and Simple Caches
• Alpha AXP 21064 has – Direct-mapped 8-KB (256 32-byte blocks) L1 instruction
cache and date cache– Direct-mapped 128-KB to 8-MB L2 cache
• Becomes increasing important due to the pressure of a fast clock cycle
![Page 4: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/4.jpg)
Using virtual caches• Cache is indexed and/or tagged with the virtual address• Cache access and MMU translation/validation done in
parallel• Physical address saved in tags for later write-back but not
used during indexing
processor datavirtual/physical address tags
main memory
address mapper
cache miss
virtual address
physical address
![Page 5: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/5.jpg)
Using virtual caches
• Problems with virtual caches
– homonym problem
– synonym problem
![Page 6: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/6.jpg)
Homonym problem
100 1000
100 10 100 20
process 1 translation information
process 2 translation information
process 1 writes 1000 to virtual page 100
process 2 read from virtual page 100
context-switched to process 2
tag data
100
![Page 7: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/7.jpg)
Homonym problem
Solutions to homonym problem
1. Cache perging at each context switch
2. Using PID (process id) as an additional ta
g
3. Virtually-index physically-tagged caches
![Page 8: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/8.jpg)
Homonym problem
![Page 9: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/9.jpg)
Synonym problem
100200
100
100200
100200
5
55
105
1010
process 1 reads from virtual page 100
process 1 reads from virtual page 200
process 1 writes 10 to virtual page 100
process 1 reads from virtual page 200
process 1 translation information
tag data
![Page 10: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/10.jpg)
Synonym problem
Solutions to synonym problem1. Hardware anti-aliasing2. Alignment of synonyms (require all the sy
nonyms to be identical in the lower bits of their virtual addresses assuming a direct-mapped cache)
![Page 11: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/11.jpg)
Accessing physical caches without address translation
virtual page #
compare
cache
Latch
Address mapper
page offset
LatchLatch
compare
set index
Pipeline stage boundary
Tags Data
cache data (if cache hit)To Processor
real address
set select
k-way cache output
![Page 12: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/12.jpg)
Pipelining Writes for Fast Write Hits
tag comparison
actual writing
tag comparison
tag comparison
actual writing
actual writing
Time
Write request i + 1Write request i
Write request i + 1Write request i
Write request i - 1
Write request i - 1
![Page 13: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/13.jpg)
Pipelining Writes for Fast Write Hits
![Page 14: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/14.jpg)
Summary of Cache Optimizations
![Page 15: Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address…](https://reader036.vdocument.in/reader036/viewer/2022090107/5a4d1be27f8b9ab0599e076e/html5/thumbnails/15.jpg)
Summary of Cache Optimizations