diff options
author | Tim Newsome <tim@sifive.com> | 2018-01-29 11:52:31 -0800 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2018-01-29 11:52:31 -0800 |
commit | d3d3681f3468c633bc93a727a35bc07348245440 (patch) | |
tree | dd2839357de2f18f3c70b4da8d5d2075c279ee99 /riscv/debug_module.cc | |
parent | cd1e73b4eda7ec555f2cb832fe98d618c377ea65 (diff) | |
download | riscv-isa-sim-d3d3681f3468c633bc93a727a35bc07348245440.zip riscv-isa-sim-d3d3681f3468c633bc93a727a35bc07348245440.tar.gz riscv-isa-sim-d3d3681f3468c633bc93a727a35bc07348245440.tar.bz2 |
Update debug_defines
Diffstat (limited to 'riscv/debug_module.cc')
-rw-r--r-- | riscv/debug_module.cc | 8 |
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) { |