Merge zizzer:/bk/m5 into zeep.eecs.umich.edu:/z/saidi/work/m5
[gem5.git] / sim / serialize.cc
index 180cc38a0063812f29eef3062486018dcff78f0c..2a5e3d398b45d53ad09a8194ae07819e8497a78a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2002-2004 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -186,22 +186,22 @@ INSTANTIATE_PARAM_TEMPLATES(string)
 class Globals : public Serializable
 {
   public:
-    string name() const;
-    void serialize(ostreamos);
+    const string name() const;
+    void serialize(ostream &os);
     void unserialize(Checkpoint *cp);
 };
 
 /// The one and only instance of the Globals class.
 Globals globals;
 
-string
+const string
 Globals::name() const
 {
     return "Globals";
 }
 
 void
-Globals::serialize(ostreamos)
+Globals::serialize(ostream &os)
 {
     nameOut(os);
     SERIALIZE_SCALAR(curTick);
@@ -335,10 +335,7 @@ SerializeParamContext::checkParams()
     if (serialize_dir.isValid()) {
         checkpointDirBase = serialize_dir;
     } else {
-        if (outputDirectory.empty())
-            checkpointDirBase = "m5.%012d";
-        else
-            checkpointDirBase = outputDirectory + "cpt.%012d";
+        checkpointDirBase = outputDirectory + "cpt.%012d";
     }
 
     // guarantee that directory ends with a '/'
@@ -431,7 +428,7 @@ Serializable::create(Checkpoint *cp, const std::string &section)
 
 Checkpoint::Checkpoint(const std::string &cpt_dir, const std::string &path,
                        const ConfigNode *_configNode)
-    : db(new IniFile), basePath(path), configNode(_configNode)
+    : db(new IniFile), basePath(path), configNode(_configNode), cptDir(cpt_dir)
 {
     string filename = cpt_dir + "/" + Checkpoint::baseFilename;
     if (!db->load(filename)) {