Ok. I think I got it... This example will show that sets[i]=| head | .... | tail |
init (b1,0) (b2,0) (b3,0) (b4,0) b1 is accessed (b1,1) (b2,0) (b3,0) (b4,0) b3 is accessed (b3,1) (b1,1) (b2,0) (b4,0) b1 is accessed (b1,2) (b3,1) (b2,0) (b4,0) b4 is accessed (b4,1) (b1,2) (b3,1) (b2,0) b2 is accessed (b2,1) (b4,1) (b1,2) (b3,1) Now want to evict? Head shows the MRU and tail shows the LRU. The line BlkType *blk = sets[set].blks(assoc-1]; always point to tail. So (b3,1) is found as victim. The question now is what do "totalRefs" and "sampledRefs" mean? According to stat descriptions, totalRefs means "total number of references to valid blocks". Back to the example, totalRefs=1 because when b3 is selected as victim, its refCount is added to totalRefs. However totalRefs should be 5. Because valid blocks were referenced 5 times. I have no idea about sampledRefs.... Can you clarify that? On 1/3/12, Nilay Vaish <[email protected]> wrote: > On Tue, 3 Jan 2012, Mahmood Naderan wrote: > >>> 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? > > No. > >> >> >>> 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); > > This line is enforcing the LRU discipline. > >> >> 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? > > The function accessBlock() does not need to perform any replacement. > > -- > Nilay > -- -- // Naderan *Mahmood; _______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
