diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2015-08-28 10:58:44 +0100 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2015-08-28 10:58:44 +0100 |
commit | e9d6bf5e35b732df925f65a7b7adaa746f6a7f3b (patch) | |
tree | 0815f893cdece423342a11df7c03f648933f88e7 /src/mem/ruby/system/System.cc | |
parent | fc3d34a4889f96395d7d3185a0c5a2dbb5c77343 (diff) | |
download | gem5-e9d6bf5e35b732df925f65a7b7adaa746f6a7f3b.tar.xz |
ruby: Use the const serialize interface in RubySystem
The new serialization code (kudos to Tim Jones) moves all of the state
mangling in RubySystem to memWriteback. This makes it possible to use
the new const serialization interface.
This changeset moves the cache recorder cleanup from the checkpoint()
method to drainResume() to make checkpointing truly constant and
updates the checkpointing code to use the new interface.
Diffstat (limited to 'src/mem/ruby/system/System.cc')
-rw-r--r-- | src/mem/ruby/system/System.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc index c00082010..fd712a47a 100644 --- a/src/mem/ruby/system/System.cc +++ b/src/mem/ruby/system/System.cc @@ -235,7 +235,7 @@ RubySystem::writeCompressedTrace(uint8_t *raw_data, string filename, } void -RubySystem::serializeOld(CheckpointOut &cp) +RubySystem::serialize(CheckpointOut &cp) const { // Store the cache-block size, so we are able to restore on systems with a // different cache-block size. CacheRecorder depends on the correct @@ -259,10 +259,17 @@ RubySystem::serializeOld(CheckpointOut &cp) SERIALIZE_SCALAR(cache_trace_file); SERIALIZE_SCALAR(cache_trace_size); +} - // Now finished with the cache recorder. - delete m_cache_recorder; - m_cache_recorder = NULL; +void +RubySystem::drainResume() +{ + // Delete the cache recorder if it was created in memWriteback() + // to checkpoint the current cache state. + if (m_cache_recorder) { + delete m_cache_recorder; + m_cache_recorder = NULL; + } } void |