Cache Review Flashcards
What is temporal locality?
If we have accessed an address recently, we are likely to access it again soon
What is spatial locality?
If we have accessed an address recently, we are likely to access addresses around it
What is AMAT?
Average Memory Access Time. Metric to evaluate how fast our cache is. AMAT = (hit time) + (miss rate) * (miss penalty)
What is a cache’s miss penalty?
The time it takes to access main memory
What fields are in the cache table?
Index (bits of address), data, validity bit (is the real or garbage?)
What is block size and what’s another name for it?
The number of bytes that we are storing in each line. Must be a power of 2. Also called line size
What is a cache line?
An entry in the cache table
What is a fully associative cache?
any block from memory can be in any cache line.
What is a direct-mapped cache?
for any block, there is only one line where that block can go. Index bits tell us which line, remaining upper bits tell us if it’s a match
What are the pros/cons of a direct-mapped cache?
(+) fast, cheap, and energy efficient because we only have to check one spot for a hit
(-) could have multiple blocks that map to the same location (== worse miss rate)
What is a set-associative cache?
there are n lines where a block can be located. index bits tell us which set, tag is remaining bits
What are the cons of LRU replacement policy?
(-) requires a lot of bits to keep track of LRU, must update each entry for every hit or miss
What is write-allocate?
On a write miss, we bring the entire block into the cache
What is no-write-allocate?
On a write miss, we do not bring the entire block into the cache
What is write-through?
On write hit, we write to the cache and to memory at the same time