Dear George,

At the moment the replacement policies are LRU-based. If you want to experiment 
with 
various replacement policies, I suggest that you use cfg.Policy parameter. Then 
you should 
modify this enum in StdArray.hp by adding your policies, for example:
 
enum ReplacementPolicy {
  REPLACEMENT_LRU,
  REPLACEMENT_PLRU,
  GEORGE_POLICY1,
  GEORGE_POLICY2
};

When constructing the StdArray object, you should parse the cfg.Policy 
parameter and 
set your replacement policy to GEORGE_POLICY1 or whatever you like. Also, the 
new 
class that implements your policy should be constructed and set accordingly in 
the switch 
statement within init(). 

Yes, you will have to change the methods you mentioned. You will probably need 
additional 
data structures and methods to implement your policy. Other than this, I don’t 
think anything 
should be changed (although I have never experimented with replacement 
policies). Keep in 
mind that recordAccess() is used not only for insertions, but also for lookups. 

Also, please make sure that your timing simulator is consistent with the 
corresponding trace 
simulator (in terms of the replacement policies).

Regards,
Djordje
________________________________________
From: George Ioannidis [[email protected]]
Sent: Thursday, May 12, 2011 11:04 PM
To: Simflex
Subject: Cache Partitioning in L2 CMP Cache

 Hello,

 I am trying to implement cache partitioning in L2 CMP Caches, namely to
 change insertion/replacement policies. I want to ask if I have to modify
 anything else besides the things I'm stating just below.

 As I have seen, to change the replacement policy, I only have to make
 changes within the components/CMPCache/StdArray.hpp (find attached), by
 creating a new template class, similar to the SetLRU class, i.e.:

 template<typename _State, const _State &_DefaultState>
 class SetPartition : public Set<_State, _DefaultState>

 1) To change the eviction policy (like don't remove the LRU block, but
 something else), I only have to modify the method: virtual
 Block<_State,_DefaultState>* pickVictim()
 2) To change the insertion policy (like don't move the block to the
 MRU, but somewhere else), I only have to modify the method: virtual void
 recordAccess(Block<_State,_DefaultState> *aBlock)

 Am I missing something else that I have to change (in StdArray.hpp or
 in another file) or do I only have to change the aforementioned methods?


 Thank you,
 -George

Reply via email to