The xtask tool provides a streamlined flow for developing and testing Caliptra firmware on FPGA hardware. It automates firmware building, test cross-compilation, bitstream programming, and test execution.
Sets up the FPGA environment. This should be run after the FPGA board is powered on.
- Clones the
caliptra-swrepository on the FPGA. - Downloads and programs the appropriate bitstream.
- Configures the FPGA mode (e.g.,
coreorcore-on-subsystem). Defaults tocore.
# Defaults to --configuration core
cargo xtask fpga bootstrap --target-host <ssh-host>Builds Caliptra firmware and (optionally) MCU firmware, then copies them to the FPGA.
--mcu-rev: Specifies the git revision ofcaliptra-mcu-swto build for subsystem modes.
cargo xtask fpga build --target-host <ssh-host>Cross-compiles test binaries for the FPGA architecture (aarch64) using a containerized build environment and copies the resulting archive to the FPGA.
--package-filter: Optionalcargo-nextestfilter to reduce the number of compiled tests.
cargo xtask fpga build-test --target-host <ssh-host> --package-filter "package(caliptra-drivers)"Executes the test suite on the FPGA via SSH.
- Automatically runs the
nextestprofile associated with the current configuration (e.g.,fpga-coreorfpga-subsystem). --test-filter: Optional filter for specific tests. Note: You should typically include apackage()filter along with thetest()filter to correctly target tests.--test-output: Enables real-time test output capture.
cargo xtask fpga test --target-host <ssh-host> --test-filter "package(caliptra-drivers) & test(test_persistent)"All FPGA commands default to --target-host caliptra-fpga. To use this "magic" target without typing the full IP address or hostname every time, add an alias to your local ~/.ssh/config file:
Host caliptra-fpga
HostName <IP_ADDRESS_OF_YOUR_FPGA>
User runner
# Optional: IdentityFile ~/.ssh/id_rsa
Once configured, you can omit the --target-host argument:
cargo xtask fpga test --test-filter "test(smoke)"- One-time Setup: Configure your
~/.ssh/configas shown above. - Bootstrap:
cargo xtask fpga bootstrap(Run once per power cycle). - Develop & Test:
cargo xtask fpga buildcargo xtask fpga build-testcargo xtask fpga test