regs->npc = regs->pc + sizeof(MachInst);
}
-void
-m5_exit()
-{
- static SimExitEvent event("m5_exit instruction encountered");
-}
-
////////////////////////////////////////////////////////////////////////
//
// alpha exceptions - value equals trap address, update with MD_FAULT_TYPE
#include <fenv.h>
#endif
-#include "cpu/static_inst.hh"
#include "base/cprintf.hh"
#include "base/misc.hh"
-#include "cpu/full_cpu/op_class.hh"
-
#include "cpu/exec_context.hh"
-#include "cpu/simple_cpu/simple_cpu.hh"
-#include "cpu/full_cpu/spec_state.hh"
-#include "cpu/full_cpu/full_cpu.hh"
#include "cpu/exetrace.hh"
+#include "cpu/full_cpu/full_cpu.hh"
+#include "cpu/full_cpu/op_class.hh"
+#include "cpu/full_cpu/spec_state.hh"
+#include "cpu/simple_cpu/simple_cpu.hh"
+#include "cpu/static_inst.hh"
#include "sim/annotation.hh"
+#include "sim/sim_events.hh"
#ifdef FULL_SYSTEM
#include "targetarch/ev5.hh"
#else
0x00: decode PALFUNC {
format EmulatedCallPal {
+ 0x00: halt ({{
+ if (!xc->misspeculating())
+ SimExit("halt instruction encountered");
+ }});
0x83: callsys({{ xc->syscall(); }});
// Read uniq reg into ABI return value register (r0)
0x9e: rduniq({{ R0 = Runiq; }});
}}, No_OpClass);
0x20: m5exit({{
if (!xc->misspeculating())
- m5_exit();
+ SimExit("m5_exit instruction encountered");
}}, No_OpClass);
0x30: initparam({{ Ra = xc->cpu->system->init_param; }});
0x40: resetstats({{
return "simulation termination";
}
+void
+SimExit(const char *message)
+{
+ static SimExitEvent event(message);
+}
//
// constructor: automatically schedules at specified time
virtual const char *description();
};
+void SimExit(const char *message);
+
//
// Event class to terminate simulation after 'n' related events have
// occurred using a shared counter: used to terminate when *all*