Block Replacement: Selecting the Victim
After a read miss, what cache block should we replace with the data block read from main memory?
Direct-mapped cache: Unique line.
Associative caches:
- Least recently used (LRU): Replace block in set corresponding to address which has not been read or written for the longest time.
- Random: Select block in set randomly.
- First-In First-Out (FIFO): Select block which has been in the set for the longest time.