sim: add some DPRINTFs for debugging unserialization
authorSteve Reinhardt <steve.reinhardt@amd.com>
Mon, 23 May 2011 21:27:20 +0000 (14:27 -0700)
committerSteve Reinhardt <steve.reinhardt@amd.com>
Mon, 23 May 2011 21:27:20 +0000 (14:27 -0700)
Also got rid of unused C++ unserializeAll() method
(this is now handled in Python)

src/sim/sim_object.cc
src/sim/sim_object.hh

index 8919f3e72c41855435a022576df95b733ecfab03..9ac0b7fffb7e45e444c590597676134090b420f9 100644 (file)
@@ -38,7 +38,7 @@
 #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"
 
@@ -78,8 +78,12 @@ SimObject::init()
 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
@@ -126,25 +130,6 @@ SimObject::serializeAll(ostream &os)
    }
 }
 
-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
 //
index d57a56ab85e6039bb23848c61e3e284c89774ec6..995431845c3752fe361d23898c745ee9483676ac 100644 (file)
@@ -138,7 +138,6 @@ class SimObject : public EventManager, public Serializable
 
     // 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