#eye #eye

Cache Simulator

The following is a cache simulator that replicates the behavior of caches in x86 machines. You can input parameters based off the number of sets, lines per set, and block size. The output reports the number of hits, misses, and evictions using the LRU replacement policy. The simulator can take in text files, called ‘trace files’, or take in keyboard input for instructions. For more detail, you can run the program in verbose mode which additionally outputs the attempted loads and stores. The approach I decided to take was essentially through arrays that consist of sets. Within the set structures contains an array of blocks. This is for organization purposes and makes the most sense to me instead of doing a 2D-array. I have included my basic function skeletons and structs along with some outputs from the traces.

Please contact me in the case that you would like to see the full implementation and please do not share this private page. This is due to CMU’s academic integrity policy.

1.5 Weeks
Language and Tools:
Written in C, Valgrind