Cache Flashcards
Hardware prefetching
using hardware to predict blocks of data that will be used soon and fetch it before it is used.
What to prefetch?
When to prefetch?
Write-through
When there is a cache hit for an address that needs to be written to, the value is written in the cache and the lower levels of memory
Write-back
When there is a cache hit, the block in cache is written and also stored in the Write Back Buffer (WBB). It’ll be written to lower levels of memory when there is a read of the block.
Replacement Policies
Put blocks into the cache speculatively. Read addresses from a lower level.
exp.
next block prefetching: getting the next block when the current block access has a miss
binding: prefetch data in registers only
non-binding: prefetch data in cache only
only prefetch when there is dead data in the cache
Timeliness
start prefetch sufficiently in advance
Coverage
prefetch as many as possible
Accurate
predict data to prefetch that will be used soon and not fill the cache with unnecessary or non useful data and avoid eviction of useful data!
Correlating Predictor
a large table of addresses with a miss
Stride Prefetcher
Uses direct map cache. Every address in the table has an associated stride value.
The new address - old address of the same tag = actual stride.
If no match, update stride state.
The new address + stride in table (aka predicted stride) = prefetch or not.