Skip to content

Commit

Permalink
Merge pull request #1473 from riscv-software-src/unavailable
Browse files Browse the repository at this point in the history
Fix behavior of unavailable harts.
  • Loading branch information
aswaterman authored Sep 28, 2023
2 parents 847fe5d + 77e9aae commit d1efcdf
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions riscv/debug_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,14 @@ bool debug_module_t::dmi_read(unsigned address, uint32_t *value)
dmstatus.allresumeack = false;
}
auto hart = sim->get_harts().at(hart_id);
if (hart_state[hart_id].halted) {
dmstatus.allrunning = false;
dmstatus.anyhalted = true;
dmstatus.allunavail = false;
} else if (!hart_available(hart_id)) {
if (!hart_available(hart_id)) {
dmstatus.allrunning = false;
dmstatus.allhalted = false;
dmstatus.anyunavail = true;
} else if (hart_state[hart_id].halted) {
dmstatus.allrunning = false;
dmstatus.anyhalted = true;
dmstatus.allunavail = false;
} else {
dmstatus.allhalted = false;
dmstatus.anyrunning = true;
Expand Down Expand Up @@ -579,6 +579,10 @@ bool debug_module_t::perform_abstract_command()
abstractcs.cmderr = CMDERR_BUSY;
return true;
}
if (!hart_available(dmcontrol.hartsel)) {
abstractcs.cmderr = CMDERR_HALTRESUME;
return true;
}

if ((command >> 24) == 0) {
// register access
Expand Down

0 comments on commit d1efcdf

Please sign in to comment.