Skip to content

Commit

Permalink
[ISS] Fixed invalid platform shutdown in semi-hosted exit
Browse files Browse the repository at this point in the history
  • Loading branch information
haugoug committed Mar 16, 2022
1 parent ab4e395 commit f5a7166
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions models/cpu/iss/vp/src/iss_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,10 +769,10 @@ void iss_wrapper::handle_riscv_ebreak()

case 0x18:
{
if (this->cpu.regfile.regs[11] == 0x20026)
exit(0);
else
exit(1);
int status = this->cpu.regfile.regs[11] == 0x20026 ? 0 : 1;

this->clock->stop_retain(-1);
this->clock->stop_engine(status & 0x7fffffff);

break;
}
Expand Down

0 comments on commit f5a7166

Please sign in to comment.