From 0cda97a5970fae1c065862e16f73494083ded513 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Fri, 22 Nov 2024 15:23:36 +0000 Subject: [PATCH 1/6] [top_darjeeling] Regenerate files Signed-off-by: Amaury Pouly --- hw/top_darjeeling/ip_autogen/clkmgr/BUILD | 29 ++++--------------- hw/top_darjeeling/ip_autogen/pinmux/BUILD | 29 ++++--------------- hw/top_darjeeling/ip_autogen/pwrmgr/BUILD | 29 ++++--------------- hw/top_darjeeling/ip_autogen/rstmgr/BUILD | 29 ++++--------------- hw/top_darjeeling/sw/autogen/top_darjeeling.c | 5 ++++ hw/top_darjeeling/sw/autogen/top_darjeeling.h | 19 ++++++++++++ 6 files changed, 48 insertions(+), 92 deletions(-) diff --git a/hw/top_darjeeling/ip_autogen/clkmgr/BUILD b/hw/top_darjeeling/ip_autogen/clkmgr/BUILD index 3bed0f321eb3d..6733fbf793347 100644 --- a/hw/top_darjeeling/ip_autogen/clkmgr/BUILD +++ b/hw/top_darjeeling/ip_autogen/clkmgr/BUILD @@ -2,29 +2,12 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -package(default_visibility = ["//visibility:public"]) - -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) +load("//rules/opentitan:hw.bzl", "opentitan_ip") -autogen_hjson_c_header( - name = "clkmgr_c_regs", - srcs = [ - "data/clkmgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "clkmgr_rust_regs", - srcs = [ - "data/clkmgr.hjson", - ], -) +package(default_visibility = ["//visibility:public"]) -filegroup( - name = "all_files", - srcs = glob(["**"]), +opentitan_ip( + name = "clkmgr", + files = glob(["**"]), + hjson = "data/clkmgr.hjson", ) diff --git a/hw/top_darjeeling/ip_autogen/pinmux/BUILD b/hw/top_darjeeling/ip_autogen/pinmux/BUILD index 5a99add16588c..8ed5dfbce120b 100644 --- a/hw/top_darjeeling/ip_autogen/pinmux/BUILD +++ b/hw/top_darjeeling/ip_autogen/pinmux/BUILD @@ -2,29 +2,12 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -package(default_visibility = ["//visibility:public"]) - -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) +load("//rules/opentitan:hw.bzl", "opentitan_ip") -autogen_hjson_c_header( - name = "pinmux_c_regs", - srcs = [ - "data/pinmux.hjson", - ], -) - -autogen_hjson_rust_header( - name = "pinmux_rust_regs", - srcs = [ - "data/pinmux.hjson", - ], -) +package(default_visibility = ["//visibility:public"]) -filegroup( - name = "all_files", - srcs = glob(["**"]), +opentitan_ip( + name = "pinmux", + files = glob(["**"]), + hjson = "data/pinmux.hjson", ) diff --git a/hw/top_darjeeling/ip_autogen/pwrmgr/BUILD b/hw/top_darjeeling/ip_autogen/pwrmgr/BUILD index 1206ee3d1c10b..9e373887077a1 100644 --- a/hw/top_darjeeling/ip_autogen/pwrmgr/BUILD +++ b/hw/top_darjeeling/ip_autogen/pwrmgr/BUILD @@ -2,29 +2,12 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -package(default_visibility = ["//visibility:public"]) - -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) +load("//rules/opentitan:hw.bzl", "opentitan_ip") -autogen_hjson_c_header( - name = "pwrmgr_c_regs", - srcs = [ - "data/pwrmgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "pwrmgr_rust_regs", - srcs = [ - "data/pwrmgr.hjson", - ], -) +package(default_visibility = ["//visibility:public"]) -filegroup( - name = "all_files", - srcs = glob(["**"]), +opentitan_ip( + name = "pwrmgr", + files = glob(["**"]), + hjson = "data/pwrmgr.hjson", ) diff --git a/hw/top_darjeeling/ip_autogen/rstmgr/BUILD b/hw/top_darjeeling/ip_autogen/rstmgr/BUILD index 417731a72f481..e91ed71d0e61d 100644 --- a/hw/top_darjeeling/ip_autogen/rstmgr/BUILD +++ b/hw/top_darjeeling/ip_autogen/rstmgr/BUILD @@ -2,29 +2,12 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -package(default_visibility = ["//visibility:public"]) - -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) +load("//rules/opentitan:hw.bzl", "opentitan_ip") -autogen_hjson_c_header( - name = "rstmgr_c_regs", - srcs = [ - "data/rstmgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "rstmgr_rust_regs", - srcs = [ - "data/rstmgr.hjson", - ], -) +package(default_visibility = ["//visibility:public"]) -filegroup( - name = "all_files", - srcs = glob(["**"]), +opentitan_ip( + name = "rstmgr", + files = glob(["**"]), + hjson = "data/rstmgr.hjson", ) diff --git a/hw/top_darjeeling/sw/autogen/top_darjeeling.c b/hw/top_darjeeling/sw/autogen/top_darjeeling.c index 03e6933a26845..609d96fa335f5 100644 --- a/hw/top_darjeeling/sw/autogen/top_darjeeling.c +++ b/hw/top_darjeeling/sw/autogen/top_darjeeling.c @@ -1,6 +1,11 @@ // Copyright lowRISC contributors (OpenTitan project). // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 +// +// ------------------- W A R N I N G: A U T O - G E N E R A T E D C O D E !! -------------------// +// PLEASE DO NOT HAND-EDIT THIS FILE. IT HAS BEEN AUTO-GENERATED WITH THE FOLLOWING COMMAND: +// util/topgen.py -t hw/top_darjeeling/data/top_darjeeling.hjson +// -o hw/top_darjeeling #include "hw/top_darjeeling/sw/autogen/top_darjeeling.h" diff --git a/hw/top_darjeeling/sw/autogen/top_darjeeling.h b/hw/top_darjeeling/sw/autogen/top_darjeeling.h index 7425071470e60..feb2095ab32f7 100644 --- a/hw/top_darjeeling/sw/autogen/top_darjeeling.h +++ b/hw/top_darjeeling/sw/autogen/top_darjeeling.h @@ -1,6 +1,11 @@ // Copyright lowRISC contributors (OpenTitan project). // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 +// +// ------------------- W A R N I N G: A U T O - G E N E R A T E D C O D E !! -------------------// +// PLEASE DO NOT HAND-EDIT THIS FILE. IT HAS BEEN AUTO-GENERATED WITH THE FOLLOWING COMMAND: +// util/topgen.py -t hw/top_darjeeling/data/top_darjeeling.hjson +// -o hw/top_darjeeling #ifndef OPENTITAN_HW_TOP_DARJEELING_SW_AUTOGEN_TOP_DARJEELING_H_ #define OPENTITAN_HW_TOP_DARJEELING_SW_AUTOGEN_TOP_DARJEELING_H_ @@ -1655,6 +1660,20 @@ typedef enum top_darjeeling_hintable_clocks { kTopDarjeelingHintableClocksLast = 3, /**< \internal Last Valid Hintable Clock */ } top_darjeeling_hintable_clocks_t; +/** + * Clock IDs for peripherals to map against properties. + */ +typedef enum top_darjeeling_clock_src { + kTopDarjeelingClockSrcUnknown = 0, /**< ID representing unknown clock */ + kTopDarjeelingClockSrcMain = 1, /**< Clock main */ + kTopDarjeelingClockSrcIo = 2, /**< Clock io */ + kTopDarjeelingClockSrcUsb = 3, /**< Clock usb */ + kTopDarjeelingClockSrcAon = 4, /**< Clock aon */ + kTopDarjeelingClockSrcIoDiv2 = 5, /**< Clock io_div2 */ + kTopDarjeelingClockSrcIoDiv4 = 6, /**< Clock io_div4 */ + kTopDarjeelingClockSrcCount = 7, /**< Number of clock IDs */ +} top_darjeeling_clock_src_t; + /** * MMIO Region * From 8a436825787464fdb8ba00f98c4b5d2c71197017 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Fri, 22 Nov 2024 15:11:28 +0000 Subject: [PATCH 2/6] [rand_testutils] Remove useless dependency on the top lib Signed-off-by: Amaury Pouly --- sw/device/lib/testing/BUILD | 1 - sw/device/lib/testing/rand_testutils.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/sw/device/lib/testing/BUILD b/sw/device/lib/testing/BUILD index a62b6723e9b42..3e7d29e028c7d 100644 --- a/sw/device/lib/testing/BUILD +++ b/sw/device/lib/testing/BUILD @@ -365,7 +365,6 @@ cc_library( target_compatible_with = [OPENTITAN_CPU], deps = [ ":rv_core_ibex_testutils", - "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:memory", "//sw/device/lib/dif:rv_core_ibex", diff --git a/sw/device/lib/testing/rand_testutils.c b/sw/device/lib/testing/rand_testutils.c index 27befae2b2ab1..d30ef6fd299e2 100644 --- a/sw/device/lib/testing/rand_testutils.c +++ b/sw/device/lib/testing/rand_testutils.c @@ -14,8 +14,6 @@ #include "sw/device/lib/testing/rv_core_ibex_testutils.h" #include "sw/device/lib/testing/test_framework/check.h" -#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h" - /** * The polynomial co-efficients used in the 32-bit LFSR implementation. * From d15e49eda81f5cd0cd01ff522bece0349876c3a2 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Fri, 22 Nov 2024 16:08:13 +0000 Subject: [PATCH 3/6] [top_darjeeling] Move ast and sensor_ctrl to new rules Signed-off-by: Amaury Pouly --- hw/top_darjeeling/ip/ast/BUILD | 11 +++++----- hw/top_darjeeling/ip/ast/data/BUILD | 24 ++------------------- hw/top_darjeeling/ip/sensor_ctrl/BUILD | 11 +++++----- hw/top_darjeeling/ip/sensor_ctrl/data/BUILD | 24 ++------------------- 4 files changed, 16 insertions(+), 54 deletions(-) diff --git a/hw/top_darjeeling/ip/ast/BUILD b/hw/top_darjeeling/ip/ast/BUILD index bb10f42047c70..182106bca3d19 100644 --- a/hw/top_darjeeling/ip/ast/BUILD +++ b/hw/top_darjeeling/ip/ast/BUILD @@ -2,11 +2,12 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 +load("//rules/opentitan:hw.bzl", "opentitan_ip") + package(default_visibility = ["//visibility:public"]) -filegroup( - name = "all_files", - srcs = glob(["**"]) + [ - "//hw/top_darjeeling/ip/ast/data:all_files", - ], +opentitan_ip( + name = "ast", + files = glob(["**"]), + hjson = "//hw/top_darjeeling/ip/ast/data:hjson", ) diff --git a/hw/top_darjeeling/ip/ast/data/BUILD b/hw/top_darjeeling/ip/ast/data/BUILD index d71fefb5672e5..dc211f10842ea 100644 --- a/hw/top_darjeeling/ip/ast/data/BUILD +++ b/hw/top_darjeeling/ip/ast/data/BUILD @@ -4,27 +4,7 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "ast_c_regs", - srcs = [ - "ast.hjson", - ], -) - -autogen_hjson_rust_header( - name = "ast_rust_regs", - srcs = [ - "ast.hjson", - ], -) - filegroup( - name = "all_files", - srcs = glob(["**"]), + name = "hjson", + srcs = ["ast.hjson"], ) diff --git a/hw/top_darjeeling/ip/sensor_ctrl/BUILD b/hw/top_darjeeling/ip/sensor_ctrl/BUILD index 44122369227e5..1fab98bee6bb9 100644 --- a/hw/top_darjeeling/ip/sensor_ctrl/BUILD +++ b/hw/top_darjeeling/ip/sensor_ctrl/BUILD @@ -2,11 +2,12 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 +load("//rules/opentitan:hw.bzl", "opentitan_ip") + package(default_visibility = ["//visibility:public"]) -filegroup( - name = "all_files", - srcs = glob(["**"]) + [ - "//hw/top_darjeeling/ip/sensor_ctrl/data:all_files", - ], +opentitan_ip( + name = "sensor_ctrl", + files = glob(["**"]), + hjson = "//hw/top_darjeeling/ip/sensor_ctrl/data:hjson", ) diff --git a/hw/top_darjeeling/ip/sensor_ctrl/data/BUILD b/hw/top_darjeeling/ip/sensor_ctrl/data/BUILD index 8e4acec5a4027..c160cf080967e 100644 --- a/hw/top_darjeeling/ip/sensor_ctrl/data/BUILD +++ b/hw/top_darjeeling/ip/sensor_ctrl/data/BUILD @@ -4,27 +4,7 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "sensor_ctrl_c_regs", - srcs = [ - "sensor_ctrl.hjson", - ], -) - -autogen_hjson_rust_header( - name = "sensor_ctrl_rust_regs", - srcs = [ - "sensor_ctrl.hjson", - ], -) - filegroup( - name = "all_files", - srcs = glob(["**"]), + name = "hjson", + srcs = ["sensor_ctrl.hjson"], ) From 91be93fc863207deb689691908af6d5cee89c3b8 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Fri, 22 Nov 2024 16:27:54 +0000 Subject: [PATCH 4/6] [earlgrey,sw] Remove use of legacy file Signed-off-by: Amaury Pouly --- hw/top_earlgrey/sw/cw310/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/top_earlgrey/sw/cw310/BUILD b/hw/top_earlgrey/sw/cw310/BUILD index 25b990888184d..412fb5498fbce 100644 --- a/hw/top_earlgrey/sw/cw310/BUILD +++ b/hw/top_earlgrey/sw/cw310/BUILD @@ -2,7 +2,7 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -load("//rules:opentitan.bzl", "OPENTITAN_CPU") +load("//rules/opentitan:defs.bzl", "OPENTITAN_CPU") package(default_visibility = ["//visibility:public"]) From 7fdb84670b468f0bba57a10d48a92bd61f5d499e Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Fri, 22 Nov 2024 16:39:25 +0000 Subject: [PATCH 5/6] [silicon_creator] Fix reference to flash_ctrl registers Signed-off-by: Amaury Pouly --- sw/device/silicon_creator/lib/cert/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/device/silicon_creator/lib/cert/BUILD b/sw/device/silicon_creator/lib/cert/BUILD index 4d1e23beb906c..04f7fb7d1e074 100644 --- a/sw/device/silicon_creator/lib/cert/BUILD +++ b/sw/device/silicon_creator/lib/cert/BUILD @@ -206,7 +206,7 @@ cc_library( srcs = ["dice_chain.c"], hdrs = ["dice_chain.h"], deps = [ - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", "//sw/device/lib/crypto/drivers:entropy", From bd2244cc886ef32f28af2bce4712302ea7886732 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Mon, 25 Nov 2024 12:56:30 +0000 Subject: [PATCH 6/6] [bazel,top] Rework top selection mecanism to use string_flag Signed-off-by: Amaury Pouly --- hw/BUILD | 2 +- hw/bitstream/vivado/BUILD | 6 ++-- hw/top/BUILD | 51 +++++++++++++++++++---------- hw/top/defs.bzl | 18 ++++++++++ sw/device/lib/dif/autogen/BUILD | 2 +- sw/device/lib/testing/BUILD | 2 +- sw/device/lib/testing/autogen/BUILD | 2 +- 7 files changed, 58 insertions(+), 25 deletions(-) diff --git a/hw/BUILD b/hw/BUILD index e605673a208a7..29c0972b70cd5 100644 --- a/hw/BUILD +++ b/hw/BUILD @@ -35,7 +35,7 @@ string_list_flag( fusesoc_build( name = "verilator_real", srcs = [ - "//hw/top", + "//hw/top:top_desc", ], cores = [ "//:cores", diff --git a/hw/bitstream/vivado/BUILD b/hw/bitstream/vivado/BUILD index d519d54f267c9..b6318a179e61f 100644 --- a/hw/bitstream/vivado/BUILD +++ b/hw/bitstream/vivado/BUILD @@ -40,7 +40,7 @@ fusesoc_build( name = "fpga_cw310", testonly = True, srcs = [ - "//hw/top", + "//hw/top:top_desc", _CW310_TESTROM, _OTP_RMA, ], @@ -90,7 +90,7 @@ fusesoc_build( name = "fpga_cw310_hyperdebug", testonly = True, srcs = [ - "//hw/top", + "//hw/top:top_desc", _CW310_TESTROM, _OTP_RMA, ], @@ -140,7 +140,7 @@ fusesoc_build( name = "fpga_cw340", testonly = True, srcs = [ - "//hw/top", + "//hw/top:top_desc", _CW340_TESTROM, _OTP_RMA, ], diff --git a/hw/top/BUILD b/hw/top/BUILD index 86acafce84da5..7870b9df0c214 100644 --- a/hw/top/BUILD +++ b/hw/top/BUILD @@ -2,6 +2,7 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 +load("@bazel_skylib//rules:common_settings.bzl", "string_flag") load( "//rules:autogen.bzl", "opentitan_ip_c_header", @@ -14,24 +15,37 @@ load("//hw/top:defs.bzl", IPS = "OPENTITAN_ALL_IPS") package(default_visibility = ["//visibility:public"]) -# FIXME rework that properly with platforms -constraint_setting( - name = "top_setting", - default_constraint_value = ":top_earlgrey", -) +ALL_TOPS = [ + "earlgrey", + "darjeeling", +] -constraint_value( - name = "top_earlgrey", - constraint_setting = ":top_setting", +# Use this flag to select the top. +string_flag( + name = "top", + build_setting_default = "earlgrey", + values = ALL_TOPS, ) +# Config settings to test against tops. +[ + config_setting( + name = "is_{}".format(top), + flag_values = { + ":top": top, + }, + ) + for top in ALL_TOPS +] + alias( - name = "top", + name = "top_desc", actual = select( { - ":top_earlgrey": "//hw/top_earlgrey", + ":is_earlgrey": "//hw/top_earlgrey", + ":is_darjeeling": "//hw/top_darjeeling", }, - no_match_error = "no top selected", + no_match_error = "unknown top", ), ) @@ -39,9 +53,10 @@ alias( name = "top_lib", actual = select( { - ":top_earlgrey": "//hw/top_earlgrey/sw/autogen:top_earlgrey", + ":is_earlgrey": "//hw/top_earlgrey/sw/autogen:top_earlgrey", + ":is_darjeeling": "//hw/top_darjeeling/sw/autogen:top_darjeeling", }, - no_match_error = "no top selected", + no_match_error = "unknown top", ), ) @@ -49,7 +64,7 @@ alias( opentitan_ip_c_header( name = "{}_c_regs".format(ip), ip = ip, - top = ":top", + top = ":top_desc", ) for ip in IPS ] @@ -58,14 +73,14 @@ alias( opentitan_ip_rust_header( name = "{}_rust_regs".format(ip), ip = ip, - top = ":top", + top = ":top_desc", ) for ip in IPS ] opentitan_top_dt_api( name = "dt_api", - top = ":top", + top = ":top_desc", deps = [":top_lib"], ) @@ -73,7 +88,7 @@ opentitan_top_dt_api( opentitan_ip_dt_header( name = "dt_{}".format(ip), ip = ip, - top = ":top", + top = ":top_desc", deps = [":dt_api"], ) for ip in IPS @@ -87,6 +102,6 @@ cc_library( opentitan_top_devicetables( name = "devicetables", - top = ":top", + top = ":top_desc", deps = [":dt_headers"], ) diff --git a/hw/top/defs.bzl b/hw/top/defs.bzl index db99ac722ba4f..845fdca062c4d 100644 --- a/hw/top/defs.bzl +++ b/hw/top/defs.bzl @@ -43,3 +43,21 @@ OPENTITAN_ALL_IPS = [ "uart", "usbdev", ] + +def opentitan_require_top(top_name): + """ + Use this macro in the `target_compatible_with` attribute of + a rule to express the requirement that this target should only + be considered for a particular top. + + Example: + cc_library( + name = "bla", + ... + target_compatible_with = opentitan_require_top("earlgrey"), + ) + """ + return select({ + "//hw/top:is_{}".format(top_name): [], + "//conditions:default": ["@platforms//:incompatible"], + }) diff --git a/sw/device/lib/dif/autogen/BUILD b/sw/device/lib/dif/autogen/BUILD index a2d3e17de2202..9b0bca373b0b6 100644 --- a/sw/device/lib/dif/autogen/BUILD +++ b/sw/device/lib/dif/autogen/BUILD @@ -11,7 +11,7 @@ package(default_visibility = ["//visibility:public"]) opentitan_autogen_dif( name = ip, ip = ip, - top = "//hw/top", + top = "//hw/top:top_desc", ) for ip in OPENTITAN_ALL_IPS ] diff --git a/sw/device/lib/testing/BUILD b/sw/device/lib/testing/BUILD index 3e7d29e028c7d..2e962b9e63ea1 100644 --- a/sw/device/lib/testing/BUILD +++ b/sw/device/lib/testing/BUILD @@ -38,7 +38,7 @@ cc_library( ] + select( { # FIXME improve this when we have proper platforms - "//hw/top:top_earlgrey": [ + "//hw/top:is_earlgrey": [ "//sw/device/lib/dif:flash_ctrl", "//sw/device/lib/dif:keymgr", "//sw/device/lib/dif:usbdev", diff --git a/sw/device/lib/testing/autogen/BUILD b/sw/device/lib/testing/autogen/BUILD index 197574c71ce34..4f8405a813f0f 100644 --- a/sw/device/lib/testing/autogen/BUILD +++ b/sw/device/lib/testing/autogen/BUILD @@ -8,5 +8,5 @@ package(default_visibility = ["//visibility:public"]) opentitan_autogen_isr_testutils( name = "isr_testutils", - top = "//hw/top", + top = "//hw/top:top_desc", )