| # 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", "NEXUS_CORE_TARGETS", "matcha_extflash_tar", "sec_flash_binary", "smc_flash_binary") |
| |
| sec_flash_binary( |
| name = "kelvin_test_sc_extflash", |
| srcs = [ |
| "kelvin_test_sc.c", |
| "kelvin_test_sc_loaders.h", |
| "kelvin_test_sc_loaders_extflash.c", |
| ], |
| copts = [ |
| "-nostdlib", |
| "-ffreestanding", |
| ], |
| per_device_deps = { |
| "fpga_nexus": [NEXUS_CORE_TARGETS.get("secure_core")], |
| }, |
| deps = [ |
| "//hw/top_matcha/ip/ml_top/data:ml_top_regs", |
| "//hw/top_matcha/sw/autogen:top_matcha", |
| "//sw/device/lib:spi_flash", |
| "//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:ottf_test_config", |
| "@lowrisc_opentitan//sw/device/silicon_creator/lib:manifest_def", |
| ], |
| ) |
| |
| smc_flash_binary( |
| name = "kelvin_test_smc", |
| srcs = [ |
| "kelvin_test_smc.c", |
| ], |
| copts = [ |
| "-nostdlib", |
| "-ffreestanding", |
| ], |
| per_device_deps = { |
| "fpga_nexus": [NEXUS_CORE_TARGETS.get("smc")], |
| }, |
| var_name = "kelvin_test_smc_fpga_nexus_bin", |
| deps = [ |
| "//hw/top_matcha/sw/autogen:top_matcha", |
| "//sw/device/lib/testing/test_framework:ottf_start_smc", |
| "//sw/device/lib/testing/test_framework:test_util", |
| "@lowrisc_opentitan//sw/device/lib/testing/test_framework:ottf_test_config", |
| ], |
| ) |
| |
| KELVIN_BINS = [ |
| "branch_div_test_elf", |
| "branch_modulo_test_elf", |
| "getvl_test_elf", |
| "rv32ui_add_elf", |
| "rv32ui_addi_elf", |
| "rv32ui_and_elf", |
| "rv32ui_andi_elf", |
| "rv32ui_auipc_elf", |
| "rv32ui_beq_elf", |
| "rv32ui_bge_elf", |
| "rv32ui_bgeu_elf", |
| "rv32ui_blt_elf", |
| "rv32ui_bltu_elf", |
| "rv32ui_bne_elf", |
| "rv32ui_fence_i_elf", |
| "rv32ui_jalr_elf", |
| "rv32ui_jal_elf", |
| "rv32ui_lb_elf", |
| "rv32ui_lbu_elf", |
| "rv32ui_lh_elf", |
| "rv32ui_lhu_elf", |
| "rv32ui_lui_elf", |
| "rv32ui_lw_elf", |
| "rv32ui_ori_elf", |
| "rv32ui_or_elf", |
| "rv32ui_sb_elf", |
| "rv32ui_sh_elf", |
| "rv32ui_simple_elf", |
| "rv32ui_slli_elf", |
| "rv32ui_sll_elf", |
| "rv32ui_slti_elf", |
| "rv32ui_sltiu_elf", |
| "rv32ui_slt_elf", |
| "rv32ui_sltu_elf", |
| "rv32ui_srai_elf", |
| "rv32ui_sra_elf", |
| "rv32ui_srli_elf", |
| "rv32ui_srl_elf", |
| "rv32ui_sub_elf", |
| "rv32ui_sw_elf", |
| "rv32ui_xori_elf", |
| "rv32ui_xor_elf", |
| "rv32um_div_elf", |
| "rv32um_divu_elf", |
| "rv32um_mul_elf", |
| "rv32um_mulh_elf", |
| "rv32um_mulhsu_elf", |
| "rv32um_mulhu_elf", |
| "rv32um_rem_elf", |
| "rv32um_remu_elf", |
| ] |
| |
| [matcha_extflash_tar( |
| name = "kelvin_fpga_test_{}_extflash".format(test), |
| kelvin_binary = "@kelvin-binary//:{}.bin".format(test), |
| sc_binary = ":kelvin_test_sc_extflash_fpga_nexus_bin", |
| smc_binary = ":kelvin_test_smc_fpga_nexus_bin", |
| tags = [ |
| "kelvin_fpga", |
| ], |
| ) for test in KELVIN_BINS] |