diff --git a/hw/ip/adc_ctrl/data/BUILD b/hw/ip/adc_ctrl/data/BUILD index feea87a9cd4ba2..dda56de039e27f 100644 --- a/hw/ip/adc_ctrl/data/BUILD +++ b/hw/ip/adc_ctrl/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "adc_ctrl_c_regs", - srcs = [ - "adc_ctrl.hjson", - ], -) - -autogen_hjson_rust_header( - name = "adc_ctrl_rust_regs", - srcs = [ - "adc_ctrl.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/adc_ctrl/defs.bzl b/hw/ip/adc_ctrl/defs.bzl new file mode 100644 index 00000000000000..3c84ecf064c05e --- /dev/null +++ b/hw/ip/adc_ctrl/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +ADC_CTRL = opentitan_ip( + name = "adc_ctrl", + hjson = "//hw/ip/adc_ctrl/data:adc_ctrl.hjson", +) diff --git a/hw/ip/aes/data/BUILD b/hw/ip/aes/data/BUILD index d57a9ac6063e44..dda56de039e27f 100644 --- a/hw/ip/aes/data/BUILD +++ b/hw/ip/aes/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "aes_c_regs", - srcs = [ - "aes.hjson", - ], -) - -autogen_hjson_rust_header( - name = "aes_rust_regs", - srcs = [ - "aes.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/aes/defs.bzl b/hw/ip/aes/defs.bzl new file mode 100644 index 00000000000000..98538b8cd96cb0 --- /dev/null +++ b/hw/ip/aes/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +AES = opentitan_ip( + name = "aes", + hjson = "//hw/ip/aes/data:aes.hjson", +) diff --git a/hw/ip/aon_timer/data/BUILD b/hw/ip/aon_timer/data/BUILD index 3fd155b53d331f..dda56de039e27f 100644 --- a/hw/ip/aon_timer/data/BUILD +++ b/hw/ip/aon_timer/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "aon_timer_c_regs", - srcs = [ - "aon_timer.hjson", - ], -) - -autogen_hjson_rust_header( - name = "aon_timer_rust_regs", - srcs = [ - "aon_timer.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/aon_timer/defs.bzl b/hw/ip/aon_timer/defs.bzl new file mode 100644 index 00000000000000..cec3926e89fc16 --- /dev/null +++ b/hw/ip/aon_timer/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +AON_TIMER = opentitan_ip( + name = "aon_timer", + hjson = "//hw/ip/aon_timer/data:aon_timer.hjson", +) diff --git a/hw/ip/csrng/data/BUILD b/hw/ip/csrng/data/BUILD index ae8f6b37462b40..dda56de039e27f 100644 --- a/hw/ip/csrng/data/BUILD +++ b/hw/ip/csrng/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "csrng_c_regs", - srcs = [ - "csrng.hjson", - ], -) - -autogen_hjson_rust_header( - name = "csrng_rust_regs", - srcs = [ - "csrng.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/csrng/defs.bzl b/hw/ip/csrng/defs.bzl new file mode 100644 index 00000000000000..b7cb5af71fc47a --- /dev/null +++ b/hw/ip/csrng/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +CSRNG = opentitan_ip( + name = "csrng", + hjson = "//hw/ip/csrng/data:csrng.hjson", +) diff --git a/hw/ip/dma/data/BUILD b/hw/ip/dma/data/BUILD index 7f438f91b0975c..dda56de039e27f 100644 --- a/hw/ip/dma/data/BUILD +++ b/hw/ip/dma/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "dma_c_regs", - srcs = [ - "dma.hjson", - ], -) - -autogen_hjson_rust_header( - name = "dma_rust_regs", - srcs = [ - "dma.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/dma/defs.bzl b/hw/ip/dma/defs.bzl new file mode 100644 index 00000000000000..47a5d84ab24851 --- /dev/null +++ b/hw/ip/dma/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +DMA = opentitan_ip( + name = "dma", + hjson = "//hw/ip/dma/data:dma.hjson", +) diff --git a/hw/ip/edn/data/BUILD b/hw/ip/edn/data/BUILD index ce0737c0897c16..dda56de039e27f 100644 --- a/hw/ip/edn/data/BUILD +++ b/hw/ip/edn/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "edn_c_regs", - srcs = [ - "edn.hjson", - ], -) - -autogen_hjson_rust_header( - name = "edn_rust_regs", - srcs = [ - "edn.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/edn/defs.bzl b/hw/ip/edn/defs.bzl new file mode 100644 index 00000000000000..04eb193df2880e --- /dev/null +++ b/hw/ip/edn/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +EDN = opentitan_ip( + name = "edn", + hjson = "//hw/ip/edn/data:edn.hjson", +) diff --git a/hw/ip/entropy_src/data/BUILD b/hw/ip/entropy_src/data/BUILD index 109760987a3660..dda56de039e27f 100644 --- a/hw/ip/entropy_src/data/BUILD +++ b/hw/ip/entropy_src/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "entropy_src_c_regs", - srcs = [ - "entropy_src.hjson", - ], -) - -autogen_hjson_rust_header( - name = "entropy_src_rust_regs", - srcs = [ - "entropy_src.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/entropy_src/defs.bzl b/hw/ip/entropy_src/defs.bzl new file mode 100644 index 00000000000000..2050677d7f2639 --- /dev/null +++ b/hw/ip/entropy_src/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +ENTROPY_SRC = opentitan_ip( + name = "entropy_src", + hjson = "//hw/ip/entropy_src/data:entropy_src.hjson", +) diff --git a/hw/ip/gpio/data/BUILD b/hw/ip/gpio/data/BUILD index c4fbe235eebdf6..dda56de039e27f 100644 --- a/hw/ip/gpio/data/BUILD +++ b/hw/ip/gpio/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "gpio_c_regs", - srcs = [ - "gpio.hjson", - ], -) - -autogen_hjson_rust_header( - name = "gpio_rust_regs", - srcs = [ - "gpio.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/gpio/defs.bzl b/hw/ip/gpio/defs.bzl new file mode 100644 index 00000000000000..ae881890e83145 --- /dev/null +++ b/hw/ip/gpio/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +GPIO = opentitan_ip( + name = "gpio", + hjson = "//hw/ip/gpio/data:gpio.hjson", +) diff --git a/hw/ip/hmac/data/BUILD b/hw/ip/hmac/data/BUILD index 771bf9d8ae132d..dda56de039e27f 100644 --- a/hw/ip/hmac/data/BUILD +++ b/hw/ip/hmac/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "hmac_c_regs", - srcs = [ - "hmac.hjson", - ], -) - -autogen_hjson_rust_header( - name = "hmac_rust_regs", - srcs = [ - "hmac.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/hmac/defs.bzl b/hw/ip/hmac/defs.bzl new file mode 100644 index 00000000000000..99051b3a2c076d --- /dev/null +++ b/hw/ip/hmac/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +HMAC = opentitan_ip( + name = "hmac", + hjson = "//hw/ip/hmac/data:hmac.hjson", +) diff --git a/hw/ip/i2c/data/BUILD b/hw/ip/i2c/data/BUILD index e06f70ab9459f8..dda56de039e27f 100644 --- a/hw/ip/i2c/data/BUILD +++ b/hw/ip/i2c/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "i2c_c_regs", - srcs = [ - "i2c.hjson", - ], -) - -autogen_hjson_rust_header( - name = "i2c_rust_regs", - srcs = [ - "i2c.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/i2c/defs.bzl b/hw/ip/i2c/defs.bzl new file mode 100644 index 00000000000000..df26f9d3c67892 --- /dev/null +++ b/hw/ip/i2c/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +I2C = opentitan_ip( + name = "i2c", + hjson = "//hw/ip/i2c/data:i2c.hjson", +) diff --git a/hw/ip/keymgr/data/BUILD b/hw/ip/keymgr/data/BUILD index d4d35f1f2e494f..dda56de039e27f 100644 --- a/hw/ip/keymgr/data/BUILD +++ b/hw/ip/keymgr/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "keymgr_c_regs", - srcs = [ - "keymgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "keymgr_rust_regs", - srcs = [ - "keymgr.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/keymgr/defs.bzl b/hw/ip/keymgr/defs.bzl new file mode 100644 index 00000000000000..096d51ec156092 --- /dev/null +++ b/hw/ip/keymgr/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +KEYMGR = opentitan_ip( + name = "keymgr", + hjson = "//hw/ip/keymgr/data:keymgr.hjson", +) diff --git a/hw/ip/keymgr_dpe/data/BUILD b/hw/ip/keymgr_dpe/data/BUILD index f4ca3863ba1a64..dda56de039e27f 100644 --- a/hw/ip/keymgr_dpe/data/BUILD +++ b/hw/ip/keymgr_dpe/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "keymgr_dpe_c_regs", - srcs = [ - "keymgr_dpe.hjson", - ], -) - -autogen_hjson_rust_header( - name = "keymgr_dpe_rust_regs", - srcs = [ - "keymgr_dpe.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/keymgr_dpe/defs.bzl b/hw/ip/keymgr_dpe/defs.bzl new file mode 100644 index 00000000000000..b42c635b0642c4 --- /dev/null +++ b/hw/ip/keymgr_dpe/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +KEYMGR_DPE = opentitan_ip( + name = "keymgr_dpe", + hjson = "//hw/ip/keymgr_dpe/data:keymgr_dpe.hjson", +) diff --git a/hw/ip/kmac/data/BUILD b/hw/ip/kmac/data/BUILD index bef28b65d0c57d..dda56de039e27f 100644 --- a/hw/ip/kmac/data/BUILD +++ b/hw/ip/kmac/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "kmac_c_regs", - srcs = [ - "kmac.hjson", - ], -) - -autogen_hjson_rust_header( - name = "kmac_rust_regs", - srcs = [ - "kmac.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/kmac/defs.bzl b/hw/ip/kmac/defs.bzl new file mode 100644 index 00000000000000..c5218c3dd9b9f2 --- /dev/null +++ b/hw/ip/kmac/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +KMAC = opentitan_ip( + name = "kmac", + hjson = "//hw/ip/kmac/data:kmac.hjson", +) diff --git a/hw/ip/lc_ctrl/data/BUILD b/hw/ip/lc_ctrl/data/BUILD index 84625e6ce5fed3..84766e36514982 100644 --- a/hw/ip/lc_ctrl/data/BUILD +++ b/hw/ip/lc_ctrl/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "lc_ctrl_c_regs", - srcs = [ - "lc_ctrl.hjson", - ], -) - -autogen_hjson_rust_header( - name = "lc_ctrl_rust_regs", - srcs = [ - "lc_ctrl.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/lc_ctrl/defs.bzl b/hw/ip/lc_ctrl/defs.bzl new file mode 100644 index 00000000000000..a2ce56fca46ba2 --- /dev/null +++ b/hw/ip/lc_ctrl/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +LC_CTRL = opentitan_ip( + name = "lc_ctrl", + hjson = "//hw/ip/lc_ctrl/data:lc_ctrl.hjson", +) diff --git a/hw/ip/mbx/data/BUILD b/hw/ip/mbx/data/BUILD index d252a50b4bc270..dda56de039e27f 100644 --- a/hw/ip/mbx/data/BUILD +++ b/hw/ip/mbx/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "mbx_c_regs", - srcs = [ - "mbx.hjson", - ], -) - -autogen_hjson_rust_header( - name = "mbx_rust_regs", - srcs = [ - "mbx.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/mbx/defs.bzl b/hw/ip/mbx/defs.bzl new file mode 100644 index 00000000000000..1a5c0718733afa --- /dev/null +++ b/hw/ip/mbx/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +MBX = opentitan_ip( + name = "mbx", + hjson = "//hw/ip/mbx/data:mbx.hjson", +) diff --git a/hw/ip/otbn/data/BUILD b/hw/ip/otbn/data/BUILD index 3c0a9b4973868e..dda56de039e27f 100644 --- a/hw/ip/otbn/data/BUILD +++ b/hw/ip/otbn/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "otbn_c_regs", - srcs = [ - "otbn.hjson", - ], -) - -autogen_hjson_rust_header( - name = "otbn_rust_regs", - srcs = [ - "otbn.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/otbn/defs.bzl b/hw/ip/otbn/defs.bzl new file mode 100644 index 00000000000000..0b78d924d4d63e --- /dev/null +++ b/hw/ip/otbn/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +OTBN = opentitan_ip( + name = "otbn", + hjson = "//hw/ip/otbn/data:otbn.hjson", +) diff --git a/hw/ip/otp_ctrl/data/BUILD b/hw/ip/otp_ctrl/data/BUILD index afe34b68415e41..5f742a53819946 100644 --- a/hw/ip/otp_ctrl/data/BUILD +++ b/hw/ip/otp_ctrl/data/BUILD @@ -4,11 +4,6 @@ load("@bazel_skylib//rules:common_settings.bzl", "int_flag", "string_flag") load("@rules_pkg//pkg:mappings.bzl", "pkg_files") -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) load("//rules:const.bzl", "CONST", "EARLGREY_ALERTS", "EARLGREY_LOC_ALERTS") load( "//rules:otp.bzl", @@ -68,22 +63,6 @@ exports_files([ "otp_ctrl_img.c.tpl", ]) -autogen_hjson_c_header( - name = "otp_ctrl_c_regs", - srcs = [ - "otp_ctrl.hjson", - ], - node = "core", -) - -autogen_hjson_rust_header( - name = "otp_ctrl_rust_regs", - srcs = [ - "otp_ctrl.hjson", - ], - node = "core", -) - exports_files(["otp_ctrl_mmap.hjson"]) otp_json( diff --git a/hw/ip/otp_ctrl/data/earlgrey_skus/sival/BUILD b/hw/ip/otp_ctrl/data/earlgrey_skus/sival/BUILD index 866ef18cc7950e..f063bc7c14c7be 100644 --- a/hw/ip/otp_ctrl/data/earlgrey_skus/sival/BUILD +++ b/hw/ip/otp_ctrl/data/earlgrey_skus/sival/BUILD @@ -285,7 +285,7 @@ cc_library( name = "otp_consts", srcs = [":otp_consts_c_file"], deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/silicon_creator/manuf/lib:otp_img_types", ], ) diff --git a/hw/ip/otp_ctrl/defs.bzl b/hw/ip/otp_ctrl/defs.bzl new file mode 100644 index 00000000000000..0f76f2989d30a7 --- /dev/null +++ b/hw/ip/otp_ctrl/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +OTP_CTRL = opentitan_ip( + name = "otp_ctrl", + hjson = "//hw/ip/otp_ctrl/data:otp_ctrl.hjson", +) diff --git a/hw/ip/pattgen/data/BUILD b/hw/ip/pattgen/data/BUILD index c14e0b1164b601..dda56de039e27f 100644 --- a/hw/ip/pattgen/data/BUILD +++ b/hw/ip/pattgen/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "pattgen_c_regs", - srcs = [ - "pattgen.hjson", - ], -) - -autogen_hjson_rust_header( - name = "pattgen_rust_regs", - srcs = [ - "pattgen.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/pattgen/defs.bzl b/hw/ip/pattgen/defs.bzl new file mode 100644 index 00000000000000..71dac6c0e56e33 --- /dev/null +++ b/hw/ip/pattgen/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +PATTGEN = opentitan_ip( + name = "pattgen", + hjson = "//hw/ip/pattgen/data:pattgen.hjson", +) diff --git a/hw/ip/pwm/data/BUILD b/hw/ip/pwm/data/BUILD index 899d4fc20483b4..dda56de039e27f 100644 --- a/hw/ip/pwm/data/BUILD +++ b/hw/ip/pwm/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "pwm_c_regs", - srcs = [ - "pwm.hjson", - ], -) - -autogen_hjson_rust_header( - name = "pwm_rust_regs", - srcs = [ - "pwm.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/pwm/defs.bzl b/hw/ip/pwm/defs.bzl new file mode 100644 index 00000000000000..0705ece5424533 --- /dev/null +++ b/hw/ip/pwm/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +PWM = opentitan_ip( + name = "pwm", + hjson = "//hw/ip/pwm/data:pwm.hjson", +) diff --git a/hw/ip/rom_ctrl/data/BUILD b/hw/ip/rom_ctrl/data/BUILD index 84e91818f32607..dda56de039e27f 100644 --- a/hw/ip/rom_ctrl/data/BUILD +++ b/hw/ip/rom_ctrl/data/BUILD @@ -4,28 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "rom_ctrl_c_regs", - srcs = [ - "rom_ctrl.hjson", - ], - node = "regs", -) - -autogen_hjson_rust_header( - name = "rom_ctrl_rust_regs", - srcs = [ - "rom_ctrl.hjson", - ], - node = "regs", -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/rom_ctrl/defs.bzl b/hw/ip/rom_ctrl/defs.bzl new file mode 100644 index 00000000000000..4ce9ff304c8236 --- /dev/null +++ b/hw/ip/rom_ctrl/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +ROM_CTRL = opentitan_ip( + name = "rom_ctrl", + hjson = "//hw/ip/rom_ctrl/data:rom_ctrl.hjson", +) diff --git a/hw/ip/rv_core_ibex/data/BUILD b/hw/ip/rv_core_ibex/data/BUILD index d897425e739c5e..dda56de039e27f 100644 --- a/hw/ip/rv_core_ibex/data/BUILD +++ b/hw/ip/rv_core_ibex/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "rv_core_ibex_c_regs", - srcs = [ - "rv_core_ibex.hjson", - ], -) - -autogen_hjson_rust_header( - name = "rv_core_ibex_rust_regs", - srcs = [ - "rv_core_ibex.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/rv_core_ibex/defs.bzl b/hw/ip/rv_core_ibex/defs.bzl new file mode 100644 index 00000000000000..c37ecc7c416191 --- /dev/null +++ b/hw/ip/rv_core_ibex/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +RV_CORE_IBEX = opentitan_ip( + name = "rv_core_ibex", + hjson = "//hw/ip/rv_core_ibex/data:rv_core_ibex.hjson", +) diff --git a/hw/ip/rv_dm/data/BUILD b/hw/ip/rv_dm/data/BUILD index 7280e10c17567f..dda56de039e27f 100644 --- a/hw/ip/rv_dm/data/BUILD +++ b/hw/ip/rv_dm/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "rv_dm_c_regs", - srcs = [ - "rv_dm.hjson", - ], -) - -autogen_hjson_rust_header( - name = "rv_dm_rust_regs", - srcs = [ - "rv_dm.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/rv_dm/defs.bzl b/hw/ip/rv_dm/defs.bzl new file mode 100644 index 00000000000000..4609c35166123a --- /dev/null +++ b/hw/ip/rv_dm/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +RV_DM = opentitan_ip( + name = "rv_dm", + hjson = "//hw/ip/rv_dm/data:rv_dm.hjson", +) diff --git a/hw/ip/rv_timer/data/BUILD b/hw/ip/rv_timer/data/BUILD index bd6ff36d3cfc40..dda56de039e27f 100644 --- a/hw/ip/rv_timer/data/BUILD +++ b/hw/ip/rv_timer/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "rv_timer_c_regs", - srcs = [ - "rv_timer.hjson", - ], -) - -autogen_hjson_rust_header( - name = "rv_timer_rust_regs", - srcs = [ - "rv_timer.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/rv_timer/defs.bzl b/hw/ip/rv_timer/defs.bzl new file mode 100644 index 00000000000000..cdb3cfbe852211 --- /dev/null +++ b/hw/ip/rv_timer/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +RV_TIMER = opentitan_ip( + name = "rv_timer", + hjson = "//hw/ip/rv_timer/data:rv_timer.hjson", +) diff --git a/hw/ip/soc_dbg_ctrl/defs.bzl b/hw/ip/soc_dbg_ctrl/defs.bzl new file mode 100644 index 00000000000000..1b497c526d32dc --- /dev/null +++ b/hw/ip/soc_dbg_ctrl/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +SOC_DBG_CTRL = opentitan_ip( + name = "soc_dbg_ctrl", + hjson = "//hw/ip/soc_dbg_ctrl/data:soc_dbg_ctrl.hjson", +) diff --git a/hw/ip/spi_device/data/BUILD b/hw/ip/spi_device/data/BUILD index c96cff6aa56a88..dda56de039e27f 100644 --- a/hw/ip/spi_device/data/BUILD +++ b/hw/ip/spi_device/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "spi_device_c_regs", - srcs = [ - "spi_device.hjson", - ], -) - -autogen_hjson_rust_header( - name = "spi_device_rust_regs", - srcs = [ - "spi_device.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/spi_device/defs.bzl b/hw/ip/spi_device/defs.bzl new file mode 100644 index 00000000000000..4b5aa4bbaead03 --- /dev/null +++ b/hw/ip/spi_device/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +SPI_DEVICE = opentitan_ip( + name = "spi_device", + hjson = "//hw/ip/spi_device/data:spi_device.hjson", +) diff --git a/hw/ip/spi_host/data/BUILD b/hw/ip/spi_host/data/BUILD index b94bd407381497..dda56de039e27f 100644 --- a/hw/ip/spi_host/data/BUILD +++ b/hw/ip/spi_host/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "spi_host_c_regs", - srcs = [ - "spi_host.hjson", - ], -) - -autogen_hjson_rust_header( - name = "spi_host_rust_regs", - srcs = [ - "spi_host.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/spi_host/defs.bzl b/hw/ip/spi_host/defs.bzl new file mode 100644 index 00000000000000..c37da35dfbb37b --- /dev/null +++ b/hw/ip/spi_host/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +SPI_HOST = opentitan_ip( + name = "spi_host", + hjson = "//hw/ip/spi_host/data:spi_host.hjson", +) diff --git a/hw/ip/sram_ctrl/data/BUILD b/hw/ip/sram_ctrl/data/BUILD index ca4d984c811fdf..dda56de039e27f 100644 --- a/hw/ip/sram_ctrl/data/BUILD +++ b/hw/ip/sram_ctrl/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "sram_ctrl_c_regs", - srcs = [ - "sram_ctrl.hjson", - ], -) - -autogen_hjson_rust_header( - name = "sram_ctrl_rust_regs", - srcs = [ - "sram_ctrl.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/sram_ctrl/defs.bzl b/hw/ip/sram_ctrl/defs.bzl new file mode 100644 index 00000000000000..bc2c5133053270 --- /dev/null +++ b/hw/ip/sram_ctrl/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +SRAM_CTRL = opentitan_ip( + name = "sram_ctrl", + hjson = "//hw/ip/sram_ctrl/data:sram_ctrl.hjson", +) diff --git a/hw/ip/sysrst_ctrl/data/BUILD b/hw/ip/sysrst_ctrl/data/BUILD index 14bd56b9e3628d..dda56de039e27f 100644 --- a/hw/ip/sysrst_ctrl/data/BUILD +++ b/hw/ip/sysrst_ctrl/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "sysrst_ctrl_c_regs", - srcs = [ - "sysrst_ctrl.hjson", - ], -) - -autogen_hjson_rust_header( - name = "sysrst_ctrl_rust_regs", - srcs = [ - "sysrst_ctrl.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/sysrst_ctrl/defs.bzl b/hw/ip/sysrst_ctrl/defs.bzl new file mode 100644 index 00000000000000..abac87b7cab049 --- /dev/null +++ b/hw/ip/sysrst_ctrl/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +SYSRST_CTRL = opentitan_ip( + name = "sysrst_ctrl", + hjson = "//hw/ip/sysrst_ctrl/data:sysrst_ctrl.hjson", +) diff --git a/hw/ip/uart/data/BUILD b/hw/ip/uart/data/BUILD index 0ab7e35ce8ab00..dda56de039e27f 100644 --- a/hw/ip/uart/data/BUILD +++ b/hw/ip/uart/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "uart_c_regs", - srcs = [ - "uart.hjson", - ], -) - -autogen_hjson_rust_header( - name = "uart_rust_regs", - srcs = [ - "uart.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/uart/defs.bzl b/hw/ip/uart/defs.bzl new file mode 100644 index 00000000000000..7e8d9dff4f3173 --- /dev/null +++ b/hw/ip/uart/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +UART = opentitan_ip( + name = "uart", + hjson = "//hw/ip/uart/data:uart.hjson", +) diff --git a/hw/ip/usbdev/data/BUILD b/hw/ip/usbdev/data/BUILD index 3729aabb8ac2c1..dda56de039e27f 100644 --- a/hw/ip/usbdev/data/BUILD +++ b/hw/ip/usbdev/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "usbdev_c_regs", - srcs = [ - "usbdev.hjson", - ], -) - -autogen_hjson_rust_header( - name = "usbdev_rust_regs", - srcs = [ - "usbdev.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip/usbdev/defs.bzl b/hw/ip/usbdev/defs.bzl new file mode 100644 index 00000000000000..eb95f5516cb6a8 --- /dev/null +++ b/hw/ip/usbdev/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +USBDEV = opentitan_ip( + name = "usbdev", + hjson = "//hw/ip/usbdev/data:usbdev.hjson", +) diff --git a/hw/ip_templates/alert_handler/defs.bzl.tpl b/hw/ip_templates/alert_handler/defs.bzl.tpl new file mode 100644 index 00000000000000..41e6888970592e --- /dev/null +++ b/hw/ip_templates/alert_handler/defs.bzl.tpl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +ALERT_HANDLER = opentitan_ip( + name = "alert_handler", + hjson = "//hw/top_${topname}/ip_autogen/alert_handler:data/alert_handler.hjson", +) diff --git a/hw/ip_templates/clkmgr/BUILD.tpl b/hw/ip_templates/clkmgr/BUILD.tpl index 3bed0f321eb3d9..dda56de039e27f 100644 --- a/hw/ip_templates/clkmgr/BUILD.tpl +++ b/hw/ip_templates/clkmgr/BUILD.tpl @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "clkmgr_c_regs", - srcs = [ - "data/clkmgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "clkmgr_rust_regs", - srcs = [ - "data/clkmgr.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip_templates/clkmgr/defs.bzl.tpl b/hw/ip_templates/clkmgr/defs.bzl.tpl new file mode 100644 index 00000000000000..19b9b13b5438d2 --- /dev/null +++ b/hw/ip_templates/clkmgr/defs.bzl.tpl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +CLKMGR = opentitan_ip( + name = "clkmgr", + hjson = "//hw/top_${topname}/ip_autogen/clkmgr:data/clkmgr.hjson", +) diff --git a/hw/ip_templates/flash_ctrl/BUILD.tpl b/hw/ip_templates/flash_ctrl/BUILD.tpl index 48b6309efafeda..dda56de039e27f 100644 --- a/hw/ip_templates/flash_ctrl/BUILD.tpl +++ b/hw/ip_templates/flash_ctrl/BUILD.tpl @@ -4,28 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "flash_ctrl_c_regs", - srcs = [ - "data/flash_ctrl.hjson", - ], - node = "core", -) - -autogen_hjson_rust_header( - name = "flash_ctrl_rust_regs", - srcs = [ - "data/flash_ctrl.hjson", - ], - node = "core", -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip_templates/flash_ctrl/defs.bzl.tpl b/hw/ip_templates/flash_ctrl/defs.bzl.tpl new file mode 100644 index 00000000000000..3e11f7813929cd --- /dev/null +++ b/hw/ip_templates/flash_ctrl/defs.bzl.tpl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +FLASH_CTRL = opentitan_ip( + name = "flash_ctrl", + hjson = "//hw/top_${topname}/ip_autogen/flash_ctrl:data/flash_ctrl.hjson", +) diff --git a/hw/ip_templates/pinmux/BUILD.tpl b/hw/ip_templates/pinmux/BUILD.tpl index 5a99add16588c2..dda56de039e27f 100644 --- a/hw/ip_templates/pinmux/BUILD.tpl +++ b/hw/ip_templates/pinmux/BUILD.tpl @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "pinmux_c_regs", - srcs = [ - "data/pinmux.hjson", - ], -) - -autogen_hjson_rust_header( - name = "pinmux_rust_regs", - srcs = [ - "data/pinmux.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip_templates/pinmux/defs.bzl.tpl b/hw/ip_templates/pinmux/defs.bzl.tpl new file mode 100644 index 00000000000000..e478c7eeda913d --- /dev/null +++ b/hw/ip_templates/pinmux/defs.bzl.tpl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +PINMUX = opentitan_ip( + name = "pinmux", + hjson = "//hw/top_${topname}/ip_autogen/pinmux:data/pinmux.hjson", +) diff --git a/hw/ip_templates/pwrmgr/BUILD.tpl b/hw/ip_templates/pwrmgr/BUILD.tpl index 1206ee3d1c10b3..dda56de039e27f 100644 --- a/hw/ip_templates/pwrmgr/BUILD.tpl +++ b/hw/ip_templates/pwrmgr/BUILD.tpl @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "pwrmgr_c_regs", - srcs = [ - "data/pwrmgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "pwrmgr_rust_regs", - srcs = [ - "data/pwrmgr.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip_templates/pwrmgr/defs.bzl.tpl b/hw/ip_templates/pwrmgr/defs.bzl.tpl new file mode 100644 index 00000000000000..73cb0a065ccaf6 --- /dev/null +++ b/hw/ip_templates/pwrmgr/defs.bzl.tpl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +PWRMGR = opentitan_ip( + name = "pwrmgr", + hjson = "//hw/top_${topname}/ip_autogen/pwrmgr:data/pwrmgr.hjson", +) diff --git a/hw/ip_templates/rstmgr/BUILD.tpl b/hw/ip_templates/rstmgr/BUILD.tpl index 417731a72f4813..dda56de039e27f 100644 --- a/hw/ip_templates/rstmgr/BUILD.tpl +++ b/hw/ip_templates/rstmgr/BUILD.tpl @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "rstmgr_c_regs", - srcs = [ - "data/rstmgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "rstmgr_rust_regs", - srcs = [ - "data/rstmgr.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/ip_templates/rstmgr/defs.bzl.tpl b/hw/ip_templates/rstmgr/defs.bzl.tpl new file mode 100644 index 00000000000000..eee0131c3f47ce --- /dev/null +++ b/hw/ip_templates/rstmgr/defs.bzl.tpl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +RSTMGR = opentitan_ip( + name = "rstmgr", + hjson = "//hw/top_${topname}/ip_autogen/rstmgr:data/rstmgr.hjson", +) diff --git a/hw/ip_templates/rv_plic/defs.bzl.tpl b/hw/ip_templates/rv_plic/defs.bzl.tpl new file mode 100644 index 00000000000000..a36033cefc4838 --- /dev/null +++ b/hw/ip_templates/rv_plic/defs.bzl.tpl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +RV_PLIC = opentitan_ip( + name = "rv_plic", + hjson = "//hw/top_${topname}/ip_autogen/rv_plic:data/rv_plic.hjson", +) diff --git a/hw/top/BUILD b/hw/top/BUILD new file mode 100644 index 00000000000000..0604fb06d11ab5 --- /dev/null +++ b/hw/top/BUILD @@ -0,0 +1,108 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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/opentitan:hw.bzl", "describe_top", "select_top_ld", "select_top_lib") +load("//hw/top:defs.bzl", "ALL_IP_NAMES", "ALL_TOPS", "ALL_TOP_NAMES", "opentitan_require_ip") +load( + "//rules:autogen.bzl", + "opentitan_ip_c_header", + "opentitan_ip_rust_header", +) + +package(default_visibility = ["//visibility:public"]) + +# Use this flag to select the top. +string_flag( + name = "top", + build_setting_default = "earlgrey", + values = ALL_TOP_NAMES, +) + +# Config settings to test against tops. +[ + config_setting( + name = "is_{}".format(top), + flag_values = { + ":top": top, + }, + ) + for top in ALL_TOP_NAMES +] + +[ + describe_top( + name = "top_{}_desc".format(top), + all_tops = ALL_TOPS, + top = top, + ) + for top in ALL_TOP_NAMES +] + +# Point to the right top description. +alias( + name = "top_desc", + actual = select({ + "is_{}".format(top): ":top_{}_desc".format(top) + for top in ALL_TOP_NAMES + }), +) + +[ + select_top_lib( + name = "top_{}_lib".format(top), + all_tops = ALL_TOPS, + top = top, + ) + for top in ALL_TOP_NAMES +] + +# Point to the right top library. +alias( + name = "top_lib", + actual = select({ + "is_{}".format(top): ":top_{}_lib".format(top) + for top in ALL_TOP_NAMES + }), +) + +[ + select_top_ld( + name = "top_{}_ld".format(top), + all_tops = ALL_TOPS, + top = top, + ) + for top in ALL_TOP_NAMES +] + +# Point to the right top library. +alias( + name = "top_ld", + actual = select({ + "is_{}".format(top): ":top_{}_ld".format(top) + for top in ALL_TOP_NAMES + }), +) + +# C register headers for all IPs. +[ + opentitan_ip_c_header( + name = "{}_c_regs".format(ip), + ip = ip, + target_compatible_with = opentitan_require_ip(ip), + top = ":top_desc", + ) + for ip in ALL_IP_NAMES +] + +# Rust register headers for all IPs. +[ + opentitan_ip_rust_header( + name = "{}_rust_regs".format(ip), + ip = ip, + target_compatible_with = opentitan_require_ip(ip), + top = ":top_desc", + ) + for ip in ALL_IP_NAMES +] diff --git a/hw/top/defs.bzl b/hw/top/defs.bzl new file mode 100644 index 00000000000000..6448f3be97ab3f --- /dev/null +++ b/hw/top/defs.bzl @@ -0,0 +1,54 @@ +# Copyright lowRISC contributors (OpenTitan project). +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 +load("//rules/opentitan:hw.bzl", "opentitan_top") +load("//hw/top_earlgrey/data/autogen:defs.bzl", "EARLGREY") +load("//hw/top_darjeeling/data/autogen:defs.bzl", "DARJEELING") + +ALL_TOPS = [ + EARLGREY, + DARJEELING, +] + +ALL_TOP_NAMES = [ + top.name + for top in ALL_TOPS +] + +def _all_ip_names(): + names = {ip.name: 1 for top in ALL_TOPS for ip in top.ips} + return sorted(names.keys()) + +ALL_IP_NAMES = _all_ip_names() + +def opentitan_if_ip(ip, obj, default): + """ + Return a select expression that evaluate to `obj` if the ip is + supported by the active top, and `default` otherwose. + """ + compatible_tops = [] + for top in ALL_TOPS: + for _ip in top.ips: + if _ip.name == ip: + compatible_tops.append(top.name) + break + + return select({ + "//hw/top:is_{}".format(top): obj + for top in compatible_tops + } | { + "//conditions:default": default, + }) + +def opentitan_require_ip(ip): + """ + Return a value that can be used with `target_compatible_with` to + express that this target only works on top with the requested IP. + + Example: + cc_library( + name = "bla", + target_compatible_with = opentitan_require_ip("uart"), + ) + """ + return opentitan_if_ip(ip, [], ["@platforms//:incompatible"]) diff --git a/hw/top_darjeeling/data/autogen/BUILD b/hw/top_darjeeling/data/autogen/BUILD new file mode 100644 index 00000000000000..0d618a755d6600 --- /dev/null +++ b/hw/top_darjeeling/data/autogen/BUILD @@ -0,0 +1,10 @@ +# 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 + +exports_files(["top_darjeeling.gen.hjson"]) diff --git a/hw/top_darjeeling/data/autogen/defs.bzl b/hw/top_darjeeling/data/autogen/defs.bzl new file mode 100644 index 00000000000000..ede9b996d63d0d --- /dev/null +++ b/hw/top_darjeeling/data/autogen/defs.bzl @@ -0,0 +1,83 @@ +# 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 + +load("//rules/opentitan:hw.bzl", "opentitan_top") +load("//hw/ip/aes:defs.bzl", "AES") +load("//hw/top_darjeeling/ip_autogen/alert_handler:defs.bzl", "ALERT_HANDLER") +load("//hw/ip/aon_timer:defs.bzl", "AON_TIMER") +load("//hw/top_darjeeling/ip/ast:defs.bzl", "AST") +load("//hw/top_darjeeling/ip_autogen/clkmgr:defs.bzl", "CLKMGR") +load("//hw/ip/csrng:defs.bzl", "CSRNG") +load("//hw/ip/dma:defs.bzl", "DMA") +load("//hw/ip/edn:defs.bzl", "EDN") +load("//hw/ip/gpio:defs.bzl", "GPIO") +load("//hw/ip/hmac:defs.bzl", "HMAC") +load("//hw/ip/i2c:defs.bzl", "I2C") +load("//hw/ip/keymgr_dpe:defs.bzl", "KEYMGR_DPE") +load("//hw/ip/kmac:defs.bzl", "KMAC") +load("//hw/ip/lc_ctrl:defs.bzl", "LC_CTRL") +load("//hw/ip/mbx:defs.bzl", "MBX") +load("//hw/ip/otbn:defs.bzl", "OTBN") +load("//hw/ip/otp_ctrl:defs.bzl", "OTP_CTRL") +load("//hw/top_darjeeling/ip_autogen/pinmux:defs.bzl", "PINMUX") +load("//hw/top_darjeeling/ip_autogen/pwrmgr:defs.bzl", "PWRMGR") +load("//hw/ip/rom_ctrl:defs.bzl", "ROM_CTRL") +load("//hw/top_darjeeling/ip_autogen/rstmgr:defs.bzl", "RSTMGR") +load("//hw/ip/rv_core_ibex:defs.bzl", "RV_CORE_IBEX") +load("//hw/ip/rv_dm:defs.bzl", "RV_DM") +load("//hw/top_darjeeling/ip_autogen/rv_plic:defs.bzl", "RV_PLIC") +load("//hw/ip/rv_timer:defs.bzl", "RV_TIMER") +load("//hw/top_darjeeling/ip/sensor_ctrl:defs.bzl", "SENSOR_CTRL") +load("//hw/ip/soc_dbg_ctrl:defs.bzl", "SOC_DBG_CTRL") +load("//hw/top_darjeeling/ip/soc_proxy:defs.bzl", "SOC_PROXY") +load("//hw/ip/spi_device:defs.bzl", "SPI_DEVICE") +load("//hw/ip/spi_host:defs.bzl", "SPI_HOST") +load("//hw/ip/sram_ctrl:defs.bzl", "SRAM_CTRL") +load("//hw/ip/uart:defs.bzl", "UART") + +DARJEELING = opentitan_top( + name = "darjeeling", + hjson = "//hw/top_darjeeling/data/autogen:top_darjeeling.gen.hjson", + top_lib = "//hw/top_darjeeling/sw/autogen:top_darjeeling", + top_ld = "//hw/top_darjeeling/sw/autogen:top_darjeeling_memory", + ips = [ + AES, + ALERT_HANDLER, + AON_TIMER, + AST, + CLKMGR, + CSRNG, + DMA, + EDN, + GPIO, + HMAC, + I2C, + KEYMGR_DPE, + KMAC, + LC_CTRL, + MBX, + OTBN, + OTP_CTRL, + PINMUX, + PWRMGR, + ROM_CTRL, + RSTMGR, + RV_CORE_IBEX, + RV_DM, + RV_PLIC, + RV_TIMER, + SENSOR_CTRL, + SOC_DBG_CTRL, + SOC_PROXY, + SPI_DEVICE, + SPI_HOST, + SRAM_CTRL, + UART, + ], +) diff --git a/hw/top_darjeeling/ip/ast/data/BUILD b/hw/top_darjeeling/ip/ast/data/BUILD index d71fefb5672e5b..dda56de039e27f 100644 --- a/hw/top_darjeeling/ip/ast/data/BUILD +++ b/hw/top_darjeeling/ip/ast/data/BUILD @@ -4,26 +4,6 @@ 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(["**"]), diff --git a/hw/top_darjeeling/ip/ast/defs.bzl b/hw/top_darjeeling/ip/ast/defs.bzl new file mode 100644 index 00000000000000..1f742098ed305f --- /dev/null +++ b/hw/top_darjeeling/ip/ast/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +AST = opentitan_ip( + name = "ast", + hjson = "//hw/top_darjeeling/ip/ast/data:ast.hjson", +) diff --git a/hw/top_darjeeling/ip/sensor_ctrl/data/BUILD b/hw/top_darjeeling/ip/sensor_ctrl/data/BUILD index 8e4acec5a40275..dda56de039e27f 100644 --- a/hw/top_darjeeling/ip/sensor_ctrl/data/BUILD +++ b/hw/top_darjeeling/ip/sensor_ctrl/data/BUILD @@ -4,26 +4,6 @@ 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(["**"]), diff --git a/hw/top_darjeeling/ip/sensor_ctrl/defs.bzl b/hw/top_darjeeling/ip/sensor_ctrl/defs.bzl new file mode 100644 index 00000000000000..82bbdfa899fa96 --- /dev/null +++ b/hw/top_darjeeling/ip/sensor_ctrl/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +SENSOR_CTRL = opentitan_ip( + name = "sensor_ctrl", + hjson = "//hw/top_darjeeling/ip/sensor_ctrl/data:sensor_ctrl.hjson", +) diff --git a/hw/top_darjeeling/ip/soc_proxy/data/BUILD b/hw/top_darjeeling/ip/soc_proxy/data/BUILD index 697e89f3ca1d58..dda56de039e27f 100644 --- a/hw/top_darjeeling/ip/soc_proxy/data/BUILD +++ b/hw/top_darjeeling/ip/soc_proxy/data/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "soc_proxy_c_regs", - srcs = [ - "soc_proxy.hjson", - ], -) - -autogen_hjson_rust_header( - name = "soc_proxy_rust_regs", - srcs = [ - "soc_proxy.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/top_darjeeling/ip/soc_proxy/defs.bzl b/hw/top_darjeeling/ip/soc_proxy/defs.bzl new file mode 100644 index 00000000000000..c218486459927d --- /dev/null +++ b/hw/top_darjeeling/ip/soc_proxy/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +SOC_PROXY = opentitan_ip( + name = "soc_proxy", + hjson = "//hw/top_darjeeling/ip/soc_proxy/data:soc_proxy.hjson", +) diff --git a/hw/top_darjeeling/ip_autogen/alert_handler/defs.bzl b/hw/top_darjeeling/ip_autogen/alert_handler/defs.bzl new file mode 100644 index 00000000000000..04eb13538bb7cd --- /dev/null +++ b/hw/top_darjeeling/ip_autogen/alert_handler/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +ALERT_HANDLER = opentitan_ip( + name = "alert_handler", + hjson = "//hw/top_darjeeling/ip_autogen/alert_handler:data/alert_handler.hjson", +) diff --git a/hw/top_darjeeling/ip_autogen/clkmgr/BUILD b/hw/top_darjeeling/ip_autogen/clkmgr/BUILD index 3bed0f321eb3d9..dda56de039e27f 100644 --- a/hw/top_darjeeling/ip_autogen/clkmgr/BUILD +++ b/hw/top_darjeeling/ip_autogen/clkmgr/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "clkmgr_c_regs", - srcs = [ - "data/clkmgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "clkmgr_rust_regs", - srcs = [ - "data/clkmgr.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/top_darjeeling/ip_autogen/clkmgr/defs.bzl b/hw/top_darjeeling/ip_autogen/clkmgr/defs.bzl new file mode 100644 index 00000000000000..5989dc24c93cd8 --- /dev/null +++ b/hw/top_darjeeling/ip_autogen/clkmgr/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +CLKMGR = opentitan_ip( + name = "clkmgr", + hjson = "//hw/top_darjeeling/ip_autogen/clkmgr:data/clkmgr.hjson", +) diff --git a/hw/top_darjeeling/ip_autogen/pinmux/BUILD b/hw/top_darjeeling/ip_autogen/pinmux/BUILD index 5a99add16588c2..dda56de039e27f 100644 --- a/hw/top_darjeeling/ip_autogen/pinmux/BUILD +++ b/hw/top_darjeeling/ip_autogen/pinmux/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "pinmux_c_regs", - srcs = [ - "data/pinmux.hjson", - ], -) - -autogen_hjson_rust_header( - name = "pinmux_rust_regs", - srcs = [ - "data/pinmux.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/top_darjeeling/ip_autogen/pinmux/defs.bzl b/hw/top_darjeeling/ip_autogen/pinmux/defs.bzl new file mode 100644 index 00000000000000..d1edbbbda43c7f --- /dev/null +++ b/hw/top_darjeeling/ip_autogen/pinmux/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +PINMUX = opentitan_ip( + name = "pinmux", + hjson = "//hw/top_darjeeling/ip_autogen/pinmux:data/pinmux.hjson", +) diff --git a/hw/top_darjeeling/ip_autogen/pwrmgr/BUILD b/hw/top_darjeeling/ip_autogen/pwrmgr/BUILD index 1206ee3d1c10b3..dda56de039e27f 100644 --- a/hw/top_darjeeling/ip_autogen/pwrmgr/BUILD +++ b/hw/top_darjeeling/ip_autogen/pwrmgr/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "pwrmgr_c_regs", - srcs = [ - "data/pwrmgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "pwrmgr_rust_regs", - srcs = [ - "data/pwrmgr.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/top_darjeeling/ip_autogen/pwrmgr/defs.bzl b/hw/top_darjeeling/ip_autogen/pwrmgr/defs.bzl new file mode 100644 index 00000000000000..1e98ada8faf8cb --- /dev/null +++ b/hw/top_darjeeling/ip_autogen/pwrmgr/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +PWRMGR = opentitan_ip( + name = "pwrmgr", + hjson = "//hw/top_darjeeling/ip_autogen/pwrmgr:data/pwrmgr.hjson", +) diff --git a/hw/top_darjeeling/ip_autogen/rstmgr/BUILD b/hw/top_darjeeling/ip_autogen/rstmgr/BUILD index 417731a72f4813..dda56de039e27f 100644 --- a/hw/top_darjeeling/ip_autogen/rstmgr/BUILD +++ b/hw/top_darjeeling/ip_autogen/rstmgr/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "rstmgr_c_regs", - srcs = [ - "data/rstmgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "rstmgr_rust_regs", - srcs = [ - "data/rstmgr.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/top_darjeeling/ip_autogen/rstmgr/defs.bzl b/hw/top_darjeeling/ip_autogen/rstmgr/defs.bzl new file mode 100644 index 00000000000000..d2a841e6b66775 --- /dev/null +++ b/hw/top_darjeeling/ip_autogen/rstmgr/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +RSTMGR = opentitan_ip( + name = "rstmgr", + hjson = "//hw/top_darjeeling/ip_autogen/rstmgr:data/rstmgr.hjson", +) diff --git a/hw/top_darjeeling/ip_autogen/rv_plic/defs.bzl b/hw/top_darjeeling/ip_autogen/rv_plic/defs.bzl new file mode 100644 index 00000000000000..28c225c679829d --- /dev/null +++ b/hw/top_darjeeling/ip_autogen/rv_plic/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +RV_PLIC = opentitan_ip( + name = "rv_plic", + hjson = "//hw/top_darjeeling/ip_autogen/rv_plic:data/rv_plic.hjson", +) diff --git a/hw/top_earlgrey/BUILD b/hw/top_earlgrey/BUILD index 29e608fd386321..16d7594b7f4a97 100644 --- a/hw/top_earlgrey/BUILD +++ b/hw/top_earlgrey/BUILD @@ -2,11 +2,6 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) load( "//rules/opentitan:defs.bzl", "CLEAR_KEY_SET", @@ -22,34 +17,6 @@ load( package(default_visibility = ["//visibility:public"]) -autogen_hjson_c_header( - name = "rv_plic_c_regs", - srcs = [ - "//hw/top_earlgrey/ip_autogen/rv_plic:data/rv_plic.hjson", - ], -) - -autogen_hjson_rust_header( - name = "rv_plic_rust_regs", - srcs = [ - "//hw/top_earlgrey/ip_autogen/rv_plic:data/rv_plic.hjson", - ], -) - -autogen_hjson_c_header( - name = "alert_handler_c_regs", - srcs = [ - "//hw/top_earlgrey/ip_autogen/alert_handler:data/alert_handler.hjson", - ], -) - -autogen_hjson_rust_header( - name = "alert_handler_rust_regs", - srcs = [ - "//hw/top_earlgrey/ip_autogen/alert_handler:data/alert_handler.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]) + [ @@ -72,7 +39,7 @@ fpga_cw310( "//sw/device/lib/arch:fpga_cw310", ], linker_script = "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_a", - rom_scramble_config = "//hw/top_earlgrey/data:autogen/top_earlgrey.gen.hjson", + rom_scramble_config = "//hw/top_earlgrey/data/autogen:top_earlgrey.gen.hjson", test_cmd = "testing-not-supported", ) @@ -251,7 +218,7 @@ fpga_cw305( "//sw/device/lib/arch:fpga_cw305", ], linker_script = "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_a", - rom_scramble_config = "//hw/top_earlgrey/data:autogen/top_earlgrey.gen.hjson", + rom_scramble_config = "//hw/top_earlgrey/data/autogen:top_earlgrey.gen.hjson", test_cmd = "testing-not-supported", ) @@ -284,7 +251,7 @@ fpga_cw340( "exit_success": DEFAULT_TEST_SUCCESS_MSG, "exit_failure": DEFAULT_TEST_FAILURE_MSG, }, - rom_scramble_config = "//hw/top_earlgrey/data:autogen/top_earlgrey.gen.hjson", + rom_scramble_config = "//hw/top_earlgrey/data/autogen:top_earlgrey.gen.hjson", test_cmd = "testing-not-supported", ) @@ -417,7 +384,7 @@ silicon( "exit_success": DEFAULT_TEST_SUCCESS_MSG, "exit_failure": DEFAULT_TEST_FAILURE_MSG, }, - rom_scramble_config = "//hw/top_earlgrey/data:autogen/top_earlgrey.gen.hjson", + rom_scramble_config = "//hw/top_earlgrey/data/autogen:top_earlgrey.gen.hjson", test_cmd = """ --exec="transport init" --exec="bootstrap --clear-uart=true {firmware}" @@ -486,7 +453,7 @@ sim_verilator( ], linker_script = "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_a", otp = "//hw/ip/otp_ctrl/data:img_rma", - rom_scramble_config = "//hw/top_earlgrey/data:autogen/top_earlgrey.gen.hjson", + rom_scramble_config = "//hw/top_earlgrey/data/autogen:top_earlgrey.gen.hjson", test_cmd = "testing-not-supported", ) @@ -549,7 +516,7 @@ sim_dv( otp_data_perm = "//hw/ip/otp_ctrl/data:data_perm", otp_mmap = "//hw/ip/otp_ctrl/data:otp_ctrl_mmap.hjson", otp_seed = "//hw/ip/otp_ctrl/data:otp_seed", - rom_scramble_config = "//hw/top_earlgrey/data:autogen/top_earlgrey.gen.hjson", + rom_scramble_config = "//hw/top_earlgrey/data/autogen:top_earlgrey.gen.hjson", ) sim_dv( diff --git a/hw/top_earlgrey/data/autogen/BUILD b/hw/top_earlgrey/data/autogen/BUILD new file mode 100644 index 00000000000000..e8ea69918aa9ff --- /dev/null +++ b/hw/top_earlgrey/data/autogen/BUILD @@ -0,0 +1,10 @@ +# 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_earlgrey/data/top_earlgrey.hjson +# -o hw/top_earlgrey + +exports_files(["top_earlgrey.gen.hjson"]) diff --git a/hw/top_earlgrey/data/autogen/defs.bzl b/hw/top_earlgrey/data/autogen/defs.bzl new file mode 100644 index 00000000000000..4ffb0e9367e9ae --- /dev/null +++ b/hw/top_earlgrey/data/autogen/defs.bzl @@ -0,0 +1,89 @@ +# 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_earlgrey/data/top_earlgrey.hjson +# -o hw/top_earlgrey + +load("//rules/opentitan:hw.bzl", "opentitan_top") +load("//hw/ip/adc_ctrl:defs.bzl", "ADC_CTRL") +load("//hw/ip/aes:defs.bzl", "AES") +load("//hw/top_earlgrey/ip_autogen/alert_handler:defs.bzl", "ALERT_HANDLER") +load("//hw/ip/aon_timer:defs.bzl", "AON_TIMER") +load("//hw/top_earlgrey/ip/ast:defs.bzl", "AST") +load("//hw/top_earlgrey/ip_autogen/clkmgr:defs.bzl", "CLKMGR") +load("//hw/ip/csrng:defs.bzl", "CSRNG") +load("//hw/ip/edn:defs.bzl", "EDN") +load("//hw/ip/entropy_src:defs.bzl", "ENTROPY_SRC") +load("//hw/top_earlgrey/ip_autogen/flash_ctrl:defs.bzl", "FLASH_CTRL") +load("//hw/ip/gpio:defs.bzl", "GPIO") +load("//hw/ip/hmac:defs.bzl", "HMAC") +load("//hw/ip/i2c:defs.bzl", "I2C") +load("//hw/ip/keymgr:defs.bzl", "KEYMGR") +load("//hw/ip/kmac:defs.bzl", "KMAC") +load("//hw/ip/lc_ctrl:defs.bzl", "LC_CTRL") +load("//hw/ip/otbn:defs.bzl", "OTBN") +load("//hw/ip/otp_ctrl:defs.bzl", "OTP_CTRL") +load("//hw/ip/pattgen:defs.bzl", "PATTGEN") +load("//hw/top_earlgrey/ip_autogen/pinmux:defs.bzl", "PINMUX") +load("//hw/ip/pwm:defs.bzl", "PWM") +load("//hw/top_earlgrey/ip_autogen/pwrmgr:defs.bzl", "PWRMGR") +load("//hw/ip/rom_ctrl:defs.bzl", "ROM_CTRL") +load("//hw/top_earlgrey/ip_autogen/rstmgr:defs.bzl", "RSTMGR") +load("//hw/ip/rv_core_ibex:defs.bzl", "RV_CORE_IBEX") +load("//hw/ip/rv_dm:defs.bzl", "RV_DM") +load("//hw/top_earlgrey/ip_autogen/rv_plic:defs.bzl", "RV_PLIC") +load("//hw/ip/rv_timer:defs.bzl", "RV_TIMER") +load("//hw/top_earlgrey/ip/sensor_ctrl:defs.bzl", "SENSOR_CTRL") +load("//hw/ip/spi_device:defs.bzl", "SPI_DEVICE") +load("//hw/ip/spi_host:defs.bzl", "SPI_HOST") +load("//hw/ip/sram_ctrl:defs.bzl", "SRAM_CTRL") +load("//hw/ip/sysrst_ctrl:defs.bzl", "SYSRST_CTRL") +load("//hw/ip/uart:defs.bzl", "UART") +load("//hw/ip/usbdev:defs.bzl", "USBDEV") + +EARLGREY = opentitan_top( + name = "earlgrey", + hjson = "//hw/top_earlgrey/data/autogen:top_earlgrey.gen.hjson", + top_lib = "//hw/top_earlgrey/sw/autogen:top_earlgrey", + top_ld = "//hw/top_earlgrey/sw/autogen:top_earlgrey_memory", + ips = [ + ADC_CTRL, + AES, + ALERT_HANDLER, + AON_TIMER, + AST, + CLKMGR, + CSRNG, + EDN, + ENTROPY_SRC, + FLASH_CTRL, + GPIO, + HMAC, + I2C, + KEYMGR, + KMAC, + LC_CTRL, + OTBN, + OTP_CTRL, + PATTGEN, + PINMUX, + PWM, + PWRMGR, + ROM_CTRL, + RSTMGR, + RV_CORE_IBEX, + RV_DM, + RV_PLIC, + RV_TIMER, + SENSOR_CTRL, + SPI_DEVICE, + SPI_HOST, + SRAM_CTRL, + SYSRST_CTRL, + UART, + USBDEV, + ], +) diff --git a/hw/top_earlgrey/ip/ast/data/BUILD b/hw/top_earlgrey/ip/ast/data/BUILD index d71fefb5672e5b..dda56de039e27f 100644 --- a/hw/top_earlgrey/ip/ast/data/BUILD +++ b/hw/top_earlgrey/ip/ast/data/BUILD @@ -4,26 +4,6 @@ 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(["**"]), diff --git a/hw/top_earlgrey/ip/ast/defs.bzl b/hw/top_earlgrey/ip/ast/defs.bzl new file mode 100644 index 00000000000000..d0abf200ab2e1b --- /dev/null +++ b/hw/top_earlgrey/ip/ast/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +AST = opentitan_ip( + name = "ast", + hjson = "//hw/top_earlgrey/ip/ast/data:ast.hjson", +) diff --git a/hw/top_earlgrey/ip/sensor_ctrl/data/BUILD b/hw/top_earlgrey/ip/sensor_ctrl/data/BUILD index 8e4acec5a40275..dda56de039e27f 100644 --- a/hw/top_earlgrey/ip/sensor_ctrl/data/BUILD +++ b/hw/top_earlgrey/ip/sensor_ctrl/data/BUILD @@ -4,26 +4,6 @@ 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(["**"]), diff --git a/hw/top_earlgrey/ip/sensor_ctrl/defs.bzl b/hw/top_earlgrey/ip/sensor_ctrl/defs.bzl new file mode 100644 index 00000000000000..251e67cd683855 --- /dev/null +++ b/hw/top_earlgrey/ip/sensor_ctrl/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +SENSOR_CTRL = opentitan_ip( + name = "sensor_ctrl", + hjson = "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl.hjson", +) diff --git a/hw/top_earlgrey/ip_autogen/alert_handler/defs.bzl b/hw/top_earlgrey/ip_autogen/alert_handler/defs.bzl new file mode 100644 index 00000000000000..b8a990e699586d --- /dev/null +++ b/hw/top_earlgrey/ip_autogen/alert_handler/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +ALERT_HANDLER = opentitan_ip( + name = "alert_handler", + hjson = "//hw/top_earlgrey/ip_autogen/alert_handler:data/alert_handler.hjson", +) diff --git a/hw/top_earlgrey/ip_autogen/clkmgr/BUILD b/hw/top_earlgrey/ip_autogen/clkmgr/BUILD index 3bed0f321eb3d9..dda56de039e27f 100644 --- a/hw/top_earlgrey/ip_autogen/clkmgr/BUILD +++ b/hw/top_earlgrey/ip_autogen/clkmgr/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "clkmgr_c_regs", - srcs = [ - "data/clkmgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "clkmgr_rust_regs", - srcs = [ - "data/clkmgr.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/top_earlgrey/ip_autogen/clkmgr/defs.bzl b/hw/top_earlgrey/ip_autogen/clkmgr/defs.bzl new file mode 100644 index 00000000000000..24fcb3e9f52c2c --- /dev/null +++ b/hw/top_earlgrey/ip_autogen/clkmgr/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +CLKMGR = opentitan_ip( + name = "clkmgr", + hjson = "//hw/top_earlgrey/ip_autogen/clkmgr:data/clkmgr.hjson", +) diff --git a/hw/top_earlgrey/ip_autogen/flash_ctrl/BUILD b/hw/top_earlgrey/ip_autogen/flash_ctrl/BUILD index 48b6309efafeda..dda56de039e27f 100644 --- a/hw/top_earlgrey/ip_autogen/flash_ctrl/BUILD +++ b/hw/top_earlgrey/ip_autogen/flash_ctrl/BUILD @@ -4,28 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "flash_ctrl_c_regs", - srcs = [ - "data/flash_ctrl.hjson", - ], - node = "core", -) - -autogen_hjson_rust_header( - name = "flash_ctrl_rust_regs", - srcs = [ - "data/flash_ctrl.hjson", - ], - node = "core", -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/top_earlgrey/ip_autogen/flash_ctrl/defs.bzl b/hw/top_earlgrey/ip_autogen/flash_ctrl/defs.bzl new file mode 100644 index 00000000000000..9bbcb9a1399d71 --- /dev/null +++ b/hw/top_earlgrey/ip_autogen/flash_ctrl/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +FLASH_CTRL = opentitan_ip( + name = "flash_ctrl", + hjson = "//hw/top_earlgrey/ip_autogen/flash_ctrl:data/flash_ctrl.hjson", +) diff --git a/hw/top_earlgrey/ip_autogen/pinmux/BUILD b/hw/top_earlgrey/ip_autogen/pinmux/BUILD index 5a99add16588c2..dda56de039e27f 100644 --- a/hw/top_earlgrey/ip_autogen/pinmux/BUILD +++ b/hw/top_earlgrey/ip_autogen/pinmux/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "pinmux_c_regs", - srcs = [ - "data/pinmux.hjson", - ], -) - -autogen_hjson_rust_header( - name = "pinmux_rust_regs", - srcs = [ - "data/pinmux.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/top_earlgrey/ip_autogen/pinmux/defs.bzl b/hw/top_earlgrey/ip_autogen/pinmux/defs.bzl new file mode 100644 index 00000000000000..e3cc44171d2a61 --- /dev/null +++ b/hw/top_earlgrey/ip_autogen/pinmux/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +PINMUX = opentitan_ip( + name = "pinmux", + hjson = "//hw/top_earlgrey/ip_autogen/pinmux:data/pinmux.hjson", +) diff --git a/hw/top_earlgrey/ip_autogen/pwrmgr/BUILD b/hw/top_earlgrey/ip_autogen/pwrmgr/BUILD index 1206ee3d1c10b3..dda56de039e27f 100644 --- a/hw/top_earlgrey/ip_autogen/pwrmgr/BUILD +++ b/hw/top_earlgrey/ip_autogen/pwrmgr/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "pwrmgr_c_regs", - srcs = [ - "data/pwrmgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "pwrmgr_rust_regs", - srcs = [ - "data/pwrmgr.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/top_earlgrey/ip_autogen/pwrmgr/defs.bzl b/hw/top_earlgrey/ip_autogen/pwrmgr/defs.bzl new file mode 100644 index 00000000000000..e1f88ac2b12a56 --- /dev/null +++ b/hw/top_earlgrey/ip_autogen/pwrmgr/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +PWRMGR = opentitan_ip( + name = "pwrmgr", + hjson = "//hw/top_earlgrey/ip_autogen/pwrmgr:data/pwrmgr.hjson", +) diff --git a/hw/top_earlgrey/ip_autogen/rstmgr/BUILD b/hw/top_earlgrey/ip_autogen/rstmgr/BUILD index 417731a72f4813..dda56de039e27f 100644 --- a/hw/top_earlgrey/ip_autogen/rstmgr/BUILD +++ b/hw/top_earlgrey/ip_autogen/rstmgr/BUILD @@ -4,26 +4,6 @@ package(default_visibility = ["//visibility:public"]) -load( - "//rules:autogen.bzl", - "autogen_hjson_c_header", - "autogen_hjson_rust_header", -) - -autogen_hjson_c_header( - name = "rstmgr_c_regs", - srcs = [ - "data/rstmgr.hjson", - ], -) - -autogen_hjson_rust_header( - name = "rstmgr_rust_regs", - srcs = [ - "data/rstmgr.hjson", - ], -) - filegroup( name = "all_files", srcs = glob(["**"]), diff --git a/hw/top_earlgrey/ip_autogen/rstmgr/defs.bzl b/hw/top_earlgrey/ip_autogen/rstmgr/defs.bzl new file mode 100644 index 00000000000000..ba2f5d3fa4f7bd --- /dev/null +++ b/hw/top_earlgrey/ip_autogen/rstmgr/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +RSTMGR = opentitan_ip( + name = "rstmgr", + hjson = "//hw/top_earlgrey/ip_autogen/rstmgr:data/rstmgr.hjson", +) diff --git a/hw/top_earlgrey/ip_autogen/rv_plic/defs.bzl b/hw/top_earlgrey/ip_autogen/rv_plic/defs.bzl new file mode 100644 index 00000000000000..9decefda6cdfc7 --- /dev/null +++ b/hw/top_earlgrey/ip_autogen/rv_plic/defs.bzl @@ -0,0 +1,9 @@ +# Copyright lowRISC contributors (OpenTitan project). +# 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") + +RV_PLIC = opentitan_ip( + name = "rv_plic", + hjson = "//hw/top_earlgrey/ip_autogen/rv_plic:data/rv_plic.hjson", +) diff --git a/rules/autogen.bzl b/rules/autogen.bzl index 9b46c795e8860b..2f020e9f118c1f 100644 --- a/rules/autogen.bzl +++ b/rules/autogen.bzl @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 load("//rules:stamp.bzl", "stamp_attr", "stamping_enabled") +load("//rules/opentitan:hw.bzl", "OpenTitanTopInfo") """Autogeneration rules for OpenTitan. @@ -11,35 +12,33 @@ used by the OpenTitan build, such as register definition files generated from hjson register descriptions. """ -def _hjson_c_header(ctx): - output_stem = (ctx.attr.output_stem if ctx.attr.output_stem else ctx.label.name.replace("_c_", "_")) - header = ctx.actions.declare_file("{}.h".format(output_stem)) - node = [] - if ctx.attr.node: - node.append("--node={}".format(ctx.attr.node)) +def _opentitan_ip_c_header_impl(ctx): + header = ctx.actions.declare_file("{}_regs.h".format(ctx.attr.ip)) + top = ctx.attr.top[OpenTitanTopInfo] + if ctx.attr.ip not in top.ip_hjson: + fail("Cannot generate headers: top {} does not contain IP {}".format(top.name, ctx.attr.ip)) + hjson = top.ip_hjson[ctx.attr.ip] arguments = [ "-D", "-q", "-o", header.path, - ] + node + [src.path for src in ctx.files.srcs] - - # `inputs = ctx.files.srcs` will create `inputs` as an immutable list - # so need to unpack like this before appending the alias later - inputs = list(ctx.files.srcs) + hjson.path, + ] + inputs = [hjson] - # add path to an alias path if it's needed - if ctx.attr.alias: + # Add path to an alias path if it's needed. + if ctx.file.alias: alias = ctx.file.alias - # add the alias argument + # add the alias argument. arguments.extend([ "--alias", alias.path, ]) - # add the alias as an input file + # add the alias as an input file. inputs.append(alias) ctx.actions.run( @@ -60,25 +59,17 @@ def _hjson_c_header(ctx): ), ] -autogen_hjson_c_header = rule( - implementation = _hjson_c_header, +opentitan_ip_c_header = rule( + implementation = _opentitan_ip_c_header_impl, + doc = "Generate the C headers for an IP block as used in a top", attrs = { - "srcs": attr.label_list(allow_files = True), - "node": attr.string( - doc = "Register block node to generate", - ), + "top": attr.label(providers = [OpenTitanTopInfo], doc = "Opentitan top description"), + "ip": attr.string(doc = "Name of the IP block"), "alias": attr.label( mandatory = False, allow_single_file = True, doc = "A path to an alias file", ), - "output_stem": attr.string( - doc = """ - The name of the output file with no suffix. - This is optional, and if not given it will be set to the - target name replacing "_c_" by "_". - """, - ), "_regtool": attr.label( default = "//util:regtool", executable = True, @@ -87,27 +78,28 @@ autogen_hjson_c_header = rule( }, ) -def _hjson_rust_header(ctx): - node = [] - if ctx.attr.node: - node.append("--node={}".format(ctx.attr.node)) +def _opentitan_ip_rust_header_impl(ctx): + tock = ctx.actions.declare_file("{}.rs".format(ctx.attr.ip)) + top = ctx.attr.top[OpenTitanTopInfo] + if ctx.attr.ip not in top.ip_hjson: + fail("Cannot generate headers: top {} does not contain IP {}".format(top.name, ctx.attr.ip)) + hjson = top.ip_hjson[ctx.attr.ip] + stamp_args = [] stamp_files = [] if stamping_enabled(ctx): stamp_files = [ctx.version_file] stamp_args.append("--version-stamp={}".format(ctx.version_file.path)) - output_stem = (ctx.attr.output_stem if ctx.attr.output_stem else ctx.label.name.replace("_rust_", "_")) - tock = ctx.actions.declare_file("{}.rs".format(output_stem)) ctx.actions.run( outputs = [tock], - inputs = ctx.files.srcs + [ctx.executable._regtool] + stamp_files, + inputs = [hjson] + stamp_files, arguments = [ "--tock", "-q", "-o", tock.path, - ] + stamp_args + node + [src.path for src in ctx.files.srcs], + ] + stamp_args + [hjson.path], executable = ctx.executable._regtool, ) @@ -118,20 +110,12 @@ def _hjson_rust_header(ctx): ), ] -autogen_hjson_rust_header = rule( - implementation = _hjson_rust_header, +opentitan_ip_rust_header = rule( + implementation = _opentitan_ip_rust_header_impl, + doc = "Generate the Rust headers for an IP block as used in a top", attrs = { - "srcs": attr.label_list(allow_files = True), - "node": attr.string( - doc = "Register block node to generate", - ), - "output_stem": attr.string( - doc = """ - The name of the output file with no suffix. - This is optional, and if not given it will be set to the - target name replacing "_rust_" by "_". - """, - ), + "top": attr.label(providers = [OpenTitanTopInfo], doc = "Opentitan top description"), + "ip": attr.string(doc = "Name of the IP block"), "_regtool": attr.label( default = "//util:regtool", executable = True, diff --git a/rules/host.bzl b/rules/host.bzl index 434713d9bcd7e6..fb940edf176d48 100644 --- a/rules/host.bzl +++ b/rules/host.bzl @@ -23,6 +23,9 @@ def _host_tools_transition_impl(settings, attr): "//hw/bitstream/universal:rom": "//hw/bitstream/universal:none", "//hw/bitstream/universal:otp": "//hw/bitstream/universal:none", "//hw/bitstream/universal:env": "//hw/bitstream/universal:none", + # WARNING This is a horrible hack: when we transition to host, we pretend + # that this is earlgrey so opentitantool can compile... + "//hw/top": "earlgrey", } return ret @@ -39,5 +42,6 @@ host_tools_transition = transition( "//hw/bitstream/universal:rom", "//hw/bitstream/universal:otp", "//hw/bitstream/universal:env", + "//hw/top", ], ) diff --git a/rules/opentitan/hw.bzl b/rules/opentitan/hw.bzl new file mode 100644 index 00000000000000..8d76b5fccc975c --- /dev/null +++ b/rules/opentitan/hw.bzl @@ -0,0 +1,134 @@ +# Copyright lowRISC contributors (OpenTitan project). +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +"""Rules to describe OpenTitan HW""" + +def opentitan_ip(name, hjson): + """ + Return a structure describing an IP. This can be given to opentitan_top. + + Arguments: + - name: name of ip in lower case. + - hjson: label of the IP's hjson path, you MUST NOT use a relative label. + - alias: label of an alias file. + """ + return struct( + name = name, + hjson = hjson, + ) + +def opentitan_top(name, hjson, top_lib, top_ld, ips): + """ + Return a structure describing a top. + + Arguments: + - name: name of top in lower case. + - hjson: label of the top's hjson path (generated by topgen), you MUST NOT + use a relative label. + - top_lib: same but for the top's library. + - top_ld: same but for the top's linker script. + - ips: array of ips, the entries must be built by opentitan_ip(). + """ + return struct( + name = name, + hjson = hjson, + top_lib = top_lib, + top_ld = top_ld, + ips = ips, + ) + +OpenTitanTopInfo = provider( + doc = "Information about an OpenTitan top", + fields = { + "name": "Name of this top (string)", + "hjson": "topgen-generated HJSON file for this top (file)", + "ip_hjson": "dictionary of IPs HSJON files (dict: string => file)", + }, +) + +def _describe_top(ctx): + ip_hjson = {} + + # We cannot use ctx.files because it is only a list and not a dict. + for (ipname, hjson) in ctx.attr.ip_hjson.items(): + if len(hjson[DefaultInfo].files.to_list()) != 1: + fail("IP {} in top {} must provide exactly one Hjson file".format(ipname, ctx.attr.topname)) + + # Extract the file from the Target. + ip_hjson[ipname] = hjson[DefaultInfo].files.to_list()[0] + + return [ + OpenTitanTopInfo( + name = ctx.attr.topname, + hjson = ctx.file.hjson, + ip_hjson = ip_hjson, + ), + ] + +describe_top_rule = rule( + implementation = _describe_top, + doc = """Create a target that provides the description of a top in the form of an OpenTitanTopInfo provider.""", + attrs = { + "hjson": attr.label(mandatory = True, allow_single_file = True, doc = "toplevel hjson file generated by topgen"), + "ip_hjson": attr.string_keyed_label_dict(allow_files = True, doc = "mapping from hjson files to IP name"), + "topname": attr.string(mandatory = True, doc = "Name of the top"), + }, +) + +def describe_top(name, all_tops, top): + """ + Create a target that provides an OpenTitanTopInfo corresponding to the + requested top. + + - all_tops: list of tops (created by opentitan_top). + - top: name of the top to use. + """ + + # Although we already pass the top description to the rule, those are just strings. + # We also need to let bazel know that we depend on the hjson files which is why + # we also pass them in a structured way. + all_hjson = {} + top_hjson = None + for _top in all_tops: + if _top.name != top: + continue + top_hjson = _top.hjson + for ip in _top.ips: + all_hjson[ip.name] = ip.hjson + + if top_hjson == None: + fail("top {} not found in the provided list of tops".format(top)) + + describe_top_rule( + name = name, + hjson = top_hjson, + ip_hjson = all_hjson, + topname = top, + ) + +def select_top_lib(name, all_tops, top): + """ + Create an alias to the top library. + """ + libs = [_top.top_lib for _top in all_tops if _top.name == top] + if len(libs) == 0: + fail("not top found with name {}".format(top)) + + native.alias( + name = name, + actual = libs[0], + ) + +def select_top_ld(name, all_tops, top): + """ + Create an alias to the top library. + """ + libs = [_top.top_ld for _top in all_tops if _top.name == top] + if len(libs) == 0: + fail("not top found with name {}".format(top)) + + native.alias( + name = name, + actual = libs[0], + ) diff --git a/sw/device/lib/arch/BUILD b/sw/device/lib/arch/BUILD index cb77ea55d7a3e8..5d41cd20882523 100644 --- a/sw/device/lib/arch/BUILD +++ b/sw/device/lib/arch/BUILD @@ -40,7 +40,7 @@ cc_library( srcs = ["device_fpga_cw305.c"], deps = [ ":device", - "//hw/ip/uart/data:uart_c_regs", + "//hw/top:uart_c_regs", "//sw/device/lib/base:macros", "//sw/device/silicon_creator/lib/drivers:ibex", "//sw/device/silicon_creator/lib/drivers:uart", @@ -52,7 +52,7 @@ cc_library( srcs = ["device_fpga_cw310.c"], deps = [ ":device", - "//hw/ip/uart/data:uart_c_regs", + "//hw/top:uart_c_regs", "//sw/device/lib/base:macros", "//sw/device/silicon_creator/lib/drivers:ibex", "//sw/device/silicon_creator/lib/drivers:uart", @@ -64,7 +64,7 @@ cc_library( srcs = ["device_fpga_cw340.c"], deps = [ ":device", - "//hw/ip/uart/data:uart_c_regs", + "//hw/top:uart_c_regs", "//sw/device/lib/base:macros", "//sw/device/silicon_creator/lib/drivers:ibex", "//sw/device/silicon_creator/lib/drivers:uart", @@ -76,8 +76,8 @@ cc_library( srcs = ["device_silicon.c"], deps = [ ":device", - "//hw/ip/rv_core_ibex/data:rv_core_ibex_c_regs", - "//hw/ip/uart/data:uart_c_regs", + "//hw/top:rv_core_ibex_c_regs", + "//hw/top:uart_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", ], ) @@ -87,8 +87,8 @@ cc_library( srcs = ["device_sim_dv.c"], deps = [ ":device", - "//hw/ip/rv_core_ibex/data:rv_core_ibex_c_regs", - "//hw/ip/uart/data:uart_c_regs", + "//hw/top:rv_core_ibex_c_regs", + "//hw/top:uart_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", ], ) @@ -98,8 +98,8 @@ cc_library( srcs = ["device_sim_verilator.c"], deps = [ ":device", - "//hw/ip/rv_core_ibex/data:rv_core_ibex_c_regs", - "//hw/ip/uart/data:uart_c_regs", + "//hw/top:rv_core_ibex_c_regs", + "//hw/top:uart_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", ], ) diff --git a/sw/device/lib/crypto/drivers/BUILD b/sw/device/lib/crypto/drivers/BUILD index 0fe8705302d425..d8a07459457d11 100644 --- a/sw/device/lib/crypto/drivers/BUILD +++ b/sw/device/lib/crypto/drivers/BUILD @@ -24,7 +24,7 @@ cc_library( hdrs = ["aes.h"], deps = [ ":entropy", - "//hw/ip/aes/data:aes_c_regs", + "//hw/top:aes_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", @@ -59,7 +59,7 @@ cc_library( ], deps = [ ":entropy", - "//hw/ip/keymgr/data:keymgr_c_regs", + "//hw/top:keymgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", @@ -103,7 +103,7 @@ cc_library( ], deps = [ ":entropy", - "//hw/ip/kmac/data:kmac_c_regs", + "//hw/top:kmac_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", @@ -118,9 +118,9 @@ cc_library( srcs = ["entropy.c"], hdrs = ["entropy.h"], deps = [ - "//hw/ip/csrng/data:csrng_c_regs", - "//hw/ip/edn/data:edn_c_regs", - "//hw/ip/entropy_src/data:entropy_src_c_regs", + "//hw/top:csrng_c_regs", + "//hw/top:edn_c_regs", + "//hw/top:entropy_src_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", @@ -138,7 +138,7 @@ cc_library( hdrs = ["entropy_kat.h"], deps = [ ":entropy", - "//hw/ip/csrng/data:csrng_c_regs", + "//hw/top:csrng_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", @@ -175,7 +175,7 @@ cc_library( srcs = ["hmac.c"], hdrs = ["hmac.h"], deps = [ - "//hw/ip/hmac/data:hmac_c_regs", + "//hw/top:hmac_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", @@ -192,7 +192,7 @@ cc_library( hdrs = ["otbn.h"], deps = [ ":entropy", - "//hw/ip/otbn/data:otbn_c_regs", + "//hw/top:otbn_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", diff --git a/sw/device/lib/dif/BUILD b/sw/device/lib/dif/BUILD index a5dd7ee9b5c12a..7ecfebc3728afb 100644 --- a/sw/device/lib/dif/BUILD +++ b/sw/device/lib/dif/BUILD @@ -37,7 +37,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/adc_ctrl/data:adc_ctrl_c_regs", + "//hw/top:adc_ctrl_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -72,7 +72,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/aes/data:aes_c_regs", + "//hw/top:aes_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -106,7 +106,7 @@ cc_library( ], deps = [ ":base", - "//hw/top_earlgrey:alert_handler_c_regs", + "//hw/top:alert_handler_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -140,7 +140,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/aon_timer/data:aon_timer_c_regs", + "//hw/top:aon_timer_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -172,7 +172,7 @@ cc_library( hdrs = ["dif_clkmgr.h"], deps = [ ":base", - "//hw/top_earlgrey/ip_autogen/clkmgr:clkmgr_c_regs", + "//hw/top:clkmgr_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -206,8 +206,8 @@ cc_library( ], deps = [ ":base", - "//hw/ip/csrng/data:csrng_c_regs", - "//hw/ip/edn/data:edn_c_regs", + "//hw/top:csrng_c_regs", + "//hw/top:edn_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -229,7 +229,7 @@ cc_library( deps = [ ":base", ":csrng_shared", - "//hw/ip/csrng/data:csrng_c_regs", + "//hw/top:csrng_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -263,7 +263,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/dma/data:dma_c_regs", + "//hw/top:dma_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -298,7 +298,7 @@ cc_library( deps = [ ":base", ":csrng_shared", - "//hw/ip/edn/data:edn_c_regs", + "//hw/top:edn_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -332,7 +332,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/entropy_src/data:entropy_src_c_regs", + "//hw/top:entropy_src_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -364,7 +364,7 @@ cc_library( ], deps = [ ":base", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -398,7 +398,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/gpio/data:gpio_c_regs", + "//hw/top:gpio_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -432,7 +432,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/hmac/data:hmac_c_regs", + "//hw/top:hmac_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -466,7 +466,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/i2c/data:i2c_c_regs", + "//hw/top:i2c_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -500,7 +500,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/keymgr/data:keymgr_c_regs", + "//hw/top:keymgr_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -534,7 +534,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/keymgr_dpe/data:keymgr_dpe_c_regs", + "//hw/top:keymgr_dpe_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -567,7 +567,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/kmac/data:kmac_c_regs", + "//hw/top:kmac_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -601,7 +601,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/lc_ctrl/data:lc_ctrl_c_regs", + "//hw/top:lc_ctrl_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -635,7 +635,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/mbx/data:mbx_c_regs", + "//hw/top:mbx_c_regs", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", @@ -670,7 +670,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/otbn/data:otbn_c_regs", + "//hw/top:otbn_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -704,7 +704,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -738,7 +738,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/pattgen/data:pattgen_c_regs", + "//hw/top:pattgen_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -772,7 +772,7 @@ cc_library( ], deps = [ ":base", - "//hw/top_earlgrey/ip_autogen/pinmux:pinmux_c_regs", + "//hw/top:pinmux_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -807,7 +807,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/pwm/data:pwm_c_regs", + "//hw/top:pwm_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -840,7 +840,7 @@ cc_library( ], deps = [ ":base", - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_c_regs", + "//hw/top:pwrmgr_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -874,7 +874,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/rom_ctrl/data:rom_ctrl_c_regs", + "//hw/top:rom_ctrl_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -911,7 +911,7 @@ cc_library( deps = [ ":base", ":rstmgr_intf", - "//hw/top_earlgrey/ip_autogen/rstmgr:rstmgr_c_regs", + "//hw/top:rstmgr_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -945,7 +945,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/rv_core_ibex/data:rv_core_ibex_c_regs", + "//hw/top:rv_core_ibex_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/runtime:hart", @@ -977,7 +977,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/rv_dm/data:rv_dm_c_regs", + "//hw/top:rv_dm_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/base:multibits", @@ -1009,7 +1009,7 @@ cc_library( ], deps = [ ":base", - "//hw/top_earlgrey:rv_plic_c_regs", + "//hw/top:rv_plic_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -1043,7 +1043,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/rv_timer/data:rv_timer_c_regs", + "//hw/top:rv_timer_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:math", @@ -1078,7 +1078,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/spi_device/data:spi_device_c_regs", + "//hw/top:spi_device_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -1112,7 +1112,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/spi_host/data:spi_host_c_regs", + "//hw/top:spi_host_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -1147,7 +1147,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/sram_ctrl/data:sram_ctrl_c_regs", + "//hw/top:sram_ctrl_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -1181,7 +1181,7 @@ cc_library( ], deps = [ ":base", - "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_c_regs", + "//hw/top:sensor_ctrl_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:mmio", @@ -1213,7 +1213,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/sysrst_ctrl/data:sysrst_ctrl_c_regs", + "//hw/top:sysrst_ctrl_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -1245,7 +1245,7 @@ cc_library( hdrs = ["dif_uart.h"], deps = [ ":base", - "//hw/ip/uart/data:uart_c_regs", + "//hw/top:uart_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:math", @@ -1280,7 +1280,7 @@ cc_library( ], deps = [ ":base", - "//hw/ip/usbdev/data:usbdev_c_regs", + "//hw/top:usbdev_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", diff --git a/sw/device/lib/testing/BUILD b/sw/device/lib/testing/BUILD index 2952dc07a2f97b..2afc7c76deadbb 100644 --- a/sw/device/lib/testing/BUILD +++ b/sw/device/lib/testing/BUILD @@ -135,7 +135,7 @@ cc_library( hdrs = ["entropy_testutils.h"], target_compatible_with = [OPENTITAN_CPU], deps = [ - "//hw/ip/edn/data:edn_c_regs", + "//hw/top:edn_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/dif:csrng", @@ -152,7 +152,7 @@ cc_library( hdrs = ["flash_ctrl_testutils.h"], target_compatible_with = [OPENTITAN_CPU], deps = [ - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:mmio", @@ -169,7 +169,7 @@ cc_library( target_compatible_with = [OPENTITAN_CPU], deps = [ ":flash_ctrl_testutils", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/dif:flash_ctrl", "//sw/device/lib/testing/test_framework:check", @@ -200,7 +200,7 @@ cc_library( hdrs = ["hmac_testutils.h"], target_compatible_with = [OPENTITAN_CPU], deps = [ - "//hw/ip/hmac/data:hmac_c_regs", + "//hw/top:hmac_c_regs", "//sw/device/lib/base:mmio", "//sw/device/lib/dif:hmac", "//sw/device/lib/runtime:ibex", @@ -214,7 +214,7 @@ cc_library( hdrs = ["i2c_testutils.h"], target_compatible_with = [OPENTITAN_CPU], deps = [ - "//hw/ip/i2c/data:i2c_c_regs", + "//hw/top:i2c_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/dif:i2c", "//sw/device/lib/dif:pinmux", @@ -235,7 +235,7 @@ cc_library( ":kmac_testutils", ":otp_ctrl_testutils", ":rstmgr_testutils", - "//hw/ip/keymgr/data:keymgr_c_regs", + "//hw/top:keymgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:boot_stage", "//sw/device/lib/base:mmio", @@ -524,7 +524,7 @@ cc_library( hdrs = ["uart_testutils.h"], target_compatible_with = [OPENTITAN_CPU], deps = [ - "//hw/ip/uart/data:uart_c_regs", + "//hw/top:uart_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/dif:pinmux", "//sw/device/lib/dif:uart", diff --git a/sw/device/lib/testing/test_rom/BUILD b/sw/device/lib/testing/test_rom/BUILD index ba40faa5f3487b..59c95cdb7cab0e 100644 --- a/sw/device/lib/testing/test_rom/BUILD +++ b/sw/device/lib/testing/test_rom/BUILD @@ -92,10 +92,10 @@ cc_library( # This should be built only for english breakfast and skipped if using wildcards. tags = ["manual"], deps = [ - "//hw/ip/gpio/data:gpio_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/ip/spi_device/data:spi_device_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:gpio_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:spi_device_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:multibits", @@ -136,9 +136,9 @@ cc_library( # This should be built only for english breakfast and skipped if using wildcards. tags = ["manual"], deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/ip/spi_device/data:spi_device_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:spi_device_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:macros", @@ -172,15 +172,15 @@ cc_library( deps = [ ":target_test_rom_lib", ":test_rom_manifest", - "//hw/ip/csrng/data:csrng_c_regs", - "//hw/ip/edn/data:edn_c_regs", - "//hw/ip/entropy_src/data:entropy_src_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/ip/sram_ctrl/data:sram_ctrl_c_regs", - "//hw/top_earlgrey/ip/ast/data:ast_c_regs", - "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/clkmgr:clkmgr_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:ast_c_regs", + "//hw/top:clkmgr_c_regs", + "//hw/top:csrng_c_regs", + "//hw/top:edn_c_regs", + "//hw/top:entropy_src_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:sensor_ctrl_c_regs", + "//hw/top:sram_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:abs_mmio", diff --git a/sw/device/silicon_creator/imm_rom_ext/BUILD b/sw/device/silicon_creator/imm_rom_ext/BUILD index faa572d3b35fa0..541795bef9c112 100644 --- a/sw/device/silicon_creator/imm_rom_ext/BUILD +++ b/sw/device/silicon_creator/imm_rom_ext/BUILD @@ -14,7 +14,7 @@ cc_library( srcs = ["imm_rom_ext.c"], hdrs = ["imm_rom_ext.h"], deps = [ - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//sw/device/lib/arch:device", "//sw/device/lib/base:macros", "//sw/device/silicon_creator/lib:dbg_print", diff --git a/sw/device/silicon_creator/lib/BUILD b/sw/device/silicon_creator/lib/BUILD index 6c10565c0a7335..31126c09fb9d57 100644 --- a/sw/device/silicon_creator/lib/BUILD +++ b/sw/device/silicon_creator/lib/BUILD @@ -31,8 +31,8 @@ dual_cc_library( ), deps = dual_inputs( device = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:hardened", "//sw/device/lib/base:memory", @@ -198,10 +198,10 @@ cc_library( srcs = ["irq_asm.S"], target_compatible_with = [OPENTITAN_CPU], deps = [ - "//hw/ip/aon_timer/data:aon_timer_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_c_regs", - "//hw/top_earlgrey/ip_autogen/rstmgr:rstmgr_c_regs", + "//hw/top:aon_timer_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:pwrmgr_c_regs", + "//hw/top:rstmgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:multibits", ], @@ -358,15 +358,15 @@ dual_cc_library( "//sw/device/lib/base:hardened", "//sw/device/lib/base:macros", "//sw/device/silicon_creator/lib/drivers:lifecycle", - "//hw/ip/keymgr/data:keymgr_c_regs", - "//hw/ip/lc_ctrl/data:lc_ctrl_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/ip/rv_core_ibex/data:rv_core_ibex_c_regs", - "//hw/ip/sram_ctrl/data:sram_ctrl_c_regs", - "//hw/ip/uart/data:uart_c_regs", - "//hw/top_earlgrey:alert_handler_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/rstmgr:rstmgr_c_regs", + "//hw/top:keymgr_c_regs", + "//hw/top:lc_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:rv_core_ibex_c_regs", + "//hw/top:sram_ctrl_c_regs", + "//hw/top:uart_c_regs", + "//hw/top:alert_handler_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:rstmgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/silicon_creator/lib/drivers:retention_sram", "//sw/device/lib/arch:device", @@ -420,7 +420,7 @@ cc_library( srcs = ["bootstrap_fuzzer_util.cc"], hdrs = ["bootstrap_fuzzer_util.h"], deps = [ - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:hardened", "//sw/device/silicon_creator/lib:bootstrap_unittest_util", @@ -438,9 +438,9 @@ cc_library( hdrs = ["bootstrap_unittest_util.h"], deps = [ ":bootstrap", - "//hw/ip/gpio/data:gpio_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:gpio_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/silicon_creator/lib/base:chip", ], diff --git a/sw/device/silicon_creator/lib/cert/BUILD b/sw/device/silicon_creator/lib/cert/BUILD index 73ce5b78ef46fc..d6ba8a5bec3477 100644 --- a/sw/device/silicon_creator/lib/cert/BUILD +++ b/sw/device/silicon_creator/lib/cert/BUILD @@ -89,7 +89,7 @@ cc_library( hdrs = ["cert.h"], deps = [ ":asn1", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//sw/device/lib/base:hardened", "//sw/device/silicon_creator/lib:error", "//sw/device/silicon_creator/lib/drivers:flash_ctrl", @@ -104,7 +104,7 @@ cc_test( srcs = ["cert_unittest.cc"], deps = [ ":cert", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//sw/device/lib/base:hardened", "//sw/device/silicon_creator/lib:error", "//sw/device/silicon_creator/testing:rom_test", @@ -166,7 +166,7 @@ cc_library( ":cbor", ":cert", ":cwt_template", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:status", "//sw/device/silicon_creator/lib:attestation", "//sw/device/silicon_creator/lib:otbn_boot_services", @@ -207,7 +207,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", diff --git a/sw/device/silicon_creator/lib/drivers/BUILD b/sw/device/silicon_creator/lib/drivers/BUILD index a55827a9d21d9e..829313d55fc0a7 100644 --- a/sw/device/silicon_creator/lib/drivers/BUILD +++ b/sw/device/silicon_creator/lib/drivers/BUILD @@ -48,8 +48,8 @@ dual_cc_library( ), deps = dual_inputs( device = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey:alert_handler_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:alert_handler_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", ], host = [ @@ -74,7 +74,7 @@ cc_test( srcs = ["alert_unittest.cc"], deps = [ dual_cc_device_library_of(":alert"), - "//hw/top_earlgrey:alert_handler_c_regs", + "//hw/top:alert_handler_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:crc32", "@googletest//:gtest_main", @@ -91,10 +91,10 @@ opentitan_test( deps = [ ":alert", ":rstmgr", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey:alert_handler_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/rstmgr:rstmgr_c_regs", + "//hw/top:alert_handler_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:rstmgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/testing:rstmgr_testutils", @@ -110,9 +110,9 @@ cc_library( ":flash_ctrl", ":lifecycle", ":otp", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip/ast/data:ast_c_regs", - "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_c_regs", + "//hw/top:ast_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:sensor_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:abs_mmio", @@ -148,7 +148,7 @@ dual_cc_library( ), deps = dual_inputs( device = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", ], host = [ "//sw/device/lib/base:global_mock", @@ -156,7 +156,7 @@ dual_cc_library( "@googletest//:gtest", ], shared = [ - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", @@ -192,7 +192,7 @@ dual_cc_library( ), deps = dual_inputs( device = [ - "//hw/ip/hmac/data:hmac_c_regs", + "//hw/top:hmac_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", ], host = [ @@ -215,7 +215,7 @@ cc_test( srcs = ["hmac_unittest.cc"], deps = [ dual_cc_device_library_of(":hmac"), - "//hw/ip/hmac/data:hmac_c_regs", + "//hw/top:hmac_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/silicon_creator/lib:error", @@ -251,7 +251,7 @@ dual_cc_library( ), deps = dual_inputs( shared = [ - "//hw/ip/rv_core_ibex/data:rv_core_ibex_c_regs", + "//hw/top:rv_core_ibex_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:abs_mmio", @@ -279,7 +279,7 @@ cc_library( srcs = ["keymgr.c"], hdrs = ["keymgr.h"], deps = [ - "//hw/ip/keymgr/data:keymgr_c_regs", + "//hw/top:keymgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:macros", @@ -321,7 +321,7 @@ opentitan_test( ":kmac", ":lifecycle", ":retention_sram", - "//hw/ip/kmac/data:kmac_c_regs", + "//hw/top:kmac_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/dif:flash_ctrl", @@ -345,7 +345,7 @@ cc_library( srcs = ["kmac.c"], hdrs = ["kmac.h"], deps = [ - "//hw/ip/kmac/data:kmac_c_regs", + "//hw/top:kmac_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:macros", @@ -392,7 +392,7 @@ dual_cc_library( ), deps = dual_inputs( device = [ - "//hw/ip/lc_ctrl/data:lc_ctrl_c_regs", + "//hw/top:lc_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", ], host = [ @@ -414,7 +414,7 @@ cc_test( srcs = ["lifecycle_unittest.cc"], deps = [ dual_cc_device_library_of(":lifecycle"), - "//hw/ip/lc_ctrl/data:lc_ctrl_c_regs", + "//hw/top:lc_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/silicon_creator/testing:rom_test", "@googletest//:gtest_main", @@ -426,7 +426,7 @@ cc_library( srcs = ["otbn.c"], hdrs = ["otbn.h"], deps = [ - "//hw/ip/otbn/data:otbn_c_regs", + "//hw/top:otbn_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", @@ -466,7 +466,7 @@ dual_cc_library( "@googletest//:gtest", ], shared = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:hardened", "//sw/device/lib/base:macros", "//sw/device/silicon_creator/lib/base:sec_mmio", @@ -490,9 +490,9 @@ cc_library( srcs = ["pinmux.c"], hdrs = ["pinmux.h"], deps = [ - "//hw/ip/gpio/data:gpio_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/pinmux:pinmux_c_regs", + "//hw/top:gpio_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:pinmux_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:csr", @@ -524,7 +524,7 @@ cc_library( srcs = ["retention_sram.c"], hdrs = ["retention_sram.h"], deps = [ - "//hw/ip/sram_ctrl/data:sram_ctrl_c_regs", + "//hw/top:sram_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:macros", @@ -581,9 +581,9 @@ dual_cc_library( "//sw/device/lib/base:csr", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:hardened", - "//hw/ip/entropy_src/data:entropy_src_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/ip/rv_core_ibex/data:rv_core_ibex_c_regs", + "//hw/top:entropy_src_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:rv_core_ibex_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:crc32", ], @@ -606,8 +606,8 @@ cc_test( deps = [ dual_cc_device_library_of(":rnd"), ":otp", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/ip/rv_core_ibex/data:rv_core_ibex_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:rv_core_ibex_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:boot_stage_rom_ext", "//sw/device/lib/base:abs_mmio", @@ -654,7 +654,7 @@ dual_cc_library( ), deps = dual_inputs( device = [ - "//hw/top_earlgrey/ip_autogen/rstmgr:rstmgr_c_regs", + "//hw/top:rstmgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", ], host = [ @@ -663,7 +663,7 @@ dual_cc_library( "@googletest//:gtest", ], shared = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", "//sw/device/lib/base:multibits", @@ -705,7 +705,7 @@ cc_library( hdrs = ["uart.h"], deps = [ ":ibex", - "//hw/ip/uart/data:uart_c_regs", + "//hw/top:uart_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:abs_mmio", @@ -746,9 +746,9 @@ cc_library( hdrs = ["watchdog.h"], deps = [ ":pwrmgr", - "//hw/ip/aon_timer/data:aon_timer_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_c_regs", + "//hw/top:aon_timer_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:pwrmgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/silicon_creator/lib/base:sec_mmio", @@ -762,8 +762,8 @@ cc_test( srcs = ["watchdog_unittest.cc"], deps = [ ":watchdog", - "//hw/ip/aon_timer/data:aon_timer_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:aon_timer_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/silicon_creator/lib/base:sec_mmio", @@ -805,8 +805,8 @@ dual_cc_library( ), deps = dual_inputs( device = [ - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", - "//hw/ip/spi_device/data:spi_device_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:spi_device_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", ], host = [ @@ -830,7 +830,7 @@ cc_test( ], deps = [ dual_cc_device_library_of(":spi_device"), - "//hw/ip/spi_device/data:spi_device_c_regs", + "//hw/top:spi_device_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/silicon_creator/lib:error", @@ -845,7 +845,7 @@ cc_library( hdrs = ["pwrmgr.h"], deps = [ ":ibex", - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_c_regs", + "//hw/top:pwrmgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/silicon_creator/lib/base:sec_mmio", @@ -859,8 +859,8 @@ cc_library( deps = [ ":lifecycle", ":otp", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:sensor_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", @@ -874,8 +874,8 @@ cc_test( srcs = ["sensor_ctrl_unittest.cc"], deps = [ ":sensor_ctrl", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:sensor_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "@googletest//:gtest_main", ], diff --git a/sw/device/silicon_creator/lib/sigverify/BUILD b/sw/device/silicon_creator/lib/sigverify/BUILD index a513241cf0c2f6..3de5afa39a2a5c 100644 --- a/sw/device/silicon_creator/lib/sigverify/BUILD +++ b/sw/device/silicon_creator/lib/sigverify/BUILD @@ -166,7 +166,7 @@ cc_library( deps = [ ":mod_exp_ibex", ":rsa_key", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:hardened", "//sw/device/silicon_creator/lib/drivers:hmac", "//sw/device/silicon_creator/lib/drivers:lifecycle", @@ -201,7 +201,7 @@ cc_library( hdrs = ["spx_verify.h"], deps = [ ":spx_key", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:hardened", "//sw/device/silicon_creator/lib/drivers:hmac", "//sw/device/silicon_creator/lib/drivers:lifecycle", @@ -231,7 +231,7 @@ cc_library( srcs = ["usage_constraints.c"], hdrs = ["usage_constraints.h"], deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:hardened", "//sw/device/silicon_creator/lib:manifest", @@ -253,7 +253,7 @@ cc_test( srcs = ["flash_exec_unittest.cc"], deps = [ ":flash_exec", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//sw/device/silicon_creator/testing:rom_test", "@googletest//:gtest_main", ], diff --git a/sw/device/silicon_creator/manuf/base/BUILD b/sw/device/silicon_creator/manuf/base/BUILD index d9731d70fa4ac8..ae037f5e8b0892 100644 --- a/sw/device/silicon_creator/manuf/base/BUILD +++ b/sw/device/silicon_creator/manuf/base/BUILD @@ -93,7 +93,7 @@ opentitan_binary( linker_script = "//sw/device/silicon_creator/manuf/lib:sram_program_linker_script", deps = [ ":flash_info_permissions", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:macros", diff --git a/sw/device/silicon_creator/manuf/lib/BUILD b/sw/device/silicon_creator/manuf/lib/BUILD index 44e757ac01e8cb..682bddf47ce8c1 100644 --- a/sw/device/silicon_creator/manuf/lib/BUILD +++ b/sw/device/silicon_creator/manuf/lib/BUILD @@ -42,9 +42,9 @@ cc_library( deps = [ ":ast_program", ":sram_start_headers", - "//hw/ip/csrng/data:csrng_c_regs", - "//hw/ip/edn/data:edn_c_regs", - "//hw/ip/entropy_src/data:entropy_src_c_regs", + "//hw/top:csrng_c_regs", + "//hw/top:edn_c_regs", + "//hw/top:entropy_src_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/crt", "//sw/device/lib/testing/test_framework:ottf_isrs", @@ -58,9 +58,9 @@ cc_library( deps = [ ":ast_program", ":sram_start_headers", - "//hw/ip/csrng/data:csrng_c_regs", - "//hw/ip/edn/data:edn_c_regs", - "//hw/ip/entropy_src/data:entropy_src_c_regs", + "//hw/top:csrng_c_regs", + "//hw/top:edn_c_regs", + "//hw/top:entropy_src_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/crt", "//sw/device/lib/testing/test_framework:ottf_isrs", @@ -72,9 +72,9 @@ cc_library( srcs = ["flash_info_fields.c"], hdrs = ["flash_info_fields.h"], deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip/ast/data:ast_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:ast_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:status", "//sw/device/lib/dif:flash_ctrl", "//sw/device/lib/testing:flash_ctrl_testutils", @@ -87,7 +87,7 @@ cc_library( srcs = ["otp_fields.c"], hdrs = ["otp_fields.h"], deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:bitfield", ], ) @@ -102,7 +102,7 @@ cc_library( srcs = ["util.c"], hdrs = ["util.h"], deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:status", "//sw/device/lib/crypto/impl:hash", @@ -175,7 +175,7 @@ cc_library( ":flash_info_fields", ":otp_img_types", ":util", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -221,7 +221,7 @@ opentitan_test( ":flash_info_fields", # Testing sival SKU only should be sufficient. ":individualize_sw_cfg_sival", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:status", "//sw/device/lib/dif:flash_ctrl", @@ -288,9 +288,9 @@ opentitan_test( deps = [ ":flash_info_fields", ":personalize", - "//hw/ip/lc_ctrl/data:lc_ctrl_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:lc_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:status", "//sw/device/lib/dif:flash_ctrl", diff --git a/sw/device/silicon_creator/manuf/tests/BUILD b/sw/device/silicon_creator/manuf/tests/BUILD index ce839516dfbf65..3c9e01cf66ebdf 100644 --- a/sw/device/silicon_creator/manuf/tests/BUILD +++ b/sw/device/silicon_creator/manuf/tests/BUILD @@ -125,7 +125,7 @@ opentitan_test( test_harness = "//sw/host/tests/manuf/manuf_cp_unlock_raw", ), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", "//sw/device/silicon_creator/lib/drivers:otp", @@ -147,7 +147,7 @@ opentitan_test( test_harness = "//sw/host/tests/manuf/manuf_cp_volatile_unlock_raw", ), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", "//sw/device/silicon_creator/lib/drivers:otp", @@ -188,7 +188,7 @@ opentitan_test( test_harness = "//sw/host/tests/manuf/manuf_cp_yield_test", ), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", "//sw/device/silicon_creator/lib/drivers:otp", @@ -280,7 +280,7 @@ opentitan_binary( linker_script = "//sw/device/silicon_creator/manuf/lib:sram_program_linker_script", deps = [ ":test_wafer_auth_secret", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:macros", @@ -375,7 +375,7 @@ opentitan_binary( kind = "ram", linker_script = "//sw/device/silicon_creator/manuf/lib:sram_program_linker_script", deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:macros", @@ -448,7 +448,7 @@ opentitan_test( test_harness = "//sw/host/tests/manuf/manuf_cp_test_lock", ), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", "//sw/device/silicon_creator/lib/drivers:otp", @@ -476,7 +476,7 @@ opentitan_test( test_harness = "//sw/host/tests/manuf/otp_ctrl:otp_ctrl", ), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", "//sw/device/silicon_creator/lib/drivers:otp", diff --git a/sw/device/silicon_creator/rom/BUILD b/sw/device/silicon_creator/rom/BUILD index 0cef04a5012619..2e1d7024fe9685 100644 --- a/sw/device/silicon_creator/rom/BUILD +++ b/sw/device/silicon_creator/rom/BUILD @@ -85,7 +85,7 @@ cc_library( hdrs = ["rom_isrs.h"], target_compatible_with = [OPENTITAN_CPU], deps = [ - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:csr", "//sw/device/lib/base:macros", @@ -101,21 +101,21 @@ cc_library( ":linker_script", ":rom_common", ":rom_epmp", - "//hw/ip/aon_timer/data:aon_timer_c_regs", - "//hw/ip/csrng/data:csrng_c_regs", - "//hw/ip/edn/data:edn_c_regs", - "//hw/ip/entropy_src/data:entropy_src_c_regs", - "//hw/ip/gpio/data:gpio_c_regs", - "//hw/ip/lc_ctrl/data:lc_ctrl_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/ip/rv_core_ibex/data:rv_core_ibex_c_regs", - "//hw/ip/sram_ctrl/data:sram_ctrl_c_regs", - "//hw/top_earlgrey/ip/ast/data:ast_c_regs", - "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/clkmgr:clkmgr_c_regs", - "//hw/top_earlgrey/ip_autogen/pinmux:pinmux_c_regs", - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_c_regs", - "//hw/top_earlgrey/ip_autogen/rstmgr:rstmgr_c_regs", + "//hw/top:aon_timer_c_regs", + "//hw/top:ast_c_regs", + "//hw/top:clkmgr_c_regs", + "//hw/top:csrng_c_regs", + "//hw/top:edn_c_regs", + "//hw/top:entropy_src_c_regs", + "//hw/top:gpio_c_regs", + "//hw/top:lc_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:pinmux_c_regs", + "//hw/top:pwrmgr_c_regs", + "//hw/top:rstmgr_c_regs", + "//hw/top:rv_core_ibex_c_regs", + "//hw/top:sensor_ctrl_c_regs", + "//hw/top:sram_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:hardened", "//sw/device/lib/base:multibits", @@ -138,7 +138,7 @@ cc_library( ":sigverify_keys_ecdsa_p256", ":sigverify_keys_spx", ":sigverify_otp_keys", - "//hw/ip/aon_timer/data:aon_timer_c_regs", + "//hw/top:aon_timer_c_regs", "//sw/device/lib/arch:device", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:csr", @@ -277,7 +277,7 @@ opentitan_test( ], deps = [ ":mask_rom_lib", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//sw/device/lib/arch:device", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", @@ -318,9 +318,9 @@ cc_library( srcs = ["bootstrap.c"], hdrs = ["bootstrap.h"], deps = [ - "//hw/ip/gpio/data:gpio_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:gpio_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", @@ -338,9 +338,9 @@ cc_test( srcs = ["bootstrap_unittest.cc"], deps = [ ":bootstrap", - "//hw/ip/gpio/data:gpio_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:gpio_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/silicon_creator/lib:bootstrap_unittest_util", "@googletest//:gtest_main", @@ -368,7 +368,7 @@ cc_library( hdrs = ["sigverify_otp_keys.h"], deps = [ ":sigverify_key_types", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:macros", "//sw/device/silicon_creator/lib:error", "//sw/device/silicon_creator/lib/drivers:hmac", @@ -418,7 +418,7 @@ cc_library( deps = [ ":sigverify_key_types", ":sigverify_otp_keys", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:macros", "//sw/device/silicon_creator/lib:error", "//sw/device/silicon_creator/lib/drivers:lifecycle", diff --git a/sw/device/silicon_creator/rom/e2e/BUILD b/sw/device/silicon_creator/rom/e2e/BUILD index cffafdcfbbec52..c26d0c5709fb68 100644 --- a/sw/device/silicon_creator/rom/e2e/BUILD +++ b/sw/device/silicon_creator/rom/e2e/BUILD @@ -106,7 +106,7 @@ opentitan_test( ], linker_script = "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_{}".format(slot), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", "//sw/device/silicon_creator/lib/drivers:otp", @@ -143,7 +143,7 @@ opentitan_test( ], linker_script = "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_{}".format(slot), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", "//sw/device/silicon_creator/lib/drivers:otp", @@ -169,7 +169,7 @@ opentitan_test( # specify one by default. manifest = "//sw/device/silicon_creator/rom_ext:manifest", deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", "//sw/device/silicon_creator/lib/drivers:otp", @@ -379,8 +379,8 @@ opentitan_test( exit_success = MSG_PASS, ), deps = [ - "//hw/ip/uart/data:uart_c_regs", - "//hw/top_earlgrey/ip_autogen/pinmux:pinmux_c_regs", + "//hw/top:pinmux_c_regs", + "//hw/top:uart_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/runtime:hart", "//sw/device/lib/runtime:log", @@ -409,7 +409,7 @@ opentitan_test( ), linker_script = "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_a", deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", "//sw/device/silicon_creator/lib/drivers:otp", @@ -432,7 +432,7 @@ opentitan_test( ), linker_script = "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_a", deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", "//sw/device/silicon_creator/lib/drivers:otp", @@ -463,7 +463,7 @@ opentitan_test( ), linker_script = "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_a", deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib:boot_data", "//sw/device/silicon_creator/lib/drivers:lifecycle", diff --git a/sw/device/silicon_creator/rom/e2e/boot_policy_flash_ecc_error/BUILD b/sw/device/silicon_creator/rom/e2e/boot_policy_flash_ecc_error/BUILD index 8d9a03bc2761e7..b301a1f11045f5 100644 --- a/sw/device/silicon_creator/rom/e2e/boot_policy_flash_ecc_error/BUILD +++ b/sw/device/silicon_creator/rom/e2e/boot_policy_flash_ecc_error/BUILD @@ -216,8 +216,8 @@ SEC_VERS = [ manifest = ":manifest_sec_ver_1", spx_key = {"//sw/device/silicon_creator/rom/keys/fake/spx:prod_key_0_spx": "prod_key_0"}, deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:macros", diff --git a/sw/device/silicon_creator/rom/e2e/boot_policy_newer/BUILD b/sw/device/silicon_creator/rom/e2e/boot_policy_newer/BUILD index 318f36ac62a162..8ab9eb3e779ecf 100644 --- a/sw/device/silicon_creator/rom/e2e/boot_policy_newer/BUILD +++ b/sw/device/silicon_creator/rom/e2e/boot_policy_newer/BUILD @@ -69,7 +69,7 @@ SEC_VERS = [ ], manifest = ":manifest_sec_ver_{}".format(sec_ver), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", "//sw/device/silicon_creator/lib/drivers:otp", diff --git a/sw/device/silicon_creator/rom/e2e/chip_specific_startup/BUILD b/sw/device/silicon_creator/rom/e2e/chip_specific_startup/BUILD index 466d2d9cb1e137..612cb7b38ae5fe 100644 --- a/sw/device/silicon_creator/rom/e2e/chip_specific_startup/BUILD +++ b/sw/device/silicon_creator/rom/e2e/chip_specific_startup/BUILD @@ -36,11 +36,11 @@ package(default_visibility = ["//visibility:public"]) test_harness = "//sw/host/tests/rom/e2e_chip_specific_startup", ), deps = [ - "//hw/ip/csrng/data:csrng_c_regs", - "//hw/ip/edn/data:edn_c_regs", - "//hw/ip/entropy_src/data:entropy_src_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_c_regs", + "//hw/top:csrng_c_regs", + "//hw/top:edn_c_regs", + "//hw/top:entropy_src_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:sensor_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/dif:clkmgr", diff --git a/sw/device/silicon_creator/rom/e2e/immutable_rom_ext_section/BUILD b/sw/device/silicon_creator/rom/e2e/immutable_rom_ext_section/BUILD index 221d5061f680f4..1be7e5245b9079 100644 --- a/sw/device/silicon_creator/rom/e2e/immutable_rom_ext_section/BUILD +++ b/sw/device/silicon_creator/rom/e2e/immutable_rom_ext_section/BUILD @@ -230,7 +230,7 @@ manifest(d = { linker_script = "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_{}".format(s["slot"]), manifest = ":manifest", deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:hardened", "//sw/device/lib/base:status", diff --git a/sw/device/silicon_creator/rom/e2e/retention_ram/BUILD b/sw/device/silicon_creator/rom/e2e/retention_ram/BUILD index 5ae205a0049eb7..b5ffb729b3d3a5 100644 --- a/sw/device/silicon_creator/rom/e2e/retention_ram/BUILD +++ b/sw/device/silicon_creator/rom/e2e/retention_ram/BUILD @@ -76,7 +76,7 @@ opentitan_test( tags = maybe_skip_in_ci(CONST.LCV.RMA), ), deps = [ - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_c_regs", + "//hw/top:pwrmgr_c_regs", "//sw/device/lib/base:memory", "//sw/device/lib/dif:aon_timer", "//sw/device/lib/dif:pwrmgr", diff --git a/sw/device/silicon_creator/rom/e2e/shutdown_alert/BUILD b/sw/device/silicon_creator/rom/e2e/shutdown_alert/BUILD index 3a729c57aea8d3..4789b064be5f3b 100644 --- a/sw/device/silicon_creator/rom/e2e/shutdown_alert/BUILD +++ b/sw/device/silicon_creator/rom/e2e/shutdown_alert/BUILD @@ -66,7 +66,7 @@ ALERT_LC_STATES = get_lc_items( "OTP_ALERT_DIGEST=OTP_CTRL_PARAM_OWNER_SW_CFG_ROM_ALERT_DIGEST_{}_OFFSET".format(lc_state.upper()), ], deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_a", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:alert", @@ -181,7 +181,7 @@ otp_alert_digest( tags = maybe_skip_in_ci(lc_state_val), ), deps = [ - "//hw/ip/uart/data:uart_c_regs", + "//hw/top:uart_c_regs", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_a", "//sw/device/lib/testing/test_framework:ottf_main", diff --git a/sw/device/silicon_creator/rom/e2e/sigverify_spx/BUILD b/sw/device/silicon_creator/rom/e2e/sigverify_spx/BUILD index 5a56146ddcbca1..8cd8530b4faaed 100644 --- a/sw/device/silicon_creator/rom/e2e/sigverify_spx/BUILD +++ b/sw/device/silicon_creator/rom/e2e/sigverify_spx/BUILD @@ -106,7 +106,7 @@ opentitan_binary( CONST.LCV.RMA, ), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_a", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", @@ -193,7 +193,7 @@ opentitan_binary( lc_state_val, ), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_a", "//sw/device/lib/testing/test_framework:ottf_main", "//sw/device/silicon_creator/lib/drivers:lifecycle", diff --git a/sw/device/silicon_creator/rom/e2e/sram/BUILD b/sw/device/silicon_creator/rom/e2e/sram/BUILD index 598768e68282ad..ad5409d30364cd 100644 --- a/sw/device/silicon_creator/rom/e2e/sram/BUILD +++ b/sw/device/silicon_creator/rom/e2e/sram/BUILD @@ -62,8 +62,8 @@ _TESTS = { otp = param["otp"], ), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/ip/sram_ctrl/data:sram_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:sram_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/testing/test_framework:ottf_main", diff --git a/sw/device/silicon_creator/rom/e2e/watchdog/BUILD b/sw/device/silicon_creator/rom/e2e/watchdog/BUILD index f3140c27aaff8e..27828d70f02b93 100644 --- a/sw/device/silicon_creator/rom/e2e/watchdog/BUILD +++ b/sw/device/silicon_creator/rom/e2e/watchdog/BUILD @@ -94,7 +94,7 @@ WATCHDOG_TEST_CASES = { ], manifest = "//sw/device/silicon_creator/rom_ext:manifest", deps = [ - "//hw/ip/aon_timer/data:aon_timer_c_regs", + "//hw/top:aon_timer_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_a", diff --git a/sw/device/silicon_creator/rom_ext/BUILD b/sw/device/silicon_creator/rom_ext/BUILD index 49cb4d9f9ce4c2..3de879f2099df9 100644 --- a/sw/device/silicon_creator/rom_ext/BUILD +++ b/sw/device/silicon_creator/rom_ext/BUILD @@ -24,7 +24,7 @@ cc_library( srcs = ["rescue.c"], hdrs = ["rescue.h"], deps = [ - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//sw/device/lib/base:memory", "//sw/device/silicon_creator/lib:boot_data", "//sw/device/silicon_creator/lib:dbg_print", @@ -103,7 +103,7 @@ cc_library( srcs = ["bootstrap.c"], hdrs = ["bootstrap.h"], deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:hardened", "//sw/device/lib/base:macros", "//sw/device/silicon_creator/lib:bootstrap", @@ -120,7 +120,7 @@ cc_test( srcs = ["bootstrap_unittest.cc"], deps = [ ":bootstrap", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//sw/device/lib/base:memory", "//sw/device/silicon_creator/lib:bootstrap", "//sw/device/silicon_creator/lib:bootstrap_unittest_util", @@ -225,8 +225,8 @@ cc_library( ":rom_ext_boot_policy_ptrs", ":rom_ext_manifest", ":sigverify_keys", - "//hw/ip/sram_ctrl/data:sram_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:sram_ctrl_c_regs", "//sw/device/lib/arch:device", "//sw/device/lib/base:csr", "//sw/device/lib/base:macros", diff --git a/sw/device/silicon_creator/rom_ext/e2e/handoff/BUILD b/sw/device/silicon_creator/rom_ext/e2e/handoff/BUILD index f39d1862f89347..4c5863bfb22a10 100644 --- a/sw/device/silicon_creator/rom_ext/e2e/handoff/BUILD +++ b/sw/device/silicon_creator/rom_ext/e2e/handoff/BUILD @@ -67,7 +67,7 @@ _FAULT_TEST_CASES = { linker_script = ":ld_slot_a", manifest = "//sw/device/silicon_owner:manifest", deps = [ - "//hw/ip/uart/data:uart_c_regs", + "//hw/top:uart_c_regs", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:hardened", diff --git a/sw/device/silicon_creator/rom_ext/e2e/lockdown/BUILD b/sw/device/silicon_creator/rom_ext/e2e/lockdown/BUILD index 52908a6526d88d..8c679e79531820 100644 --- a/sw/device/silicon_creator/rom_ext/e2e/lockdown/BUILD +++ b/sw/device/silicon_creator/rom_ext/e2e/lockdown/BUILD @@ -68,7 +68,7 @@ opentitan_test( tags = ["broken"], ), deps = [ - "//hw/ip/sram_ctrl/data:sram_ctrl_c_regs", + "//hw/top:sram_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:status", "//sw/device/lib/testing/test_framework:ottf_main", diff --git a/sw/device/silicon_creator/rom_ext/keys/fake/BUILD b/sw/device/silicon_creator/rom_ext/keys/fake/BUILD index 66082363a7c8ae..51060f3b38b70b 100644 --- a/sw/device/silicon_creator/rom_ext/keys/fake/BUILD +++ b/sw/device/silicon_creator/rom_ext/keys/fake/BUILD @@ -16,7 +16,7 @@ cc_library( "rom_ext_test_key_0_rsa_3072_exp_f4.h", ], deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:macros", "//sw/device/silicon_creator/lib/sigverify", ], diff --git a/sw/device/silicon_creator/rom_ext/sival/keys/BUILD b/sw/device/silicon_creator/rom_ext/sival/keys/BUILD index 895fadbb4b3aad..1256d8eac5a8db 100644 --- a/sw/device/silicon_creator/rom_ext/sival/keys/BUILD +++ b/sw/device/silicon_creator/rom_ext/sival/keys/BUILD @@ -16,7 +16,7 @@ cc_library( "earlgrey_z0_sival_1.h", ], deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:macros", "//sw/device/silicon_creator/lib/sigverify", ], diff --git a/sw/device/tests/BUILD b/sw/device/tests/BUILD index 8c21d669ff27f3..f5d020247bffdd 100644 --- a/sw/device/tests/BUILD +++ b/sw/device/tests/BUILD @@ -292,7 +292,7 @@ opentitan_test( timeout = "long", ), deps = [ - "//hw/top_earlgrey:alert_handler_c_regs", + "//hw/top:alert_handler_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:memory", @@ -322,7 +322,7 @@ opentitan_test( fpga = fpga_params(timeout = "moderate"), verilator = verilator_params(timeout = "long"), deps = [ - "//hw/top_earlgrey:alert_handler_c_regs", + "//hw/top:alert_handler_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:math", "//sw/device/lib/base:mmio", @@ -362,7 +362,7 @@ opentitan_test( ), fpga = fpga_params(timeout = "moderate"), deps = [ - "//hw/top_earlgrey:alert_handler_c_regs", + "//hw/top:alert_handler_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:math", "//sw/device/lib/base:mmio", @@ -404,7 +404,7 @@ opentitan_test( # in CI/nightlies. verilator = verilator_params(tags = ["manual"]), deps = [ - "//hw/top_earlgrey:alert_handler_c_regs", + "//hw/top:alert_handler_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:math", "//sw/device/lib/base:mmio", @@ -453,11 +453,11 @@ opentitan_test( timeout = "moderate", ), deps = [ - "//hw/ip/i2c/data:i2c_c_regs", - "//hw/ip/spi_device/data:spi_device_c_regs", - "//hw/ip/spi_host/data:spi_host_c_regs", - "//hw/ip/usbdev/data:usbdev_c_regs", - "//hw/top_earlgrey:alert_handler_c_regs", + "//hw/top:alert_handler_c_regs", + "//hw/top:i2c_c_regs", + "//hw/top:spi_device_c_regs", + "//hw/top:spi_host_c_regs", + "//hw/top:usbdev_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:math", "//sw/device/lib/base:mmio", @@ -505,7 +505,7 @@ opentitan_test( timeout = "moderate", ), deps = [ - "//hw/top_earlgrey:alert_handler_c_regs", + "//hw/top:alert_handler_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:math", "//sw/device/lib/base:mmio", @@ -1216,7 +1216,7 @@ opentitan_test( ), deps = [ "//hw/ip/aes:model", - "//hw/ip/edn/data:edn_c_regs", + "//hw/top:edn_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/crypto/drivers:otbn", @@ -1254,7 +1254,7 @@ opentitan_test( timeout = "eternal", ), deps = [ - "//hw/ip/edn/data:edn_c_regs", + "//hw/top:edn_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/dif:csrng", @@ -1289,7 +1289,7 @@ opentitan_test( ), deps = [ "//hw/ip/aes:model", - "//hw/ip/edn/data:edn_c_regs", + "//hw/top:edn_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/dif:aes", @@ -1320,7 +1320,7 @@ opentitan_test( timeout = "long", ), deps = [ - "//hw/ip/edn/data:edn_c_regs", + "//hw/top:edn_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/dif:csrng", @@ -1491,7 +1491,7 @@ opentitan_test( # in CI/nightlies. verilator = verilator_params(tags = ["manual"]), deps = [ - "//hw/ip/entropy_src/data:entropy_src_c_regs", + "//hw/top:entropy_src_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:memory", "//sw/device/lib/base:mmio", @@ -1708,7 +1708,7 @@ opentitan_test( }, ), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:mmio", @@ -1855,7 +1855,7 @@ opentitan_test( ), verilator = verilator_params(timeout = "long"), deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:mmio", "//sw/device/lib/dif:clkmgr", @@ -1904,7 +1904,7 @@ opentitan_test( ), verilator = verilator_params(timeout = "long"), deps = [ - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -1930,7 +1930,7 @@ opentitan_test( ), verilator = verilator_params(timeout = "long"), deps = [ - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:macros", "//sw/device/lib/base:memory", @@ -2310,9 +2310,9 @@ opentitan_test( }, ), deps = [ - "//hw/ip/aes/data:aes_c_regs", - "//hw/ip/keymgr/data:keymgr_c_regs", - "//hw/ip/kmac/data:kmac_c_regs", + "//hw/top:aes_c_regs", + "//hw/top:keymgr_c_regs", + "//hw/top:kmac_c_regs", "//sw/device/lib/arch:boot_stage", "//sw/device/lib/base:macros", "//sw/device/lib/dif:aes", @@ -2341,8 +2341,8 @@ opentitan_test( ), verilator = verilator_params(timeout = "long"), deps = [ - "//hw/ip/keymgr/data:keymgr_c_regs", - "//hw/ip/kmac/data:kmac_c_regs", + "//hw/top:keymgr_c_regs", + "//hw/top:kmac_c_regs", "//sw/device/lib/arch:device", "//sw/device/lib/base:macros", "//sw/device/lib/dif:keymgr", @@ -2368,7 +2368,7 @@ opentitan_test( ), verilator = verilator_params(timeout = "long"), deps = [ - "//hw/ip/otbn/data:otbn_c_regs", + "//hw/top:otbn_c_regs", "//sw/device/lib/arch:device", "//sw/device/lib/base:macros", "//sw/device/lib/dif:keymgr", @@ -2398,7 +2398,7 @@ opentitan_test( silicon = silicon_params(tags = ["broken"]), verilator = verilator_params(timeout = "long"), deps = [ - "//hw/ip/otbn/data:otbn_c_regs", + "//hw/top:otbn_c_regs", "//sw/device/lib/arch:device", "//sw/device/lib/base:macros", "//sw/device/lib/dif:keymgr", @@ -3282,7 +3282,7 @@ opentitan_test( # in CI/nightlies. verilator = verilator_params(tags = ["manual"]), deps = [ - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_c_regs", + "//hw/top:pwrmgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/dif:pwrmgr", "//sw/device/lib/dif:rv_plic", @@ -3317,7 +3317,7 @@ opentitan_test( # in CI/nightlies. verilator = verilator_params(tags = ["manual"]), deps = [ - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_c_regs", + "//hw/top:pwrmgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/dif:pwrmgr", "//sw/device/lib/dif:rv_plic", @@ -3360,7 +3360,7 @@ opentitan_test( # in CI/nightlies. verilator = verilator_params(tags = ["manual"]), deps = [ - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_c_regs", + "//hw/top:pwrmgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/dif:pwrmgr", @@ -3422,7 +3422,7 @@ opentitan_test( srcs = ["pwrmgr_sensor_ctrl_deep_sleep_wake_up.c"], exec_env = {"//hw/top_earlgrey:sim_dv": None}, deps = [ - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_c_regs", + "//hw/top:pwrmgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/dif:pwrmgr", "//sw/device/lib/dif:rv_plic", @@ -3596,10 +3596,10 @@ opentitan_test( ), verilator = verilator_params(timeout = "long"), deps = [ - "//hw/ip/i2c/data:i2c_c_regs", - "//hw/ip/spi_device/data:spi_device_c_regs", - "//hw/ip/spi_host/data:spi_host_c_regs", - "//hw/ip/usbdev/data:usbdev_c_regs", + "//hw/top:i2c_c_regs", + "//hw/top:spi_device_c_regs", + "//hw/top:spi_host_c_regs", + "//hw/top:usbdev_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:memory", @@ -3997,7 +3997,7 @@ opentitan_test( }, ), deps = [ - "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_c_regs", + "//hw/top:sensor_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:abs_mmio", @@ -4040,7 +4040,7 @@ opentitan_test( tags = ["manual"], ), deps = [ - "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_c_regs", + "//hw/top:sensor_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:memory", @@ -4074,7 +4074,7 @@ opentitan_test( tags = ["broken"], ), deps = [ - "//hw/ip/pwm/data:pwm_c_regs", + "//hw/top:pwm_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/dif:aon_timer", @@ -4820,7 +4820,7 @@ opentitan_test( tags = ["broken"], ), deps = [ - "//hw/top_earlgrey:alert_handler_c_regs", + "//hw/top:alert_handler_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:boot_stage", "//sw/device/lib/arch:device", @@ -5030,19 +5030,19 @@ opentitan_test( tags = ["broken"], ), deps = [ - "//hw/ip/adc_ctrl/data:adc_ctrl_c_regs", "//hw/ip/aes:model", - "//hw/ip/aes/data:aes_c_regs", - "//hw/ip/csrng/data:csrng_c_regs", - "//hw/ip/entropy_src/data:entropy_src_c_regs", - "//hw/ip/gpio/data:gpio_c_regs", - "//hw/ip/hmac/data:hmac_c_regs", - "//hw/ip/i2c/data:i2c_c_regs", - "//hw/ip/kmac/data:kmac_c_regs", - "//hw/ip/pattgen/data:pattgen_c_regs", - "//hw/ip/pwm/data:pwm_c_regs", - "//hw/ip/spi_host/data:spi_host_c_regs", - "//hw/ip/uart/data:uart_c_regs", + "//hw/top:adc_ctrl_c_regs", + "//hw/top:aes_c_regs", + "//hw/top:csrng_c_regs", + "//hw/top:entropy_src_c_regs", + "//hw/top:gpio_c_regs", + "//hw/top:hmac_c_regs", + "//hw/top:i2c_c_regs", + "//hw/top:kmac_c_regs", + "//hw/top:pattgen_c_regs", + "//hw/top:pwm_c_regs", + "//hw/top:spi_host_c_regs", + "//hw/top:uart_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:math", "//sw/device/lib/base:multibits", @@ -5499,12 +5499,12 @@ test_suite( test_harness = "//sw/host/tests/chip/rv_dm:ndm_reset_req", ), deps = [ - "//hw/ip/adc_ctrl/data:adc_ctrl_c_regs", - "//hw/ip/keymgr/data:keymgr_c_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/ip/sysrst_ctrl/data:sysrst_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/pinmux:pinmux_c_regs", + "//hw/top:adc_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:keymgr_c_regs", + "//hw/top:otp_ctrl_c_regs", + "//hw/top:pinmux_c_regs", + "//hw/top:sysrst_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/dif:adc_ctrl", @@ -6432,9 +6432,9 @@ opentitan_test( # in CI/nightlies. verilator = verilator_params(tags = ["manual"]), deps = [ - "//hw/ip/lc_ctrl/data:lc_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/clkmgr:clkmgr_c_regs", - "//hw/top_earlgrey/ip_autogen/pinmux:pinmux_c_regs", + "//hw/top:clkmgr_c_regs", + "//hw/top:lc_ctrl_c_regs", + "//hw/top:pinmux_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/dif:clkmgr", @@ -6505,8 +6505,8 @@ opentitan_binary( kind = "ram", linker_script = "//sw/device/silicon_creator/manuf/lib:sram_program_linker_script", deps = [ - "//hw/ip/pwm/data:pwm_c_regs", - "//hw/ip/rv_timer/data:rv_timer_c_regs", + "//hw/top:pwm_c_regs", + "//hw/top:rv_timer_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:macros", @@ -6534,8 +6534,8 @@ opentitan_test( EARLGREY_SILICON_OWNER_ROM_EXT_ENVS, ), deps = [ - "//hw/ip/pwm/data:pwm_c_regs", - "//hw/ip/rv_timer/data:rv_timer_c_regs", + "//hw/top:pwm_c_regs", + "//hw/top:rv_timer_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:macros", @@ -6657,7 +6657,7 @@ opentitan_test( verilator = verilator_params(tags = ["manual"]), deps = [ ":otbn_randomness_impl", - "//hw/ip/entropy_src/data:entropy_src_c_regs", + "//hw/top:entropy_src_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:memory", "//sw/device/lib/base:mmio", @@ -6777,7 +6777,7 @@ opentitan_test( EARLGREY_SILICON_OWNER_ROM_EXT_ENVS, ), deps = [ - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_c_regs", + "//hw/top:pwrmgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:mmio", diff --git a/sw/device/tests/penetrationtests/firmware/fi/BUILD b/sw/device/tests/penetrationtests/firmware/fi/BUILD index e7f793afad7d84..d7b10c993423a3 100644 --- a/sw/device/tests/penetrationtests/firmware/fi/BUILD +++ b/sw/device/tests/penetrationtests/firmware/fi/BUILD @@ -9,8 +9,8 @@ cc_library( srcs = ["crypto_fi.c"], hdrs = ["crypto_fi.h"], deps = [ - "//hw/ip/aes/data:aes_c_regs", - "//hw/ip/kmac/data:kmac_c_regs", + "//hw/top:aes_c_regs", + "//hw/top:kmac_c_regs", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:memory", "//sw/device/lib/base:status", @@ -34,7 +34,7 @@ cc_library( ], hdrs = ["ibex_fi.h"], deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//sw/device/lib/base:csr", "//sw/device/lib/base:memory", "//sw/device/lib/base:status", @@ -149,7 +149,7 @@ cc_library( srcs = ["rom_fi.c"], hdrs = ["rom_fi.h"], deps = [ - "//hw/ip/rom_ctrl/data:rom_ctrl_c_regs", + "//hw/top:rom_ctrl_c_regs", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:memory", "//sw/device/lib/base:status", diff --git a/sw/device/tests/sim_dv/BUILD b/sw/device/tests/sim_dv/BUILD index e007bcbfac9f79..7d7c7eb41ded67 100644 --- a/sw/device/tests/sim_dv/BUILD +++ b/sw/device/tests/sim_dv/BUILD @@ -10,8 +10,8 @@ opentitan_test( srcs = ["i2c_host_tx_rx_test.c"], exec_env = {"//hw/top_earlgrey:sim_dv": None}, deps = [ - "//hw/ip/lc_ctrl/data:lc_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/clkmgr:clkmgr_c_regs", + "//hw/top:clkmgr_c_regs", + "//hw/top:lc_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/dif:i2c", @@ -32,8 +32,8 @@ opentitan_test( srcs = ["i2c_device_tx_rx_test.c"], exec_env = {"//hw/top_earlgrey:sim_dv": None}, deps = [ - "//hw/ip/lc_ctrl/data:lc_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/clkmgr:clkmgr_c_regs", + "//hw/top:clkmgr_c_regs", + "//hw/top:lc_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:mmio", "//sw/device/lib/dif:i2c", @@ -536,7 +536,7 @@ opentitan_test( srcs = ["sram_ctrl_execution_main_test.c"], exec_env = {"//hw/top_earlgrey:sim_dv": None}, deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:bitfield", "//sw/device/lib/base:macros", @@ -559,7 +559,7 @@ cc_library( target_compatible_with = [OPENTITAN_CPU], visibility = ["//sw/device/tests:__pkg__"], deps = [ - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_c_regs", + "//hw/top:pwrmgr_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:mmio", @@ -607,7 +607,7 @@ opentitan_test( srcs = ["pwrmgr_b2b_sleep_reset_test.c"], exec_env = {"//hw/top_earlgrey:sim_dv": None}, deps = [ - "//hw/ip/aon_timer/data:aon_timer_c_regs", + "//hw/top:aon_timer_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:mmio", @@ -631,7 +631,7 @@ opentitan_test( srcs = ["sensor_ctrl_status.c"], exec_env = {"//hw/top_earlgrey:sim_dv": None}, deps = [ - "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_c_regs", + "//hw/top:sensor_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:memory", @@ -654,7 +654,7 @@ opentitan_test( srcs = ["alert_handler_entropy_test.c"], exec_env = {"//hw/top_earlgrey:sim_dv": None}, deps = [ - "//hw/top_earlgrey:alert_handler_c_regs", + "//hw/top:alert_handler_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/arch:device", "//sw/device/lib/base:memory", @@ -673,7 +673,7 @@ opentitan_test( # The test requires to drive fatal alerts which is possible only in DV sim. exec_env = {"//hw/top_earlgrey:sim_dv": None}, deps = [ - "//hw/top_earlgrey:alert_handler_c_regs", + "//hw/top:alert_handler_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:math", "//sw/device/lib/base:mmio", @@ -730,7 +730,7 @@ opentitan_test( srcs = ["ast_usb_clk_calib.c"], exec_env = {"//hw/top_earlgrey:sim_dv": None}, deps = [ - "//hw/top_earlgrey/ip/ast/data:ast_c_regs", + "//hw/top:ast_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:memory", "//sw/device/lib/base:mmio", @@ -793,8 +793,8 @@ opentitan_test( srcs = ["inject_scramble_seed.c"], exec_env = {"//hw/top_earlgrey:sim_dv": None}, deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs", + "//hw/top:flash_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:mmio", @@ -817,7 +817,7 @@ opentitan_test( srcs = ["exit_test_unlocked_bootstrap.c"], exec_env = {"//hw/top_earlgrey:sim_dv": None}, deps = [ - "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs", + "//hw/top:otp_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:abs_mmio", "//sw/device/lib/base:mmio", @@ -861,7 +861,7 @@ opentitan_test( srcs = ["ast_clk_rst_inputs.c"], exec_env = {"//hw/top_earlgrey:sim_dv": None}, deps = [ - "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_c_regs", + "//hw/top:sensor_ctrl_c_regs", "//hw/top_earlgrey/sw/autogen:top_earlgrey", "//sw/device/lib/base:memory", "//sw/device/lib/base:mmio", diff --git a/sw/device/tock/BUILD b/sw/device/tock/BUILD index 8bd2cc8ea0e8f2..4dfe8e6744922c 100644 --- a/sw/device/tock/BUILD +++ b/sw/device/tock/BUILD @@ -9,31 +9,31 @@ package(default_visibility = ["//visibility:public"]) filegroup( name = "lowrisc_defs", srcs = [ - "//hw/ip/adc_ctrl/data:adc_ctrl_rust_regs", - "//hw/ip/aes/data:aes_rust_regs", - "//hw/ip/aon_timer/data:aon_timer_rust_regs", - "//hw/ip/csrng/data:csrng_rust_regs", - "//hw/ip/edn/data:edn_rust_regs", - "//hw/ip/entropy_src/data:entropy_src_rust_regs", - "//hw/ip/gpio/data:gpio_rust_regs", - "//hw/ip/hmac/data:hmac_rust_regs", - "//hw/ip/i2c/data:i2c_rust_regs", - "//hw/ip/keymgr/data:keymgr_rust_regs", - "//hw/ip/kmac/data:kmac_rust_regs", - "//hw/ip/lc_ctrl/data:lc_ctrl_rust_regs", - "//hw/ip/otbn/data:otbn_rust_regs", - "//hw/ip/otp_ctrl/data:otp_ctrl_rust_regs", - "//hw/ip/pattgen/data:pattgen_rust_regs", - "//hw/ip/pwm/data:pwm_rust_regs", - "//hw/ip/rom_ctrl/data:rom_ctrl_rust_regs", - "//hw/ip/rv_core_ibex/data:rv_core_ibex_rust_regs", - "//hw/ip/rv_timer/data:rv_timer_rust_regs", - "//hw/ip/spi_device/data:spi_device_rust_regs", - "//hw/ip/spi_host/data:spi_host_rust_regs", - "//hw/ip/sram_ctrl/data:sram_ctrl_rust_regs", - "//hw/ip/sysrst_ctrl/data:sysrst_ctrl_rust_regs", - "//hw/ip/uart/data:uart_rust_regs", - "//hw/ip/usbdev/data:usbdev_rust_regs", + "//hw/top:adc_ctrl_rust_regs", + "//hw/top:aes_rust_regs", + "//hw/top:aon_timer_rust_regs", + "//hw/top:csrng_rust_regs", + "//hw/top:edn_rust_regs", + "//hw/top:entropy_src_rust_regs", + "//hw/top:gpio_rust_regs", + "//hw/top:hmac_rust_regs", + "//hw/top:i2c_rust_regs", + "//hw/top:keymgr_rust_regs", + "//hw/top:kmac_rust_regs", + "//hw/top:lc_ctrl_rust_regs", + "//hw/top:otbn_rust_regs", + "//hw/top:otp_ctrl_rust_regs", + "//hw/top:pattgen_rust_regs", + "//hw/top:pwm_rust_regs", + "//hw/top:rom_ctrl_rust_regs", + "//hw/top:rv_core_ibex_rust_regs", + "//hw/top:rv_timer_rust_regs", + "//hw/top:spi_device_rust_regs", + "//hw/top:spi_host_rust_regs", + "//hw/top:sram_ctrl_rust_regs", + "//hw/top:sysrst_ctrl_rust_regs", + "//hw/top:uart_rust_regs", + "//hw/top:usbdev_rust_regs", ], output_group = "tock", ) @@ -41,15 +41,15 @@ filegroup( filegroup( name = "earlgrey_defs", srcs = [ - "//hw/top_earlgrey:alert_handler_rust_regs", - "//hw/top_earlgrey:rv_plic_rust_regs", - "//hw/top_earlgrey/ip/ast/data:ast_rust_regs", - "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_rust_regs", - "//hw/top_earlgrey/ip_autogen/clkmgr:clkmgr_rust_regs", - "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_rust_regs", - "//hw/top_earlgrey/ip_autogen/pinmux:pinmux_rust_regs", - "//hw/top_earlgrey/ip_autogen/pwrmgr:pwrmgr_rust_regs", - "//hw/top_earlgrey/ip_autogen/rstmgr:rstmgr_rust_regs", + "//hw/top:alert_handler_rust_regs", + "//hw/top:ast_rust_regs", + "//hw/top:clkmgr_rust_regs", + "//hw/top:flash_ctrl_rust_regs", + "//hw/top:pinmux_rust_regs", + "//hw/top:pwrmgr_rust_regs", + "//hw/top:rstmgr_rust_regs", + "//hw/top:rv_plic_rust_regs", + "//hw/top:sensor_ctrl_rust_regs", ], output_group = "tock", ) diff --git a/util/py/scripts/audit_sec_mmio_calls.py b/util/py/scripts/audit_sec_mmio_calls.py index 07b424facfd57e..8a3140ba075724 100644 --- a/util/py/scripts/audit_sec_mmio_calls.py +++ b/util/py/scripts/audit_sec_mmio_calls.py @@ -63,14 +63,13 @@ def __init__(self): bazel.try_escape_sandbox() def query_hjson_sources(self) -> list[Path]: - """Find hjson files associated with autogen_hjson_c_header targets.""" - log.info("Querying Bazel for autogen_hjson_c_header srcs") + """Find hjson files associated with the top.""" + log.info("Querying Bazel for IP hjson files") query_lines = run.run( "./bazelisk.sh", "cquery", - "labels(srcs, kind(autogen_hjson_c_header, //...))", - "--output=starlark", - "--starlark:expr='\\n'.join([f.path for f in target.files.to_list()])", + "labels(ip_hjson, //hw/top:top_earlgrey_desc)", + "--output=files", ) return [Path(line) for line in query_lines] @@ -255,7 +254,7 @@ def main(log_level: ot_logging.LogLevel = ot_logging.LogLevel.WARNING) -> None: report_lines.append("Callsites where " f"[bold]{function_name}[/bold] " + "is called with hw-writable register " + - f"[purple]{register_token}[/purple]:") + f"[purple]{register_token}[/purple]: ") report_lines.append("") for loc in sorted(callsites, key=lambda c: c.path): diff --git a/util/topgen.py b/util/topgen.py index 424cf197236103..887ce7620bd7f3 100755 --- a/util/topgen.py +++ b/util/topgen.py @@ -1358,6 +1358,15 @@ def render_template(template_path: str, rendered_path: Path, helper=c_helper, gencmd=gencmd_bzl) + # "data_BUILD.h.tpl" -> "data/autogen/BUILD" + render_template(TOPGEN_TEMPLATE_PATH / "data_BUILD.tpl", + path / "data" / "autogen" / "BUILD", + gencmd=gencmd_bzl) + # "data_defs.tpl" -> "data/autogen/defs.bzl" + render_template(TOPGEN_TEMPLATE_PATH / "data_defs.tpl", + path / "data" / "autogen" / "defs.bzl", + gencmd=gencmd_bzl) + # generate chip level xbar and alert_handler TB tb_files = [ "xbar_env_pkg__params.sv", "tb__xbar_connect.sv", diff --git a/util/topgen/templates/data_BUILD.tpl b/util/topgen/templates/data_BUILD.tpl new file mode 100644 index 00000000000000..456344d945c18f --- /dev/null +++ b/util/topgen/templates/data_BUILD.tpl @@ -0,0 +1,6 @@ +# Copyright lowRISC contributors (OpenTitan project). +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 +${gencmd} + +exports_files(["top_${top["name"]}.gen.hjson"]) diff --git a/util/topgen/templates/data_defs.tpl b/util/topgen/templates/data_defs.tpl new file mode 100644 index 00000000000000..02fb3b4cbb39bc --- /dev/null +++ b/util/topgen/templates/data_defs.tpl @@ -0,0 +1,35 @@ +# Copyright lowRISC contributors (OpenTitan project). +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 +${gencmd} + +<% +top_name = top["name"] + +all_ips = {} +for m in sorted(top["module"], key=lambda x: x["type"]): + all_ips[m["type"]] = m.get("attr", "") + +%>\ +load("//rules/opentitan:hw.bzl", "opentitan_top") +% for (ip, type) in all_ips.items(): +% if type == "ipgen": +load("//hw/top_${top_name}/ip_autogen/${ip}:defs.bzl", "${ip.upper()}") +% elif type == "reggen_top" or type == "reggen_only": +load("//hw/top_${top_name}/ip/${ip}:defs.bzl", "${ip.upper()}") +% else: +load("//hw/ip/${ip}:defs.bzl", "${ip.upper()}") +% endif: +% endfor + +${top_name.upper()} = opentitan_top( + name = "${top_name}", + hjson = "//hw/top_${top_name}/data/autogen:top_${top_name}.gen.hjson", + top_lib = "//hw/top_${top_name}/sw/autogen:top_${top_name}", + top_ld = "//hw/top_${top_name}/sw/autogen:top_${top_name}_memory", + ips = [ +% for ip in all_ips.keys(): + ${ip.upper()}, +% endfor + ], +)