Open-source project
ChampSim/ChampSim avatar
ChampSim/ChampSim

ChampSim: a trace-based simulator for cache and branch research

ChampSim is an open-source trace based simulator maintained at Texas A&M University and through the support of the computer architecture community.

774 stars659 forksC++Apache-2.0

At a glance

What is it?
ChampSim is an open-source trace-based microarchitecture simulator maintained at Texas A&M University, used to study cache, branch predictor, prefetcher and replacement policies. It reads a JSON configuration, compiles a model you modify, and replays instruction traces to report IPC and other statistics.
Who is it for?
ChampSim fits graduate students, architecture competition entrants and anyone comparing cache, prefetcher or replacement policies against a common harness, and the vcpkg plus config.sh plus make path is quick to reproduce. It does not fit work that needs cycle-accurate timing, power or full-system behaviour, since the trace-driven design abstracts all of that away.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 41 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What ChampSim models and what it leaves out

ChampSim is described as a trace-based simulator for a microarchitecture study, and its evaluation metric is stated plainly: it measures IPC, the instructions per cycle value, as a performance metric, with other useful statistics printed at the end of a simulation. The scope is the cache hierarchy, not the whole machine.

The directory layout shows the modelling surface. There is a branch/ directory for branch predictors, a btb/ directory for the branch target buffer, a prefetcher/ directory for data prefetchers, a replacement/ directory for replacement policies, and a config/ directory for the per-module configuration. A module.options file and a global.options file sit at the root, and inc/ holds headers while src/ holds the simulator core.

The Makefile confirms the modularity, because it computes separate roots for each module family by appending a directory name to the module root, so a branch module and a prefetcher module compile as independent objects. The same file also carries three make-time customisation points, BIN_ROOT, OBJ_ROOT and DEP_ROOT, which decide where the binary and the intermediate objects go.

What is absent matters as much. There is no mention of power or energy modelling, no full-system simulation, and no timing accuracy claim, because a trace-driven design counts instructions and models memory hierarchy behaviour rather than cycles of wall clock time. That is a deliberate trade: a research harness that answers cache and prefetcher questions quickly, at the cost of fidelity in areas it does not attempt.

Dependencies through vcpkg and the build sequence

ChampSim manages its dependencies with vcpkg, and the repository ships vcpkg as a submodule, so the setup is three commands from a fresh clone.

bash
git submodule update --init
vcpkg/bootstrap-vcpkg.sh
vcpkg/vcpkg install

The first command materialises the bundled vcpkg tree, the second bootstraps the vcpkg binary itself, and the third installs the libraries listed in vcpkg.json. The Makefile shows which libraries that is, linking against CLI11 for command line parsing, lzma, z and bz2 for compressed trace input, and fmt for formatting.

The build then needs a configuration. ChampSim takes a JSON configuration script, and the README points to champsim_config.json as a fully specified example. All options in that file are optional and fall back to defaults, and the configuration script can also be run with no input at all, in which case an empty file is assumed.

bash
$ ./config.sh <configuration file>
$ make

The order matters. config.sh is what turns the JSON into the generated build configuration under the .csconfig object directory, and make then compiles the result. Running make without a prior config.sh invocation builds the default configuration, which is a reasonable starting point but not what you want when you are testing a specific policy.

Running a simulation and reading the statistics

The simulator runs as a plain binary with instruction counts for a warmup phase and a simulation phase, and a path to a trace file.

bash
$ bin/champsim --warmup-instructions 200000000 --simulation-instructions 500000000 ~/path/to/traces/600.perlbench_s-210B.champsimtrace.xz

The counts are in instructions retired, not in cycles, and the README is explicit that the statistics printed at the end of the simulation cover only the simulation phase. The warmup phase exists to let the simulated state settle, so a run with a warmup of zero measures a cold machine that no real workload would resemble.

Trace files come from the competition archives. Traces for the 3rd Data Prefetching Championship are published at the DPC-3 site on Stony Brook's servers, and the traces for the 2nd Cache Replacement Championship come from a separate link. Storage for these is credited to Daniel Jimenez at Texas A&M University and Mike Ferdman at Stony Brook University. The README adds a warning worth repeating: frequent users are encouraged to maintain their own repository of traces, in case the links ever break. That is a practical instruction, since the simulator reads compressed trace files and depends on that archive remaining reachable.

For anyone who needs a trace of their own program, the README points to the tracer/ directory, which holds example tracing utilities.

Adding a prefetcher through the empty template

The extension workflow is three steps, and the README is clear that the template you copy is an L2 prefetcher, so if you are designing for a different cache level the template is only a starting point.

First, create the directory and copy the empty template into it.

bash
$ mkdir prefetcher/mypref
$ cp prefetcher/no_l2c/no.cc prefetcher/mypref/mypref.cc

Then edit your own file with the editor of your choice.

bash
$ vim prefetcher/mypref/mypref.cc

Finally, register the new component in the configuration file, where the prefetcher name matches the directory you created.

json
{
    "L2C": {
        "prefetcher": "mypref"
    }
}

The name mypref in the configuration is what links the JSON to the prefetcher/mypref directory, which is why the copy step insists on that exact naming. After registering it, the usual sequence applies: run config.sh with the configuration file, run make, then run the binary against a trace.

bash
$ ./config.sh <configuration file>
$ make
$ bin/champsim --warmup-instructions 200000000 --simulation-instructions 500000000 600.perlbench_s-210B.champsimtrace.xz

The same pattern applies to branch predictors and replacement policies, since the Makefile treats branch, btb, prefetcher and replacement as parallel module families. The test/ directory holds the test targets, and the Makefile exposes test and pytest targets alongside clean, configclean and compile_commands.

Where ChampSim is the wrong instrument

The main limitation is the trace abstraction itself. Because ChampSim replays a recorded instruction stream, it cannot react to timing feedback, it cannot model a real operating system, and it cannot represent speculative execution effects that depend on a live microarchitecture. A result from ChampSim is a statement about a policy under a modelled memory hierarchy, not a prediction of how a specific machine will run.

Second, there is no power or energy model in the repository. Any conclusion about energy or thermal behaviour has to come from elsewhere, and the IPC metric gives no help there.

Third, the dependency chain is heavier than a single binary would be. A newcomer must initialise a submodule, bootstrap vcpkg, install libraries, generate a configuration and compile, and the first build can fail for reasons that have nothing to do with the model. The build also relies on a C++ toolchain plus the vendored libraries from vcpkg, so compiler and library version mismatches are a known class of friction in this layout.

Finally, results depend on trace choice. The competition traces are single fixed workloads, and a policy that wins on one trace can lose on another, so a single run tells you very little.

Licence, citation expectations and release cadence

The project is under the Apache-2.0 licence, with the LICENSE file at the root of the repository, and it is maintained at Texas A&M University with support from the computer architecture community.

The licensing comes with an expectation that the README states plainly: ChampSim is the result of academic research, and users are asked to cite it, with a specific reference given to the 2022 paper on the Championship Simulator, including a DOI pointing to an arXiv entry. There is also a mechanism for credit. Users who publish work with ChampSim may submit a pull request modifying PUBLICATIONS_USING_CHAMPSIM.bib to have their paper listed in the documentation.

Releases follow a dated calendar scheme rather than semantic versioning: 2026-04 dated 2026-04-10, 2024-12 dated 2024-12-05, and 2023-08 dated 2023-08-09. That makes sense for a competition-driven project, since the cycles are tied to the cache and prefetch championships, but it also means the version number tells you a date rather than a compatibility level.

The repository is not archived and its last push was on 2026-09-13, so the simulator is still being worked on. The 2026-04 release is a good target for a new user, since it is the most recent one and the last push is later than it.

Editorial conclusion

ChampSim fits graduate students, architecture competition entrants and anyone comparing cache, prefetcher or replacement policies against a common harness, and the vcpkg plus config.sh plus make path is quick to reproduce. It does not fit work that needs cycle-accurate timing, power or full-system behaviour, since the trace-driven design abstracts all of that away. Verify first that the trace you intend to use is still downloadable, since the README itself asks users to keep their own copy of trace data.

Frequently asked questions

How do I build ChampSim?

Initialise the bundled vcpkg submodule, bootstrap it and install the dependencies, then generate the build configuration and compile. The README gives git submodule update --init, vcpkg/bootstrap-vcpkg.sh and vcpkg/vcpkg install, followed by ./config.sh and make.

What configuration format does ChampSim use?

JSON. The README points to champsim_config.json as a fully specified example, says every option in it is optional and replaced by defaults, and notes that config.sh can also be run with no input, in which case an empty file is assumed.

How do I add my own prefetcher to ChampSim?

Create a directory under prefetcher, copy the empty template prefetcher/no_l2c/no.cc into it, edit it, and name it in the configuration file under the L2C prefetcher key, then rerun config.sh and make. The README notes that the example template is an L2 prefetcher, so a different cache level needs your own design.

Where do I get ChampSim traces?

The README points to the Data Prefetching Championship 3 trace archive on Stony Brook's servers and to a separate link for the 2nd Cache Replacement Championship traces. It also asks frequent users to keep their own copy of the traces in case those links break.

Official sources

  1. ChampSim/ChampSim on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/champsim-champsim.svg)](https://hysenlabs.com/projects/champsim-champsim)

Was this useful?