Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Skip to content
BoardRunner

Configuration reference

FastDyn reads one TOML file for a machine experiment. The core sections are [Machine], [Memory.main], and one or more CPU array tables such as [[CPU.cpu0]]. Device handling, plugins, FMU generation, and helper processes add their own sections.

This reference describes the current parser. Examples are fragments to merge into a complete configuration; do not paste a second definition of an existing TOML table or key. Use configure a firmware for the guided workflow and the feature chapters for plugin-specific settings.

Machine controls

Key in [Machine]Preferred value / defaultBehavior
platformOptional stringSVD platform metadata; generic-cortexm allows a generic Cortex-M profile.
qemu_pathOptional executable pathExplicit QEMU selection. Otherwise use FASTDYN_QEMU, recorded build metadata, then the architecture executable on PATH.
displayString, "none"QEMU display backend.
serialOptional stringExplicit QEMU serial backend.
monitorOptional stringExplicit monitor backend, overriding the default TCP choice.
monitor_portInteger, 5555Default monitor TCP port; 0 disables it.
qmp_socketString, "/tmp/qmp.sock"QMP socket; the default is replaced with a run-specific path.
enable_gdbBoolean, falseEnable QEMU's GDB server.
gdb_portInteger, 1234GDB server port.
stop_on_startBoolean, falseStart paused.
launch_gdbBoolean, falseRequest the automatic GDB-launch path.
log_optionsStringQEMU -d categories; "none" disables instruction logging.
log_filePath stringQEMU log destination; relative paths are under the work directory.
semihostingBoolean, false in the TOML parserEnable semihosting for supported targets.
semihosting_config"enable=on,target=native"QEMU semihosting configuration.
print_commandBoolean, falsePrint the generated QEMU command.
exit_timeout_msPositive integer, 5000Wait before force-killing QEMU during shutdown.
reset_memory_filesBoolean, falseClear file-backed RAM before launch.
biosOptional path stringFallback BIOS image for a CPU without its own bios.

The default QMP path becomes <work-dir>/qmp.sock. If that path exceeds Unix socket limits, the launcher selects a shorter per-user location. A nondefault explicit socket path remains explicit.

Simulation time

[Machine]
icount = { shift = 5, sleep = false, align = false }
timer_irq_period_ns = 1000000
exact_budget_stop = false

icount accepts a QEMU option string, a boolean, or a table. The table supports enabled, nonnegative integer or string shift, boolean sleep and align, and extra as a string or string array. enabled = false disables it. FASTDYN_QEMU_ICOUNT overrides the generated value.

timer_irq_period_ns selects the periodic board interrupt interval when used by the configured runtime. The maintained vehicle profiles use 1,000,000 ns. This is a simulation-time setting, not a claim that the host executes a step in one millisecond.

exact_budget_stop is parsed as a co-simulation stopping-mode option and defaults to false. At the reviewed e44dca2 revision, its native enabling call is commented out, so setting this field alone does not activate exact mode. Select exact stopping through the controller's --exact option or BudgetMaster(..., exact_stop=True), which sends QMP set-budget-mode. See FastDyn as a secondary simulator for the complete setup, timing contract, and validation limits.

Coverage and fuzzing

KeyDefaultMeaning
coveragefalseEnable the configured coverage path; requires a compatible build.
edge_coveragefalseAdd cumulative edge output when coverage is available.
fuzzingfalseStart the compiled input backend.
fuzzing_schemaAbsentJSON schema file for the generic native fuzzer.
finlineAbsentExisting static inline-I/O mapping path; see inline device modeling for its access-map and original-instruction handling.
savestate_extra_rangesEmpty arrayAdditional { start, size } regions for the native save-state machinery.

FASTDYN_COVERAGE, FASTDYN_EDGE_COVERAGE, and FASTDYN_FUZZING override their corresponding booleans. A save-state range accepts integer or integer-string addresses and a positive size; ranges exceeding the 64-bit address space are rejected. These settings do not make the current ARM-oriented snapshot implementation architecture-independent.

Memory banks

The main bank is a plain table. Additional banks use array tables:

[Memory.main]
id = "ram0"
base_address = "0x20000000"
memory_size = "256K"
backend = "file"
share = true

[[Memory.ram1]]
id = "ram1"
base_address = "0x30000000"
memory_size = "64K"
backend = "ram"
KeyDefaultMeaning
memory_sizeRequiredQEMU size string, for example "256K" or "8M".
base_addressUnsetGuest mapping base where supported by the machine.
idBank nameQEMU memory-backend identifier.
memory_type"SRAM"Metadata label: SRAM, MMIO, FLASH, DRAM, RAM, or SYSTEM.
backend"file"file, ram, or memfd.
memory_fileRun-local fileBacking path for a file backend.
sharetrueRequest shared mapping of the backend.

The generic Cortex-M machine maps additional banks through its custom properties. Other QEMU machines retain their own memory layout. Additional bank indices are generated in sorted name order. index and prealloc appear in some historical examples but are not consumed by the current TOML memory parser; do not rely on those keys to change the run.

Explicitly use backend = "file" when depending on swarm's FASTDYN_QEMU_MEMORY_DIR override. Keep arbitrary external RAM paths separate between concurrent runs. reset_memory_files clears guest RAM backing, not external device or helper state.

CPU and firmware

[[CPU.cpu0]]
arch = "arm"
machine = "cortexm"
cpu = "cortex-m4"
binary = "firmware.elf"
init_nsvtor = "0x08000000"
plugin_library = "build/libfastdyn.so"
KeyDefault / purpose
arch"arm"; selects architecture-specific launch behavior.
machine"cortexm"; QEMU machine model.
cpu"cortex-m4"; QEMU CPU model.
binaryFirmware path; supply the correct image for the selected machine.
init_nsvtorCortex-M initial vector address; when omitted for the generic Cortex-M ELF path, the launcher attempts to derive it.
plugin_libraryDefault FastDyn build library path.
drive_file, drive_formatOptional disk-image boot input; format defaults to "raw".
biosOptional CPU BIOS image, with machine-level fallback.
monitor_elfOptional monitor image used by existing monitor-based integrations.
twintrace"record", "replay", or disabled/"None".
hardware_traceTrace file for record/replay.
existing_config_pathDirectory containing existing virtual/modifier rules; false or empty disables it.
logger_contentExisting plugin-logger configuration text.

A QEMU instance with multiple CPUs requires homogeneous arch, machine, cpu, and binary, plus a common plugin library. The parser consumes the first entry under each CPU name. Do not put different firmware images into multiple entries of [[CPU.cpu0]] expecting separate instances.

Virtuals and modifiers are child arrays:

[[CPU.cpu0.virtuals]]
at = "0x080068b0"
instruction = "printreg"
args = ["0"]

[[CPU.cpu0.modifiers]]
at = "0x0800397e"
patch = "r0 <- 3"

Those addresses are from the bundled minimal fixture. The exact grammar and register support are described in virtuals and modifiers.

Run-wide plugins

[CPU.cpu0.plugins.function_counter]
enabled = true

Each plugin owns the remaining fields of its table. An optional source names an external plugin directory, resolved relative to the configuration file. FastDyn removes source before handing settings to the plugin. See virtual plugins for the host/runtime contract.

Devices and handlers

[Device.Models.<name>] registers a model family and its optional backend. [Device.<device>] declares regions and model-specific configuration. Each [[Device.<device>.handlers]] entry needs model and enabled; optional fields include scroll, args, and type.

[Device.Models.elder]

[Device.uart]
ranges = [["0x40004400", "0x400047ff"]]
irq = [54]

[[Device.uart.handlers]]
model = "elder"
enabled = true
scroll = "models/uart.so"

This fragment requires an actual model implementing the selected device. Device-specific fields outside FastDyn's reserved keys are carried to the model. slaves and connections support attached devices and host endpoints as documented in the device chapters.

irq is a list of numbers, numeric strings, SVD names, or inclusive [first, last] ranges. Cortex-M numeric values are exception numbers. The old colon-separated string form is rejected. FastDyn also rejects enabling both passthrough and twintrace hardware backends for the same device, because both would issue accesses to the physical probe.

FMU selection and generation

[FMU]
active = "quadrotor"
auto_build = true

[FMU.models.quadrotor]
model = "FastDyn.Copter"
model_file = "modelica/FastDyn/Copter.mo"
source_roots = ["modelica", "third_party/common/modelica_models"]
output = "out/fmi3/Copter"
build = true
release = false

active, FASTDYN_FMI_NAME, or --fmu selects a named entry, in increasing precedence. A configuration may alternatively place one model directly in [FMU], in which case --fmu NAME is not applicable.

model and model_file identify the Modelica model. Supply source_roots as a nonempty path array, or source_root for one root. output defaults under out/fmi3/. build = true requests a packaged FMU; false emits a source tree that still needs a compiled runtime binary before execution. auto_build defaults to false, while the maintained vehicle profiles enable it. release controls the Rumoca Cargo build mode.

[FMU.models.<name>.parameters] holds numeric parameter overrides. compose selects a composition file; an inline physics table is an alternative and must name the same model. These alternatives cannot be combined. [FMU].rumoca_dir or FASTDYN_RUMOCA_DIR selects the compiler checkout. See physics and FMU for package loading and the model interface.

Helpers, bridge boot, and profiling

[Run] supplies cwd and env defaults for helpers. Each [Run.processes.<name>] accepts:

KeyDefault / behavior
commandRequired string or string array. A string uses a shell by default.
enabledtrue
cwdRun default, then repository root
envAdditional helper environment
backgroundtrue; false runs the helper synchronously during startup
quietfalse; true discards stdout/stderr
start_delay_sec0; delayed startup
ready_messagePrinted after starting; it is not a readiness probe
stop_on_exittrue; stop the helper when FastDyn exits
terminate_run_on_exitfalse; when true, helper exit stops QEMU
shellExplicit shell behavior override

[Run].bridge_boot selects the console initialization script used by profiles such as PX4. It is independent of helpers. FASTDYN_BRIDGE_BOOT overrides it; an explicitly empty value disables automatic console initialization.

[Rumoca] configures the optional separate Rumoca viewer/lockstep process. It is normally disabled in the in-process ArduPilot FMU path.

[Run.profiling] supports timing and timing_echo (both default true), python (false), fmu (defaults to the timing setting), perf ("off", "stat", or "record"), perf_events, and perf_frequency_hz (99). Profiling outputs live under the work directory; Linux perf use also depends on host availability and permissions.

Path and environment rules

Field familyResolution
Firmware, hardware trace, scroll, slave device_scroll, Python endpoint helperConfiguration directory first if the file exists there; otherwise current-directory behavior.
External plugin sourceConfiguration directory.
existing_config_path, fuzzing schemaConfiguration directory, current directory, then discovered repository root.
FMU sources/output and helper working directoriesRepository-root-relative unless absolute.
TOML bridge_bootRepository root; environment override is caller-directory-relative.
QEMU log_fileWork directory when relative.

Helper strings support ${NAME} and ${NAME:-default} expansion. That is not a promise of arbitrary shell expansion in every TOML field. Swarm injects explicit overrides for monitor/GDB/service ports, RAM backing, and QMP sockets.

Core configuration is not a uniformly closed schema: a key found in an old example may be ignored by today's parser. Use this reference and the source of the consuming plugin, and inspect generated artifacts when changing a critical field.

Source guide