diff options
author | Aaron Jones <aaron@vexing.codes> | 2019-07-21 16:08:37 -0600 |
---|---|---|
committer | Aaron Jones <aaron@vexing.codes> | 2019-07-22 11:34:33 -0600 |
commit | d184cd4dbfb1c863ae9f1e7c4c263ac626706351 (patch) | |
tree | d919b85827e8e3dfd957ff817286177ad7f59555 /riscv/sim.cc | |
parent | 88a852836acb4c7166b1aa4102e11354bfd99234 (diff) | |
download | spike-d184cd4dbfb1c863ae9f1e7c4c263ac626706351.zip spike-d184cd4dbfb1c863ae9f1e7c4c263ac626706351.tar.gz spike-d184cd4dbfb1c863ae9f1e7c4c263ac626706351.tar.bz2 |
Implement MMIO device plugins.
Diffstat (limited to 'riscv/sim.cc')
-rw-r--r-- | riscv/sim.cc | 12 |
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); |