From c77993aef24987e26fc3f135fd5ba66d921d0107 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 17 Jan 2024 21:55:40 +0100 Subject: [PATCH] runtime: Propagate fpga_runtime flag to the runtime test image This makes it possible to test runtime features on the fpga before the sw-emulator implements the hardware. Signed-off-by: Arthur Heymans --- builder/src/firmware.rs | 12 ++++++++++++ runtime/tests/runtime_integration_tests/common.rs | 9 +++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/builder/src/firmware.rs b/builder/src/firmware.rs index 7a824bb084..4ec34d497c 100644 --- a/builder/src/firmware.rs +++ b/builder/src/firmware.rs @@ -57,6 +57,17 @@ pub const APP_WITH_UART: FwId = FwId { features: &["emu", "test_only_commands", "fips_self_test"], }; +pub const APP_WITH_UART_FPGA: FwId = FwId { + crate_name: "caliptra-runtime", + bin_name: "caliptra-runtime", + features: &[ + "emu", + "test_only_commands", + "fips_self_test", + "fpga_realtime", + ], +}; + pub mod caliptra_builder_tests { use super::*; @@ -376,6 +387,7 @@ pub const REGISTERED_FW: &[&FwId] = &[ &FMC_FAKE_WITH_UART, &APP, &APP_WITH_UART, + &APP_WITH_UART_FPGA, &caliptra_builder_tests::FWID, &hw_model_tests::MAILBOX_RESPONDER, &hw_model_tests::MAILBOX_SENDER, diff --git a/runtime/tests/runtime_integration_tests/common.rs b/runtime/tests/runtime_integration_tests/common.rs index 1cb0125af1..4f48ced435 100644 --- a/runtime/tests/runtime_integration_tests/common.rs +++ b/runtime/tests/runtime_integration_tests/common.rs @@ -1,7 +1,7 @@ // Licensed under the Apache-2.0 license use caliptra_builder::{ - firmware::{self, APP_WITH_UART, FMC_WITH_UART}, + firmware::{self, APP_WITH_UART, APP_WITH_UART_FPGA, FMC_WITH_UART}, FwId, ImageOptions, }; use caliptra_common::mailbox_api::{ @@ -43,7 +43,12 @@ pub fn run_rt_test( test_image_options: Option, init_params: Option, ) -> DefaultHwModel { - let runtime_fwid = test_fwid.unwrap_or(&APP_WITH_UART); + let default_rt_fwid = if cfg!(feature = "fpga_realtime") { + &APP_WITH_UART_FPGA + } else { + &APP_WITH_UART + }; + let runtime_fwid = test_fwid.unwrap_or(default_rt_fwid); let image_options = test_image_options.unwrap_or_else(|| { let mut opts = ImageOptions::default();