From 85c30699696544c06f7aad99bda3aff1c747e190 Mon Sep 17 00:00:00 2001 From: Miles Dai Date: Wed, 27 Nov 2024 19:56:01 +0000 Subject: [PATCH] [cryptotest] Enable fpga_cw310_sival_rom_ext exec env Signed-off-by: Miles Dai --- .../tests/crypto/cryptotest/cryptotest.bzl | 27 ++++++++++++++++--- .../tests/crypto/cryptotest/firmware/BUILD | 27 ++++++++----------- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/sw/device/tests/crypto/cryptotest/cryptotest.bzl b/sw/device/tests/crypto/cryptotest/cryptotest.bzl index 910279a0f7f53..74d6e484c1437 100644 --- a/sw/device/tests/crypto/cryptotest/cryptotest.bzl +++ b/sw/device/tests/crypto/cryptotest/cryptotest.bzl @@ -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. @@ -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 = """ @@ -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 = """ @@ -59,7 +80,6 @@ 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 = """ @@ -67,4 +87,5 @@ def cryptotest(name, test_vectors, test_args, test_harness, skip_in_nightly_ci = """ + test_args, test_harness = test_harness, ), + deps = FIRMWARE_DEPS, ) diff --git a/sw/device/tests/crypto/cryptotest/firmware/BUILD b/sw/device/tests/crypto/cryptotest/firmware/BUILD index 30e34191eb27a..4b6699de3037f 100644 --- a/sw/device/tests/crypto/cryptotest/firmware/BUILD +++ b/sw/device/tests/crypto/cryptotest/firmware/BUILD @@ -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",