Skip to content

Commit

Permalink
[hw/top] Introduce new targets for C/Rust headers using multitop
Browse files Browse the repository at this point in the history
These new targets are multitop aware and will replace the existing
ones. Note that those targets are marked with compatibility
requirements on the top. For example, //hw/top:mbx_c_regs cannot
be compiled with --//hw/top=earlgrey. This guarantees that by
transitivity, targets that depends on, .e.g mbx headers, can only
be compiled on relevant targets.

Signed-off-by: Amaury Pouly <[email protected]>
  • Loading branch information
pamaury committed Dec 12, 2024
1 parent 1388f76 commit 346232b
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion hw/top/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

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_TOPS", "ALL_TOP_NAMES")
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"])

Expand Down Expand Up @@ -79,3 +84,25 @@ alias(
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
]

0 comments on commit 346232b

Please sign in to comment.