Skip to content

Commit

Permalink
[hw/top] Add support for english_breakfast
Browse files Browse the repository at this point in the history
Signed-off-by: Amaury Pouly <[email protected]>
  • Loading branch information
pamaury committed Sep 20, 2024
1 parent 02697ba commit 3f6dbf0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 9 additions & 0 deletions hw/top/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,31 @@ load("//hw/top:alias_top.bzl", "alias_top", "alias_ip_sw")
alias_top(
name = "top_lib",
earlgrey = "//hw/top_earlgrey/sw/autogen:top_earlgrey",
englishbreakfast = "//hw/top_englishbreakfast:top_lib",
)

alias_top(
name = "dt_api",
earlgrey = "//hw/top_earlgrey/sw/autogen:dt_api",
englishbreakfast = "//hw/top_englishbreakfast:dt_api",
)

alias_top(
name = "devicetables",
earlgrey = "//hw/top_earlgrey/sw/autogen:devicetables",
englishbreakfast = "//hw/top_englishbreakfast:devicetables",
)

alias_ip_sw(
name = "sensor_ctrl",
earlgrey = "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl",
englishbreakfast = "//hw/top_englishbreakfast/ip/sensor_ctrl/data:sensor_ctrl",
)

alias_ip_sw(
name = "ast",
earlgrey = "//hw/top_earlgrey/ip/ast/data:ast",
englishbreakfast = "//hw/top_englishbreakfast/ip/ast/data:ast",
)

IP_AUTOGEN = [
Expand All @@ -45,6 +50,7 @@ IP_AUTOGEN = [
[
alias_ip_sw(
name = "{}".format(ipname),
englishbreakfast = "//hw/top_englishbreakfast:{}".format(ipname),
earlgrey = "//hw/top_earlgrey/ip_autogen/{}:{}".format(ipname, ipname),
)
for ipname in IP_AUTOGEN
Expand All @@ -53,15 +59,18 @@ IP_AUTOGEN = [
# The following IPs do not follow the regular scheme above for earlgrey and should ideally be made more uniform.
alias_ip_sw(
name = "rv_plic",
englishbreakfast = "//hw/top_englishbreakfast:rv_plic",
earlgrey = "//hw/top_earlgrey:rv_plic",
)

alias_ip_sw(
name = "alert_handler",
englishbreakfast = "//hw/top_englishbreakfast:alert_handler",
earlgrey = "//hw/top_earlgrey:alert_handler",
)

alias_ip_sw(
name = "pinmux",
englishbreakfast = "//hw/top_englishbreakfast:pinmux",
earlgrey = "//hw/top_earlgrey/ip/pinmux/data/autogen:pinmux",
)
8 changes: 5 additions & 3 deletions hw/top/alias_top.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

def alias_top(name, earlgrey):
def alias_top(name, earlgrey, englishbreakfast):
native.alias(
name = name,
actual = select({
"//sw/device:is_english_breakfast": englishbreakfast,
"//conditions:default": earlgrey,
}),
)

def alias_ip_sw(name, earlgrey):
for suffix in ["c_regs", "rust_regs"]:
def alias_ip_sw(name, earlgrey, englishbreakfast):
for suffix in ["c_regs", "rust_regs", "dt"]:
alias_top(
name = "{}_{}".format(name, suffix),
earlgrey = "{}_{}".format(earlgrey, suffix),
englishbreakfast = "{}_{}".format(englishbreakfast, suffix),
)

0 comments on commit 3f6dbf0

Please sign in to comment.