ruby: move stall and wakeup functions to AbstractController
[gem5.git] / src / mem / simple_dram.cc
index 340a57088fb5ee36bd57eae1c4207f66cc6ec009..0b24b4056874c17585d571af7a088ca62f4ea834 100644 (file)
@@ -396,8 +396,11 @@ SimpleDRAM::processWriteEvent()
     }
 
     // Once you're done emptying the write queue, check if there's
-    // anything in the read queue, and call schedule if required
-    schedule(nextReqEvent, busBusyUntil);
+    // anything in the read queue, and call schedule if required. The
+    // retry above could already have caused it to be scheduled, so
+    // first check
+    if (!nextReqEvent.scheduled())
+        schedule(nextReqEvent, busBusyUntil);
 }
 
 void
@@ -736,6 +739,9 @@ SimpleDRAM::accessAndRespond(PacketPtr pkt)
         // next tick
         port.schedTimingResp(pkt, curTick() + 1);
     } else {
+        // @todo the packet is going to be deleted, and the DRAMPacket
+        // is still having a pointer to it
+        pendingDelete.push_back(pkt);
     }
 
     DPRINTF(DRAM, "Done\n");