The code is marking the block that is being replaced invalid there, and the caller of insertBlock() should be marking the block valid when it's the insertion is complete (along with the other status the block can have based on why the block is being replaced).
Ali On Feb 7, 2013, at 6:07 PM, Rodrigo Reynolds RamÃrez <rodrigo.r...@hotmail.com> wrote: > Hello Everyone, > > I have been updating my cache code from the stable version to a new one > (890fc69ba53c). My code is for the cache replacement policies, I have a > doubt, in the insertBlock method for the src/mem/cache/tags/lru.cc. There is > an invalidation for the block that is being inserted. I copy the code below, > this invalidation is not present in the stable version I think it does not be > there, because you are invalidating the block that you are inserting. Is that > right? > > Thanks in advance > Rodrigo > > if (blk->isValid()) { > replacements[0]++; > totalRefs += blk->refCount; > ++sampledRefs; > blk->refCount = 0; > > // deal with evicted block > assert(blk->srcMasterId < cache->system->maxMasters()); > occupancies[blk->srcMasterId]--; > > blk->invalidate(); //I think this line is incorrect > } > _______________________________________________ > gem5-users mailing list > gem5-users@gem5.org > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________ gem5-users mailing list gem5-users@gem5.org http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users