diff options
author | Lisa Hsu <hsul@eecs.umich.edu> | 2004-03-11 18:52:29 -0500 |
---|---|---|
committer | Lisa Hsu <hsul@eecs.umich.edu> | 2004-03-11 18:52:29 -0500 |
commit | 3bc8cffc75c2e03a6a8fe5f4425940a16405f672 (patch) | |
tree | 1d44dba1a7dbd4aef6fad45753b7607928d3414a /sim/sim_events.cc | |
parent | 1039028d408d5a374a67d8d3ecc640a0e6559fbb (diff) | |
parent | 2c60d7aa9e4b48f30ab8c48436ff2dfec8e390f2 (diff) | |
download | gem5-3bc8cffc75c2e03a6a8fe5f4425940a16405f672.tar.xz |
merge with m5 head
--HG--
extra : convert_revision : c90339248d1ee74df1c6b90a77ec9ea41f646311
Diffstat (limited to 'sim/sim_events.cc')
-rw-r--r-- | sim/sim_events.cc | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/sim/sim_events.cc b/sim/sim_events.cc index a31da18dd..f7b07359c 100644 --- a/sim/sim_events.cc +++ b/sim/sim_events.cc @@ -28,11 +28,13 @@ #include <string> -#include "sim/param.hh" -#include "sim/eventq.hh" +#include "base/callback.hh" #include "base/hostinfo.hh" +#include "sim/eventq.hh" +#include "sim/param.hh" #include "sim/sim_events.hh" #include "sim/sim_exit.hh" +#include "sim/sim_init.hh" #include "sim/sim_stats.hh" using namespace std; @@ -178,7 +180,7 @@ class ProgressEvent : public Event ProgressEvent::ProgressEvent(EventQueue *q, Tick _interval) : Event(q), interval(_interval) { - schedule(interval); + schedule(curTick + interval); } // @@ -221,10 +223,24 @@ ProgressParamContext progessMessageParams("progress"); Param<Tick> progress_interval(&progessMessageParams, "cycle", "cycle interval for progress messages"); +namespace { + struct SetupProgress : public Callback + { + Tick interval; + SetupProgress(Tick tick) : interval(tick) {} + + virtual void process() + { + new ProgressEvent(&mainEventQueue, interval); + delete this; + } + }; +} + /* check execute options */ void ProgressParamContext::checkParams() { if (progress_interval.isValid()) - new ProgressEvent(&mainEventQueue, progress_interval); + registerInitCallback(new SetupProgress(progress_interval)); } |