Cache: Panic if you attempt to create a checkpoint with a cache in the system
This commit is contained in:
6
src/mem/cache/cache.hh
vendored
6
src/mem/cache/cache.hh
vendored
@@ -370,6 +370,12 @@ class Cache : public BaseCache
|
||||
* Find next request ready time from among possible sources.
|
||||
*/
|
||||
Tick nextMSHRReadyTime();
|
||||
|
||||
/** serialize the state of the caches
|
||||
* We currently don't support checkpointing cache state, so this panics.
|
||||
*/
|
||||
virtual void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
};
|
||||
|
||||
#endif // __CACHE_HH__
|
||||
|
||||
29
src/mem/cache/cache_impl.hh
vendored
29
src/mem/cache/cache_impl.hh
vendored
@@ -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 §ion)
|
||||
{
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
///////////////
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user