nkanderson / ECE585-llc

Simulation of a last level cache (LLC) for ECE 585 final project
1 stars 0 forks source link

Uploading python class structure diagram, might be helpful for final … #41

Closed reecewayt closed 3 days ago

reecewayt commented 1 week ago

@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.

mdhardenburgh commented 1 week ago

what does allocate do?

reecewayt commented 1 week ago

@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
        """