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'.
This commit is contained in:
Prakash Ramrakhyani 2014-03-07 15:56:23 -05:00
parent c446dc40bd
commit e88cffb30a

View file

@ -183,7 +183,7 @@ Cache<TagStore>::satisfyCpuSideRequest(PacketPtr pkt, BlkType *blk,
pkt->assertMemInhibit();
}
// on ReadExReq we give up our copy unconditionally
assert(blk != tempBlock);
if (blk != tempBlock)
tags->invalidate(blk);
blk->invalidate();
} else if (blk->isWritable() && !pending_downgrade
@ -1456,7 +1456,7 @@ 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);
if (blk != tempBlock)
tags->invalidate(blk);
blk->invalidate();
}