blob: d96917281ff47acc5e38d0a0d22d2dbdd5535914 [file]
# Licensed under the Apache-2.0 license
# SPDX-License-Identifier: Apache-2.0
load("@pigweed//pw_kernel/tooling:target_codegen.bzl", "target_codegen")
load("@pigweed//pw_kernel/tooling:target_linker_script.bzl", "target_linker_script")
load("@pigweed//pw_kernel/tooling/panic_detector:rust_binary_no_panics_test.bzl", "rust_binary_no_panics_test")
load("@rules_rust//rust:defs.bzl", "rust_binary")
load("//target/veer:defs.bzl", "TARGET_COMPATIBLE_WITH", "veer_system_config", "veer_system_image")
load("//target/veer/tooling:caliptra_runner.bzl", "caliptra_test")
# The OpenPRoT runtime image for the Caliptra MCU. `:runtime_image_emulator`
# and `:runtime_image_fpga` are the image with its signed SoC manifest.
veer_system_image(
name = "runtime",
kernel = ":target",
platform = "//target/veer",
system_config = ":system_config",
tags = ["kernel"],
visibility = ["//visibility:public"],
)
target_linker_script(
name = "linker_script",
system_config = ":system_config",
tags = ["kernel"],
template = "//target/veer:linker_script_template",
)
veer_system_config(
name = "system_config",
src = "system.json5.tmpl",
)
target_codegen(
name = "codegen",
arch = "@pigweed//pw_kernel/arch/riscv:arch_riscv",
system_config = ":system_config",
)
rust_binary(
name = "target",
srcs = ["target.rs"],
edition = "2024",
tags = ["kernel"],
target_compatible_with = TARGET_COMPATIBLE_WITH,
deps = [
":codegen",
":linker_script",
"//target/veer:config",
"//target/veer:entry",
"//target/veer/peripherals:handoff",
"//target/veer/peripherals:wdt",
"@pigweed//pw_kernel/arch/riscv:arch_riscv",
"@pigweed//pw_kernel/kernel",
"@pigweed//pw_kernel/subsys/console:console_backend",
"@pigweed//pw_kernel/target:target_common",
"@pigweed//pw_log/rust:pw_log",
],
)
caliptra_test(
name = "runtime_test",
srcs = ["host_test.rs"],
mcu_image = ":runtime",
)
rust_binary_no_panics_test(
name = "no_panics_test",
binary = ":runtime",
tags = ["kernel"],
)