ChampSim is a trace-based simulator for a microarchitecture study. If you have questions about how to use ChampSim, we encourage you to search the threads in the Discussions tab or start your own thread. If you are aware of a bug or have a feature request, open a new Issue.
ChampSim is the result of academic research. If you use this software in your work, please cite it using the following reference:
Gober, N., Chacon, G., Wang, L., Gratz, P. V., Jimenez, D. A., Teran, E., Pugsley, S., & Kim, J. (2022). The Championship Simulator: Architectural Simulation for Education and Competition. https://doi.org/10.48550/arXiv.2210.14324
If you use ChampSim in your work, you may submit a pull request modifying PUBLICATIONS_USING_CHAMPSIM.bib
to have it featured in the documentation.
ChampSim uses vcpkg to manage its dependencies. In this repository, vcpkg is included as a submodule. You can download the dependencies with
git submodule update --init
vcpkg/bootstrap-vcpkg.sh
vcpkg/vcpkg install
ChampSim takes a JSON configuration script. Examine champsim_config.json
for a fully-specified example. All options described in this file are optional and will be replaced with defaults if not specified. The configuration scrip can also be run without input, in which case an empty file is assumed.
$ ./config.sh <configuration file>
$ make
Traces used for the 3rd Data Prefetching Championship (DPC-3) can be found here. (https://dpc3.compas.cs.stonybrook.edu/champsim-traces/speccpu/) A set of traces used for the 2nd Cache Replacement Championship (CRC-2) can be found from this link. (http://bit.ly/2t2nkUj)
Storage for these traces is kindly provided by Daniel Jimenez (Texas A&M University) and Mike Ferdman (Stony Brook University). If you find yourself frequently using ChampSim, it is highly encouraged that you maintain your own repository of traces, in case the links ever break.
Execute the binary directly.
$ bin/champsim --warmup_instructions 200000000 --simulation_instructions 500000000 ~/path/to/traces/600.perlbench_s-210B.champsimtrace.xz
The number of warmup and simulation instructions given will be the number of instructions retired. Note that the statistics printed at the end of the simulation include only the simulation phase.
Copy an empty template
$ mkdir prefetcher/mypref
$ cp prefetcher/no_l2c/no.cc prefetcher/mypref/mypref.cc
Work on your algorithms with your favorite text editor
$ vim prefetcher/mypref/mypref.cc
Compile and test Add your prefetcher to the configuration file.
{
"L2C": {
"prefetcher": "mypref"
}
}
Note that the example prefetcher is an L2 prefetcher. You might design a prefetcher for a different level.
$ ./config.sh <configuration file>
$ make
$ bin/champsim --warmup_instructions 200000000 --simulation_instructions 500000000 600.perlbench_s-210B.champsimtrace.xz
Program traces are available in a variety of locations, however, many ChampSim users wish to trace their own programs for research purposes.
Example tracing utilities are provided in the tracer/
directory.
ChampSim measures the IPC (Instruction Per Cycle) value as a performance metric.
There are some other useful metrics printed out at the end of simulation.
Good luck and be a champion!