Updates for importing matcha to another Bazel project - Add SEARCH_DIR directives in linker scripts, so they can find the memory include when we're importing this repo. - Point the arch-specific libraries to the fully-qualified names. Change-Id: I26ef363f91c80037ad1f8fdadfffca0a86d4b892
diff --git a/rules/matcha.bzl b/rules/matcha.bzl index 8caf9aa..24b6093 100644 --- a/rules/matcha.bzl +++ b/rules/matcha.bzl
@@ -34,23 +34,23 @@ # List of supported riscv core targets. VERILATOR_CORE_TARGETS = { - "secure_core": "//sw/device/lib/arch:sim_verilator", - "smc": "//sw/device/lib/arch:smc_sim_verilator", + "secure_core": "@matcha//sw/device/lib/arch:sim_verilator", + "smc": "@matcha//sw/device/lib/arch:smc_sim_verilator", } DV_CORE_TARGETS = { - "secure_core": "//sw/device/lib/arch:sim_dv", - "smc": "//sw/device/lib/arch:smc_sim_dv", + "secure_core": "@matcha//sw/device/lib/arch:sim_dv", + "smc": "@matcha//sw/device/lib/arch:smc_sim_dv", } NEXUS_CORE_TARGETS = { - "secure_core": "//sw/device/lib/arch:sc_fpga_nexus", - "smc": "//sw/device/lib/arch:smc_fpga_nexus", + "secure_core": "@matcha//sw/device/lib/arch:sc_fpga_nexus", + "smc": "@matcha//sw/device/lib/arch:smc_fpga_nexus", } ASIC_CORE_TARGETS = { - "secure_core": "//sw/device/lib/arch:sc_asic", - "smc": "//sw/device/lib/arch:smc_asic", + "secure_core": "@matcha//sw/device/lib/arch:sc_asic", + "smc": "@matcha//sw/device/lib/arch:smc_asic", } MATCHA_COPTS = [
diff --git a/sw/device/lib/testing/test_framework/ottf_sc.ld b/sw/device/lib/testing/test_framework/ottf_sc.ld index 49bd456..d51172e 100644 --- a/sw/device/lib/testing/test_framework/ottf_sc.ld +++ b/sw/device/lib/testing/test_framework/ottf_sc.ld
@@ -9,7 +9,7 @@ * * This linker script generates a binary to run rom. */ - +SEARCH_DIR ( external/matcha ) INCLUDE hw/top_matcha/sw/autogen/top_matcha_memory.ld /**
diff --git a/sw/device/lib/testing/test_framework/ottf_smc.ld b/sw/device/lib/testing/test_framework/ottf_smc.ld index ed83c13..4538ca4 100644 --- a/sw/device/lib/testing/test_framework/ottf_smc.ld +++ b/sw/device/lib/testing/test_framework/ottf_smc.ld
@@ -10,6 +10,7 @@ * This linker script generates a binary to run rom. */ +SEARCH_DIR ( external/matcha ) INCLUDE hw/top_matcha/sw/autogen/top_matcha_memory.ld MEMORY { virtual(rx): ORIGIN = 0x10000, LENGTH = 0x400000