summaryrefslogtreecommitdiff
path: root/src/mem/cache/cache_impl.hh
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2012-05-10 18:04:26 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2012-05-10 18:04:26 -0500
commitf6895e8bd46a1533c607fe528a2da68b64e722dc (patch)
tree62f2225f891dcf1201bde837f1b918aa3e3c7679 /src/mem/cache/cache_impl.hh
parentdc456d8166fce16c3af26f09405b0bf91ff1e38f (diff)
downloadgem5-f6895e8bd46a1533c607fe528a2da68b64e722dc.tar.xz
Cache: Panic if you attempt to create a checkpoint with a cache in the system
Diffstat (limited to 'src/mem/cache/cache_impl.hh')
-rw-r--r--src/mem/cache/cache_impl.hh29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh
index 008bbb8d9..3312fc941 100644
--- a/src/mem/cache/cache_impl.hh
+++ b/src/mem/cache/cache_impl.hh
@@ -1539,6 +1539,35 @@ Cache<TagStore>::nextMSHRReadyTime()
return nextReady;
}
+template<class TagStore>
+void
+Cache<TagStore>::serialize(std::ostream &os)
+{
+ warn("*** Creating checkpoints with caches is not supported. ***\n");
+ warn(" Remove any caches before taking checkpoints\n");
+ warn(" This checkpoint will not restore correctly and dirty data in "
+ "the cache will be lost!\n");
+
+ // Since we don't write back the data dirty in the caches to the physical
+ // memory if caches exist in the system we won't be able to restore
+ // from the checkpoint as any data dirty in the caches will be lost.
+
+ bool bad_checkpoint = true;
+ SERIALIZE_SCALAR(bad_checkpoint);
+}
+
+template<class TagStore>
+void
+Cache<TagStore>::unserialize(Checkpoint *cp, const std::string &section)
+{
+ bool bad_checkpoint;
+ UNSERIALIZE_SCALAR(bad_checkpoint);
+ if (bad_checkpoint) {
+ fatal("Restoring from checkpoints with caches is not supported in the "
+ "classic memory system. Please remove any caches before taking "
+ "checkpoints.\n");
+ }
+}
///////////////
//