aboutsummaryrefslogtreecommitdiff
path: root/riscv/debug_module.cc
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2018-01-29 11:52:31 -0800
committerTim Newsome <tim@sifive.com>2018-01-29 11:52:31 -0800
commit5c8e9664dd5a8f02828b3ea81289d99545a4103e (patch)
treedd2839357de2f18f3c70b4da8d5d2075c279ee99 /riscv/debug_module.cc
parent7ac0eed95f198a56c8c12d9913f2647a16e2e276 (diff)
downloadspike-5c8e9664dd5a8f02828b3ea81289d99545a4103e.zip
spike-5c8e9664dd5a8f02828b3ea81289d99545a4103e.tar.gz
spike-5c8e9664dd5a8f02828b3ea81289d99545a4103e.tar.bz2
Update debug_defines
Diffstat (limited to 'riscv/debug_module.cc')
-rw-r--r--riscv/debug_module.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/riscv/debug_module.cc b/riscv/debug_module.cc
index 2bc480a..1d18478 100644
--- a/riscv/debug_module.cc
+++ b/riscv/debug_module.cc
@@ -347,7 +347,8 @@ 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, DMI_DMCONTROL_HARTSEL, dmcontrol.hartsel);
+ result = set_field(result, ((1L<<hartsellen)-1) <<
+ DMI_DMCONTROL_HARTSEL_OFFSET, 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);
@@ -423,7 +424,7 @@ bool debug_module_t::dmi_read(unsigned address, uint32_t *value)
result = set_field(result, DMI_HARTINFO_DATAADDR, debug_data_start);
break;
case DMI_SBCS:
- result = set_field(result, DMI_SBCS_VERSION, sbcs.version);
+ result = set_field(result, DMI_SBCS_SBVERSION, sbcs.version);
result = set_field(result, DMI_SBCS_SBREADONADDR, sbcs.readonaddr);
result = set_field(result, DMI_SBCS_SBACCESS, sbcs.sbaccess);
result = set_field(result, DMI_SBCS_SBAUTOINCREMENT, sbcs.autoincrement);
@@ -593,7 +594,8 @@ 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, DMI_DMCONTROL_HARTSEL);
+ dmcontrol.hartsel = get_field(value, ((1L<<hartsellen)-1) <<
+ DMI_DMCONTROL_HARTSEL_OFFSET);
}
processor_t *proc = current_proc();
if (proc) {