Skip to content

Commit 7403c91

Browse files
committed
[cov,rom_ext] Add coverage view for ROM_EXT
This change adds `coverage_view_test` targets for all `ROM_EXT` variations and slots in the `rom_ext` BUILD file. Change-Id: I1d1bbfd83982f46df5610dfa1fe71ed9d44e5065 Signed-off-by: Yi-Hsuan Deng <[email protected]>
1 parent 052b019 commit 7403c91

File tree

1 file changed

+51
-0
lines changed
  • sw/device/silicon_creator/rom_ext/sival

1 file changed

+51
-0
lines changed

sw/device/silicon_creator/rom_ext/sival/BUILD

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
66
load("//rules:const.bzl", "CONST", "hex")
77
load("//rules:manifest.bzl", "manifest")
88
load("//rules:signing.bzl", "offline_presigning_artifacts", "offline_signature_attach")
9+
load("//rules/coverage:view.bzl", "coverage_view_test")
910
load("//rules/opentitan:defs.bzl", "opentitan_binary")
1011
load(
1112
"//sw/device/silicon_creator/rom_ext:defs.bzl",
@@ -105,6 +106,56 @@ manifest(d = {
105106
for slot in SLOTS
106107
]
107108

109+
ROM_EXT_CONFIGS = {
110+
"dice_x509_xmodem": {
111+
"dice": "dice_x509",
112+
"deps": ["//sw/device/silicon_creator/lib/rescue:rescue_xmodem"],
113+
},
114+
"dice_cwt_spidfu": {
115+
"dice": "dice_cwt",
116+
"deps": ["//sw/device/silicon_creator/lib/rescue:rescue_spidfu"],
117+
},
118+
"dice_x509_usbdfu": {
119+
"dice": "dice_x509",
120+
"deps": ["//sw/device/silicon_creator/lib/rescue:rescue_usbdfu"],
121+
},
122+
}
123+
124+
[
125+
opentitan_binary(
126+
name = "rom_ext_prod_{}".format(name),
127+
exec_env = [
128+
"//hw/top_earlgrey:silicon_creator",
129+
],
130+
extra_bazel_features = [
131+
"minsize",
132+
"use_lld",
133+
],
134+
linker_script = "//sw/device/silicon_creator/rom_ext:ld_slot_virtual",
135+
linkopts = [
136+
"$(location //sw/device/silicon_creator/rom_ext:rom_ext_{})".format(config["dice"]),
137+
"$(location //sw/device/lib/crt)",
138+
],
139+
deps = [
140+
# The sival_owner C library is excluded from the real ROM_EXT,
141+
# as chips maintain their ownership configuration in flash.
142+
"//sw/device/lib/crt",
143+
"//sw/device/silicon_creator/lib:manifest_def",
144+
"//sw/device/silicon_creator/rom_ext:rom_ext_{}".format(config["dice"]),
145+
"//sw/device/silicon_creator/rom_ext/imm_section:main_section_{}_slot_virtual".format(config["dice"]),
146+
] + config["deps"],
147+
)
148+
for name, config in ROM_EXT_CONFIGS.items()
149+
]
150+
151+
[
152+
coverage_view_test(
153+
name = "rom_ext_prod_{}_coverage_view".format(name),
154+
elf = "rom_ext_prod_{}".format(name),
155+
)
156+
for name in ROM_EXT_CONFIGS.keys()
157+
]
158+
108159
offline_presigning_artifacts(
109160
name = "presigning",
110161
testonly = True,

0 commit comments

Comments
 (0)