- A program that simulates the behavior of cache memory system.
- It's a part of the 4th lab of 15-213: Introduction to Computer Systems.
- The simulator in cache-sim.c takes memory trace generated by valgrind as input, simulates and counts the (hit, miss, evict) behavior of the cache and outputs the total number of (hits, misses and evictions).
- It can simulate the behavior of cache memory with arbitrary size and associativity selected by the user.
- The program is partitioned into three sections: (1): parse the command-line options. (2) allocate memory for the cache and initialize it. (3): simulate each memory access in the trace file the print the output.
Run the following commands to get it on your local machine:
git clone https://github.com/Eslam-Walid/cache-simulator.git
.make
.
Use the following command to print a help message of how to use it:
./csim -h
.
cache-lab.pdf
: lab writup.csim.c
: contains the main function.cache-sim.c
: my implementation of the simulator.traces
: directory contains the valgrind memory trace files.csim-ref
: reference simulator to compare your results with.test-sim
: program comes with lab files to check the correctness of your simulator and evaluate it.