MXPerfSim
Introduction
The MX Performance Simulator (MXPerfSim) is a performance estimation tool developed by XCENA to provide performance modeling for the manycore-based near-data processing (NDP) systems.
The main goal of MXPerfSim is to support design space exploration of manycore-based near-data acceleration architecture for research purposes. Therefore, instead of providing performance metrics that closely resemble those of the MX1 product, MXPerfSim aims to support design space exploration by presenting performance trends under various design choices.
How to use
1. Quick start
-
Get the Docker image from Docker Hub (xcenadev/sdk - Docker Image Docker Hub) -
Set up the Docker container (please follow 1. Prepare Docker Environment in Emulator Installation)
-
Move to the emulator folder and type
./run.sh --trace_dump <trace_dump_path>to launch QEMU with the memory trace dumper enabled.<trace_dump_path>is an optional argument which designates the path of the output memory trace files (default: mxperfsim_traces).run.shalways takes the token after--trace_dumpas the path, so omit the path only when--trace_dumpis the last option. -
You will be at
~/sdkfolder when QEMU is launched. Move to any folder which contains MU kernel code and build script that you want to get traces from, and build the MU kernel. -
Move to
~/sdkfolder in QEMU and type./generate_traces.sh <executable_path>.<executable_path>is the path of the executable that you built in Step 4. -
After the trace generation finishes, shut down the guest with
sudo shutdown -h nowin the guest shell (see Exiting the Emulator), wait for QEMU to exit, and move to the MXPerfSim folder (cd /work/tools/mxperfsim). -
Type
./run_mxperfsim.sh <config_file> mu_trace_prefix=<trace_dir> stats_file_prefix=<stats_dir>to execute performance simulation (overrides MUST be written askey=value).<config_file>is the path of the configuration file (examples are located atconfigs/examples),<trace_dir>is the path where memory trace files are located (if you run trace generation with the default path,mu_trace_prefixis/work/emulator/mxperfsim_traces), and<stats_dir>is the location where output statistics files will be created. -
You can run simulation directly by executing the following command in terminal.
<overridden_parameters>are optional parameters that override the values specified in the configuration file (written askey=value)../run_mxperfsim.sh <config_file> <overridden_parameters>The script builds
build/release/mxperfsimif the executable is missing. You can also invoke that executable directly with the same arguments.
The configuration file supplies hardware parameters to the simulator for performance simulation. Main parameters include:
-
Number of memory execution unit (MU) clusters
-
Size of L1/L2/L3 caches
-
Number of L3 cache slices (must be a power of 2)
-
Associativity of L3 caches
-
Hit latency of L3 caches
-
Queue latency between HW modules (except the internal queues of MU clusters)
-
Number of DRAM channels (must be a power of 2)
For a more detailed description of the simulation parameters, please refer to Appendix.A: MXPerfSim parameter description.
Once output statistics are generated by MXPerfSim, they can be visualized by using plotting scripts provided with the simulator.
You can run the plotting script by executing the following command in a terminal. <plot_mode> means the type of plot generation. When plot_mode is 0, the plotting script runs in scalability mode and generates plots that show the trend of each performance metric over different numbers of MU clusters. If plot_mode is 1, the script runs in interval mode and generates plots that show trend of performance metrics over time for a given number of MU clusters. To run the script in scalability mode, you have to get statistics of the target workload with different numbers of MU clusters, starting from 1.
./run_auto_plotter.sh <plot_mode>
2. Understanding outputs
Since the most important system factor for memory-bound workloads is hit rate of caches (i.e., what portion of memory accesses can be filtered by the cache hierarchy), the core statistics provided by the MX Performance Simulator are performance-related metrics of the cache hierarchy. Specifically, the MX Performance Simulator produces the following statistics as simulation outputs.
-
MU thread: number of load/stores per thread, average interval of load instructions in terms of number of instructions or cycles
-
Cache: hit count, miss count, evict count, bypass count of individual caches, as well as aggregated statistics for each cache level.
-
DRAM: number of total reads/writes
Output statistics for MU clusters are sorted by cluster ID. In other words, statistics for MU thread, L1 cache, L2 cache are grouped by cluster ID and displayed in cluster ID order.
While MXPerfSim produces text-based output statistics, they also can be visualized using Python scripts.

Overview
MXPerfSim is a specialized tool designed to estimate the performance of the “MX1-like” system for a given workload. By adjusting the configuration of hardware IPs or fine-tuning specific parameter values within a range analogous to that of the manycore-based NDP system, it enables design space exploration and supports data-driven decision-making during the architectural design phase of next-generation MX products.
For memory-bound workloads, the single most critical determinant of system performance is the efficiency with which the cache hierarchy filters DRAM accesses.
Accordingly, the performance simulator utilizes load/store traces generated by the MX1’s Memory Execution Units (MUs), applying concurrency to MU threads’ cache memory accesses. MXPerfSim’s objective is to deliver meaningful, cache memory-related performance metrics that closely reflect real-world behavior. Therefore, cache memory is implemented using a detailed timing model, while the modeling of the remaining hardware components (e.g., bus, DRAM) is relatively simple.
Target domain
Since XCENA’s products are fundamentally designed to accelerate memory-bound workloads, the dominant factor influencing application performance is the cache memory subsystem. Accordingly, the simulator focuses on collecting detailed cache-related statistics. The overall implementation can be summarized as follows:
Simplified MU Thread Timing Model
-
Based on the trace manager shown in the block diagram.
-
Only memory instructions are simulated; compute instructions are modeled as simple latency gaps proportional to the number of intervening memory instructions (gap × 1 cycle).
-
Each MU thread issues at most one outstanding load at a time, following a single-load model: a new request is issued only when the response to the previous load has been received.
Excluded Components
- Certain IP blocks, such as instruction caches, TLBs, and cache/bus schedulers, are not modeled.
Cache Timing Model (L1–L3)
-
Provides a relatively detailed timing representation.
-
Beyond simple hit/miss evaluation, the model implements essential high-performance cache features such as MSHR handling, enabling a more faithful representation of highly concurrent shared cache memory behavior.
Simulator structure
The simulator advances hardware models according to a shared tick counter. Each model uses its configured clock frequency to determine when its next cycle occurs.
The simulator connects trace readers to cache and memory models. The configuration controls how many threads share each cache and how the cache levels connect. For example, increasing the number of threads per L1 cache makes more requests compete for that cache’s capacity and ports.

In the simulator, the connectivity between hardware blocks is configurable. For example, parameters such as the number of MU threads sharing a single L1 cache can be adjusted to observe the resulting performance variations.

Each IP block is managed by a corresponding ModuleImpl/ClockImpl class, which contains a doTick function defining the operations performed by that IP block in a single cycle. The specific behavior of each IP block is implemented within its own doTick function. For example:
-
MU Thread: Reads the trace file, generates packets, and checks for the arrival of response packets.
-
Cache: Processes cache requests issued by MU threads and updates cache status based on response packets received from lower cache levels (or DRAM).
The ModuleImpl class also contains inbound and outbound interfaces that connect to other modules. Using the interface functions of the inbound/outbound classes, modules perform packet transmission and reception with one another.

A TimeQueue delays a packet until its configured latency has elapsed. The simulator uses separate queues for requests and responses between connected modules. Those queues allow traffic in both directions. The simulator advances the interface queues after advancing the hardware models.

A cache places locally completed requests in its processQueue. Requests that need a lower memory level enter its forwardQueue. The queue timing determines when another module can receive each packet.

IP block documentation
An intellectual property (IP) block here means one modeled hardware component. The sections below describe the cache, memory, and routing blocks.

Cache
The cache model receives requests and examines ready responses during doTick(). Its MSHR merges requests for a line that already has an outstanding miss. When the line’s response arrives, the model completes the pending requests for that line. The model does not implement cache coherence or transfer actual data values. It treats pending writes as complete when the MSHR entry is released.
DRAM
The DRAM model queues requests in arrival order. dram_latency sets the queue latency. dram_process_queue_depth limits the number of outstanding requests. dram_queuing_interval limits response spacing. See tools/mxperfsim/mxperfsim/public/src/dram/simple_dram.cpp for the queue and response checks.
Arbiter
An arbiter selects one request from several inputs and sends it to one output. The model supports two selection policies.
Two arbitration policies are supported:
-
Least Recently Granted (LRG)
-
Round-Robin
Router
A router sends one input packet to one of several outputs. The router selects an output from packet metadata, such as the request address. The configuration controls the number of outputs.
Multi-In-Out
The Multi-In-Out block combines an arbiter and a router. The arbiter selects one of M inputs. The router then sends the selected packet to one of N outputs.
Appendix.A: MXPerfSim parameter description
mu_trace_prefix Path to the directory containing MU thread trace files. Each trace file is named mu_thread_{thread ID}.txt. The simulator locates the corresponding file under this path and uses it as the input trace.
stats_file_prefix Path to the directory where output statistics files are stored. During execution, interval-based statistics are generated at 1 ms simulation-time intervals, and aggregate statistics are produced at the end of the simulation.
- Interval statistics:
cluster_{#clusters}/interval_{interval}.txt - Aggregate statistics:
cluster_{#clusters}.txt
num_clusters Total number of MU clusters.
num_l3_caches
Number of L3 caches (must be a power of 2).
num_dram_channels
Number of DRAM channels (must be a power of 2).
cluster_frequency ~ bus_frequency Clock frequency (in GHz) for each component.
tick_granularity Tick resolution of the simulation. A single tick corresponds to 1 ps of absolute time. For example, if this parameter is set to 250, the simulator polls all modules at 250 ps intervals to check whether their local clock domain has reached the next cycle, and then invokes the cycle() function if so.
l[x]_cache_size Total cache size (bytes) for level x.
l3_cache_line_size L3 cache line size (bytes).
l3_cache_way L3 cache associativity (number of ways).
l3_mshr_size Number of MSHR entries for L3 cache.
l3_repl_policy Replacement policy for L3 cache. Supported options: lru, round_robin, random.
l3_hit_latency L3 cache hit latency (in cycles).
dram_process_queue_depth Maximum number of outstanding requests that a DRAM channel can process concurrently.
Appendix.B: Extending MX Performance Simulator with third-party simulators
The MX Performance Simulator can be extended with third-party simulators to simulate different forms of systems. For example, users can integrate a customized core model instead of the MU cluster model, or a detailed DRAM simulator such as DRAMSim or Ramulator instead of default FIFO-based DRAM model.
The replacement must exchange requests and responses through MXPerfSim packets. In other words, a translation layer to convert MXPerfSim’s packet from/to third-party simulators’ data flow abstraction is needed to integrate MXPerfSim with other simulators.
As described in the “Simulator structure” section, the hardware components of MXPerfSim are interconnected through timer-based queues. These queues are instantiated in the buildSystem function in mx_simulator.cpp. Therefore, users can replace the MU cluster or DRAM models with third-party simulators in the buildSystem function by changing the hardware component instantiation part, and connect them to the existing cache hierarchy of MXPerfSim by changing the queue instantiation part.
For example, if a user wants to attach a custom CPU model on top of MXPerfSim’s cache hierarchy, the following steps are needed for integration.
The code section below shows instantiation of hardware components in MxSimulator::buildSystem function. Users can add a custom CPU model by replacing the MU cluster instantiation part (lines 1–2) with an instantiation of the custom CPU model.
1: mxSubSystem_ = std::make_shared<MxSubSystem>();
2: mxSubSystem_->buildMxSubSystem(config, ID);
3:
4: std::string statsFilePrefix = config.getStr("stats_file_prefix");
5: if (fs::exists(statsFilePrefix) == false)
6: {
7: fs::create_directories(statsFilePrefix);
8: }
9:
10: // L3 cache creation
11: for (uint64_t i = 0; i < numL3Cache; i++)
12: {
13: uint64_t tickPerCycle = static_cast<uint64_t>(1000.0 / l3CacheFreq);
14: auto l3Cache = std::make_shared<BaseCache>(config, BaseCacheCore::BaseCacheCoreType::L3);
15: l3Cache->getCacheCore()->setId(ID++);
16: l3Cache->getCacheCore()->setCacheId(i);
17: l3Cache->setTickPerCycle(tickPerCycle);
18: l3Caches_.push_back(l3Cache);
19: }
20:
21: // DRAM channel creation
22: for (uint64_t i = 0; i < numDramChannel; i++)
23: {
24: uint64_t tickPerCycle = static_cast<uint64_t>(1000.0 / dramChannelFreq);
25: auto dramChannel = std::make_shared<DramChannel>(config);
26: dramChannel->getDramCore()->setId(ID++);
27: dramChannel->getDramCore()->setDramId(i);
28: dramChannel->setTickPerCycle(tickPerCycle);
29: dramChannels_.push_back(dramChannel);
30: }
A custom CPU model can then be connected with other hardware components in MXPerfSim by modifying queue creation (Line 2-28) and attaching code (Line 30-31) in the same function.
1: // Cluster <-> L3 cache connection
2: std::vector<std::vector<std::shared_ptr<Inbound<std::shared_ptr<Packet>>>>> mxSubSystemDownstreamInbounds;
3: std::vector<std::vector<std::shared_ptr<Outbound<std::shared_ptr<Packet>>>>> mxSubSystemDownstreamOutbounds;
4: mxSubSystemDownstreamInbounds.resize(numClusters);
5: mxSubSystemDownstreamOutbounds.resize(numClusters);
6:
7: std::vector<std::vector<std::shared_ptr<Inbound<std::shared_ptr<Packet>>>>> l3UpstreamInbounds;
8: std::vector<std::vector<std::shared_ptr<Outbound<std::shared_ptr<Packet>>>>> l3UpstreamOutbounds;
9: l3UpstreamInbounds.resize(numL3Cache);
10: l3UpstreamOutbounds.resize(numL3Cache);
11:
12: for (uint64_t i = 0; i < numClusters; i++)
13: {
14: for (uint64_t j = 0; j < numL3Cache; j++)
15: {
16: auto mxSubSystemOutboundL3InboundQ = std::make_shared<TimeQueue<std::shared_ptr<Packet>>>(busLatency, 1);
17: mxSubSystemOutboundL3InboundQ->setTickPerCycle(busTickPerCycle);
18: registerInterfaceClock(mxSubSystemOutboundL3InboundQ);
19: mxSubSystemDownstreamOutbounds[i].push_back(mxSubSystemOutboundL3InboundQ);
20: l3UpstreamInbounds[j].push_back(mxSubSystemOutboundL3InboundQ);
21:
22: auto mxSubSystemInboundL3OutboundQ = std::make_shared<TimeQueue<std::shared_ptr<Packet>>>(busLatency, 1);
23: mxSubSystemInboundL3OutboundQ->setTickPerCycle(busTickPerCycle);
24: registerInterfaceClock(mxSubSystemInboundL3OutboundQ);
25: mxSubSystemDownstreamInbounds[i].push_back(mxSubSystemInboundL3OutboundQ);
26: l3UpstreamOutbounds[j].push_back(mxSubSystemInboundL3OutboundQ);
27: }
28: }
29:
30: mxSubSystem_->setOutbounds(mxSubSystemDownstreamOutbounds);
31: mxSubSystem_->setInbounds(mxSubSystemDownstreamInbounds);
Note that the custom hardware model has to contain a translation interface between MXPerfSim’s packet and the custom model’s own data flow abstraction.