Skip to content

Commit

Permalink
[device/test_rom] Add bootstrap to second test rom
Browse files Browse the repository at this point in the history
Fix some SPI dpi corner cases.
Fix Uart drain error.

Signed-off-by: Daniel Beitel <[email protected]>
  • Loading branch information
dbeitel-opentitan committed Mar 13, 2024
1 parent 3ff10f1 commit f97efeb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions sw/device/lib/testing/test_rom/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ cc_library(
"//hw/top_darjeeling/sw/autogen:top_darjeeling",
"//sw/device/lib/testing/test_framework:check",
"//sw/device/lib/testing/test_framework:status",
"//sw/device/silicon_creator/rom:bootstrap",
"//sw/lib/sw/device/arch:device",
"//sw/lib/sw/device/base:abs_mmio",
"//sw/lib/sw/device/base:bitfield",
Expand Down
15 changes: 15 additions & 0 deletions sw/device/lib/testing/test_rom/test_second_rom.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "sw/device/lib/testing/test_framework/check.h"
#include "sw/device/lib/testing/test_framework/status.h"
#include "sw/device/silicon_creator/rom/bootstrap.h"
#include "sw/ip/base/dif/dif_base.h"
#include "sw/ip/clkmgr/dif/dif_clkmgr.h"
#include "sw/ip/gpio/dif/dif_gpio.h"
Expand Down Expand Up @@ -111,6 +112,20 @@ bool second_rom_test_main(void) {
LOG_INFO("Jitter is enabled");
}

if (bootstrap_requested() == kHardenedBoolTrue) {
// This log statement is used to synchronize the rom and DV testbench
// for specific test cases.
LOG_INFO("Boot strap requested");

rom_error_t bootstrap_err = bootstrap();
if (bootstrap_err != kErrorOk) {
LOG_ERROR("Bootstrap failed with status code: %08x",
(uint32_t)bootstrap_err);
// Currently the only way to recover is by a hard reset.
test_status_set(kTestStatusFailed);
}
}

_ottf_main();

// If the test image returns, we should abort anyway.
Expand Down

0 comments on commit f97efeb

Please sign in to comment.