Browse Source

Pass target machine's return code back to OS

mvp
Andrew Waterman 13 years ago
parent
commit
d5204838b7
  1. 3
      riscv/sim.cc
  2. 2
      riscv/sim.h
  3. 2
      riscv/spike.cc

3
riscv/sim.cc

@ -72,7 +72,7 @@ reg_t sim_t::get_scr(int which)
}
}
void sim_t::run()
int sim_t::run()
{
while (htif->tick())
{
@ -81,6 +81,7 @@ void sim_t::run()
else
step(INTERLEAVE);
}
return htif->exit_code();
}
void sim_t::step(size_t n)

2
riscv/sim.h

@ -19,7 +19,7 @@ public:
~sim_t();
// run the simulation to completion
void run();
int run();
bool running();
void stop();
void set_debug(bool value);

2
riscv/spike.cc

@ -68,5 +68,5 @@ int main(int argc, char** argv)
}
s.set_debug(debug);
s.run();
return s.run();
}

Loading…
Cancel
Save