diff options
author | Prakash Ramrakhyani <prakash.ramrakhyani@arm.com> | 2014-03-07 15:56:23 -0500 |
---|---|---|
committer | Prakash Ramrakhyani <prakash.ramrakhyani@arm.com> | 2014-03-07 15:56:23 -0500 |
commit | e88cffb30a808bcfe30858167ae704ca890c72df (patch) | |
tree | f05ea0dcfe3c67b6950cb6ab1d82202e9f249159 /src/mem/cache | |
parent | c446dc40bd438057536fda6e95a44b43589f92b6 (diff) | |
download | gem5-e88cffb30a808bcfe30858167ae704ca890c72df.tar.xz |
mem: Fix incorrect assert failure in the Cache
This patch fixes an assert condition that is not true at all
times. There are valid situations that arise in dual-core
dual-workload runs where the assert condition is false. The function
call following the assert however needs to be called only when the
condition is true (a block cannot be invalidated in the tags structure
if has not been allocated in the structure, and the tempBlock is never
allocated). Hence the 'assert' has been replaced with an 'if'.
Diffstat (limited to 'src/mem/cache')
-rw-r--r-- | src/mem/cache/cache_impl.hh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh index b482d6314..e8e1876a0 100644 --- a/src/mem/cache/cache_impl.hh +++ b/src/mem/cache/cache_impl.hh @@ -183,8 +183,8 @@ Cache<TagStore>::satisfyCpuSideRequest(PacketPtr pkt, BlkType *blk, pkt->assertMemInhibit(); } // on ReadExReq we give up our copy unconditionally - assert(blk != tempBlock); - tags->invalidate(blk); + if (blk != tempBlock) + tags->invalidate(blk); blk->invalidate(); } else if (blk->isWritable() && !pending_downgrade && !pkt->sharedAsserted() && !pkt->req->isInstFetch()) { @@ -1456,8 +1456,8 @@ Cache<TagStore>::handleSnoop(PacketPtr pkt, BlkType *blk, // Do this last in case it deallocates block data or something // like that if (invalidate) { - assert(blk != tempBlock); - tags->invalidate(blk); + if (blk != tempBlock) + tags->invalidate(blk); blk->invalidate(); } |