| # Licensed under the Apache-2.0 license | |
| # SPDX-License-Identifier: Apache-2.0 | |
| load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test") | |
| load(":caliptra_runner.bzl", "caliptra_boot_artifact") | |
| exports_files( | |
| ["on_device_test.rs"], | |
| visibility = ["//target/veer:__subpackages__"], | |
| ) | |
| # Fills a system config template with caliptra-mcu-sw memory map values. | |
| rust_binary( | |
| name = "render_system_config", | |
| srcs = ["render_system_config.rs"], | |
| edition = "2024", | |
| target_compatible_with = ["@platforms//os:linux"], | |
| visibility = ["//target/veer:__subpackages__"], | |
| deps = [ | |
| "//target/veer/peripherals:flash", | |
| "//target/veer/peripherals:mcu_mbox", | |
| "//target/veer/registers", | |
| "@rust_caliptra_crates_host//:caliptra-mcu-config", | |
| "@rust_caliptra_crates_host//:caliptra-mcu-config-emulator", | |
| "@rust_caliptra_crates_host//:caliptra-mcu-config-fpga", | |
| ], | |
| ) | |
| # Host tests of which I3C core the renderer picks for each strap value. | |
| rust_test( | |
| name = "render_system_config_test", | |
| crate = ":render_system_config", | |
| edition = "2024", | |
| target_compatible_with = ["@platforms//os:linux"], | |
| ) | |
| # Helper crate that loads the Caliptra/MCU boot binaries listed in the JSON | |
| # `.boot_env` runfile named by CALIPTRA_BOOT_ENV (generated by | |
| # `caliptra_mcu_image`) and constructs `caliptra_mcu_hw_model::InitParams`. | |
| rust_library( | |
| name = "test_boot_files", | |
| srcs = ["test_boot_files.rs"], | |
| edition = "2024", | |
| target_compatible_with = ["@platforms//os:linux"], | |
| visibility = ["//target/veer:__subpackages__"], | |
| deps = [ | |
| "//third_party/caliptra/caliptra-mcu-sw:mcu_hw_model", | |
| "@rules_rust//rust/runfiles", | |
| "@rust_caliptra_crates_host//:hex", | |
| "@rust_caliptra_crates_host//:serde_json", | |
| ], | |
| ) | |
| rust_test( | |
| name = "test_boot_files_test", | |
| crate = ":test_boot_files", | |
| edition = "2024", | |
| target_compatible_with = ["@platforms//os:linux"], | |
| ) | |
| # ── Canonical Emulator Boot Singletons ── | |
| caliptra_boot_artifact( | |
| name = "caliptra_rom_emulator", | |
| interface = "emulator", | |
| target = "//third_party/caliptra/caliptra-sw:caliptra_rom_bin", | |
| visibility = ["//target/veer:__subpackages__"], | |
| ) | |
| caliptra_boot_artifact( | |
| name = "caliptra_firmware_emulator", | |
| interface = "emulator", | |
| target = "//third_party/caliptra/caliptra-sw:caliptra_firmware_bin", | |
| visibility = ["//target/veer:__subpackages__"], | |
| ) | |
| caliptra_boot_artifact( | |
| name = "mcu_rom_emulator", | |
| interface = "emulator", | |
| target = "//third_party/caliptra/caliptra-mcu-sw:mcu_rom_bin", | |
| visibility = ["//target/veer:__subpackages__"], | |
| ) | |
| # ── Canonical FPGA Boot Singletons ── | |
| caliptra_boot_artifact( | |
| name = "caliptra_rom_fpga", | |
| interface = "fpga", | |
| target = "//third_party/caliptra/caliptra-sw:caliptra_rom_bin", | |
| visibility = ["//target/veer:__subpackages__"], | |
| ) | |
| caliptra_boot_artifact( | |
| name = "caliptra_firmware_fpga", | |
| interface = "fpga", | |
| target = "//third_party/caliptra/caliptra-sw:caliptra_firmware_bin", | |
| visibility = ["//target/veer:__subpackages__"], | |
| ) | |
| caliptra_boot_artifact( | |
| name = "mcu_rom_fpga", | |
| interface = "fpga", | |
| target = "//third_party/caliptra/caliptra-mcu-sw:mcu_rom_bin", | |
| visibility = ["//target/veer:__subpackages__"], | |
| ) |