Skip to content

Commit

Permalink
[topgen] Introduce an OPENTITAN_IS_<top> define per top
Browse files Browse the repository at this point in the history
This define is available as soon as one includes the top's library.

Signed-off-by: Amaury Pouly <[email protected]>
  • Loading branch information
pamaury committed Jan 10, 2025
1 parent 5f9153e commit 6617b03
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions hw/top_darjeeling/sw/autogen/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cc_library(
"top_darjeeling.h",
"top_darjeeling_memory.h",
],
defines = ["OPENTITAN_IS_DARJEELING"],
target_compatible_with = opentitan_require_top("darjeeling"),
)

Expand Down
1 change: 1 addition & 0 deletions hw/top_earlgrey/sw/autogen/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cc_library(
"top_earlgrey.h",
"top_earlgrey_memory.h",
],
defines = ["OPENTITAN_IS_EARLGREY"],
target_compatible_with = opentitan_require_top("earlgrey"),
)

Expand Down
1 change: 1 addition & 0 deletions util/topgen/templates/toplevel_BUILD.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cc_library(
"${top_name}.h",
"${top_name}_memory.h",
],
defines = ["OPENTITAN_IS_${top["name"].upper()}"],
target_compatible_with = opentitan_require_top("${top["name"]}"),
)

Expand Down

0 comments on commit 6617b03

Please sign in to comment.