aboutsummaryrefslogtreecommitdiff
path: root/riscv/sim.cc
diff options
context:
space:
mode:
Diffstat (limited to 'riscv/sim.cc')
-rw-r--r--riscv/sim.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/riscv/sim.cc b/riscv/sim.cc
index 2eb623a..ffed440 100644
--- a/riscv/sim.cc
+++ b/riscv/sim.cc
@@ -26,19 +26,23 @@ static void handle_signal(int sig)
sim_t::sim_t(const char* isa, const char* varch, size_t nprocs, bool halted,
reg_t start_pc, std::vector<std::pair<reg_t, mem_t*>> mems,
+ std::vector<std::pair<reg_t, abstract_device_t*>> plugin_devices,
const std::vector<std::string>& args,
std::vector<int> const hartids,
const debug_module_config_t &dm_config)
- : htif_t(args), mems(mems), procs(std::max(nprocs, size_t(1))),
- start_pc(start_pc), current_step(0), current_proc(0), debug(false),
- histogram_enabled(false), dtb_enabled(true), remote_bitbang(NULL),
- debug_module(this, dm_config)
+ : htif_t(args), mems(mems), plugin_devices(plugin_devices),
+ procs(std::max(nprocs, size_t(1))), start_pc(start_pc), current_step(0),
+ current_proc(0), debug(false), histogram_enabled(false), dtb_enabled(true),
+ remote_bitbang(NULL), debug_module(this, dm_config)
{
signal(SIGINT, &handle_signal);
for (auto& x : mems)
bus.add_device(x.first, x.second);
+ for (auto& x : plugin_devices)
+ bus.add_device(x.first, x.second);
+
debug_module.add_device(&bus);
debug_mmu = new mmu_t(this, NULL);