gem5  v22.1.0.0
base.hh
Go to the documentation of this file.
1 
29 #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
30 #define __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
31 
32 #include <memory>
33 
34 #include "base/compiler.hh"
36 #include "mem/packet.hh"
37 #include "params/BaseReplacementPolicy.hh"
38 #include "sim/sim_object.hh"
39 
40 namespace gem5
41 {
42 
47 
48 GEM5_DEPRECATED_NAMESPACE(ReplacementPolicy, replacement_policy);
49 namespace replacement_policy
50 {
51 
55 class Base : public SimObject
56 {
57  public:
58  typedef BaseReplacementPolicyParams Params;
59  Base(const Params &p) : SimObject(p) {}
60  virtual ~Base() = default;
61 
67  virtual void invalidate(const std::shared_ptr<ReplacementData>&
68  replacement_data) = 0;
69 
76  virtual void touch(const std::shared_ptr<ReplacementData>&
77  replacement_data, const PacketPtr pkt)
78  {
79  touch(replacement_data);
80  }
81  virtual void touch(const std::shared_ptr<ReplacementData>&
82  replacement_data) const = 0;
83 
90  virtual void reset(const std::shared_ptr<ReplacementData>&
91  replacement_data, const PacketPtr pkt)
92  {
93  reset(replacement_data);
94  }
95  virtual void reset(const std::shared_ptr<ReplacementData>&
96  replacement_data) const = 0;
97 
105  const ReplacementCandidates& candidates) const = 0;
106 
112  virtual std::shared_ptr<ReplacementData> instantiateEntry() = 0;
113 };
114 
115 } // namespace replacement_policy
116 } // namespace gem5
117 
118 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Abstract superclass for simulation objects.
Definition: sim_object.hh:148
A common base class of cache replacement policy objects.
Definition: base.hh:56
virtual void touch(const std::shared_ptr< ReplacementData > &replacement_data) const =0
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data) const =0
virtual void invalidate(const std::shared_ptr< ReplacementData > &replacement_data)=0
Invalidate replacement data to set it as the next probable victim.
virtual ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt)
Reset replacement data.
Definition: base.hh:90
BaseReplacementPolicyParams Params
Definition: base.hh:58
virtual void touch(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt)
Update replacement data.
Definition: base.hh:76
Base(const Params &p)
Definition: base.hh:59
virtual std::shared_ptr< ReplacementData > instantiateEntry()=0
Instantiate a replacement data entry.
STL vector class.
Definition: stl.hh:37
Bitfield< 54 > p
Definition: pagetable.hh:70
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::vector< ReplaceableEntry * > ReplacementCandidates
Replacement candidates as chosen by the indexing policy.
Definition: base.hh:46
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
Declaration of the Packet class.

Generated on Wed Dec 21 2022 10:22:28 for gem5 by doxygen 1.9.1