summaryrefslogtreecommitdiff
path: root/sim/sim_events.cc
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-11-03 11:47:55 -0500
committerNathan Binkert <binkertn@umich.edu>2004-11-03 11:47:55 -0500
commit78ae8764a9d876d377f3e35de7e412f154402580 (patch)
tree5c44e225697aea86bdd411e4959a5b88f5374c25 /sim/sim_events.cc
parent64a47b8ec16c101d2569d384e7106cd507345565 (diff)
downloadgem5-78ae8764a9d876d377f3e35de7e412f154402580.tar.xz
add a new phase to the simulator. Basically the simulator now goes
through the following phases. 1) Construct all param contexts 2) Call the checkParams() on each context 3) Build the configuration hierarchy 4) Construct all SimObjects 5) Initialize all SimObjects by calling init() on each one 6) Unserialize the checkpoint 7) Register all statisitcs 8) Check validity of all statistics (after that, no new stats) 9) Reset all stats. 10) Call SimStartup() which calls startup() on all SimObjects, ParamContexts, and any other object deriving from StartupCallback SConscript: no more SimInit() we have SimStartup() now sim/param.hh: Make all params have a startup callback. sim/sim_events.cc: the init callbacks no longer exist. We can simplify code by using startup(). sim/sim_object.hh: Make all SimObjects derive from StartupCallback --HG-- extra : convert_revision : ab81e259eb5510cc597f7bacb2bfb619fb4cc15f
Diffstat (limited to 'sim/sim_events.cc')
-rw-r--r--sim/sim_events.cc26
1 files changed, 5 insertions, 21 deletions
diff --git a/sim/sim_events.cc b/sim/sim_events.cc
index c454fdcf9..99c09f259 100644
--- a/sim/sim_events.cc
+++ b/sim/sim_events.cc
@@ -34,7 +34,7 @@
#include "sim/param.hh"
#include "sim/sim_events.hh"
#include "sim/sim_exit.hh"
-#include "sim/sim_init.hh"
+#include "sim/startup.hh"
#include "sim/stats.hh"
using namespace std;
@@ -210,12 +210,11 @@ ProgressEvent::description()
// Parameter space for execution address tracing options. Derive
// from ParamContext so we can override checkParams() function.
-class ProgressParamContext : public ParamContext
+struct ProgressParamContext : public ParamContext
{
- public:
ProgressParamContext(const string &_iniSection)
: ParamContext(_iniSection) {}
- void checkParams();
+ void startup();
};
ProgressParamContext progessMessageParams("progress");
@@ -223,24 +222,9 @@ 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()
+ProgressParamContext::startup()
{
if (progress_interval.isValid())
- registerInitCallback(new SetupProgress(progress_interval));
+ new ProgressEvent(&mainEventQueue, progress_interval);
}