FastDyn
Firmware execution you can shape
FastDyn brings firmware execution, peripheral behavior, runtime instrumentation, and physical simulation into one configurable experiment. Load a firmware image, describe its machine and environment, and decide where to observe or intervene. The same framework can change a function argument, inspect an RTOS, replay peripheral interactions, connect a controller to a vehicle model, or drive a fuzzing campaign.
The execution engine combines a patched QEMU with a native FastDyn plugin. A Python frontend prepares the experiment from TOML or a public API. Host analysis resolves information before execution; runtime plugins and device models supply behavior while the guest runs. The result is a reusable place to investigate embedded software without rebuilding an entire physical test setup for each question.
Start with your first experiment, or use Choose a workflow to find the right entry point.
What makes FastDyn useful
Shape execution at the point that matters
A modifier can change a register or memory value at a chosen guest program counter. A virtual instruction can invoke a named native behavior there. These rules live alongside the experiment configuration, so the minimal example changes the argument received by a real firmware function while preserving the firmware image and its original addresses.
This is useful for supplying missing platform behavior, skipping a known initialization dependency, injecting a fault, collecting evidence, or making a narrow experiment repeatable. The instrumentation chapter explains the different costs and contracts of virtuals, modifiers, and the existing inline-I/O path.
Give each device the environment it needs
Use a compiled C model for a peripheral, connect an access to a physical board through a debug probe, or replay an interaction trace. A permissive stub helps bring up an early experiment; an explicit model provides the state and side effects needed for meaningful execution. These options share FastDyn's device-dispatch infrastructure, allowing the model boundary to evolve as the experiment matures.
Device models explains the available mechanisms. Writing a model walks through the ABI and model build workflow.
Move beyond boot success
Function counts, argument traces, variable observations, RTOS activity, object-bound checks, MMIO observations, and coverage expose what the firmware actually does. Host preprocessors can install instrumentation across an image rather than requiring a long manual list of addresses.
The shared host-analysis API supplies reusable image, symbol, DWARF, decoding, and RTOS facts. Individual plugins retain the policy that decides what to instrument.
Close the loop with physics
FastDyn can execute controller firmware against a physical model and feed the resulting sensor values back to the controller. Its FMI 3 path loads the FMU into the execution process; the core plant does not require a separate simulator process. Vehicle profiles, mission helpers, telemetry, and optional viewers turn that capability into practical experiments.
Read Physics and FMUs, then Flight controllers. The branch previews cover newer INAV and PX4 work with the exact revisions and evidence levels that apply to each.
Scale experiments and grow the framework
Use fastdyn swarm for independent workers, and FastDyn as a secondary simulator when an external controller grants guest execution time. Add explicit communication and plant coupling when the experiment contains interacting firmware instances. Multiple firmwares explains these arrangements. The Tempo chapter covers the companion scheduler's implemented federation compiler, typed routing, and mock-participant examples.
Extensions can use the Python run API, a preparation plugin, a native runtime plugin, a peripheral model, or a physics adapter. The system model helps choose the smallest appropriate extension point.
Optimize captured native code
Supercache retains native translations across runs. The Supercache optimizer, implemented on the separately pinned scopt branch, imports captured translations and metadata for offline optimization. Its workflows include profile-guided layout, cross-block transformations, state-synchronization reduction, and checked native helper inlining. The chapter explains the matching runtime, pass-specific requirements, artifact validation, and reproducible fixture path.
Optimize firmware with explicit contracts
FirmBOLT works on the firmware ELF through an extended BOLT pipeline. Its firmbolt branch includes a direct Cortex-M/Thumb backend, typed reference handling, instruction origins, and checks that keep the default Cortex-M output within the firmware's existing memory layout. The chapter explains the optimization passes, strict and relaxed timing contracts, qualification commands, and the evidence needed before using a changed image in an experiment.
A small first taste
After installation, run this from the FastDyn source checkout:
fastdyn -q run -c configs/minimal.toml -o out/first-run
The bundled configuration changes a function argument to 3, prints the observed register value, and ends the run at the scheduler entry. It provides a short, concrete check of the entire path from configuration to guest execution. The tutorial shows how to change the argument again and inspect the generated rules.
How to read this book
| Your goal | Start here |
|---|---|
| Run a firmware experiment | Installation, first run, configuration |
| Understand the machinery | System model, execution pipeline |
| Observe or modify behavior | Virtuals and modifiers, introspection, tracing and sanitizers |
| Supply hardware behavior | Device models, hardware and traces |
| Run a controller against a plant | Physics and FMUs, flight controllers |
| Build an analysis or downstream tool | Python API, virtual plugins, host analysis |
| Work with advanced execution mechanisms | Supercache, inline device modeling, experimental automatic MMIO, JIT patcher, hot-path optimizations |
| Optimize saved native translations | Supercache optimizer |
| Optimize the firmware ELF | FirmBOLT |
| Control simulation progress and study coordination | FastDyn as a secondary simulator, Tempo |
Contact
For questions about FastDyn, feedback on this book, or collaboration, contact Arslan Khan at arslankhan@psu.edu.
To contribute documentation, see the contribution guide.
Revision and evidence
This edition was refreshed on 18 November 2026, adding the Supercache optimizer at FastDyn scopt revision 124699d with QEMU 934890e, and FirmBOLT at firmbolt revision b14f14c. Core chapters retain the FastDyn baseline f9666d7. The JIT patcher and manual inline lab are pinned to 5b8bf3d. Automatic MMIO, hot-path optimizations, and the secondary-simulator workflow are reviewed at main e44dca2. The Tempo chapter records the implemented scheduler and compiler at its separate source revision. The Supercache optimizer records its branch implementation and matching runtime; the cache-reuse chapter retains its own frontend/backend recipe. FirmBOLT records its extended BOLT implementation and firmware acceptance path separately. Each source guide records its implementation evidence; reviewing one feature at a newer revision does not revalidate every older chapter. The book covers implemented capabilities and their current limits.
The book was checked against source, configuration examples, and test programs. It is not a new measurement campaign. See the capability status and testing guide for the scope of an experiment and the evidence to retain.
FastDyn itself is distributed under Apache-2.0; bundled firmware and dependencies retain their own licenses. See the source repository's LICENSE and NOTICE.