Skip to content

[target/veer] Integrate Support for Veer Target in openprot#156

Open
moidx wants to merge 3 commits intoOpenPRoT:mainfrom
moidx:caliptra-init
Open

[target/veer] Integrate Support for Veer Target in openprot#156
moidx wants to merge 3 commits intoOpenPRoT:mainfrom
moidx:caliptra-init

Conversation

@moidx
Copy link
Copy Markdown
Collaborator

@moidx moidx commented Apr 13, 2026

This PR introduces support for the Veer target in the OpenPRoT repository. It includes integration with Pigweed, Caliptra dependencies, and necessary fixes to run IPC tests on the Caliptra emulator.

Changes

1. Introduce pigweed on veer

  • Initial integration of Pigweed for the veer target.

2. caliptra: add third_party integration for caliptra-sw and caliptra-mcu-sw

  • Added Caliptra source repositories via module extensions in third_party/caliptra.
  • Set up workspace overrides for Caliptra dependencies.

3. [target/veer] Updates to support veer target on Caliptra emulator.

  • Fixed target/veer/ipc/user/system.json5 to use the correct schema and app name.
  • Silenced unused variable warning in target/veer/entry.rs.
  • Configured target/veer/ipc/user/BUILD.bazel to use Pigweed targets directly.

Enables pigweed running on Caliptra-MCU using an initial devbundle.

Signed-off-by: Chris Frantz <cfrantz@google.com>
@moidx moidx force-pushed the caliptra-init branch 5 times, most recently from 9580f83 to 8c0a855 Compare April 14, 2026 07:35
moidx added 2 commits April 14, 2026 21:18
…u-sw

Introduce the Bazel integration layer for upstream Caliptra sources
(chipsalliance/caliptra-sw, chipsalliance/caliptra-mcu-sw, and
chipsalliance/caliptra-ureg) under third_party/caliptra/.

Dependency management:
- Two parallel crate_universe workspaces (crates_io/embedded/ and
  crates_io/host/) keep host-only features (std, alloc, ecdsa/pem)
  off embedded rlibs to stay within the 96 KB caliptra ROM budget.
- versions.bzl is the canonical source of caliptra git pins. A
  module_extension in extensions.bzl load()s it and declares the
  @caliptra_sw / @caliptra_mcu_sw git_repository rules. The root
  MODULE.bazel lifts them into its label space via use_repo().
- uprev.py (bazel run //third_party/caliptra:uprev) provides
  verify / bump / latest / release subcommands. verify cross-checks
  versions.bzl against both Cargo.toml files and MODULE.bazel (ureg
  only). bump/latest/release write versions.bzl + both Cargo.toml
  files in a single transaction.

Hand-written rust_library wrappers are retained for two classes of
targets that crate_universe cannot express: ROM-budget-blocked
crates (cfi feature unification overflows ROM) and TypeId-seam
crates (cross-workspace rlib identity mismatch).

Firmware build macros in caliptra_build.bzl produce caliptra_rom,
caliptra_fmc, caliptra_runtime, and MCU ROM ELFs. ROM and runtime
consume upstream sources verbatim (no sed, no enumerated source
lists): runtime is a plain rust_library + rust_binary pair built
from upstream lib.rs/main.rs, and ROM uses upstream main.rs as
crate_root with OUT_DIR pointed — via rustc_env — at a single
cpp-preprocessed start.S artifact in the package bin dir. Fat LTO
across the rlib/binary boundary is preserved by embed-bitcode=yes.
The primary gate is bazel build //target/veer/tooling:caliptra_runner.

CI: //third_party/caliptra/... is excluded from the clippy and
ci_tests workflow target lists, and added to .semgrepignore. The
vendor sources trip clippy lints we don't own, top-level
host-platform test requests fail on embedded-only targets (mixed
host/embedded zerocopy workspaces produce TypeId mismatches), and
the host-side build helpers trigger semgrep false positives on
argv-handling rules. First-party code remains fully linted, scanned,
and tested; caliptra firmware binaries are still built transitively
via the veer emulator tests, which pull them in under a Bazel
platform transition.

Signed-off-by: Miguel Osorio <miguelosorio@google.com>
Migrates target/veer/syscall_latency to pigweed's new rust_app API:
upstream pw_kernel/tooling split app_package into rust_app_codegen +
rust_app, and syscall_latency was the last call site still on the
old API.

Signed-off-by: Miguel Osorio <miguelosorio@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants