Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[multitop] New bazel rules to describe HW #24791

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
47a35d5
[bazel] Add new rules to describe hardware IP and tops
pamaury Oct 15, 2024
60839ea
[bazel,top_earlgrey] Use new rules to describe the top
pamaury Oct 15, 2024
862078c
[bazel,autogen] Create new rule to generate C/rust headers from top
pamaury Oct 15, 2024
7e1bf26
[bazel,top] Create a new //hw/top package
pamaury Oct 15, 2024
c9c15af
[bazel,top] Add generated C/rust rules for all IP
pamaury Oct 15, 2024
c108390
[otp_ctrl] Export file from BUILD file
pamaury Oct 17, 2024
0c9dd78
[sw/device] Remove explicit path to register header files
pamaury Oct 17, 2024
c1489b4
[mbx] Fix unittest
pamaury Oct 28, 2024
c719089
[bazel,flash_ctrl] Use new rules to describe IP
pamaury Oct 28, 2024
7ea76db
[bazel,clkmgr] Use new rules to describe IP
pamaury Oct 28, 2024
2a151f1
[bazel,rstmgr] Use new rules to describe IP
pamaury Oct 28, 2024
3ca1bc9
[bazel,pwrmgr] Use new rules to describe IP
pamaury Oct 28, 2024
5282746
[bazel,rv_plic] Use new rules to describe IP
pamaury Oct 29, 2024
ec80a17
[bazel,alert_handler] Use new rules to describe IP
pamaury Oct 29, 2024
03069a7
[bazel,pinmux] Use new rules to describe IP
pamaury Nov 5, 2024
a6b2051
[util] Add script to convert IPs to the new rules
pamaury Oct 17, 2024
883358f
[bazel,adc_ctrl] Use new rules to describe IP
pamaury Nov 7, 2024
f88bb95
[bazel,aes] Use new rules to describe IP
pamaury Nov 7, 2024
f882ea4
[bazel,aon_timer] Use new rules to describe IP
pamaury Nov 7, 2024
19d69b7
[bazel,csrng] Use new rules to describe IP
pamaury Nov 7, 2024
4d2b64c
[bazel,edn] Use new rules to describe IP
pamaury Nov 7, 2024
0388954
[bazel,entropy_src] Use new rules to describe IP
pamaury Nov 7, 2024
23d1772
[bazel,gpio] Use new rules to describe IP
pamaury Nov 7, 2024
64965e6
[bazel,hmac] Use new rules to describe IP
pamaury Nov 7, 2024
ea57f11
[bazel,i2c] Use new rules to describe IP
pamaury Nov 7, 2024
25cc115
[bazel,keymgr] Use new rules to describe IP
pamaury Nov 7, 2024
2c2b1b5
[bazel,kmac] Use new rules to describe IP
pamaury Nov 7, 2024
55c039b
[bazel,lc_ctrl] Use new rules to describe IP
pamaury Nov 7, 2024
3ec494d
[bazel,otbn] Use new rules to describe IP
pamaury Nov 7, 2024
6ae031b
[bazel,otp_ctrl] Use new rules to describe IP
pamaury Nov 7, 2024
8c13437
[bazel,pattgen] Use new rules to describe IP
pamaury Nov 7, 2024
36d6687
[bazel,prim] Use new rules to describe IP
pamaury Nov 7, 2024
d4210ea
[bazel,pwm] Use new rules to describe IP
pamaury Nov 7, 2024
cec4265
[bazel,rom_ctrl] Use new rules to describe IP
pamaury Nov 7, 2024
7961de6
[bazel,rv_core_ibex] Use new rules to describe IP
pamaury Nov 7, 2024
5f70de7
[bazel,rv_dm] Use new rules to describe IP
pamaury Nov 7, 2024
252e2ad
[bazel,rv_timer] Use new rules to describe IP
pamaury Nov 7, 2024
7e84951
[bazel,spi_device] Use new rules to describe IP
pamaury Nov 7, 2024
7166597
[bazel,spi_host] Use new rules to describe IP
pamaury Nov 7, 2024
25e4d4f
[bazel,sram_ctrl] Use new rules to describe IP
pamaury Nov 7, 2024
89bcf29
[bazel,sysrst_ctrl] Use new rules to describe IP
pamaury Nov 7, 2024
a83f7c9
[bazel,tlul] Use new rules to describe IP
pamaury Nov 7, 2024
f4c481d
[bazel,uart] Use new rules to describe IP
pamaury Nov 7, 2024
f6343da
[bazel,usbdev] Use new rules to describe IP
pamaury Nov 7, 2024
6c42e11
[bazel,ast] Use new rules to describe IP
pamaury Nov 7, 2024
46aa763
[bazel,sensor_ctrl] Use new rules to describe IP
pamaury Nov 7, 2024
ac87a5b
[bazel,xbar] Use new rules to describe IP
pamaury Nov 7, 2024
e90de56
[bazel,xbar_main] Use new rules to describe IP
pamaury Nov 7, 2024
04cadf9
[bazel,xbar_peri] Use new rules to describe IP
pamaury Nov 7, 2024
09ae04c
[bazel] Rework HW files targets
pamaury Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ filegroup(
name = "cores",
srcs = [
"check_tool_requirements.core",
"tool_requirements.py",
"topgen.core",
"topgen-reg-only.core",
"//util:check_tool_requirements.py",
],
)

Expand Down
21 changes: 1 addition & 20 deletions hw/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ string_list_flag(
fusesoc_build(
name = "verilator_real",
srcs = [
":all_files",
"//hw/top",
],
cores = [
"//:cores",
Expand Down Expand Up @@ -101,25 +101,6 @@ genrule(
visibility = ["//visibility:public"],
)

# TODO(lowRISC/opentitan#7972): Globbing all of the //hw/... hierarchy together
# is a bit of a hack. Longer term, we need proper rules for expressing the
# relationships between verilog components.
filegroup(
name = "all_files",
srcs = glob(
["**"],
# TODO(lowRISC/opentitan#15882): make Verilator work with foundry repo present.
exclude = ["foundry/**"],
) + [
"//:tool_requirements.py",
"//hw/ip:all_files",
"//hw/ip_templates:all_files",
"//hw/top_earlgrey:all_files",
"//util:check_tool_requirements.py",
],
visibility = ["//visibility:public"],
)

pkg_files(
name = "package",
srcs = ["verilator_bin"],
Expand Down
6 changes: 3 additions & 3 deletions hw/bitstream/vivado/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fusesoc_build(
name = "fpga_cw310",
testonly = True,
srcs = [
"//hw:all_files",
"//hw/top",
_CW310_TESTROM,
_OTP_RMA,
],
Expand Down Expand Up @@ -90,7 +90,7 @@ fusesoc_build(
name = "fpga_cw310_hyperdebug",
testonly = True,
srcs = [
"//hw:all_files",
"//hw/top",
_CW310_TESTROM,
_OTP_RMA,
],
Expand Down Expand Up @@ -140,7 +140,7 @@ fusesoc_build(
name = "fpga_cw340",
testonly = True,
srcs = [
"//hw:all_files",
"//hw/top",
_CW340_TESTROM,
_OTP_RMA,
],
Expand Down
4 changes: 3 additions & 1 deletion hw/ip_templates/clkmgr/BUILD → hw/dv/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ package(default_visibility = ["//visibility:public"])

filegroup(
name = "all_files",
srcs = glob(["**"]),
srcs = glob(
["**"],
),
)
38 changes: 0 additions & 38 deletions hw/ip/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,3 @@
# SPDX-License-Identifier: Apache-2.0

package(default_visibility = ["//visibility:public"])

filegroup(
name = "all_files",
srcs = glob(["**"]) + [
"//hw/ip/adc_ctrl:all_files",
"//hw/ip/aes:all_files",
"//hw/ip/aon_timer:all_files",
"//hw/ip/csrng:all_files",
"//hw/ip/edn:all_files",
"//hw/ip/entropy_src:all_files",
"//hw/ip/gpio:all_files",
"//hw/ip/hmac:all_files",
"//hw/ip/i2c:all_files",
"//hw/ip/keymgr:all_files",
"//hw/ip/kmac:all_files",
"//hw/ip/lc_ctrl:all_files",
"//hw/ip/otbn:all_files",
"//hw/ip/otp_ctrl:all_files",
"//hw/ip/pattgen:all_files",
"//hw/ip/prim:all_files",
"//hw/ip/prim_generic:all_files",
"//hw/ip/prim_xilinx:all_files",
"//hw/ip/prim_xilinx_ultrascale:all_files",
"//hw/ip/pwm:all_files",
"//hw/ip/rom_ctrl:all_files",
"//hw/ip/rv_core_ibex:all_files",
"//hw/ip/rv_dm:all_files",
"//hw/ip/rv_timer:all_files",
"//hw/ip/spi_device:all_files",
"//hw/ip/spi_host:all_files",
"//hw/ip/sram_ctrl:all_files",
"//hw/ip/sysrst_ctrl:all_files",
"//hw/ip/tlul:all_files",
"//hw/ip/trial1:all_files",
"//hw/ip/uart:all_files",
"//hw/ip/usbdev:all_files",
],
)
11 changes: 6 additions & 5 deletions hw/ip/adc_ctrl/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

load("//rules/opentitan:hw.bzl", "opentitan_ip")

package(default_visibility = ["//visibility:public"])

filegroup(
name = "all_files",
srcs = glob(["**"]) + [
"//hw/ip/adc_ctrl/data:all_files",
],
opentitan_ip(
name = "adc_ctrl",
files = glob(["**"]),
hjson = "//hw/ip/adc_ctrl/data:hjson",
)
24 changes: 2 additions & 22 deletions hw/ip/adc_ctrl/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,7 @@

package(default_visibility = ["//visibility:public"])

load(
"//rules:autogen.bzl",
"autogen_hjson_c_header",
"autogen_hjson_rust_header",
)

autogen_hjson_c_header(
name = "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(["**"]),
name = "hjson",
srcs = ["adc_ctrl.hjson"],
)
11 changes: 6 additions & 5 deletions hw/ip/aes/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

load("//rules/opentitan:hw.bzl", "opentitan_ip")

package(default_visibility = ["//visibility:public"])

filegroup(
name = "all_files",
srcs = glob(["**"]) + [
"//hw/ip/aes/data:all_files",
],
opentitan_ip(
name = "aes",
files = glob(["**"]),
hjson = "//hw/ip/aes/data:hjson",
)

cc_library(
Expand Down
24 changes: 2 additions & 22 deletions hw/ip/aes/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,7 @@

package(default_visibility = ["//visibility:public"])

load(
"//rules:autogen.bzl",
"autogen_hjson_c_header",
"autogen_hjson_rust_header",
)

autogen_hjson_c_header(
name = "aes_c_regs",
srcs = [
"aes.hjson",
],
)

autogen_hjson_rust_header(
name = "aes_rust_regs",
srcs = [
"aes.hjson",
],
)

filegroup(
name = "all_files",
srcs = glob(["**"]),
name = "hjson",
srcs = ["aes.hjson"],
)
11 changes: 6 additions & 5 deletions hw/ip/aon_timer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

load("//rules/opentitan:hw.bzl", "opentitan_ip")

package(default_visibility = ["//visibility:public"])

filegroup(
name = "all_files",
srcs = glob(["**"]) + [
"//hw/ip/aon_timer/data:all_files",
],
opentitan_ip(
name = "aon_timer",
files = glob(["**"]),
hjson = "//hw/ip/aon_timer/data:hjson",
)
24 changes: 2 additions & 22 deletions hw/ip/aon_timer/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,7 @@

package(default_visibility = ["//visibility:public"])

load(
"//rules:autogen.bzl",
"autogen_hjson_c_header",
"autogen_hjson_rust_header",
)

autogen_hjson_c_header(
name = "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(["**"]),
name = "hjson",
srcs = ["aon_timer.hjson"],
)
11 changes: 6 additions & 5 deletions hw/ip/csrng/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

load("//rules/opentitan:hw.bzl", "opentitan_ip")

package(default_visibility = ["//visibility:public"])

filegroup(
name = "all_files",
srcs = glob(["**"]) + [
"//hw/ip/csrng/data:all_files",
],
opentitan_ip(
name = "csrng",
files = glob(["**"]),
hjson = "//hw/ip/csrng/data:hjson",
)
24 changes: 2 additions & 22 deletions hw/ip/csrng/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,7 @@

package(default_visibility = ["//visibility:public"])

load(
"//rules:autogen.bzl",
"autogen_hjson_c_header",
"autogen_hjson_rust_header",
)

autogen_hjson_c_header(
name = "csrng_c_regs",
srcs = [
"csrng.hjson",
],
)

autogen_hjson_rust_header(
name = "csrng_rust_regs",
srcs = [
"csrng.hjson",
],
)

filegroup(
name = "all_files",
srcs = glob(["**"]),
name = "hjson",
srcs = ["csrng.hjson"],
)
11 changes: 6 additions & 5 deletions hw/ip/edn/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

load("//rules/opentitan:hw.bzl", "opentitan_ip")

package(default_visibility = ["//visibility:public"])

filegroup(
name = "all_files",
srcs = glob(["**"]) + [
"//hw/ip/edn/data:all_files",
],
opentitan_ip(
name = "edn",
files = glob(["**"]),
hjson = "//hw/ip/edn/data:hjson",
)
24 changes: 2 additions & 22 deletions hw/ip/edn/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,7 @@

package(default_visibility = ["//visibility:public"])

load(
"//rules:autogen.bzl",
"autogen_hjson_c_header",
"autogen_hjson_rust_header",
)

autogen_hjson_c_header(
name = "edn_c_regs",
srcs = [
"edn.hjson",
],
)

autogen_hjson_rust_header(
name = "edn_rust_regs",
srcs = [
"edn.hjson",
],
)

filegroup(
name = "all_files",
srcs = glob(["**"]),
name = "hjson",
srcs = ["edn.hjson"],
)
11 changes: 6 additions & 5 deletions hw/ip/entropy_src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

load("//rules/opentitan:hw.bzl", "opentitan_ip")

package(default_visibility = ["//visibility:public"])

filegroup(
name = "all_files",
srcs = glob(["**"]) + [
"//hw/ip/entropy_src/data:all_files",
],
opentitan_ip(
name = "entropy_src",
files = glob(["**"]),
hjson = "//hw/ip/entropy_src/data:hjson",
)
Loading
Loading