Hi all,
I want to use Gems to study cache replacement policies for CMPs. One of
the things I need to do is add to the L2 cache a thread_ID field which
will hold the id of the processor/thread that brought the cache block
into the L2 cache in the first place.
So, I have added an array that holds the id to the CacheMemory class and
whenever deallocate is called I reset the thread_ID of the touched block
(this is the easy part of course :-) ). The problem is that I am not
sure how to set the ID whenever a new block is allocated into the cache.
First of all, I am not sure what happens when a L2 miss is detected. I
would assume that the following happens :
L2 miss detected -> L2_cacheMemory.cacheProbe (to find the replacement
victim) -> L2_cacheMemory.deallocate (deallocate the selected victim) ->
L2)_cacheMemory.allocate (allocation of the new block).
Is that right? And more importantly where is this sequence defined?
I 've looked at the generated code of the protocol and I found that in
L2Cache_Transitions.C the qq_allocateL2CacheBlock method (which calls
the allocate method of CacheMemory) is called when for example the state
in L2 is NP (not present) and the event is L2Cache_Event_L1_GET_INSTR.
However I wasn't able to find where the victim cache block was selected
and deallocated prior to the new block's allocation.
Any pointers/comments/insights will be greatly appreciated!
Kind regards,
Kostis
|