mem: Add check if SimpleDRAM nextReqEvent is scheduled
authorAndreas Hansson <andreas.hansson@arm.com>
Fri, 1 Mar 2013 18:20:33 +0000 (13:20 -0500)
committerAndreas Hansson <andreas.hansson@arm.com>
Fri, 1 Mar 2013 18:20:33 +0000 (13:20 -0500)
This check covers a case where a retry is called from the SimpleDRAM
causing a new request to appear before the DRAM itself schedules a
nextReqEvent. By adding this check, the event is not scheduled twice.

src/mem/simple_dram.cc

index 340a57088fb5ee36bd57eae1c4207f66cc6ec009..90517ec629142125326eaea8571f040e640b33eb 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