X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=sim%2Fsim_object.cc;h=cab629f8dc0b184dd2c95ce4285dff54e9190d10;hb=3f7b780af5530cc60228ebd3e895ab26d477614e;hp=b3ac2c7a49ed35a091385be1b62d3109cd81c33e;hpb=f013df643a57814e6db4988037c9718eab994e5a;p=gem5.git diff --git a/sim/sim_object.cc b/sim/sim_object.cc index b3ac2c7a4..cab629f8d 100644 --- a/sim/sim_object.cc +++ b/sim/sim_object.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,7 +35,8 @@ #include "sim/configfile.hh" #include "sim/host.hh" #include "sim/sim_object.hh" -#include "sim/sim_stats.hh" +#include "sim/stats.hh" +#include "sim/param.hh" using namespace std; @@ -83,14 +84,6 @@ SimObject::resetStats() { } -// -// no default extra output -// -void -SimObject::printExtraOutput(ostream &os) -{ -} - // // static function: // call regStats() on all SimObjects and then regFormulas() on all @@ -128,7 +121,7 @@ SimObject::regAllStats() (*i)->regFormulas(); } - Statistics::registerResetCallback(&StatResetCB); + Stats::registerResetCallback(&StatResetCB); } // @@ -161,33 +154,20 @@ SimObject::resetAllStats() } } -// -// static function: call printExtraOutput() on all SimObjects. -// -void -SimObject::printAllExtraOutput(ostream &os) -{ - SimObjectList::iterator i = simObjectList.begin(); - SimObjectList::iterator end = simObjectList.end(); - - for (; i != end; ++i) { - SimObject *obj = *i; - obj->printExtraOutput(os); - } -} - // // static function: serialize all SimObjects. // void SimObject::serializeAll(ostream &os) { - SimObjectList::iterator i = simObjectList.begin(); - SimObjectList::iterator end = simObjectList.end(); + SimObjectList::reverse_iterator ri = simObjectList.rbegin(); + SimObjectList::reverse_iterator rend = simObjectList.rend(); - for (; i != end; ++i) { - SimObject *obj = *i; + for (; ri != rend; ++ri) { + SimObject *obj = *ri; obj->nameOut(os); obj->serialize(os); } } + +DEFINE_SIM_OBJECT_CLASS_NAME("SimObject", SimObject)