Skip to content

Commit

Permalink
[cryptotest] Enable fpga_cw310_sival_rom_ext exec env
Browse files Browse the repository at this point in the history
Signed-off-by: Miles Dai <[email protected]>
  • Loading branch information
milesdai authored and moidx committed Dec 3, 2024
1 parent d30491d commit 85c3069
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 19 deletions.
27 changes: 24 additions & 3 deletions sw/device/tests/crypto/cryptotest/cryptotest.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,32 @@ load(
# - silicon
CRYPTOTEST_EXEC_ENVS = {
"//hw/top_earlgrey:fpga_cw310_test_rom": None,
"//hw/top_earlgrey:fpga_cw310_sival_rom_ext": None,
"//hw/top_earlgrey:fpga_cw340_test_rom": "fpga_cw340",
"//hw/top_earlgrey:silicon_owner_sival_rom_ext": "silicon",
}

FIRMWARE_DEPS = [
"//sw/device/tests/crypto/cryptotest/firmware:aes",
"//sw/device/tests/crypto/cryptotest/firmware:drbg",
"//sw/device/tests/crypto/cryptotest/firmware:ecdh",
"//sw/device/tests/crypto/cryptotest/firmware:ecdsa",
"//sw/device/tests/crypto/cryptotest/firmware:hash",
"//sw/device/tests/crypto/cryptotest/firmware:hmac",
"//sw/device/tests/crypto/cryptotest/firmware:kmac",
"//sw/device/tests/crypto/cryptotest/firmware:sphincsplus",
"//sw/device/lib/base:csr",
"//sw/device/lib/base:status",
"//sw/device/lib/crypto/drivers:entropy",
"//sw/device/lib/testing/test_framework:check",
"//sw/device/lib/testing/test_framework:ottf_main",
"//sw/device/lib/testing/test_framework:ujson_ottf",
"//sw/device/lib/ujson",

# Include all JSON commands.
"//sw/device/tests/crypto/cryptotest/json:commands",
]

def cryptotest(name, test_vectors, test_args, test_harness, skip_in_nightly_ci = False):
"""A macro for defining a CryptoTest test case.
Expand All @@ -36,9 +58,9 @@ def cryptotest(name, test_vectors, test_args, test_harness, skip_in_nightly_ci =
tags = ["skip_in_nightly_ci"] if skip_in_nightly_ci else []
opentitan_test(
name = name,
srcs = ["//sw/device/tests/crypto/cryptotest/firmware:firmware.c"],
fpga = fpga_params(
timeout = "long",
binaries = {"//sw/device/tests/crypto/cryptotest/firmware:firmware_fpga_cw310_test_rom": "firmware"},
data = test_vectors,
tags = tags,
test_cmd = """
Expand All @@ -48,7 +70,6 @@ def cryptotest(name, test_vectors, test_args, test_harness, skip_in_nightly_ci =
),
fpga_cw340 = fpga_params(
timeout = "long",
binaries = {"//sw/device/tests/crypto/cryptotest/firmware:firmware_fpga_cw340_test_rom": "firmware"},
tags = tags,
data = test_vectors,
test_cmd = """
Expand All @@ -59,12 +80,12 @@ def cryptotest(name, test_vectors, test_args, test_harness, skip_in_nightly_ci =
exec_env = CRYPTOTEST_EXEC_ENVS,
silicon = silicon_params(
timeout = "eternal",
binaries = {"//sw/device/tests/crypto/cryptotest/firmware:firmware_silicon_owner_sival_rom_ext": "firmware"},
tags = tags,
data = test_vectors,
test_cmd = """
--bootstrap={firmware}
""" + test_args,
test_harness = test_harness,
),
deps = FIRMWARE_DEPS,
)
27 changes: 11 additions & 16 deletions sw/device/tests/crypto/cryptotest/firmware/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -178,22 +178,17 @@ FIRMWARE_DEPS = [
"//sw/device/tests/crypto/cryptotest/json:commands",
]

[
opentitan_binary(
name = "firmware_{}".format(exec_env),
testonly = True,
srcs = [":firmware.c"],
exec_env = [
"//hw/top_earlgrey:{}".format(exec_env),
],
deps = FIRMWARE_DEPS,
)
for exec_env in [
"fpga_cw310_test_rom",
"fpga_cw340_test_rom",
"silicon_owner_sival_rom_ext",
]
]
opentitan_binary(
name = "firmware",
testonly = True,
srcs = [":firmware.c"],
exec_env = [
"//hw/top_earlgrey:fpga_cw310",
"//hw/top_earlgrey:fpga_cw340",
"//hw/top_earlgrey:silicon_owner_sival_rom_ext",
],
deps = FIRMWARE_DEPS,
)

opentitan_test(
name = "chip_pen_test",
Expand Down

0 comments on commit 85c3069

Please sign in to comment.