blob: 63ba1871edd4de081c5136492a69141c408f1d0b [file]
# Licensed under the Apache-2.0 license
# SPDX-License-Identifier: Apache-2.0
load("@pigweed//pw_kernel/tooling:system_image.bzl", "system_image")
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/earlgrey:defs.bzl", "TARGET_COMPATIBLE_WITH")
load("//target/earlgrey/signing/keys:defs.bzl", "FPGA_ECDSA_KEY", "SILICON_ECDSA_KEY")
load("//target/earlgrey/tooling:opentitan_runner.bzl", "opentitan_test")
system_image(
name = "threads",
kernel = ":target",
platform = "//target/earlgrey",
)
target_linker_script(
name = "linker_script",
system_config = ":system_config",
tags = ["kernel"],
template = "//target/earlgrey:linker_script_template",
)
rust_binary_no_panics_test(
name = "no_panics_test",
binary = ":threads",
tags = [
# TODO(cfrantz): Fix this test.
"disabled",
"kernel",
],
)
opentitan_test(
name = "threads_runner_hyper310_test",
ecdsa_key = FPGA_ECDSA_KEY,
interface = "hyper310",
tags = [
"hardware",
"hyper310",
],
target = ":threads",
)
opentitan_test(
name = "threads_runner_hyper340_test",
ecdsa_key = FPGA_ECDSA_KEY,
interface = "hyper340",
tags = [
"hardware",
"hyper340",
],
target = ":threads",
)
opentitan_test(
name = "threads_runner_verilator_test",
timeout = "eternal",
ecdsa_key = FPGA_ECDSA_KEY,
interface = "verilator",
tags = [
"nightly_test",
"verilator",
],
target = ":threads",
)
opentitan_test(
name = "threads_runner_silicon_test",
ecdsa_key = SILICON_ECDSA_KEY,
interface = "teacup",
tags = [
"earlgrey_silicon",
"hardware",
],
target = ":threads",
)
opentitan_test(
name = "threads_runner_qemu_test",
timeout = "moderate",
interface = "qemu",
tags = ["qemu"],
target = ":threads",
)
filegroup(
name = "system_config",
srcs = ["system.json5"],
)
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",
target_compatible_with = TARGET_COMPATIBLE_WITH,
deps = [
":codegen",
":linker_script",
"//target/earlgrey:entry",
"@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_kernel/tests/threads/kernel:threads",
"@pigweed//pw_log/rust:pw_log",
],
)