Skip to content

Commit

Permalink
runtime: Propagate fpga_runtime flag to the runtime test image
Browse files Browse the repository at this point in the history
This makes it possible to test runtime features on the fpga before the
sw-emulator implements the hardware.

Signed-off-by: Arthur Heymans <[email protected]>
  • Loading branch information
ArthurHeymans authored and jhand2 committed Feb 5, 2024
1 parent 97ced71 commit c77993a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
12 changes: 12 additions & 0 deletions builder/src/firmware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;

Expand Down Expand Up @@ -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,
Expand Down
9 changes: 7 additions & 2 deletions runtime/tests/runtime_integration_tests/common.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down Expand Up @@ -43,7 +43,12 @@ pub fn run_rt_test(
test_image_options: Option<ImageOptions>,
init_params: Option<InitParams>,
) -> 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();
Expand Down

0 comments on commit c77993a

Please sign in to comment.