aboutsummaryrefslogtreecommitdiff
path: root/riscv/sim.h
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2018-01-12 15:26:00 -0800
committerTim Newsome <tim@sifive.com>2018-01-18 14:31:48 -0800
commitcd1e73b4eda7ec555f2cb832fe98d618c377ea65 (patch)
tree2cb499ce9dbd46efd143774783723c2b26da6948 /riscv/sim.h
parent11780eabc0147a58c575d089c4afe5732b55bb05 (diff)
downloadspike-cd1e73b4eda7ec555f2cb832fe98d618c377ea65.zip
spike-cd1e73b4eda7ec555f2cb832fe98d618c377ea65.tar.gz
spike-cd1e73b4eda7ec555f2cb832fe98d618c377ea65.tar.bz2
Support debug system bus access.
Diffstat (limited to 'riscv/sim.h')
-rw-r--r--riscv/sim.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/riscv/sim.h b/riscv/sim.h
index ce5fe19..e29cca4 100644
--- a/riscv/sim.h
+++ b/riscv/sim.h
@@ -38,8 +38,6 @@ public:
processor_t* get_core(size_t i) { return procs.at(i); }
unsigned nprocs() const { return procs.size(); }
- debug_module_t debug_module;
-
private:
std::vector<std::pair<reg_t, mem_t*>> mems;
mmu_t* debug_mmu; // debug port into main memory
@@ -92,6 +90,7 @@ private:
friend class processor_t;
friend class mmu_t;
+ friend class debug_module_t;
// htif
friend void sim_thread_main(void*);
@@ -105,6 +104,12 @@ private:
void write_chunk(addr_t taddr, size_t len, const void* src);
size_t chunk_align() { return 8; }
size_t chunk_max_size() { return 8; }
+
+public:
+ // Initialize this after procs, because in debug_module_t::reset() we
+ // enumerate processors, which segfaults if procs hasn't been initialized
+ // yet.
+ debug_module_t debug_module;
};
extern volatile bool ctrlc_pressed;