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 | 5542d31fcf19e1aa35c3a721133fe6a7dfa2fcdc (patch) | |
tree | 6d55145f1c200baffc773533ff4fa535b7345a6c /riscv/debug_module.cc | |
parent | d6fcfdebf6a893bf37670fd67203d18653df4a0e (diff) | |
download | spike-5542d31fcf19e1aa35c3a721133fe6a7dfa2fcdc.zip spike-5542d31fcf19e1aa35c3a721133fe6a7dfa2fcdc.tar.gz spike-5542d31fcf19e1aa35c3a721133fe6a7dfa2fcdc.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; } |