#include "base/misc.hh"
#include "base/trace.hh"
#include "base/types.hh"
-#include "debug/Config.hh"
+#include "debug/Checkpoint.hh"
#include "sim/sim_object.hh"
#include "sim/stats.hh"
void
SimObject::loadState(Checkpoint *cp)
{
- if (cp->sectionExists(name()))
+ if (cp->sectionExists(name())) {
+ DPRINTF(Checkpoint, "unserializing\n");
unserialize(cp, name());
+ } else {
+ DPRINTF(Checkpoint, "no checkpoint section found\n");
+ }
}
void
}
}
-void
-SimObject::unserializeAll(Checkpoint *cp)
-{
- SimObjectList::reverse_iterator ri = simObjectList.rbegin();
- SimObjectList::reverse_iterator rend = simObjectList.rend();
-
- for (; ri != rend; ++ri) {
- SimObject *obj = *ri;
- DPRINTFR(Config, "Unserializing '%s'\n",
- obj->name());
- if(cp->sectionExists(obj->name()))
- obj->unserialize(cp, obj->name());
- else
- warn("Not unserializing '%s': no section found in checkpoint.\n",
- obj->name());
- }
-}
-
-
#ifdef DEBUG
//
// static: call nameOut() & serialize() on all SimObjects
static void serializeAll(std::ostream &);
- static void unserializeAll(Checkpoint *cp);
// Methods to drain objects in order to take checkpoints
// Or switch from timing -> atomic memory model