diff options
author | Curtis Dunham <Curtis.Dunham@arm.com> | 2015-09-02 15:23:30 -0500 |
---|---|---|
committer | Curtis Dunham <Curtis.Dunham@arm.com> | 2015-09-02 15:23:30 -0500 |
commit | 87b9da2df4d4dc0028566a7803ee55159343d735 (patch) | |
tree | 17c4cb920dafff6f77d57e31029ccba38e2c267d /src/sim/root.cc | |
parent | 62e0344aefd56cb1878cdbc27dbed11d6cc73ba4 (diff) | |
download | gem5-87b9da2df4d4dc0028566a7803ee55159343d735.tar.xz |
sim: tag-based checkpoint versioning
This commit addresses gem5 checkpoints' linear versioning bottleneck.
Since development is distributed across many private trees, there exists
a sort of 'race' for checkpoint version numbers: internally a checkpoint
version may be used but then resynchronizing with the external tree causes
a conflict on that version. This change replaces the linear version number
with a set of unique strings called tags. Now the only conflicts that can
arise are of tag names, where collisions are much easier to avoid.
The checkpoint upgrader (util/cpt_upgrader.py) upgrades the version
representation, as one would expect. Each tag version implements its
upgrader code in a python file in the util/cpt_upgraders directory
rather than adding a function to the upgrader script itself.
The version tags are stored in the 'Globals' section rather than 'root'
(as the version was previously) because 'Globals' gets unserialized
first and can provide a warning before any other unserialization errors
can occur.
Diffstat (limited to 'src/sim/root.cc')
-rw-r--r-- | src/sim/root.cc | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/sim/root.cc b/src/sim/root.cc index 1d58c3bbe..7647ca5b7 100644 --- a/src/sim/root.cc +++ b/src/sim/root.cc @@ -132,8 +132,6 @@ Root::loadState(CheckpointIn &cp) void Root::serialize(CheckpointOut &cp) const { - uint64_t cpt_ver = gem5CheckpointVersion; - SERIALIZE_SCALAR(cpt_ver); SERIALIZE_SCALAR(FullSystem); std::string isa = THE_ISA_STR; SERIALIZE_SCALAR(isa); @@ -141,27 +139,7 @@ Root::serialize(CheckpointOut &cp) const void Root::unserialize(CheckpointIn &cp) -{ - uint64_t cpt_ver = 0; - UNSERIALIZE_OPT_SCALAR(cpt_ver); - if (cpt_ver < gem5CheckpointVersion) { - warn("**********************************************************\n"); - warn("!!!! Checkpoint ver %#x is older than current ver %#x !!!!\n", - cpt_ver, gem5CheckpointVersion); - warn("You might experience some issues when restoring and should run " - "the checkpoint upgrader (util/cpt_upgrader.py) on your " - "checkpoint\n"); - warn("**********************************************************\n"); - } else if (cpt_ver > gem5CheckpointVersion) { - warn("**********************************************************\n"); - warn("!!!! Checkpoint ver %#x is newer than current ver %#x !!!!\n", - cpt_ver, gem5CheckpointVersion); - warn("Running a new checkpoint with an older version of gem5 is not " - "supported. While it might work, you may experience incorrect " - "behavior or crashes.\n"); - warn("**********************************************************\n"); - } -} +{} bool FullSystem; |