Written and maintained by CASRAI Editorial Board
Published
On this page
ChampSim is an open-source, cycle-level, trace-based microarchitectural simulator developed to evaluate CPU core microarchitecture, branch prediction algorithms, and multi-level memory hierarchies without the computational overhead of full-system emulation. Maintained by researchers at Texas A and M University and the broader computer architecture research community under the Apache-2.0 license, ChampSim provides a modular C++ testbed that serves as the official evaluation platform for major academic competitions, including the Data Prefetching Championship and the Cache Replacement Championship.
What ChampSim is used for in research
In computer architecture and computer systems research, evaluating new hardware mechanisms requires balancing simulation detail against computational throughput. ChampSim occupies a vital niche in this spectrum: it delivers cycle-accurate simulation of the processor out-of-order execution core and the memory subsystem while employing trace-driven instruction execution rather than full-system software emulation. This design allows researchers to simulate hundreds of millions of instructions in minutes, making it practical to conduct comprehensive sweeps over cache sizes, prefetching heuristics, and branch predictor configurations.
ChampSim is predominantly used to investigate microarchitectural innovations where memory latency and branch mispredictions represent the primary execution bottlenecks. Because modern high-performance microprocessors spend a significant portion of their execution cycles stalled waiting for data from main memory, memory hierarchy research relies heavily on ChampSim to prototype and validate:
- Hardware Data Prefetchers: Evaluating algorithms at the L1 data cache (L1D), Level-2 cache (L2C), and Last-Level Cache (LLC) boundaries, including stream prefetchers, stride prefetchers, Signature Path Prefetchers (SPP), and machine-learning-guided prefetching mechanisms.
- Cache Replacement Policies: Testing replacement logic across set-associative structures, comparing Least Recently Used (LRU) baselines against state-of-the-art algorithms such as Static Re-Reference Interval Prediction (SRRIP), Dynamic RRIP (DRRIP), Signature-based Hit Predictor (SHiP), and Hawkeye.
- Branch Direction and Target Predictors: Investigating conditional branch predictors (such as TAGE, perceptron, and bimodal predictors) alongside Branch Target Buffers (BTB) to minimize pipeline flushes.
- DRAM Controller Scheduling: Analyzing multi-channel memory controller scheduling policies, row-buffer management schemes, and bus contention effects under memory-intensive workloads.
A defining characteristic of ChampSim is its standardization across academic research. The platform originated as the evaluation harness for the Data Prefetching Championship (DPC) and Cache Replacement Championship (CRC), organized in conjunction with premier computer systems conferences such as ISCA and MICRO. By providing an identical microarchitectural baseline and standardized benchmark traces, ChampSim enables researchers to evaluate their proposed algorithms against established state-of-the-art baselines under identical timing conditions. When evaluating processor architectures, understanding the underlying instruction set architecture is essential for contextualizing how instruction traces are generated and decoded by execution units. Furthermore, evaluating these mechanisms against standardized workloads often incorporates a synthetic benchmark or realistic trace distributions to stress specific pipeline structures.
How to install or access ChampSim
ChampSim is distributed as free, open-source software under the permissive Apache License 2.0. Researchers can access the official source code repository hosted on GitHub at https://github.com/ChampSim/ChampSim. The simulator is designed to run on modern Linux environments (such as Ubuntu 20.04 LTS, 22.04 LTS, or Debian-based distributions) and requires an updated modern C++ toolchain supporting C++20 language features.
Before compiling ChampSim, ensure your host environment contains the necessary build dependencies, including a C++20 compliant compiler (such as GCC 11 or higher, or Clang 12 or higher), CMake version 3.15 or later, GNU Make or Ninja, Python 3.8 or higher, and development libraries for XZ and LZMA compression. Managing your project code and experiment branches can be organized effectively by reviewing workflows in Git vs GitHub vs GitLab to coordinate multi-collaborator architectural evaluations.
To install ChampSim and initialize its external libraries from official sources, execute the following commands in your terminal:
- Install system package dependencies: Install the foundational compiler toolchain, CMake build system, and compression header files via your package manager:
sudo apt-get update sudo apt-get install -y build-essential gcc-11 g++-11 cmake ninja-build python3 liblzma-dev git - Clone the official ChampSim repository: Clone the repository from GitHub and navigate into the project directory:
git clone https://github.com/ChampSim/ChampSim.git cd ChampSim - Initialize and update git submodules: ChampSim uses the Microsoft vcpkg package manager as an embedded git submodule to handle C++ dependencies (such as the
{fmt}formatting library). Initialize this submodule:git submodule update --init --recursive - Bootstrap and install vcpkg packages: Run the vcpkg bootstrap script and install the required dependencies specified in the repository manifest:
./vcpkg/bootstrap-vcpkg.sh ./vcpkg/vcpkg install
Once the vcpkg installation completes successfully, all required third-party libraries and header files are linked in the local repository tree, leaving ChampSim ready for configuration and compilation.
How to configure and simulate memory hierarchies step by step
ChampSim employs a declarative JSON-based configuration system that decouples hardware topology specifications from the core simulation engine. Rather than modifying internal simulator source files for routine architectural explorations, researchers create a JSON configuration file specifying processor core parameters, cache geometry, prefetchers, replacement policies, and interconnect topologies. The configuration script then processes this file to generate specialized C++ source files that are compiled into an optimized simulation binary.
Follow this step-by-step workflow to configure, compile, and execute a custom memory hierarchy simulation:
- Create a JSON configuration file: In the root of the ChampSim directory, author a configuration file (for example,
my_config.json). This configuration specifies core sizing, branch prediction models, cache structures, and DRAM channel settings:{ "executable_name": "champsim_custom", "block_size": 64, "page_size": 4096, "heartbeat_frequency": 10000000, "num_cores": 1, "ooo_cpu": [{ "frequency": 4000, "ifetch_buffer_size": 64, "decode_buffer_size": 32, "dispatch_buffer_size": 32, "rob_size": 352, "lq_size": 128, "sq_size": 72, "fetch_width": 6, "decode_width": 6, "dispatch_width": 6, "execute_width": 6, "lq_width": 2, "sq_width": 2, "retire_width": 6, "branch_predictor": "bimodal", "btb": "basic_btb" }], "L1I": { "sets": 64, "ways": 8, "rq_size": 64, "wq_size": 64, "pq_size": 32, "mshr_size": 8, "latency": 4, "max_tag_check": 2, "max_fill": 2, "prefetcher": "no" }, "L1D": { "sets": 64, "ways": 12, "rq_size": 64, "wq_size": 64, "pq_size": 32, "mshr_size": 16, "latency": 5, "max_tag_check": 2, "max_fill": 2, "prefetcher": "next_line", "replacement": "lru" }, "L2C": { "sets": 1024, "ways": 8, "rq_size": 32, "wq_size": 32, "pq_size": 16, "mshr_size": 32, "latency": 10, "max_tag_check": 1, "max_fill": 1, "prefetcher": "no", "replacement": "lru" }, "LLC": { "sets": 2048, "ways": 16, "rq_size": 32, "wq_size": 32, "pq_size": 32, "mshr_size": 64, "latency": 20, "max_tag_check": 1, "max_fill": 1, "prefetcher": "no", "replacement": "drrip" }, "physical_memory": { "frequency": 3200, "channels": 1, "ranks": 1, "banks": 8, "rows": 65536, "columns": 128, "channel_width": 8, "wq_size": 64, "rq_size": 64, "tRP": 12.5, "tRCD": 12.5, "tCAS": 12.5 } } - Run the configuration script: Execute ChampSim’s build configuration script, passing your JSON specification:
./config.sh my_config.jsonThe script parses the JSON topology, resolves module paths, checks module compatibility, and writes generated C++ code and Makefiles into the build directory.
- Compile the binary: Build the simulator binary using GNU Make:
make -j$(nproc)This creates the target executable in the
bin/directory (for example,bin/champsim_customorbin/champsim). - Obtain benchmark instruction traces: ChampSim does not execute native x86 binaries directly; it reads pre-recorded instruction trace files. Download standardized traces from the DPC-3 repository maintained at Stony Brook University COMPAS lab or Texas A and M University:
mkdir -p traces wget -P traces/ https://dpc3.compas.cs.stonybrook.edu/champsim-traces/speccpu/600.perlbench_s-210B.champsimtrace.xz - Execute the simulation run: Launch the simulation by specifying the number of warmup instructions, detailed simulation instructions, and the trace path:
./bin/champsim_custom --warmup-instructions 200000000 --simulation-instructions 500000000 traces/600.perlbench_s-210B.champsimtrace.xzIn this invocation, the simulator executes 200 million instructions during warmup to populate cold caches and train branch prediction tables, followed by 500 million instructions during the detailed measurement phase.
Maintaining rigorous records of simulation parameters, compiler versions, and trace hashes is fundamental to achieving computational reproducibility across hardware architectural evaluations.
How to read the output
Upon completing a simulation phase, ChampSim prints formatted statistical output generated by its plain-text reporting engine (implemented in plain_printer.cc). These statistics report only events that occur during the detailed measurement region of interest (ROI); all warmup activity is excluded from the final tallies to avoid cold-start distortion. Understanding each section of the report is vital for evaluating architectural trade-offs.
The simulation report is structured into three primary sections: Core Statistics, Cache Statistics, and DRAM Statistics.
Core Statistics
The processor core report summarizes high-level execution throughput and pipeline efficiency:
- Cumulative IPC: Calculated as retired instructions divided by elapsed processor cycles. IPC (Instructions Per Cycle) is the definitive measure of overall architectural performance. An increase in IPC indicates that hardware optimizations successfully hid memory latency or prevented branch misprediction stalls.
- Branch Prediction Accuracy: Reported as an overall percentage alongside MPKI (Mispredictions Per Kilo-Instruction). A lower MPKI directly correlates with fewer pipeline flushes and less wasted speculative execution.
- Average ROB Occupancy at Mispredict: Measures how many instructions occupied the Reorder Buffer when a branch misprediction was detected. Higher occupancy implies deeper speculative pipelines and greater energy spent on squashed paths.
- Branch Type MPKI: Decomposes mispredictions across direct jumps, indirect branches, conditional branches, direct calls, indirect calls, and return instructions.
Cache Hierarchy Statistics
For each cache level (L1I, L1D, L2C, LLC), ChampSim generates a comprehensive hit/miss matrix categorized by transaction type:
- ACCESS, HIT, and MISS Counts: Broken down by access class, including
LOAD(demand read),RFO(Read For Ownership / write-allocate read),PREFETCH(speculative prefetch request),WRITE(writeback), andTRANSLATION(page table walk memory access). - MISS_MERGE: The count of secondary misses that merged into existing Miss Status Holding Registers (MSHRs). A high merge rate demonstrates effective memory-level parallelism (MLP) without exhausting MSHR entries.
- PREFETCH Effectiveness: Quantifies prefetcher performance via four critical counters:
REQUESTED(prefetch addresses generated),ISSUED(prefetches dispatched to the memory bus),USEFUL(prefetched lines that satisfied subsequent demand requests), andUSELESS(prefetched lines evicted before being referenced). - AVERAGE MISS LATENCY: Reports the mean cycle delay experienced by demand misses from request issue until data fill.
DRAM Controller Statistics
The physical memory report details the efficiency of the DRAM memory channels:
- RQ and WQ Row Buffer Hits and Misses: Measures row-buffer locality for the Read Queue (RQ) and Write Queue (WQ). A higher row-buffer hit rate minimizes activate and precharge cycle penalties.
- AVG DBUS CONGESTED CYCLE: The average duration in cycles that data bus scheduling was delayed due to channel conflicts.
- REFRESHES ISSUED: The total number of auto-refresh operations completed during the simulation period.
Worked Example: Interpreting Cache and Prefetcher Output
Consider the following representative output excerpt from an L2 cache simulation evaluating a stream prefetcher:
=== Simulation Finished ===
cpu0 cumulative IPC: 1.4820 instructions: 500000000 cycles: 337381916
cpu0 Branch Prediction Accuracy: 96.42% MPKI: 4.120 Average ROB Occupancy at Mispredict: 142.8
cpu0->L2C TOTAL ACCESS: 42150820 HIT: 28410200 MISS: 13740620 MISS_MERGE: 2150400
cpu0->L2C LOAD ACCESS: 31200400 HIT: 21500200 MISS: 9700200 MISS_MERGE: 1820100
cpu0->L2C PREFETCH ACCESS: 6820100 HIT: 4120000 MISS: 2700100 MISS_MERGE: 120300
cpu0->L2C PREFETCH REQUESTED: 7500000 ISSUED: 6820100 USEFUL: 5120300 USELESS: 1240100
cpu0->L2C AVERAGE MISS LATENCY: 28.45 cycles
In this execution log, the total L2C demand and prefetch miss rate is 13,740,620 / 42,150,820 = 32.60%. Looking at prefetch utility, of the 6,820,100 prefetches issued into the L2 cache, 5,120,300 were useful, yielding a prefetch accuracy of 5,120,300 / 6,820,100 = 75.08%. The prefetcher reduced downstream demand traffic to the Last-Level Cache while maintaining an average L2 miss latency of 28.45 cycles.
Troubleshooting ChampSim
When building custom modules or executing large trace matrices in ChampSim, researchers frequently encounter toolchain, configuration, or trace decompression issues. The following diagnosis guide outlines common error conditions and their verified solutions:
| Error Condition | Underlying Cause | Verified Remediation Step |
|---|---|---|
vcpkg bootstrap error: could not find cmake or curl |
Missing foundational build utilities required by the vcpkg script. | Install curl, zip, unzip, tar, and cmake via apt-get install before running bootstrap-vcpkg.sh. |
fatal error: lzma.h: No such file or directory |
Missing XZ/LZMA compression header files on the host compilation environment. | Install the compression library development package: sudo apt-get install liblzma-dev, then re-run make. |
Simulation immediately aborts with 0 retired instructions |
Trace file path is invalid, permissions are restricted, or the trace format is corrupted. | Confirm the trace file path exists and is readable. Verify the file format matches ChampSim expectations using xz -t trace_file to test integrity. |
Compiler error: no matching function for call to module constructor |
Module uses legacy C-style API rather than modern ChampSim C++ module class inheritance. | Ensure your module class inherits from champsim::modules::prefetcher or champsim::modules::replacement and accepts CACHE* in its constructor. |
Negative or anomalous IPC results (e.g., IPC under 0.05) |
Zero warmup instructions leading to severe cold-start cache misses and uninitialized branch tables. | Set --warmup-instructions to at least 50,000,000 to 200,000,000 instructions to warm cache lines and branch history before ROI measurement. |
config.sh error: key error or invalid JSON syntax |
Trailing commas, mismatched brackets, or unrecognized parameter keys in champsim_config.json. |
Validate the configuration JSON syntax using python3 -m json.tool my_config.json and confirm keys match the configuration schema. |
When modifying internal cache queues (such as MSHR capacity, request queue size, or write queue depth), verify that downstream interconnect bandwidth can sustain the increased transaction rate to prevent unresolvable queue deadlocks during simulation.
Free alternatives to ChampSim
While ChampSim excels at rapid prototyping of memory hierarchy and branch prediction algorithms, computer architecture research encompasses diverse modeling needs—including full-system operating system interactions, multi-threaded synchronization, and heterogeneous accelerator execution. Several open-source simulation frameworks provide complementary or alternative capabilities. The data table below compares microarchitecture simulator features, modeling scopes, and execution modes across open-source academic tools.
| Simulator | Simulation Paradigm | Primary Strength | Trace Dependency | License |
|---|---|---|---|---|
| ChampSim | Trace-driven cycle-level | Rapid memory hierarchy and prefetching sweeps; competition standardization | Required (pre-captured instruction traces) | Apache-2.0 |
| gem5 | Execution-driven and full-system | Full ISA modeling, unmodified OS booting, peripheral device emulation | Optional (executes real ELF binaries or traces) | BSD-3-Clause |
| ZSim | Execution-driven (Pin-based) | Fast simulation of large-scale (1000+ core) multi-core memory systems | None (dynamic binary instrumentation via Intel PIN) | MIT |
| Sniper | Interval simulation (Pin-based) | High-speed multi-core x86 simulation combining analytical core models with detailed caches | None (dynamic binary instrumentation) | MIT |
| MacSim | Trace-driven cycle-level | Heterogeneous CPU and GPU microarchitectures and shared memory systems | Required (PIN or GPU traces) | LGPL-2.1 |
Choosing between these platforms depends on research objectives. Researchers requiring full-system OS booting, kernel driver interactions, or device register modeling should select the gem5 simulator despite its steeper learning curve and lower simulation throughput. Conversely, researchers focusing strictly on cache replacement, prefetch generation, or DRAM scheduling will achieve significantly higher productivity and faster experimental turnaround using ChampSim.
Frequently asked questions
What is ChampSim?
ChampSim is an open-source, trace-based microarchitectural simulator designed to evaluate processor core performance, branch prediction mechanisms, and multi-level cache hierarchies. It was originally created as a competition framework for the Data Prefetching Championship and Cache Replacement Championship and is widely used across academic computer architecture research and graduate education.
Why use trace-based simulation in ChampSim?
Trace-based simulation enables ChampSim to achieve significantly higher simulation throughput than full-system simulators by bypassing operating system emulation and instruction functional execution overhead. Furthermore, instruction traces omit proprietary application opcodes, enabling researchers and students to share benchmarks across institutions without intellectual property or licensing barriers.
How do you run or execute a simulation in ChampSim?
To execute a simulation, define a system layout in a JSON configuration file, run ./config.sh my_config.json to generate the C++ simulation environment, compile the executable with make, and launch the binary passing warmup and simulation instruction counts alongside a benchmark trace file path.
Where can I find traces for ChampSim?
Standard benchmark traces—such as SPEC CPU 2017 and SPEC CPU 2006 workloads packaged for the Data Prefetching Championship—are publicly hosted by university research repositories at Stony Brook University COMPAS lab and Texas A and M University. Additionally, researchers can generate custom traces from compiled binaries using the Intel PIN tracing utility included in the ChampSim repository.
How do I cite ChampSim in academic papers?
Researchers using ChampSim in published scholarship should cite the foundational publication: Gober, N., Chacon, G., Wang, L., Gratz, P. V., Jimenez, D. A., Teran, E., Pugsley, S., and Kim, J. (2022), ‘The Championship Simulator: Architectural Simulation for Education and Competition’, arXiv:2210.14324.
Sources
- GitHub: ChampSim Open-Source Repository, checked 2026-11-19
- ChampSim Documentation: Welcome to the ChampSim wiki!, checked 2026-11-19
- arXiv: The Championship Simulator: Architectural Simulation for Education and Competition (Gober et al., 2022), checked 2026-11-19
- Stony Brook University COMPAS: DPC-3 SPEC CPU ChampSim Traces, checked 2026-11-19
Data: Microarchitecture Simulator Comparison: Execution Paradigms and Performance Profiles
Comparative matrix of open-source computer architecture and microarchitecture simulators, compiling simulation execution paradigms, primary modeling scopes, typical throughput in KIPS, trace requirements, and licensing terms from official repositories and foundational papers.
Period covered: 2022-2026. Coverage: Global.
| Simulator | Execution Paradigm | Primary Modeling Scope | Typical Speed (KIPS) | Trace Dependency | Primary Research Domain | Software License |
|---|---|---|---|---|---|---|
| ChampSim | Trace-driven cycle-level | CPU out-of-order core, cache prefetchers, replacement, DRAM | 2200 | Mandatory (pre-captured trace) | Memory hierarchy and prefetching competitions | Apache-2.0 |
| gem5 | Execution-driven & full-system | Complete system ISA, operating system, peripherals, memory | 120 | Optional (ELF binaries or traces) | Full-system interactions, OS, architecture validation | BSD-3-Clause |
| ZSim | Execution-driven (PIN JIT) | Large-scale multi-core memory systems and cache coherence | 15000 | None (dynamic binary instrumentation) | 1000+ core multi-core memory scalability | MIT |
| Sniper | Interval simulation (PIN) | Analytical core models with detailed memory hierarchy | 1800 | None (dynamic binary instrumentation) | Multi-threaded x86 workload exploration | MIT |
| MacSim | Trace-driven cycle-level | Heterogeneous CPU and GPU pipelines, shared memory | 850 | Mandatory (PIN or GPU traces) | Heterogeneous architecture memory systems | LGPL-2.1 |
Sources
- ChampSim GitHub Repository (accessed 2026-11-19)
- The Championship Simulator (Gober et al., 2022) (accessed 2026-11-19)
- gem5 Architectural Simulator (accessed 2026-11-19)
- ZSim Architectural Simulator (accessed 2026-11-19)
- Sniper Multi-Core Simulator (accessed 2026-11-19)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







