summaryrefslogtreecommitdiff
path: root/src/sim/sim_events.cc
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2006-10-06 09:28:16 -0400
committerRon Dreslinski <rdreslin@umich.edu>2006-10-06 09:28:16 -0400
commitc42a7bc4f6c03703e17fb55afe5ba8e2d920e5d5 (patch)
treed43eb581e9ef48cc9114bd7cfc5f49851409bc12 /src/sim/sim_events.cc
parentdfdb683fb9b1ebb10e80228df6494ea482609518 (diff)
parent48e89a9d1eb186cce8bc0fab76c28730896b491a (diff)
downloadgem5-c42a7bc4f6c03703e17fb55afe5ba8e2d920e5d5.tar.xz
Merge zizzer:/z/m5/Bitkeeper/newmem
into zazzer.eecs.umich.edu:/z/rdreslin/m5bk/newmemcleanest --HG-- extra : convert_revision : 2f1bbe84c92879fd1bfa579adc62a367ece1cddd
Diffstat (limited to 'src/sim/sim_events.cc')
-rw-r--r--src/sim/sim_events.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/sim/sim_events.cc b/src/sim/sim_events.cc
index d9e8bdeaa..2ccc9dad2 100644
--- a/src/sim/sim_events.cc
+++ b/src/sim/sim_events.cc
@@ -57,6 +57,11 @@ SimLoopExitEvent::process()
// otherwise do nothing... the IsExitEvent flag takes care of
// exiting the simulation loop and returning this object to Python
+
+ // but if you are doing this on intervals, don't forget to make another
+ if (repeat) {
+ schedule(curTick + repeat);
+ }
}
@@ -66,16 +71,20 @@ SimLoopExitEvent::description()
return "simulation loop exit";
}
-void
-exitSimLoop(Tick when, const std::string &message, int exit_code)
+SimLoopExitEvent *
+schedExitSimLoop(const std::string &message, Tick when, Tick repeat,
+ EventQueue *q, int exit_code)
{
- new SimLoopExitEvent(when, message, exit_code);
+ if (q == NULL)
+ q = &mainEventQueue;
+
+ return new SimLoopExitEvent(q, when, repeat, message, exit_code);
}
void
exitSimLoop(const std::string &message, int exit_code)
{
- exitSimLoop(curTick, message, exit_code);
+ schedExitSimLoop(message, curTick, 0, NULL, exit_code);
}
void