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
commit7ac0eed95f198a56c8c12d9913f2647a16e2e276 (patch)
tree2cb499ce9dbd46efd143774783723c2b26da6948 /riscv/sim.h
parentf11209d83d09222a8ccf9313de566b9d8e5b0678 (diff)
downloadspike-7ac0eed95f198a56c8c12d9913f2647a16e2e276.zip
spike-7ac0eed95f198a56c8c12d9913f2647a16e2e276.tar.gz
spike-7ac0eed95f198a56c8c12d9913f2647a16e2e276.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;