Hello,
A few years ago I have implemented a few PC-reliant RPs for fun, but did not 
merge them upstream because I did not have time to fully test them. One day 
they shall see the light of day, though :)

I don't remember what is required for the PC change in particular, but here are 
the changes that may be needed (I will add small sections of the commits for 
clarity). Remember that this implementation was created before Ruby started 
using the RPs too, so it may not work today:

=> Make RP:invalidate() not const (Usually these PC-reliant RPs use predictors, 
which must be updated on invalidations)

=> Use PacketPtr in *Tags::accessBlock()-    virtual CacheBlk* accessBlock(Addr 
addr, bool is_secure, Cycles &lat) = 0;
+    virtual CacheBlk* accessBlock(const PacketPtr pkt, Cycles &lat) = 0;
=> Make touch() and reset() use packets     virtual void touch(const 
std::shared_ptr<ReplacementData>&
-                                                replacement_data) const = 0;
+        replacement_data, const PacketPtr pkt)
+    {
+        touch(replacement_data);
+    }
+    virtual void touch(const std::shared_ptr<ReplacementData>&
+        replacement_data) const = 0;
      virtual void reset(const std::shared_ptr<ReplacementData>&-               
                                 replacement_data) const = 0;
+        replacement_data, const PacketPtr pkt)
+    {
+        reset(replacement_data);
+    }
+    virtual void reset(const std::shared_ptr<ReplacementData>&
+        replacement_data) const = 0;

=> Create your RP that overrides the newly created touch() and reset() to use 
the packets' info

Regarding your questions:1) In src/mem/packet.hh
2) The Classic cache is inside src/mem/cache/
Regards,Daniel
   Em quarta-feira, 28 de outubro de 2020 17:30:49 GMT+1, Abhishek Singh via 
gem5-users <gem5-users@gem5.org> escreveu:  
 
 Hi,
I think you should check already implemented policies in 
src/mem/cache/replacement_policies and then design yours taking that as an 
template/example.
In order to get information which you mentioned, you might have to change/add 
arguments to accessBlock, findBlock, insertBlock, etc function in 
base_set_assoc.
The information you are looking can be found in pkt class.
For simplicity you can also use fa_lru as template and change things in it to 
implement replacement policies. 
On Wed, Oct 28, 2020 at 11:46 AM Chongzhi Zhao via gem5-users 
<gem5-users@gem5.org> wrote:

Hi,I'm trying to evaluate a cache replacement policy with classic memory in SE 
mode. A few questions:   
   - The policy requires PC, address, and access type (demand 
read/writeback/prefetch) to be made visible. However, I don't see these exposed 
to the replacement policies. Where may I find them?
   - The member functions are referenced in classes CacheMemory, SectorTags, 
and BaseSetAssoc. Which one of them would be relevant to classic memory?
Cheers,
Chongzhi Zhao_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
-- 
Best Regards,
Abhishek_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s  
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to