The Lord of the Cache Project 3. Caches Three common cache designs: Direct-Mapped store in exactly...
-
Upload
basil-lynch -
Category
Documents
-
view
216 -
download
0
Transcript of The Lord of the Cache Project 3. Caches Three common cache designs: Direct-Mapped store in exactly...
The Lord of the CacheProject 3
Caches
•Three common cache designs:•Direct-Mapped• store in exactly one cache line•Fully Associative•store in any cache line•Set Associative•store in a small set of cache lines
V Tag Block
Tag Index Offset
=
hit? dataword select
32bits
Byte offset
Direct-mapped Cache
V Tag Block
word select
hit? data
line select
= = = =
32bits
64bytes
Tag Offset
Fully Associative Cache
word select
hit? data
line select
= =
32bits
64bytes
Tag Index Offset
2-way Set Associative Cache
word selecthit? data
line select
= = =
32bits
64bytes
Tag Index Offset
3-way Set Associative Cache
Cache Misses• Cold (aka Compulsory) Miss• Line is being referenced for the first time • Avoid by prefetching
• Conflict Miss• Line was in the cache, but has been evicted because
of another access with the same index• Avoid by increasing cache associativity
• Capacity Miss• line was in the cache, but has been evicted because
the cache is too small • Avoid by increasing cache size
Cache Write Policies •Write-Through • Updates to a block in cache are immediately
written through to memory
•Write-Back• Updates to a block in cache are only written
back to memory when that block is evicted