diff options
author | Samuel Obuch <sobuch@codasip.com> | 2020-08-11 16:42:56 +0200 |
---|---|---|
committer | Samuel Obuch <sobuch@codasip.com> | 2020-08-11 16:49:22 +0200 |
commit | 5e073efff040fc7f765881522f0da4e91fed00d4 (patch) | |
tree | a77f1277eee400e31e82f1ff31565a37126ad0cb /riscv | |
parent | da34b0eee44274ba4e0cddd27add832c427001bb (diff) | |
download | spike-5e073efff040fc7f765881522f0da4e91fed00d4.zip spike-5e073efff040fc7f765881522f0da4e91fed00d4.tar.gz spike-5e073efff040fc7f765881522f0da4e91fed00d4.tar.bz2 |
Add option to dissable implicit ebreak in program buffer
Diffstat (limited to 'riscv')
-rw-r--r-- | riscv/debug_module.cc | 15 | ||||
-rw-r--r-- | riscv/debug_module.h | 1 |
2 files changed, 10 insertions, 6 deletions
diff --git a/riscv/debug_module.cc b/riscv/debug_module.cc index 7860ad4..2a364b3 100644 --- a/riscv/debug_module.cc +++ b/riscv/debug_module.cc @@ -34,7 +34,7 @@ static unsigned field_width(unsigned n) debug_module_t::debug_module_t(sim_t *sim, const debug_module_config_t &config) : nprocs(sim->nprocs()), config(config), - program_buffer_bytes(4 + 4*config.progbufsize), + program_buffer_bytes(config.support_impebreak ? 4 : 0 + 4*config.progbufsize), debug_progbuf_start(debug_data_start - program_buffer_bytes), debug_abstract_start(debug_progbuf_start - debug_abstract_size*4), custom_base(0), @@ -56,12 +56,15 @@ debug_module_t::debug_module_t(sim_t *sim, const debug_module_config_t &config) memset(debug_rom_flags, 0, sizeof(debug_rom_flags)); memset(program_buffer, 0, program_buffer_bytes); - program_buffer[4*config.progbufsize] = ebreak(); - program_buffer[4*config.progbufsize+1] = ebreak() >> 8; - program_buffer[4*config.progbufsize+2] = ebreak() >> 16; - program_buffer[4*config.progbufsize+3] = ebreak() >> 24; memset(dmdata, 0, sizeof(dmdata)); + if (config.support_impebreak) { + program_buffer[4*config.progbufsize] = ebreak(); + program_buffer[4*config.progbufsize+1] = ebreak() >> 8; + program_buffer[4*config.progbufsize+2] = ebreak() >> 16; + program_buffer[4*config.progbufsize+3] = ebreak() >> 24; + } + write32(debug_rom_whereto, 0, jal(ZERO, debug_abstract_start - DEBUG_ROM_WHERETO)); @@ -87,7 +90,7 @@ void debug_module_t::reset() dmcontrol = {0}; dmstatus = {0}; - dmstatus.impebreak = true; + dmstatus.impebreak = config.support_impebreak; dmstatus.authenticated = !config.require_authentication; dmstatus.version = 2; diff --git a/riscv/debug_module.h b/riscv/debug_module.h index 42a521e..2bcdba4 100644 --- a/riscv/debug_module.h +++ b/riscv/debug_module.h @@ -18,6 +18,7 @@ typedef struct { bool support_hasel; bool support_abstract_csr_access; bool support_haltgroups; + bool support_impebreak; } debug_module_config_t; typedef struct { |