| # Copyright Google LLC 2023 |
| # Copyright lowRISC contributors. |
| # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| # SPDX-License-Identifier: Apache-2.0 |
| |
| load( |
| "//rules:matcha.bzl", |
| "ASIC_CORE_TARGETS", |
| "NEXUS_CORE_TARGETS", |
| "sec_flash_binary", |
| "smc_flash_binary", |
| ) |
| |
| # At the moment, this is only set up to run on the fpga_nexus target. |
| sec_flash_binary( |
| name = "ml_sram_readiness", |
| srcs = [ |
| "ml_sram_readiness_smc_fpga_nexus_bin_c.h", |
| "simple_sc.c", |
| ], |
| copts = [ |
| "-nostdlib", |
| "-ffreestanding", |
| ], |
| defines = [ |
| "SRAM_READINESS", |
| ], |
| per_device_deps = { |
| "fpga_nexus": [NEXUS_CORE_TARGETS.get("secure_core")], |
| }, |
| deps = [ |
| "//hw/top_matcha/sw:top_matcha", |
| "//hw/top_matcha/ip/ml_top/data:ml_top_regs", |
| "//sw/device/lib/dif:smc_ctrl", |
| "//sw/device/lib/testing/test_framework:ottf_start", |
| "//sw/device/lib/testing/test_framework:test_util", |
| "@lowrisc_opentitan//sw/device/lib/testing/test_framework:check", |
| "@lowrisc_opentitan//sw/device/lib/testing/test_framework:ottf_test_config", |
| "@lowrisc_opentitan//sw/device/silicon_creator/lib:manifest_def", |
| ], |
| ) |
| |
| sec_flash_binary( |
| name = "kelvin_checksum", |
| srcs = [ |
| "kelvin_checksum_smc_fpga_nexus_bin_c.h", |
| "simple_sc.c", |
| ], |
| copts = [ |
| "-nostdlib", |
| "-ffreestanding", |
| ], |
| defines = [ |
| "KELVIN_CHECKSUM", |
| ], |
| per_device_deps = { |
| "fpga_nexus": [NEXUS_CORE_TARGETS.get("secure_core")], |
| }, |
| deps = [ |
| "//hw/top_matcha/sw:top_matcha", |
| "//hw/top_matcha/ip/ml_top/data:ml_top_regs", |
| "//sw/device/lib/dif:smc_ctrl", |
| "//sw/device/lib/testing/test_framework:ottf_start", |
| "//sw/device/lib/testing/test_framework:test_util", |
| "@lowrisc_opentitan//sw/device/lib/testing/test_framework:check", |
| "@lowrisc_opentitan//sw/device/lib/testing/test_framework:ottf_test_config", |
| "@lowrisc_opentitan//sw/device/silicon_creator/lib:manifest_def", |
| ], |
| ) |
| |
| sec_flash_binary( |
| name = "kelvin_model", |
| srcs = [ |
| "kelvin_model_smc_fpga_nexus_bin_c.h", |
| "simple_sc.c", |
| ], |
| copts = [ |
| "-nostdlib", |
| "-ffreestanding", |
| ], |
| defines = [ |
| "KELVIN_MODEL", |
| ], |
| per_device_deps = { |
| "fpga_nexus": [NEXUS_CORE_TARGETS.get("secure_core")], |
| }, |
| deps = [ |
| "//hw/top_matcha/sw:top_matcha", |
| "//hw/top_matcha/ip/ml_top/data:ml_top_regs", |
| "//sw/device/lib/dif:smc_ctrl", |
| "//sw/device/lib/testing/test_framework:ottf_start", |
| "//sw/device/lib/testing/test_framework:test_util", |
| "@lowrisc_opentitan//sw/device/lib/testing/test_framework:check", |
| "@lowrisc_opentitan//sw/device/lib/testing/test_framework:ottf_test_config", |
| "@lowrisc_opentitan//sw/device/silicon_creator/lib:manifest_def", |
| ], |
| ) |
| |
| smc_flash_binary( |
| name = "ml_sram_readiness_smc", |
| srcs = [ |
| "ml_sram_readiness_smc.c", |
| "//sw/device/examples/testdata/hps_images:hps_images.h", |
| ], |
| copts = [ |
| "-nostdlib", |
| "-ffreestanding", |
| ], |
| per_device_deps = { |
| "fpga_nexus": [NEXUS_CORE_TARGETS.get("smc")], |
| }, |
| deps = [ |
| "//sw/device/tests:test_lib_smc", |
| "@lowrisc_opentitan//sw/device/silicon_creator/lib:manifest_def", |
| ], |
| ) |
| |
| smc_flash_binary( |
| name = "kelvin_checksum_smc", |
| srcs = [ |
| "kelvin_checksum_smc.c", |
| "//sw/device/examples/testdata/hps_images:hps_images.h", |
| "//sw/device/tests/kelvin:kelvin_checksum_bin.h", |
| ], |
| copts = [ |
| "-nostdlib", |
| "-ffreestanding", |
| ], |
| per_device_deps = { |
| "fpga_nexus": [NEXUS_CORE_TARGETS.get("smc")], |
| "asic": [ASIC_CORE_TARGETS.get("smc")], |
| }, |
| deps = [ |
| "//hw/top_matcha/sw:top_matcha", |
| "//hw/top_matcha/ip/ml_top/data:ml_top_regs", |
| "//sw/device/lib/dif:ml_top", |
| "//sw/device/lib/dif:rv_plic_smc", |
| "//sw/device/tests:test_lib_smc", |
| "@lowrisc_opentitan//sw/device/silicon_creator/lib:manifest_def", |
| ], |
| ) |
| |
| smc_flash_binary( |
| name = "kelvin_model_smc", |
| srcs = [ |
| "kelvin_model_smc.c", |
| "//sw/device/examples/testdata:kelvin_model_ml_bin.h", |
| "//sw/device/examples/testdata/hps_images:hps_images.h", |
| ], |
| copts = [ |
| "-nostdlib", |
| "-ffreestanding", |
| ], |
| per_device_deps = { |
| "fpga_nexus": [NEXUS_CORE_TARGETS.get("smc")], |
| }, |
| deps = [ |
| "//hw/top_matcha/ip/ml_top/data:ml_top_regs", |
| "//sw/device/lib/dif:ml_top", |
| "//sw/device/lib/dif:rv_plic_smc", |
| "//sw/device/tests:test_lib_smc", |
| "@lowrisc_opentitan//sw/device/silicon_creator/lib:manifest_def", |
| ], |
| ) |