Skip to content

Commit aaa32b2

Browse files
committed
[tests] Port edn_kat to multitop
Signed-off-by: Robert Schilling <[email protected]>
1 parent a65a060 commit aaa32b2

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

sw/device/tests/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,13 +1381,14 @@ opentitan_test(
13811381
{
13821382
"//hw/top_earlgrey:silicon_creator": None,
13831383
},
1384+
DARJEELING_TEST_ENVS,
13841385
),
13851386
verilator = verilator_params(
13861387
timeout = "long",
13871388
),
13881389
deps = [
1390+
"//hw/top:dt",
13891391
"//hw/top:edn_c_regs",
1390-
"//hw/top_earlgrey/sw/autogen:top_earlgrey",
13911392
"//sw/device/lib/base:mmio",
13921393
"//sw/device/lib/dif:csrng",
13931394
"//sw/device/lib/dif:csrng_shared",

sw/device/tests/edn_kat.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
33
// SPDX-License-Identifier: Apache-2.0
44

5+
#include "hw/top/dt/dt_csrng.h"
6+
#include "hw/top/dt/dt_edn.h"
7+
#include "hw/top/dt/dt_rv_core_ibex.h"
58
#include "sw/device/lib/base/mmio.h"
69
#include "sw/device/lib/dif/dif_csrng.h"
710
#include "sw/device/lib/dif/dif_csrng_shared.h"
@@ -16,7 +19,6 @@
1619
#include "sw/device/lib/testing/test_framework/ottf_main.h"
1720

1821
#include "hw/top/edn_regs.h" // Generated
19-
#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h"
2022

2123
enum {
2224
kEdnKatTimeout = (10 * 1000 * 1000),
@@ -116,15 +118,10 @@ OTTF_DEFINE_TEST_CONFIG();
116118

117119
// Initializes the peripherals used in this test.
118120
static void init_peripherals(void) {
119-
CHECK_DIF_OK(dif_csrng_init(
120-
mmio_region_from_addr(TOP_EARLGREY_CSRNG_BASE_ADDR), &csrng));
121-
CHECK_DIF_OK(
122-
dif_edn_init(mmio_region_from_addr(TOP_EARLGREY_EDN0_BASE_ADDR), &edn0));
123-
CHECK_DIF_OK(
124-
dif_edn_init(mmio_region_from_addr(TOP_EARLGREY_EDN1_BASE_ADDR), &edn1));
125-
CHECK_DIF_OK(dif_rv_core_ibex_init(
126-
mmio_region_from_addr(TOP_EARLGREY_RV_CORE_IBEX_CFG_BASE_ADDR),
127-
&rv_core_ibex));
121+
CHECK_DIF_OK(dif_csrng_init_from_dt(kDtCsrng, &csrng));
122+
CHECK_DIF_OK(dif_edn_init_from_dt(kDtEdn0, &edn0));
123+
CHECK_DIF_OK(dif_edn_init_from_dt(kDtEdn1, &edn1));
124+
CHECK_DIF_OK(dif_rv_core_ibex_init_from_dt(kDtRvCoreIbex, &rv_core_ibex));
128125
}
129126

130127
dif_edn_auto_params_t kat_auto_params_build(bool alert_test) {

0 commit comments

Comments
 (0)