This project is a simulator for a generic cache structure, defined by a JSON input file and run on a file containing memory addresses that are accessed.
This project requires Rust Nightly (rustup default nightly).
To build this product, use cargo build --release.
This will generate the executable cachesim in target/release/.
To run unit tests, first set the BASE_RES_FOLDER environment variable to the folder containing the input, trace and output files, then run cargo test. Add -- --nocapture to the end to show the execution time for each test.
To run benchmarks, do the same and run cargo bench.
Then, the report can be served through python3 -m http.server --directory target/criterion.
Benchmarking takes a while due to repeated test runs, and it doesn't parallelize in order to make sure there is no slowdown due to core contention.
Note that on lab machines the tests may be slow due to retrieving the large trace files through network ZFS. Therefore, it's recommended to copy the trace files to your local machine (perhaps in /tmp/...) and then set the BASE_RES_FOLDER to that folder, to get accurate readings of the execution time.