Time: Add a mechanism to prevent M5 from running faster than real time.
[gem5.git] / src / sim / serialize.hh
index cf1a672be9fa69cc7b8d7260614c65d451bcc461..5ea632ea4b5bdeee7138103b9437dc4f3b967e57 100644 (file)
@@ -141,7 +141,6 @@ class Serializable
     static int ckptMaxCount;
     static int ckptPrevCount;
     static void serializeAll(const std::string &cpt_dir);
-    static void unserializeAll(const std::string &cpt_dir);
     static void unserializeGlobals(Checkpoint *cp);
 };
 
@@ -219,19 +218,14 @@ class SerializableClass
 SerializableClass the##OBJ_CLASS##Class(CLASS_NAME,                        \
                                          OBJ_CLASS::createForUnserialize);
 
-void
-setCheckpointDir(const std::string &name);
-
 class Checkpoint
 {
   private:
 
     IniFile *db;
-    const std::string basePath;
-    std::map<std::string, Serializable*> objMap;
 
   public:
-    Checkpoint(const std::string &cpt_dir, const std::string &path);
+    Checkpoint(const std::string &cpt_dir);
 
     const std::string cptDir;
 
@@ -245,7 +239,20 @@ class Checkpoint
 
     // The following static functions have to do with checkpoint
     // creation rather than restoration.  This class makes a handy
-    // namespace for them though.
+    // namespace for them though.  Currently no Checkpoint object is
+    // created on serialization (only unserialization) so we track the
+    // directory name as a global.  It would be nice to change this
+    // someday
+
+  private:
+    // current directory we're serializing into.
+    static std::string currentDirectory;
+
+  public:
+    // Set the current directory.  This function takes care of
+    // inserting curTick() if there's a '%d' in the argument, and
+    // appends a '/' if necessary.  The final name is returned.
+    static std::string setDir(const std::string &base_name);
 
     // Export current checkpoint directory name so other objects can
     // derive filenames from it (e.g., memory).  The return value is