Hello,

A ReplaceableEntry (src/mem/cache/replacement_policies/replaceable_entry.hh) represents an entry of the cache and contains ReplacementData that you have to derive to adapt it to your replacement policy (add a RRPV for example).

You have to derive BaseReplacementPolicy from src/mem/cache/replacement_policies/base.hh:

invalidate(): invalidate an entry, for DRRIP you need to set your RRPV to an invalid distance.

touch(): update your replacement data when accessing this entry.

reset(): when a new block is set to this entry, set the initial replacement data here.

getVictim() chose the ReplaceableEntry (cahce line) to evict.

See src/mem/cache/replacement_policies/base.hh for the base class of replacement policies and a better descriptions of the methods and see src/mem/cache/replacement_policies/lru_rp.cc/.hh for an example of simple replacement policy (LRU).

I see two ways of implementing DRRIP:

-You can implement set duelling as a new replacement policy and call the right replacement policies methods according to what is assigned the entry your are accessing. BRRIP is implemented and SSRIP is a particular case of BRRIP so you can pass them to your set duelling and call them as you want. This is what I did some times ago because I needed to implement DIP too.

-You can fully implement DRRIP like a totally independent replacement policy.



Le 21/11/2020 à 03:37, John H via gem5-users a écrit :
Hello,

I am new with gem5, just getting started. I wanted to implement DRRIP cache replacement policy. Have any one of you tried implementing this? Any pointers on this would be helpful.

Thanks,

John

_______________________________________________
gem5-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

--
Anis Peysieux
Doctorant - Équipe PACAP

Centre de recherche INRIA Rennes - Bretagne Atlantique
Bâtiment 12E, Bureau E301, Campus de Beaulieu,
35042 Rennes Cedex, France

_______________________________________________
gem5-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to