mem-cache: Add header delay to handleFill whenReady
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Wed, 5 Dec 2018 14:29:58 +0000 (15:29 +0100)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Thu, 7 Mar 2019 13:07:09 +0000 (13:07 +0000)
A prefetch response will have a header delay, which was not being
taken into account.

Change-Id: I66a071bc81ef41b8c0de37aa2df75171d1979a6f
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/14895
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

src/mem/cache/base.cc

index 2f734ea16af05280815db9e0b033975bebb1025e..a42f2ebdad0f891a8ca54cce9e382811d080bb9d 100644 (file)
@@ -1289,8 +1289,9 @@ BaseCache::handleFill(PacketPtr pkt, CacheBlk *blk, PacketList &writebacks,
 
         pkt->writeDataToBlock(blk->data, blkSize);
     }
-    // We pay for fillLatency here.
-    blk->setWhenReady(clockEdge(fillLatency) + pkt->payloadDelay);
+    // The block will be ready when the payload arrives and the fill is done
+    blk->setWhenReady(clockEdge(fillLatency) + pkt->headerDelay +
+                      pkt->payloadDelay);
 
     return blk;
 }