Patches for benchmark on ASIC - Pick correct device lib, instead of always using nexus_fpga - Load SMC binary if running on ASIC Change-Id: I5c2e0136ecec1d2aed502888ee1e5937a6390548
diff --git a/benchmarks/benchmark_sec.c b/benchmarks/benchmark_sec.c index f5b6e72..b1b5040 100644 --- a/benchmarks/benchmark_sec.c +++ b/benchmarks/benchmark_sec.c
@@ -62,7 +62,7 @@ "kelvin.bin", (void*)TOP_MATCHA_ML_TOP_DMEM_BASE_ADDR, (TOP_MATCHA_ML_TOP_DMEM_BASE_ADDR + TOP_MATCHA_RAM_ML_DMEM_SIZE_BYTES))); - if (kDeviceType == kDeviceFpgaNexus) { + if (kDeviceType == kDeviceFpgaNexus || kDeviceType == kDeviceAsic) { LOG_INFO("Loading SMC binary"); memcpy((void*)TOP_MATCHA_RAM_SMC_BASE_ADDR, smc_bin, smc_bin_len); }
diff --git a/benchmarks/benchmarks.bzl b/benchmarks/benchmarks.bzl index 5556b17..3a269e1 100644 --- a/benchmarks/benchmarks.bzl +++ b/benchmarks/benchmarks.bzl
@@ -15,7 +15,7 @@ """Rules to run Kelvin benchmarks""" load("@kelvin_sw//build_tools/bazel:kelvin.bzl","kelvin_binary", "kelvin_test", "generate_cc_arrays") -load("@matcha//rules:matcha.bzl", "bin_to_c_file", "matcha_extflash_tar", "sec_flash_binary", "smc_flash_binary", "NEXUS_CORE_TARGETS") +load("@matcha//rules:matcha.bzl", "bin_to_c_file", "matcha_extflash_tar", "sec_flash_binary", "smc_flash_binary", "device_deps") def kelvin_benchmark_simulator( name, @@ -130,7 +130,7 @@ ], copts = ["-DBENCHMARK_NAME={}".format(name)], per_device_deps = { - device_type: [NEXUS_CORE_TARGETS.get("smc")], + device_type: device_deps("smc").get(device_type), }, deps = [ "@matcha//sw/device/lib/dif:ml_top", @@ -157,7 +157,7 @@ ], copts = ["-DBENCHMARK_NAME={}".format(name)], per_device_deps = { - device_type: [NEXUS_CORE_TARGETS.get("secure_core")], + device_type: device_deps("secure_core").get(device_type), }, deps = [ "@matcha//sw/device/lib:spi_flash",