gem5  v21.1.0.2
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 
104  virtual ReplaceableEntry* getVictim(
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__
gem5::replacement_policy::Base::Params
BaseReplacementPolicyParams Params
Definition: base.hh:58
gem5::replacement_policy::Base::reset
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt)
Reset replacement data.
Definition: base.hh:90
gem5::replacement_policy::Base::~Base
virtual ~Base()=default
std::vector
STL vector class.
Definition: stl.hh:37
gem5::replacement_policy::Base::instantiateEntry
virtual std::shared_ptr< ReplacementData > instantiateEntry()=0
Instantiate a replacement data entry.
packet.hh
gem5::ReplacementCandidates
std::vector< ReplaceableEntry * > ReplacementCandidates
Replacement candidates as chosen by the indexing policy.
Definition: base.hh:46
replaceable_entry.hh
sim_object.hh
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:283
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
gem5::replacement_policy::Base::getVictim
virtual ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
compiler.hh
gem5::SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:146
gem5::replacement_policy::Base
A common base class of cache replacement policy objects.
Definition: base.hh:55
gem5::GEM5_DEPRECATED_NAMESPACE
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
gem5::replacement_policy::Base::Base
Base(const Params &p)
Definition: base.hh:59
gem5::replacement_policy::Base::touch
virtual void touch(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt)
Update replacement data.
Definition: base.hh:76
gem5::ReplaceableEntry
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Definition: replaceable_entry.hh:63
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::replacement_policy::Base::invalidate
virtual void invalidate(const std::shared_ptr< ReplacementData > &replacement_data)=0
Invalidate replacement data to set it as the next probable victim.

Generated on Tue Sep 21 2021 12:24:57 for gem5 by doxygen 1.8.17