From 90e9f5844c3ce3c493a5133623be0f9cf1bd50d3 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 15 Oct 2021 11:34:26 +0200 Subject: [PATCH] occamy: Connect `chip_id` to SoC regs (pulp-platform/snitch#298) * Add preloading flag to `fesvr` * Add `chip_id` to SoC regs * lint: C++ sources --- target/common/test/rtl_lib.cc | 6 ++++++ target/common/test/sim.hh | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/target/common/test/rtl_lib.cc b/target/common/test/rtl_lib.cc index c098d0b119..18ba580290 100644 --- a/target/common/test/rtl_lib.cc +++ b/target/common/test/rtl_lib.cc @@ -25,6 +25,12 @@ namespace sim { void sim_thread_main(void *arg) { ((Sim *)arg)->main(); } Sim::Sim(int argc, char **argv) : htif_t(argc, argv) { + for (auto i = 1; i < argc; ++i) { + if (strcmp(argv[i], "--disable_preloading") == 0) { + printf("fesvr-based binary preloading disabled\n"); + disable_preloading = true; + } + } host = context_t::current(); target.init(sim_thread_main, this); target.switch_to(); diff --git a/target/common/test/sim.hh b/target/common/test/sim.hh index 37bef7f35a..82bcade52c 100644 --- a/target/common/test/sim.hh +++ b/target/common/test/sim.hh @@ -29,6 +29,9 @@ struct Sim : htif_t { // HTIF overrides. Calls into the global memory. void read_chunk(addr_t taddr, size_t len, void *dst); void write_chunk(addr_t taddr, size_t len, const void *src); + bool is_address_preloaded(addr_t taddr, size_t len) override { + return disable_preloading; + } void idle(); @@ -43,6 +46,7 @@ struct Sim : htif_t { context_t *host; context_t target; bool vlt_vcd = false; + bool disable_preloading = false; }; void sim_thread_main(void *arg);