[Gems-users] About Cache Replacement


Date: Mon, 12 Oct 2009 11:07:01 -0400
From: dai jianwei <adaihf@xxxxxxxxx>
Subject: [Gems-users] About Cache Replacement
Hi, all

  Sorry to trouble you.
  
  I am not quite understanding how a cache replacement works. For example, from MESI_CMP_directory-L2cache.sm, I got 

// L1 Request
...
//No room in the L2, so we need to make room before handling the request
if (L2cacheMemory[ L2cache.Memory.cacheProbe(in_msg.Address) ].Dirty ){
trigger(Event:L2_Replacement, L2cacheMemory.cacheProbe(in_msg.Address));
} else{
... }

Suppose the condition is met, then we will go to "Event: L2_Replacement". In the .sm file, we can find many kinds of transistions regarding "Event:L2_Replacement", like

Transtion(SS, L2_Replacement, S_I) {
i_allocateTBE;
f_sendInvToSharers;
rr_deallocateL2CacheBlock;
}

...
Suppose the current state is "SS", then according to the "Transition", we first will allocate a TBE(i_allocateTBE), then second send invalid to other sharers(f_sendInvToSharers), and then do deallocation for the L2 Cache Block(rr_deallocateL2CacheBlock) .  

For the replacement, I think we need to replace the victim cache block with the demanded cache block. Is it right? If so, I am wondering when this action takes place and where I can find the related information. I read through the .sm file, however I did not find the answer by myself. Is there anyone who can help me out of this? Thanks a lot for your help.


Jianwei
[← Prev in Thread] Current Thread [Next in Thread→]