nkanderson / ECE585-llc

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

Add main program loop #18

Closed nkanderson closed 2 weeks ago

nkanderson commented 3 weeks ago

To start us off, I think this can consist of a basic loop using the TraceFileParser to get one line from the file at a time and use something like a match statement to determine which actions to perform for each event. For now, each case can just have a pass statement or other placeholder.

To make this more easily testable, we may want to put the match in a separate function from the main program. This would allow us to call it directly in a testing context where we provide a single event at a time to the function without opening a file and parsing it. This function could return a dictionary with some representation of the statistics related to the action, for example:

{
    cache_reads: 2,
    cache_writes: 0,
    cache_hits: 1,
    cache_misses: 0
}

This output could also then be tested.