summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2006-05-12 18:16:07 -0400
committerAli Saidi <saidi@eecs.umich.edu>2006-05-12 18:16:07 -0400
commit03a00e5d32411f467735b2af890c1ca54930e949 (patch)
tree4154e4703c0c3e18bd4d6b4de98fe8650d6f704d /sim
parenta91ee5abc2275709871b016d43ca2d2440fa5000 (diff)
parent7929b9ee19b6fabc7e69b704fa07fdb6daa35c70 (diff)
downloadgem5-03a00e5d32411f467735b2af890c1ca54930e949.tar.xz
Merge zeep.pool:/z/saidi/work/m5.head
into zeep.pool:/z/saidi/work/m5.nm_m5_pull SConscript: dram memory needs to be converted to newmem before we can use it dev/ide_ctrl.cc: don't need this printing in newmem dev/ide_disk.cc: will read stats in next commit dev/sinic.cc: merge sinic from head, still needs work --HG-- extra : convert_revision : b9aabd8c7814d07d54ce6f971aad3ec349fa24e1
Diffstat (limited to 'sim')
-rw-r--r--sim/serialize.cc12
-rw-r--r--sim/serialize.hh5
2 files changed, 11 insertions, 6 deletions
diff --git a/sim/serialize.cc b/sim/serialize.cc
index ec7241498..c4ef124bb 100644
--- a/sim/serialize.cc
+++ b/sim/serialize.cc
@@ -51,8 +51,9 @@
using namespace std;
-int Serializable::maxCount = 0;
-int Serializable::count = 0;
+int Serializable::ckptMaxCount = 0;
+int Serializable::ckptCount = 0;
+int Serializable::ckptPrevCount = -1;
void
Serializable::nameOut(ostream &os)
@@ -241,8 +242,11 @@ Serializable::serializeAll()
globals.serialize(outstream);
SimObject::serializeAll(outstream);
- if (maxCount && ++count >= maxCount)
+ assert(Serializable::ckptPrevCount + 1 == Serializable::ckptCount);
+ Serializable::ckptPrevCount++;
+ if (ckptMaxCount && ++ckptCount >= ckptMaxCount)
SimExit(curTick + 1, "Maximum number of checkpoints dropped");
+
}
@@ -352,7 +356,7 @@ SerializeParamContext::checkParams()
if (serialize_cycle > 0)
Checkpoint::setup(serialize_cycle, serialize_period);
- Serializable::maxCount = serialize_count;
+ Serializable::ckptMaxCount = serialize_count;
}
void
diff --git a/sim/serialize.hh b/sim/serialize.hh
index bc82bf9b8..d8f5f8fc5 100644
--- a/sim/serialize.hh
+++ b/sim/serialize.hh
@@ -119,8 +119,9 @@ class Serializable
static Serializable *create(Checkpoint *cp,
const std::string &section);
- static int count;
- static int maxCount;
+ static int ckptCount;
+ static int ckptMaxCount;
+ static int ckptPrevCount;
static void serializeAll();
static void unserializeGlobals(Checkpoint *cp);
};