summaryrefslogtreecommitdiff
path: root/src/mem/cache
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2018-10-26 16:40:51 +0200
committerDaniel Carvalho <odanrc@yahoo.com.br>2018-11-05 13:35:00 +0000
commit49798e0eface6ad81f6227ea54980268656819c0 (patch)
tree2fcb4361c0b749d75ca87686066a66d0c5623d38 /src/mem/cache
parent33dc762d67b0337e12c1cfcdbbd14916c84d92de (diff)
downloadgem5-49798e0eface6ad81f6227ea54980268656819c0.tar.xz
mem-cache: Fix double block invalidation
Block was being invalidated twice when not a tempBlock. Make explicit that the else case is only to be applied when handling the tempBlock, as otherwise the Tags should be taking care of the invalidation. Change-Id: Ie7603fdbe156c54e94bbdc83541b55e66f8d250f Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/13895 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache')
-rw-r--r--src/mem/cache/base.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index 7bb0e0fdb..6f3914ccd 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -1305,9 +1305,13 @@ BaseCache::allocateBlock(const PacketPtr pkt, PacketList &writebacks)
void
BaseCache::invalidateBlock(CacheBlk *blk)
{
- if (blk != tempBlock)
+ // If handling a block present in the Tags, let it do its invalidation
+ // process, which will update stats and invalidate the block itself
+ if (blk != tempBlock) {
tags->invalidate(blk);
- blk->invalidate();
+ } else {
+ tempBlock->invalidate();
+ }
}
void