Skip to content



Repository files navigation


ChampSim is a trace-based simulator for a microarchitecture study. You can sign up to the public mailing list by sending an empty mail to Traces for the 3rd Data Prefetching Championship (DPC-3) can be found from here ( A set of traces used for the 2nd Cache Replacement Championship (CRC-2) can be found from this link. (

Clone ChampSim repository

git clone


ChampSim takes five parameters: Branch predictor, L1D prefetcher, L2C prefetcher, LLC replacement policy, and the number of cores. For example, ./ bimodal no no lru 1 builds a single-core processor with bimodal branch predictor, no L1/L2 data prefetchers, and the baseline LRU replacement policy for the LLC.

$ ./ bimodal no no no lru 1


Download DPC-3 trace

Professor Daniel Jimenez at Texas A&M University kindly provided traces for DPC-3. Use the following script to download these traces (~20GB size and max simpoint only).

$ cd scripts

$ ./

Run simulation

Execute with proper input arguments. The default TRACE_DIR in is set to $PWD/dpc3_traces.

  • Single-core simulation: Run simulation with script.
$ ./ bimodal-no-no-no-lru-1core 1 10 400.perlbench-41B.champsimtrace.xz

${BINARY}: ChampSim binary compiled by "" (bimodal-no-no-lru-1core)
${N_WARM}: number of instructions for warmup (1 million)
${N_SIM}:  number of instructinos for detailed simulation (10 million)
${TRACE}: trace name (400.perlbench-41B.champsimtrace.xz)
${OPTION}: extra option for "-low_bandwidth" (src/

Simulation results will be stored under "results_${N_SIM}M" as a form of "${TRACE}-${BINARY}-${OPTION}.txt".

  • Multi-core simulation: Run simulation with script.
$ ./ bimodal-no-no-no-lru-4core 1 10 0 400.perlbench-41B.champsimtrace.xz \\
  401.bzip2-38B.champsimtrace.xz 403.gcc-17B.champsimtrace.xz 410.bwaves-945B.champsimtrace.xz

Note that we need to specify multiple trace files for N_MIX is used to represent a unique ID for mixed multi-programmed workloads.

Add your own branch predictor, data prefetchers, and replacement policy

Copy an empty template

$ cp branch/ prefetcher/mybranch.bpred
$ cp prefetcher/ prefetcher/mypref.l1d_pref
$ cp prefetcher/ prefetcher/mypref.l2c_pref
$ cp prefetcher/ prefetcher/mypref.llc_pref
$ cp replacement/ replacement/myrepl.llc_repl

Work on your algorithms with your favorite text editor

$ vim branch/mybranch.bpred
$ vim prefetcher/mypref.l1d_pref
$ vim prefetcher/mypref.l2c_pref
$ vim prefetcher/mypref.llc_pref
$ vim replacement/myrepl.llc_repl

Compile and test

$ ./ mybranch mypref mypref mypref myrepl 1
$ ./ mybranch-mypref-mypref-mypref-myrepl-1core 1 10 bzip2_183B

How to create traces

We have included only 4 sample traces, taken from SPEC CPU 2006. These traces are short (10 million instructions), and do not necessarily cover the range of behaviors your replacement algorithm will likely see in the full competition trace list (not included). We STRONGLY recommend creating your own traces, covering a wide variety of program types and behaviors.

The included Pin Tool champsim_tracer.cpp can be used to generate new traces. We used Pin 3.2 (pin-3.2-81205-gcc-linux), and it may require installing,, or other libraries, if you do not already have them. Please refer to the Pin documentation ( for working with Pin 3.2.

Use the Pin tool like this

pin -t obj-intel64/ -- <your program here>

The tracer has three options you can set:

Specify the output file for your trace.
The default is default_trace.champsim

-s <number>
Specify the number of instructions to skip in the program before tracing begins.
The default value is 0.

-t <number>
The number of instructions to trace, after -s instructions have been skipped.
The default value is 1,000,000.

For example, you could trace 200,000 instructions of the program ls, after skipping the first 100,000 instructions, with this command:

pin -t obj/ -o traces/ls_trace.champsim -s 100000 -t 200000 -- ls

Traces created with the are approximately 64 bytes per instruction, but they generally compress down to less than a byte per instruction using xz compression.

Evaluate Simulation

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!


ChampSim repository







No releases published




  • Jupyter Notebook 49.1%
  • C++ 46.2%
  • Python 2.5%
  • Shell 1.4%
  • Other 0.8%