diff options
author | Tim Newsome <tim@sifive.com> | 2017-10-10 15:53:23 -0700 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2017-12-11 13:21:47 -0800 |
commit | 46a67860915391458d7cc8cb93248059df20b8f2 (patch) | |
tree | 8dad89d9c6bb72e55fd3a09676bd63fba86e94e3 /riscv/debug_module.h | |
parent | 12714e371e9b8ce2efcf0e77347ed1b33c8de27b (diff) | |
download | riscv-isa-sim-46a67860915391458d7cc8cb93248059df20b8f2.zip riscv-isa-sim-46a67860915391458d7cc8cb93248059df20b8f2.tar.gz riscv-isa-sim-46a67860915391458d7cc8cb93248059df20b8f2.tar.bz2 |
Make progbuf a run-time option.
Also add an implicit ebreak after the program buffer. This is not part
of the spec, but hopefully it will be.
Diffstat (limited to 'riscv/debug_module.h')
-rw-r--r-- | riscv/debug_module.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/riscv/debug_module.h b/riscv/debug_module.h index f0d2a47..8b209fb 100644 --- a/riscv/debug_module.h +++ b/riscv/debug_module.h @@ -59,7 +59,8 @@ typedef struct { class debug_module_t : public abstract_device_t { public: - debug_module_t(sim_t *sim); + debug_module_t(sim_t *sim, unsigned progsize); + ~debug_module_t(); void add_device(bus_t *bus); @@ -74,18 +75,23 @@ class debug_module_t : public abstract_device_t private: static const unsigned datasize = 2; - static const unsigned progsize = 16; + // Size of program_buffer in 32-bit words, as exposed to the rest of the + // world. + unsigned progsize; + // Actual size of the program buffer, which is 1 word bigger than we let on + // to implement the implicit ebreak at the end. + unsigned program_buffer_bytes; static const unsigned debug_data_start = 0x380; - static const unsigned debug_progbuf_start = debug_data_start - progsize*4; + unsigned debug_progbuf_start; static const unsigned debug_abstract_size = 2; - static const unsigned debug_abstract_start = debug_progbuf_start - debug_abstract_size*4; - + unsigned debug_abstract_start; + sim_t *sim; uint8_t debug_rom_whereto[4]; uint8_t debug_abstract[debug_abstract_size * 4]; - uint8_t program_buffer[progsize * 4]; + uint8_t *program_buffer; uint8_t dmdata[datasize * 4]; bool halted[1024]; |