Mem: Put prefetcher notify call before packet is deleted.
authorAli Saidi <Ali.Saidi@ARM.com>
Fri, 19 Aug 2011 20:08:08 +0000 (15:08 -0500)
committerAli Saidi <Ali.Saidi@ARM.com>
Fri, 19 Aug 2011 20:08:08 +0000 (15:08 -0500)
src/mem/cache/cache_impl.hh

index e9a40a74196f0aa5828ef52913f7b3c789a0cd12..b29d52f783e0668d411d8ec5220f025bf86f3833 100644 (file)
@@ -514,18 +514,18 @@ Cache<TagStore>::timingAccess(PacketPtr pkt)
     bool needsResponse = pkt->needsResponse();
 
     if (satisfied) {
+        if (prefetcher && (prefetchOnAccess || (blk && blk->wasPrefetched()))) {
+            if (blk)
+                blk->status &= ~BlkHWPrefetched;
+            next_pf_time = prefetcher->notify(pkt, time);
+        }
+
         if (needsResponse) {
             pkt->makeTimingResponse();
             cpuSidePort->respond(pkt, curTick()+lat);
         } else {
             delete pkt;
         }
-
-        if (prefetcher && (prefetchOnAccess || (blk && blk->wasPrefetched()))) {
-            if (blk)
-                blk->status &= ~BlkHWPrefetched;
-            next_pf_time = prefetcher->notify(pkt, time);
-        }
     } else {
         // miss