mem: Fix DRAM bank occupancy for streaming access
authorAni Udipi <ani.udipi@arm.com>
Fri, 1 Nov 2013 15:56:18 +0000 (11:56 -0400)
committerAni Udipi <ani.udipi@arm.com>
Fri, 1 Nov 2013 15:56:18 +0000 (11:56 -0400)
This patch fixes an issue that allowed more than 100% bus utilisation
in certain cases.

src/mem/simple_dram.cc

index 280ab640df0dcbc06192eb074179d4dc23e6af36..39f320dc5f9adb03bb8ad457528b90ff8e6559d9 100644 (file)
@@ -957,13 +957,19 @@ SimpleDRAM::estimateLatency(DRAMPacket* dram_pkt, Tick inTime)
             // but do care about bank being free for access
             rowHitFlag = true;
 
-            if (bank.freeAt < inTime) {
+            // When a series of requests arrive to the same row,
+            // DDR systems are capable of streaming data continuously
+            // at maximum bandwidth (subject to tCCD). Here, we approximate
+            // this condition, and assume that if whenever a bank is already
+            // busy and a new request comes in, it can be completed with no
+            // penalty beyond waiting for the existing read to complete.
+            if (bank.freeAt > inTime) {
+                accLat += bank.freeAt - inTime;
+                bankLat += tBURST;
+            } else {
                // CAS latency only
                accLat += tCL;
                bankLat += tCL;
-            } else {
-                accLat += 0;
-                bankLat += 0;
             }
 
         } else {