arXiv:2610.08186cs.AROct 2026

Manuscript Offprint

arXiv:2610.08186

A gem5-based Simulation Framework for Computing-in-DRAM

Alexander Kusnezoff, João Paulo C. de Lima, Jeronimo Castrillon, Asif Ali Khan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Alexander Kusnezoff 1^{1}, João Paulo C. de Lima 3,∗^{3,*}, Jeronimo Castrillon 1,2^{1,2}, Asif Ali Khan 4,∗^{4,*}

1^{1}TU Dresden, 2^{2}ScaDS.AI, 3^{3}Friedrich-Alexander-Universität Erlangen-Nürnberg

4^{4}Paderborn University, Germany

alexander.kusnezoff@mailbox.tu-dresden.de, joao.lima@fau.de, jeronimo.castrillon@tu-dresden.de

asif.khan@uni-paderborn.de

Abstract—Computing-in-Memory using DRAM (CIMD) has demonstrated substantial energy and throughput gains for memory-bound workloads consisting of bulk-bitwise operations, by performing computation directly within DRAM subarrays. Realizing CIMD, however, requires a redesign of the memory controller and careful mapping of operands onto the memory arrays. Presently, accurate FPGA-based testbeds exist, but they are costly and labor-intensive, while open-source simulators are largely trace-based and cannot execute full application runs. The only full-application CIMD simulator available, included with MIMDRAM [1], is built on an outdated version of gem5 and its toolchains. We present gem5-CIMD, a full-application CIMD simulation framework built on the latest version of gem5. We extend the simulated instruction set from four bitwise operations to sixteen CIM instructions spanning arithmetic, relational, conditional, and utility operations across a range of data types and bitwidths (4 to 64 bits). A complete memory-management stack comprising multi-level huge-page support, a CIM-aware allocator, and a subarray-aware address-mapping scheme ensures that CIM operands are co-located in the same DRAM subarray. In addition, gem5-CIMD is aware of the DRAM refresh interval and faithfully models and schedules the mandatory refresh operations when needed. We provide a CIM standard library intended as a compiler target and evaluate gem5-CIMD on multiple case studies including an end-to-end KNN workload. The simulator sources, including the evaluated workloads, are available at https://github.com/tud-ccc/gem5-CIMD.

Index Terms—processing-in-memory, processing-using-DRAM, computing-in-memory, logic-in-memory, gem5, architectural simulation, DRAM, compiler infrastructure

I. INTRODUCTION

Data movement, not computation, dominates the energy and latency budget of modern memory-bound workloads [2]. Across machine learning, database, and graph-processing applications, moving operands between memory and the processor is the principal bottleneck, accounting for over 62% of total system energy consumption [2]–[4]. This gap between compute throughput and memory bandwidth continues to widen as Moore's Law slows down. Processing-in-memory (PIM) addresses this directly by performing computation within, or close to, the memory that stores the data, thus reducing or fully eliminating data transfers [3], [5].

PIM has been demonstrated across various memory technologies and computational paradigms, targeting a broad range of application domains [5]. Among them, computing-in-memory using DRAM (CIMD) 1^{1} is especially attractive for applications requiring bulk-bitwise logic and arithmetic operations. By simultaneously activating multiple rows, CIMD repurposes the analog charge-sharing behavior of DRAM sense amplifiers to implement basic logic operations directly within the array [6]–[8], from which the full set of bitwise and arithmetic operations can be derived [9]. For instance, in the Ambit scheme [6], simultaneously activating three rows causes the charge accumulated on each column's bitline to reflect the bitwise majority of the three stored values and a subsequent precharge operation closes all rows and writes the majority result back to each of them. This strictly requires operands to be column-aligned within the same subarray. Other architectures such as SIMDRAM [9], MIMDRAM [1], PRADA [8], and FCDRAM [7] demonstrate that a wide range of operations can be expressed as sequences of such activate and precharge (AP) primitives, collectively referred to as microprograms [9], and executed in-place.

Leveraging CIMD in practice requires error-prone low-level programming or novel compilers. There is a growing body of work for the latter, where high-level compilation frameworks take an application kernel as input and generate its corresponding microprograms [10]–[14]. For validation, these works either rely on ad-hoc, in-house simulators or on trace-driven memory-only simulators. The few available hardware testbeds, such as PiDRAM [15], run on FPGA prototypes that are accurate but costly to acquire and laborious to configure, placing them out of reach for most researchers.

Simulation is the natural alternative, offering fine-grained control over system configuration, inexpensive design-space exploration, and flexible integration into compiler pipelines. Existing CIMD simulators, however, fall short. Ramulator [16]- and NVMain-based simulators [17] operate on memory traces and cannot execute full application runs, capturing the DRAM device in isolation while ignoring the full-system aspects. To the best of our knowledge, the only simulator capable of running complete CIMD applications is the one released with MIMDRAM [1]. 2^{2} However, this simulator is built on an outdated version of gem5 (2015), requiring outdated Python

∗^{*}Work done while the authors were at TU Dresden.

1^{1}Also referred to as Processing-using-DRAM (PuD).

2^{2}https://github.com/CMU-SAFARI/MIMDRAM

TABLE I FEATURE COMPARISON OF GEM5-CIMD VS. MIMDRAM.

FeatureMIMDRAMgem5-CIMD
gem5 version2015-erav25 (2025)
Supported CIM ISA4 ops16 ops
Same-subarray operand check×✓
CIMD-specific memory management×✓
AP/AAP statistics counters×✓

and GCC toolchains, and has been isolated from nearly a decade of upstream advances in memory-controller modeling, cache-coherence support, and system emulation. Beyond the fundamental AP and AAP operations, the simulator exposes only four bitwise primitives (AND, OR, NOT, XOR) and lacks the memory-management infrastructure needed to guarantee subarray co-location of operands. Arithmetic operations such as addition or multiplication can only be expressed by manually decomposing them into raw AP and AAP sequences, thus requiring the programmer to implement carry propagation and manage temporary DRAM rows explicitly with no ISA-level abstraction for arithmetic or relational operations.

This paper proposes gem5-CIMD, a CIMD simulation framework built on the latest gem5 (v25) [18] that addresses the above-mentioned limitations. Table I compares gem5-CIMD with the baseline MIMDRAM implementation, highlighting the newly added features. Concretely, our contributions are as follows:

Extended instruction set: gem5-CIMD extends the instruction set from four bitwise operations to sixteen CIMD instructions, spanning arithmetic, relational, conditional, and utility operations at bitwidths of 4, 8, 16, 32, and 64 bits, each backed by a precomputed Ambit [6] microprogram per supported bitwidth, executed with cycle-accurate DRAM timing.

Memory-management support: We implement multi-level huge-page table support in gem5's syscall-emulation mode, a CIM-aware memory allocator, and a subarray-aware address-mapping scheme that guarantees operands sharing a computation are placed in the same DRAM subarray.

Realistic refresh modeling: Microprograms in CIMD quickly become longer than a typical DRAM refresh interval, e.g., a 64-bit addition expands to 597 AP/AAP commands. We observed that this is an aspect that has been neglected so far in existing simulators. By omitting mandatory interleaved refresh operations, such simulators yield optimistic performance estimates. To account for this, gem5-CIMD models intermediate refreshes explicitly.

Library support: We expose the full instruction set as a C/C++ standard library intended as a compiler target. We validate gem5-CIMD against an analytical command model and the MIMDRAM simulator, and evaluate multiple case studies including bitwise logic, arithmetic, relational, and conditional operations as well as an end-to-end KNN classifier as a qualitative proof of concept.

The remainder of this paper is organized as follows. Sec- tion II provides a short background on CIMD and the gem5 simulator. Section III describes the gem5-CIMD framework. Section IV presents the evaluation, and Section V concludes the paper.

References (20)