diff options
author | Steve Reinhardt <steve.reinhardt@amd.com> | 2010-08-17 05:08:50 -0700 |
---|---|---|
committer | Steve Reinhardt <steve.reinhardt@amd.com> | 2010-08-17 05:08:50 -0700 |
commit | 5ea906ba1625266ee80968d70e0c218adedcce9f (patch) | |
tree | a28387572527f0dac40d677a8320b797dcc2a137 /src/sim | |
parent | c2cce96a0bb4878a9e6a4ae635096b5ce62e41c3 (diff) | |
download | gem5-5ea906ba1625266ee80968d70e0c218adedcce9f.tar.xz |
sim: move iterating over SimObjects into Python.
Diffstat (limited to 'src/sim')
-rw-r--r-- | src/sim/sim_object.cc | 82 | ||||
-rw-r--r-- | src/sim/sim_object.hh | 8 |
2 files changed, 0 insertions, 90 deletions
diff --git a/src/sim/sim_object.cc b/src/sim/sim_object.cc index 0b18ff437..157bf1395 100644 --- a/src/sim/sim_object.cc +++ b/src/sim/sim_object.cc @@ -97,76 +97,6 @@ SimObject::resetStats() } // -// static function: -// call regStats() on all SimObjects and then regFormulas() on all -// SimObjects. -// -struct SimObjectResetCB : public Callback -{ - virtual void process() { SimObject::resetAllStats(); } -}; - -namespace { - static SimObjectResetCB StatResetCB; -} - -void -SimObject::regAllStats() -{ - SimObjectList::iterator i; - SimObjectList::iterator end = simObjectList.end(); - - /** - * @todo change cprintfs to DPRINTFs - */ - for (i = simObjectList.begin(); i != end; ++i) { -#ifdef STAT_DEBUG - cprintf("registering stats for %s\n", (*i)->name()); -#endif - (*i)->regStats(); - } - - for (i = simObjectList.begin(); i != end; ++i) { -#ifdef STAT_DEBUG - cprintf("registering formulas for %s\n", (*i)->name()); -#endif - (*i)->regFormulas(); - } - - Stats::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. -// -void -SimObject::resetAllStats() -{ - SimObjectList::iterator i = simObjectList.begin(); - SimObjectList::iterator end = simObjectList.end(); - - for (; i != end; ++i) { - SimObject *obj = *i; - obj->resetStats(); - } -} - -// // static function: serialize all SimObjects. // void @@ -201,18 +131,6 @@ SimObject::unserializeAll(Checkpoint *cp) } -void -SimObject::startupAll() -{ - SimObjectList::iterator i = simObjectList.begin(); - SimObjectList::iterator end = simObjectList.end(); - - while (i != end) { - (*i)->startup(); - ++i; - } -} - #ifdef DEBUG // diff --git a/src/sim/sim_object.hh b/src/sim/sim_object.hh index 2bea97301..1b22c5825 100644 --- a/src/sim/sim_object.hh +++ b/src/sim/sim_object.hh @@ -94,7 +94,6 @@ class SimObject : public EventManager, public Serializable // initialization pass of all objects. // Gets invoked after construction, before unserialize. virtual void init(); - static void initAll(); // register statistics for this object virtual void regStats(); @@ -104,13 +103,6 @@ class SimObject : public EventManager, public Serializable // final initialization before simulation // all state is unserialized so virtual void startup(); - static void startupAll(); - - // static: call reg_stats on all SimObjects - static void regAllStats(); - - // static: call resetStats on all SimObjects - static void resetAllStats(); // static: call nameOut() & serialize() on all SimObjects static void serializeAll(std::ostream &); |