blob: 5930ec87d4cc181940b3bdeda827a0b4278302fb [file]
# Copyright 2025 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
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_runner", "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",
)
opentitan_runner(
name = "threads_runner_hyper310",
ecdsa_key = FPGA_ECDSA_KEY,
interface = "hyper310",
target = ":threads",
)
opentitan_test(
name = "threads_runner_hyper310_test",
ecdsa_key = FPGA_ECDSA_KEY,
interface = "hyper310",
target = ":threads",
)
opentitan_runner(
name = "threads_runner_hyper340",
ecdsa_key = FPGA_ECDSA_KEY,
interface = "hyper340",
target = ":threads",
)
opentitan_test(
name = "threads_runner_hyper340_test",
ecdsa_key = FPGA_ECDSA_KEY,
interface = "hyper340",
target = ":threads",
)
opentitan_test(
name = "threads_runner_verilator_test",
timeout = "long",
ecdsa_key = FPGA_ECDSA_KEY,
interface = "verilator",
target = ":threads",
)
opentitan_runner(
name = "threads_runner_silicon",
ecdsa_key = SILICON_ECDSA_KEY,
interface = "teacup",
tags = ["manual"],
target = ":threads",
)
opentitan_test(
name = "threads_runner_silicon_test",
ecdsa_key = SILICON_ECDSA_KEY,
interface = "teacup",
tags = ["manual"],
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",
],
)