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

Command-line reference

The installed entry point is fastdyn, provided by fastdyn.main:cli. Run commands from the FastDyn repository root unless your paths are explicitly configured for another location. The examples assume the environment from installation is active.

fastdyn --help
fastdyn COMMAND --help

This reference covers the core CLI at f9666d7f518c373e89831d8e14a6371a27fe6436, with later additions labeled by revision. Plugin-specific settings belong in TOML rather than new top-level flags.

Global options

Place these before the command:

OptionEffect
--versionPrint the installed FastDyn version.
-v, --verboseSet the default console log level to DEBUG.
-q, --quietSet it to WARNING. Cannot be combined with -v.
--log-level [LOGGER=]LEVELSet a global or namespace-specific level; repeatable.
--log-file PATHAlso write Python log messages at DEBUG and above to a file.
--helpDisplay group help.

Without a level option, FASTDYN_LOG_LEVEL supplies the default, falling back to INFO. Native plugin messages use the native threshold but are emitted directly by QEMU, so --log-file does not collect them. Put saved log files outside a work directory that the runner will replace.

fastdyn --log-level fastdyn.targets=DEBUG run -c configs/minimal.toml

run

fastdyn run -c CONFIG [-o WORK_DIR]
OptionDefaultMeaning
-c, --config PATHRequiredExisting TOML file.
-o, --work-dir PATH./fastdyn_workRun outputs; an existing directory is replaced by default.
-s, --svd PATHRepository defaultExplicit SVD file or catalog.
-p, --persist-work-dirOffRetain an existing work directory.
--fmu NAMETOML selectionOverride the active FMU model.
--no-build-fmuOffSkip automatic FMU generation. The required artifact must already exist.
--no-run-processesOffSkip [Rumoca] and [Run.processes] helpers.
-m, --map-file PATHNoneAccepted legacy option; currently unused by the run implementation.

The run path validates runtime configuration, prepares the output directory, handles optional FMU generation, starts configured helpers, preprocesses the target, and launches QEMU. Guest module boot through [Run].bridge_boot remains active with --no-run-processes; it is a separate mechanism.

Configuration or launch failures produce an error. An unexpected QEMU failure also produces a nonzero command result. Ctrl-C produces the conventional exit status 130 after shutdown handling.

loop

loop accepts the same options as run:

fastdyn loop -c configs/target.toml -o out/repeated-target

After a clean exit it restarts with a fresh work directory. After a QEMU runtime error or a terminating helper failure, it restarts while preserving the directory for inspection. Configuration and setup errors stop the loop instead of retrying indefinitely. Automatic FMU generation is attempted only for the first iteration.

This is repeated execution of the configured experiment. It does not itself construct a function-level calling context or define a fuzzing snapshot boundary.

swarm

swarm launches isolated copies of one configuration:

fastdyn swarm -c configs/copter462.toml -n 2 \
  -o out/swarm/copter --base-port 18000 --dry-run
OptionDefaultMeaning
-c, --config PATHRequiredShared configuration template.
-n, --instances N1Number of workers.
-o, --work-dir-root PATH./fastdyn_swarmParent of worker output directories.
--base-port N15000Base for worker port allocation.
--port-stride N20Spacing between each worker's port set.
--jobs NNumber of instancesMaximum concurrently running workers.
--loopOffUse fastdyn loop for each worker.
--fmu NAMETOML selectionSelect the active model.
--no-build-fmuOffSkip the one-time build before workers start.
--no-run-processesOffSkip helper processes in each worker.
--timeout-sec SECONDSNoneOverall campaign timeout.
--smoke-sec SECONDSNoneRequire workers to remain alive for a bounded smoke interval, then stop.
--stop-on-failureOffStop launching new workers after a nonzero exit.
--skip-port-checkOffSkip the preflight TCP/UDP conflict check.
--dry-runOffPrint plans and commands without launching workers or building the FMU.

Workers receive separate RAM backing, QMP sockets, output paths, and configured service ports. Dry-run output verifies the plan, not firmware or FMU execution. A swarm does not implicitly connect the guest devices or physical worlds; see multiple firmwares.

build-model

Compile C device models into shared libraries:

fastdyn build-model models/uart.c -o build/models
fastdyn build-model models/ -o build/models -r -j 8
fastdyn build-model --name spi4 models/spi4.c models/spi4_dma.c -o build/models

The source paths must exist. -o/--out-dir is required. By default each C source becomes a model; --name combines the given files into one named model.

OptionMeaning
-r, --recursiveFind C sources below input directories.
-j, --jobs NParallel compilation; defaults to CPU count.
-k, --keep-goingContinue other model builds after a failure.
--exclude PATTERNExclude matching sources; repeatable.
--no-vioBuild without LibVIO.
--pkg NAMEAdd a pkg-config package; repeatable. fastdyn links the fuzzer hooks.
--jsonEmit a machine-readable build report.

Sources, headers, and the compiler command determine whether a model is rebuilt. A failed model does not retain an old output .so, and any failure makes the command exit with status 1. See writing a model for the ABI.

Addition at a38af40: --mmio-opt

At a38af408451394ea2f41be1e9cf1e96bc46c370f, build-model --mmio-opt enables experimental extraction of read-operation metadata. Run this example from a matching FastDyn checkout with the corresponding QEMU headers and build environment:

fastdyn build-model --mmio-opt --no-vio \
  tests/models/elder_echo.c -o build/mmio-models --json

This option selects clang-18, falling back to clang, and currently requires one C source per model. It embeds metadata in the normal .so and writes elder_echo.mmio.json beside it. The separate --json flag prints the build report, including mmio_operations; it is not required to create the metadata report.

Building metadata does not enable substitution by itself. Configure the library as an elder scroll and enable [CPU.cpu0.plugins.mmio_opt] in the run configuration. The feature has reviewed correctness limitations; use the automatic MMIO workflow for its matching setup, supported execution scope, reports, and validation requirements. Ordinary build-model usage does not require this option or its Clang dependency.

help

This command browses configuration choices, distinct from Click's --help option:

fastdyn help
fastdyn help platforms STM32
fastdyn help virtuals --no-browse

Available topics are platforms, virtuals, plugins, modifiers, device-models, machine, memory, firmware, and run. plugins currently aliases virtuals, so both display virtual actions and run-wide plugins.

Use --browse to force the picker or --no-browse for plain output. platforms accepts an optional vendor/platform query and -s/--svd PATH. The top-level help browser also accepts an SVD path. The platform catalog must be present, normally from setup.

timing-summary

fastdyn timing-summary out/first-run/fastdyn_timing.jsonl --top 20

The positional file must exist. --top defaults to 30. The command reports completed phases and marks, then lists phases by descending duration. Nested phases overlap, so summing all displayed durations does not give total execution time.

Source guide