>refCount is just counting the number of times that block has been >referenced. The lru policy is maintained without making use of refCount.
i can not understand why.... Doesn't "refCount is just counting the number of times that block has been referenced" represent a Most Recently Used (or Lease Recently Used) block? >Read the function accessBlock() in lru.cc >From my understandings, 1) a block is found based on set and tag BlkType *blk = sets[set].findBlk(tag); 2) If the block is found, it is placed on the MRU position: sets[set].moveToHead(blk); 3) The next 'if" statement is about timing. 4) incrementing the refCount which shows this block has been accessed blk->refCount += 1; 5) the block is returned to caller (cache_impl.hh::access()) So where is replacement? On 1/3/12, Nilay <[email protected]> wrote: > On Tue, January 3, 2012 1:14 am, Mahmood Naderan wrote: >> Hi, >> If you look at findVictim(), you can see that a block is selected >> (with set number) and no matter what is the refCount (I think this is >> LRU counter), the block is selected as victim. > > refCount is just counting the number of times that block has been > referenced. The lru policy is maintained without making use of refCount. > >> >> BlkType *blk = sets[set].blks[assoc-1]; >> if (blk->isValid()) { >> replacements[0]++; >> totalRefs += blk->refCount; >> ++sampledRefs; >> blk->refCount = 0; >> ..... >> DPRINTF(CacheRepl, "set %x: selecting blk %x for replacement\n", >> set, regenerateBlkAddr(blk->tag, set)); >> } >> return blk; >> >> As far as I know, in LRU policy, after finding the set number, all >> counters in the ways are compared to find the minimum one. That is >> actually show the least referenced way. > > The block that has been referenced the least number of times is not > necessarily the LRU block. Read the function accessBlock() in lru.cc to > figure out how the LRU policy is being enforced. > >> >> Can someone clarify that? >> -- >> // Naderan *Mahmood; >> _______________________________________________ >> gem5-users mailing list >> [email protected] >> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users >> > > > -- > Nilay > > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users > -- -- // Naderan *Mahmood; _______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
