CMEmu: Synthesizing a Cycle-Exact Model of Program Execution on ARM Cortex-M from In-Code Timing Measurements

Oct 27, 2025·
Maciej Matraszek
Maciej Matraszek
,
Mateusz Banaszek
,
Wojciech Ciszewski
,
Artur Jamro
,
Wojciech Kordalski
,
Daniel Gutowski
,
Michał Siwinski
,
Bartłomiej Dalak
,
Konrad Iwanicki
· 0 min read
A reconstruction of processor’s pipeline operations illustrating an exhaustive test and the Fetch behavior.
Abstract
The last decade witnessed considerable interest in how microarchitectural aspects of processors can impact computer systems, with an increasing focus on dependable low-power embedded systems. Multiple hardening and verification techniques for such systems rely on emulators that faithfully model code execution timings of real microcontrollers. However, in contrast to older ultra-low-power processor families, for the prevalent ARM Cortex-M family, only models derived from hardware sources are able to provide exact timings.In this paper, we examine the feasibility of synthesizing a cycle-exact timing model of a Cortex-M3-based microcontroller using solely in-code timing measurements and publicly available documentation. The main artifact of our work is CMEmu, to the best of our knowledge the first emulator of this kind, which provides exact timings for gigabytes of diverse programs from our extensive evaluation suite. We present techniques that we devised to achieve such an accuracy, which involved elaborate research methods to capture the various intricacies of the device microarchitecture, allowing us to even report a previously unknown hardware bug in the processor.
Type
Publication
In 2025 International Conference on Modeling, Analysis and Simulation of Wireless and Mobile Systems (MSWiM)
publications
Maciej Matraszek
Authors
PhD Candidate
Currently, my research is focused on low-power wireless sensor networks with various aspects: once I was conducting sociometric studies with wearable IoT devices, another time I am trying to model the inner working of a microcontroller.