diff options
author | Tim Newsome <tim@sifive.com> | 2018-06-11 13:36:30 -0700 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2018-06-11 13:36:30 -0700 |
commit | 7964cd2a016b2b16cb11df98492e9aa231a51b82 (patch) | |
tree | 6d55145f1c200baffc773533ff4fa535b7345a6c /riscv/debug_module.cc | |
parent | abc7911a7c7929fa49b71cd37a75bd45e3f75d87 (diff) | |
download | spike-7964cd2a016b2b16cb11df98492e9aa231a51b82.zip spike-7964cd2a016b2b16cb11df98492e9aa231a51b82.tar.gz spike-7964cd2a016b2b16cb11df98492e9aa231a51b82.tar.bz2 |
Update debug_defines.h
Add support for hartselhi parsing, but other parts of the debug code
still don't support more than 1024 harts.
Diffstat (limited to 'riscv/debug_module.cc')
-rw-r--r-- | riscv/debug_module.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/riscv/debug_module.cc b/riscv/debug_module.cc index 5275a5f..f271d74 100644 --- a/riscv/debug_module.cc +++ b/riscv/debug_module.cc @@ -348,8 +348,9 @@ bool debug_module_t::dmi_read(unsigned address, uint32_t *value) result = set_field(result, DMI_DMCONTROL_HALTREQ, dmcontrol.haltreq); result = set_field(result, DMI_DMCONTROL_RESUMEREQ, dmcontrol.resumereq); - result = set_field(result, ((1L<<hartsellen)-1) << - DMI_DMCONTROL_HARTSEL_OFFSET, dmcontrol.hartsel); + result = set_field(result, DMI_DMCONTROL_HARTSELHI, + dmcontrol.hartsel >> DMI_DMCONTROL_HARTSELLO_LENGTH); + result = set_field(result, DMI_DMCONTROL_HARTSELLO, dmcontrol.hartsel); result = set_field(result, DMI_DMCONTROL_HARTRESET, dmcontrol.hartreset); result = set_field(result, DMI_DMCONTROL_NDMRESET, dmcontrol.ndmreset); result = set_field(result, DMI_DMCONTROL_DMACTIVE, dmcontrol.dmactive); @@ -668,8 +669,10 @@ bool debug_module_t::dmi_write(unsigned address, uint32_t value) dmcontrol.resumereq = get_field(value, DMI_DMCONTROL_RESUMEREQ); dmcontrol.hartreset = get_field(value, DMI_DMCONTROL_HARTRESET); dmcontrol.ndmreset = get_field(value, DMI_DMCONTROL_NDMRESET); - dmcontrol.hartsel = get_field(value, ((1L<<hartsellen)-1) << - DMI_DMCONTROL_HARTSEL_OFFSET); + dmcontrol.hartsel = get_field(value, DMI_DMCONTROL_HARTSELHI) << + DMI_DMCONTROL_HARTSELLO_LENGTH; + dmcontrol.hartsel |= get_field(value, DMI_DMCONTROL_HARTSELLO); + dmcontrol.hartsel &= (1L<<hartsellen) - 1; if (get_field(value, DMI_DMCONTROL_ACKHAVERESET)) { havereset[dmcontrol.hartsel] = false; } |