diff -r 110cce93d398 -r f2dc54dbf12d src/mem/ruby/system/System.hh --- a/src/mem/ruby/system/System.hh Fri Aug 14 19:28:44 2015 -0500 +++ b/src/mem/ruby/system/System.hh Wed Aug 19 14:34:19 2015 +0100 @@ -94,8 +94,9 @@ void resetStats(); void memWriteback(); - void serializeOld(CheckpointOut &cp) M5_ATTR_OVERRIDE; + void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE; void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE; + void drainResume() M5_ATTR_OVERRIDE; void process(); void startup(); bool functionalRead(Packet *ptr); @@ -120,11 +121,11 @@ uint64_t cache_trace_size, uint64_t block_size_bytes); - void readCompressedTrace(std::string filename, - uint8_t *&raw_data, - uint64_t &uncompressed_trace_size); - void writeCompressedTrace(uint8_t *raw_data, std::string file, - uint64_t uncompressed_trace_size); + static void readCompressedTrace(std::string filename, + uint8_t *&raw_data, + uint64_t &uncompressed_trace_size); + static void writeCompressedTrace(uint8_t *raw_data, std::string file, + uint64_t uncompressed_trace_size); private: // configuration parameters diff -r 110cce93d398 -r f2dc54dbf12d src/mem/ruby/system/System.cc --- a/src/mem/ruby/system/System.cc Fri Aug 14 19:28:44 2015 -0500 +++ b/src/mem/ruby/system/System.cc Wed Aug 19 14:34:19 2015 +0100 @@ -232,7 +232,7 @@ } 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 @@ -256,10 +256,17 @@ 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