#include "sim/host.hh"
#include "sim/sim_events.hh"
#include "sim/sim_exit.hh"
+#include "sim/sim_init.hh"
#include "sim/sim_object.hh"
#include "sim/sim_stats.hh"
exit(1);
}
+ SimInit();
+
while (!mainEventQueue.empty()) {
assert(curTick <= mainEventQueue.nextTick() &&
"event scheduled in the past");
simObjectList.push_back(this);
}
+void
+SimObject::init()
+{
+}
+
//
// no default statistics, so nothing to do in base implementation
//
Statistics::registerResetCallback(&StatResetCB);
}
+//
+// static function: call init() on all SimObjects.
+//
+void
+SimObject::initAll()
+{
+ SimObjectList::iterator i = simObjectList.begin();
+ SimObjectList::iterator end = simObjectList.end();
+
+ for (; i != end; ++i) {
+ SimObject *obj = *i;
+ obj->init();
+ }
+}
+
//
// static function: call resetStats() on all SimObjects.
//
virtual std::string name() const { return objName; }
+ // initialization pass of all objects. Gets invoked by SimInit()
+ virtual void init();
+ static void initAll();
+
// register statistics for this object
virtual void regStats();
virtual void regFormulas();