- C++20 compatible compiler (GCC 10+, Clang 10+, MSVC 2019+)
- CMake 3.14 or higher
- Make, Ninja, or MSBuild
git clone https://github.com/muditbhargava66/CacheSimulator.git
cd CacheSimulator
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -j$(nproc)git clone https://github.com/muditbhargava66/CacheSimulator.git
cd CacheSimulator
.\build.ps1./build/bin/cachesim --version
# Output: Cache Simulator v1.4.1Create example.trace:
# Memory access trace
R 0x1000
W 0x1004
R 0x1008
W 0x100C
R 0x1000 # Cache hit
# Default configuration
./build/bin/cachesim example.trace
# With visualization
./build/bin/cachesim --vis example.trace
# With power analysis
./build/bin/cachesim --power example.trace./cachesim [OPTIONS] <trace_file>
Options:
-h, --help Show help message
-v, --version Show version
-c, --config <file> Use JSON configuration file
--vis Enable cache visualization
--power Enable power analysis
--tech-node <nm> Technology node (7, 14, 22, 32, 45)# Custom cache parameters
./cachesim 64 32768 4 262144 8 1 4 trace.txt
# BS L1 A1 L2 A2 P D
# BS = Block Size, A1/A2 = Associativity, P = Prefetch, D = DistanceCreate config.json:
{
"l1": {
"size": 32768,
"associativity": 4,
"blockSize": 64,
"replacementPolicy": "LRU"
},
"l2": {
"size": 262144,
"associativity": 8,
"blockSize": 64
}
}Run with config:
./cachesim --config config.json trace.txt- User Guide - Complete tutorial
- Configuration - All configuration options
- CLI Reference - Full command reference
- Examples - More usage examples