Merge changes from topic "soundstream-bm"
* changes:
Updates for importing matcha to another Bazel project
Add support for resuming at PC in dif_ml_top
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/dif/dif_ml_top.c b/sw/device/lib/dif/dif_ml_top.c
index f2ca845..9580874 100644
--- a/sw/device/lib/dif/dif_ml_top.c
+++ b/sw/device/lib/dif/dif_ml_top.c
@@ -45,6 +45,19 @@
return kDifOk;
}
+dif_result_t dif_ml_top_resume_ctrl_en(const dif_ml_top_t *ml_top, uint32_t pc) {
+ if (ml_top == NULL) {
+ return kDifBadArg;
+ }
+ if (pc >= 0x400000) {
+ return kDifBadArg;
+ }
+ uint32_t ctrl_en = 0;
+ ctrl_en = bitfield_field32_write(ctrl_en, ML_TOP_CTRL_PC_START_FIELD, pc);
+ mmio_region_write32(ml_top->base_addr, ML_TOP_CTRL_REG_OFFSET, ctrl_en);
+ return kDifOk;
+}
+
dif_result_t dif_ml_top_read_ctrl_en(const dif_ml_top_t *ml_top, uint32_t *result) {
if (ml_top == NULL) {
return kDifBadArg;
diff --git a/sw/device/lib/dif/dif_ml_top.h b/sw/device/lib/dif/dif_ml_top.h
index 81f079c..57ed19e 100644
--- a/sw/device/lib/dif/dif_ml_top.h
+++ b/sw/device/lib/dif/dif_ml_top.h
@@ -34,6 +34,7 @@
// ML_Top Control Register
dif_result_t dif_ml_top_reset_ctrl_en(const dif_ml_top_t *ml_top);
dif_result_t dif_ml_top_release_ctrl_en(const dif_ml_top_t *ml_top);
+dif_result_t dif_ml_top_resume_ctrl_en(const dif_ml_top_t *ml_top, uint32_t pc);
dif_result_t dif_ml_top_read_ctrl_en(const dif_ml_top_t *ml_top,
uint32_t *result);
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