ruby: cache recorder: move check on block size to RubySystem.
authorNilay Vaish <nilay@cs.wisc.edu>
Sat, 15 Aug 2015 00:28:44 +0000 (19:28 -0500)
committerNilay Vaish <nilay@cs.wisc.edu>
Sat, 15 Aug 2015 00:28:44 +0000 (19:28 -0500)
src/mem/ruby/system/CacheRecorder.cc
src/mem/ruby/system/System.cc

index 339cf1b4f748bc76c6b142365b7e676da7341dbf..9568d6a88ec384e832bd42062bd59e3864b04b9a 100644 (file)
@@ -58,15 +58,6 @@ CacheRecorder::CacheRecorder(uint8_t* uncompressed_trace,
       m_seq_map(seq_map),  m_bytes_read(0), m_records_read(0),
       m_records_flushed(0), m_block_size_bytes(block_size_bytes)
 {
-    if (m_uncompressed_trace != NULL) {
-        if (m_block_size_bytes < RubySystem::getBlockSizeBytes()) {
-            // Block sizes larger than when the trace was recorded are not
-            // supported, as we cannot reliably turn accesses to smaller blocks
-            // into larger ones.
-            panic("Recorded cache block size (%d) < current block size (%d) !!",
-                    m_block_size_bytes, RubySystem::getBlockSizeBytes());
-        }
-    }
 }
 
 CacheRecorder::~CacheRecorder()
index b623e351d0acc8970758b5551534233eb01ee2ec..ad2f59e4fadb91d409cf73a142419e33d6d5f8a7 100644 (file)
@@ -304,9 +304,17 @@ RubySystem::unserialize(CheckpointIn &cp)
     // This value should be set to the checkpoint-system's block-size.
     // Optional, as checkpoints without it can be run if the
     // checkpoint-system's block-size == current block-size.
-    uint64_t block_size_bytes = getBlockSizeBytes();
+    uint64_t block_size_bytes = m_block_size_bytes;
     UNSERIALIZE_OPT_SCALAR(block_size_bytes);
 
+    if (block_size_bytes < m_block_size_bytes) {
+        // Block sizes larger than when the trace was recorded are not
+        // supported, as we cannot reliably turn accesses to smaller blocks
+        // into larger ones.
+        panic("Recorded cache block size (%d) < current block size (%d) !!",
+              block_size_bytes, m_block_size_bytes);
+    }
+
     string cache_trace_file;
     uint64_t cache_trace_size = 0;