Computing Systems Final Flashcards
valid
Cache component that is set when the cache entry is being used
Tag
The memory address mapped to the entry
Hit ratio (h)
Percentage of accesses that hit the cache
Miss ratio (1 – h)
Percentage of access that miss the cache
Cache access time (c)
Time to access the cache (Both hit and miss)
Main memory access time (m)
Time to access main memory
Average memory latency
c + (1 – h) * m
How do you improve the average memory latency?
Increase hit rate
Decrease cache access time
Decrease memory access time
Principle of Spatial Locality
If we reference a memory location (e.g., 1000),
we are more likely to reference a location near it (e.g., 1001) than some random location
Examples of spatial locality in programs?
- Arrays
- Instructions (PC + 1)
cache blocks
store multiple words in a single cache line
write through
Store instructions write to both memory and the cache
Write policy disadvantage
cache and memory inconsistent
Write policy advantage
fewer stores to memory
write back
Only write the contents back to memory once cache block is evicted
write allocate advantage
it exploits spatial and temporal
locality
dirty bit
set to 1 anytime a store instruction modified memory
Write allocate
Stores that miss the cache are brought into the cache
write no-allocate
Stores that miss the cache will not be brought into the
cache
content addressable memory
Search for an element by content instead of by address
ex. Cache
Fully associative
Any memory location can be stored in any block (cache line)
Fully associative disadvantages
Must check every tag in the cache
Direct Mapped
A memory location can only reside in one particular block.
Data from memory address is mapped to cache
block using a modular approach
Direct mapped advantages
Only need to check one tag. improves cache access time