Skip to content

Commit

Permalink
[bazel] Eliminate opentitan_functest references
Browse files Browse the repository at this point in the history
1. Eliminate references to opentitan_functest().
2. Eliminate explicit splices in favor of the implied universal splice.

Signed-off-by: Chris Frantz <[email protected]>
  • Loading branch information
cfrantz committed Nov 17, 2023
1 parent beac109 commit 63b46d3
Showing 1 changed file with 8 additions and 32 deletions.
40 changes: 8 additions & 32 deletions sw/device/silicon_creator/manuf/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ load(
"RSA_ONLY_KEY_STRUCTS",
)
load("//rules:otp.bzl", "otp_image")
load("//rules:splice.bzl", "bitstream_splice")
load(
"//rules/opentitan:defs.bzl",
"cw310_jtag_params",
Expand Down Expand Up @@ -158,27 +157,13 @@ opentitan_test(
for i in range(0, 8)
]

# Bitstream with ROM and above OTP image that is in the test_unlocked* LC state
# with ROM execution disabled.
[
bitstream_splice(
name = "bitstream_rom_exec_disabled_test_unlocked{}".format(i),
src = "//hw/bitstream:rom_with_fake_keys",
data = ":otp_img_rom_exec_disabled_test_unlocked{}".format(i),
meminfo = "//hw/bitstream:otp_mmi",
update_usr_access = True,
visibility = ["//visibility:private"],
)
for i in range(0, 8)
]

[
opentitan_test(
name = "manuf_cp_yield_test_functest_{}".format(lc_state.lower()),
srcs = ["//sw/device/silicon_creator/rom/e2e:empty_test.c"],
cw310 = cw310_jtag_params(
bitstream = ":bitstream_rom_exec_disabled_{}".format(lc_state.lower()),
lc_state = lc_state, # will be expanded in test_cmd
otp = ":otp_img_rom_exec_disabled_{}".format(lc_state.lower()),
tags = ["manuf"],
test_cmd = "--initial-lc-state={lc_state}",
test_harness = "//sw/host/tests/manuf/manuf_cp_yield_test",
Expand Down Expand Up @@ -216,15 +201,15 @@ cc_library(
)

# We are using a bitstream with ROM execution disabled so the contents of flash
# does not matter but opentitan_functest() is unhappy if we don't provide one.
# does not matter but opentitan_test() is unhappy if we don't provide one.
# Additionally, ROM execution is disabled in the OTP image we use so we do not
# attempt to bootstrap.
[
opentitan_test(
name = "manuf_sram_program_crc_{}_functest".format(lc_state.lower()),
srcs = ["sram_empty_functest.c"],
cw310 = cw310_jtag_params(
bitstream = ":bitstream_rom_exec_disabled_{}".format(lc_state.lower()),
otp = ":otp_img_rom_exec_disabled_{}".format(lc_state.lower()),
test_cmd = "--elf={firmware}",
test_harness = "//sw/host/tests/manuf/manuf_sram_program_crc_check",
),
Expand Down Expand Up @@ -307,7 +292,7 @@ opentitan_binary(
binaries = {
":sram_device_info_flash_wr_functest": "sram_program",
},
bitstream = "bitstream_rom_exec_disabled_{}".format(init_lc_state.lower()),
otp = ":otp_img_rom_exec_disabled_{}".format(init_lc_state.lower()),
tags = ["manuf"],
target_lc_state = target_lc_state, # will be expanded in test_cmd
test_cmd = """
Expand Down Expand Up @@ -378,7 +363,7 @@ opentitan_binary(
)

# We are using a bitstream with disabled execution so the content of the flash
# does not matter but opentitan_functest() is unhappy if we don't provide one.
# does not matter but opentitan_test() is unhappy if we don't provide one.
# Additionally, ROM execution is disabled in the OTP image we use so we do not
# attempt to bootstrap.
[
Expand All @@ -389,7 +374,7 @@ opentitan_binary(
binaries = {
":sram_exec_test": "sram_program",
},
bitstream = ":bitstream_rom_exec_disabled_{}".format(lc_state.lower()),
otp = ":otp_img_rom_exec_disabled_{}".format(lc_state.lower()),
tags = ["manuf"],
test_cmd = """
--elf={sram_program}
Expand Down Expand Up @@ -422,7 +407,7 @@ opentitan_test(
name = "manuf_cp_test_lock_functest",
srcs = ["//sw/device/silicon_creator/rom/e2e:empty_test.c"],
cw310 = cw310_jtag_params(
bitstream = ":bitstream_otp_ctrl_functest",
otp = ":otp_img_otp_ctrl_functest",
tags = ["manuf"],
test_harness = "//sw/host/tests/manuf/manuf_cp_test_lock",
),
Expand All @@ -444,20 +429,11 @@ otp_image(
visibility = ["//visibility:private"],
)

bitstream_splice(
name = "bitstream_otp_ctrl_functest",
src = "//hw/bitstream:rom_with_fake_keys",
data = ":otp_img_otp_ctrl_functest",
meminfo = "//hw/bitstream:otp_mmi",
update_usr_access = True,
visibility = ["//visibility:private"],
)

opentitan_test(
name = "otp_ctrl_functest",
srcs = [":empty_functest.c"],
cw310 = cw310_jtag_params(
bitstream = ":bitstream_otp_ctrl_functest",
otp = ":otp_img_otp_ctrl_functest",
tags = ["manuf"],
test_harness = "//sw/host/tests/manuf/otp_ctrl:otp_ctrl",
),
Expand Down

0 comments on commit 63b46d3

Please sign in to comment.