Closed reecewayt closed 3 days ago
what does allocate do?
@mdhardenburgh Here's the comment header for allocate, it can be found in src/cache/cache_set.py
. Let me know if you have other questions.
"""
Allocate a new cache line. First searches for invalid lines
if none found uses PLRU to select victim.
Args:
tag: Tag to be stored in the cache line
state: Initial MESI state (default Exclusive for new allocations)
Returns:
(victim_line , allocated_way_index)
- victim_line: CacheLine object of the victim line
- If victim_line is None, no writeback needed (invalid line was used)
- If victim_line is Modified, writeback needed
- victim_line contains tag and L1 status for inclusion handling
"""
@nkanderson, @d-engler , and @mdhardenburgh please review the diagram I'm adding to our repo. It is a basic pictorial view of the cache classes that make up our cache structure. Let me know if any of you have questions.