uby: Fix checkpointing and restore
[gem5.git] / src / mem / ruby / system / CacheRecorder.cc
index 3a76a64f7545b1fe08f26f46feb3f1ddce427ffe..8e8757967747dc330079084960508f53090cf500 100644 (file)
@@ -95,6 +95,8 @@ CacheRecorder::enqueueNextFlushRequest()
         m_sequencer_ptr->makeRequest(pkt);
 
         DPRINTF(RubyCacheTrace, "Flushing %s\n", *rec);
+    } else {
+        DPRINTF(RubyCacheTrace, "Flushed all %d records\n", m_records_flushed);
     }
 }
 
@@ -109,21 +111,21 @@ CacheRecorder::enqueueNextFetchRequest()
 
         for (int rec_bytes_read = 0; rec_bytes_read < m_block_size_bytes;
                 rec_bytes_read += RubySystem::getBlockSizeBytes()) {
-            Request* req = new Request();
+            Request* req = nullptr;
             MemCmd::Command requestType;
 
             if (traceRecord->m_type == RubyRequestType_LD) {
                 requestType = MemCmd::ReadReq;
-                req->setPhys(traceRecord->m_data_address + rec_bytes_read,
+                req = new Request(traceRecord->m_data_address + rec_bytes_read,
                     RubySystem::getBlockSizeBytes(), 0, Request::funcMasterId);
             }   else if (traceRecord->m_type == RubyRequestType_IFETCH) {
                 requestType = MemCmd::ReadReq;
-                req->setPhys(traceRecord->m_data_address + rec_bytes_read,
+                req = new Request(traceRecord->m_data_address + rec_bytes_read,
                         RubySystem::getBlockSizeBytes(),
                         Request::INST_FETCH, Request::funcMasterId);
             }   else {
                 requestType = MemCmd::WriteReq;
-                req->setPhys(traceRecord->m_data_address + rec_bytes_read,
+                req = new Request(traceRecord->m_data_address + rec_bytes_read,
                     RubySystem::getBlockSizeBytes(), 0, Request::funcMasterId);
             }
 
@@ -137,13 +139,15 @@ CacheRecorder::enqueueNextFetchRequest()
 
         m_bytes_read += (sizeof(TraceRecord) + m_block_size_bytes);
         m_records_read++;
+    } else {
+        DPRINTF(RubyCacheTrace, "Fetched all %d records\n", m_records_read);
     }
 }
 
 void
 CacheRecorder::addRecord(int cntrl, const physical_address_t data_addr,
                          const physical_address_t pc_addr,
-                         RubyRequestType type, Time time, DataBlock& data)
+                         RubyRequestType type, Tick time, DataBlock& data)
 {
     TraceRecord* rec = (TraceRecord*)malloc(sizeof(TraceRecord) +
                                             m_block_size_bytes);