Skip to content

Commit

Permalink
[sw] Port rv_core_ibex_address_translation_test to devicetables
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Jones <[email protected]>
  • Loading branch information
AlexJones0 committed Feb 12, 2025
1 parent 740cf41 commit 32d42ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion sw/device/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5253,9 +5253,10 @@ opentitan_test(
"//hw/top_earlgrey:fpga_cw310_rom_with_fake_keys": None,
"//hw/top_earlgrey:sim_dv": None,
"//hw/top_earlgrey:sim_verilator": None,
"//hw/top_darjeeling:sim_dv": None,
},
deps = [
"//hw/top_earlgrey/sw/autogen:top_earlgrey",
"//hw/top:dt",
"//sw/device/lib/base:csr",
"//sw/device/lib/base:memory",
"//sw/device/lib/base:mmio",
Expand Down
10 changes: 5 additions & 5 deletions sw/device/tests/rv_core_ibex_address_translation_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

#include "dt/dt_rv_core_ibex.h" // Generated
#include "sw/device/lib/base/csr.h"
#include "sw/device/lib/base/memory.h"
#include "sw/device/lib/base/mmio.h"
Expand All @@ -14,8 +15,6 @@
#include "sw/device/lib/testing/test_framework/ottf_main.h"
#include "sw/device/silicon_creator/lib/epmp_state.h"

#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h"

#define TEST_STR "Hello there, WHaT 1S Y0Ur N@ME?"
#define EXPECTED_RESULT_MAKE_LOWER_CASE "hello there, what 1s y0ur n@me?"
#define EXPECTED_RESULT_GET_NAME "My name is Titan, Open Titan"
Expand Down Expand Up @@ -300,9 +299,10 @@ void check_dbus_map(dif_rv_core_ibex_t *ibex_core) {
bool test_main(void) {
// Get ibex core handle.
dif_rv_core_ibex_t ibex_core;
CHECK_DIF_OK(dif_rv_core_ibex_init(
mmio_region_from_addr(TOP_EARLGREY_RV_CORE_IBEX_CFG_BASE_ADDR),
&ibex_core));
dt_rv_core_ibex_t kRvCoreIbexDt = (dt_rv_core_ibex_t)0;
static_assert(kDtRvCoreIbexCount >= 1,
"This test requires at least one Ibex core");
CHECK_DIF_OK(dif_rv_core_ibex_init_from_dt(kRvCoreIbexDt, &ibex_core));

check_ibus_map(&ibex_core);
check_dbus_map(&ibex_core);
Expand Down

0 comments on commit 32d42ab

Please sign in to comment.