Hi List,
I am trying to keep track of the number of times a address is referenced in L2 cache. For this I have added a "counter" entry in the Cache structure (in MSI_MOSI_CMP_dierctory_L2cache.sm) & its value gets incremented on each reference
================================================================
L2cacheMemory[addr].counter:=L2cacheMemory[addr].counter+1; // called in whenever a request comes either from private L1 or from other nodes
=================================================================
I also want to clear this counter value when a line gets deallocated, for this I reset the counter on the following action
==============================================================================
action(rr_deallocateL2CacheBlock, "\r", desc="Deallocate L2 cache block. Sets the cache to not present, allowing a replacement in parallel with a fetch.") {
L2cacheMemory[address].counter:=0;
L2cacheMemory.deallocate(address);
}
==============================================================================
But the problem is the counter never gets cleared it is always incrementing, even though the line gets deallocated!!!
Any idea why this is happening or I am doing something wrong???
Shoaib
|