gem5  v22.1.0.0
tree_plru_rp.hh
Go to the documentation of this file.
1 
69 #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_TREE_PLRU_RP_HH__
70 #define __MEM_CACHE_REPLACEMENT_POLICIES_TREE_PLRU_RP_HH__
71 
72 #include <cstdint>
73 #include <memory>
74 #include <vector>
75 
77 
78 namespace gem5
79 {
80 
81 struct TreePLRURPParams;
82 
83 GEM5_DEPRECATED_NAMESPACE(ReplacementPolicy, replacement_policy);
84 namespace replacement_policy
85 {
86 
87 class TreePLRU : public Base
88 {
89  private:
110 
114  const uint64_t numLeaves;
115 
121  uint64_t count;
122 
127 
128  protected:
134  {
140  const uint64_t index;
141 
147  std::shared_ptr<PLRUTree> tree;
148 
155  TreePLRUReplData(const uint64_t index, std::shared_ptr<PLRUTree> tree);
156  };
157 
158  public:
159  typedef TreePLRURPParams Params;
160  TreePLRU(const Params &p);
161  ~TreePLRU() = default;
162 
169  void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
170  override;
171 
178  void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
179  override;
180 
187  void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
188  override;
189 
197  ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
198  override;
199 
210  std::shared_ptr<ReplacementData> instantiateEntry() override;
211 };
212 
213 } // namespace replacement_policy
214 } // namespace gem5
215 
216 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_TREE_PLRU_RP_HH__
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
A common base class of cache replacement policy objects.
Definition: base.hh:56
BaseReplacementPolicyParams Params
Definition: base.hh:58
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
const uint64_t numLeaves
Number of leaves that share a single replacement data.
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using TreePLRU bits.
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
uint64_t count
Count of the number of sharers of a replacement data.
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
std::vector< bool > PLRUTree
Instead of implementing the tree itself with pointers, it is implemented as an array of bits.
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
PLRUTree * treeInstance
Holds the latest temporary tree instance created by instantiateEntry().
Bitfield< 54 > p
Definition: pagetable.hh:70
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
The replacement data needed by replacement policies.
Tree-PLRU-specific implementation of replacement data.
std::shared_ptr< PLRUTree > tree
Shared tree pointer.
TreePLRUReplData(const uint64_t index, std::shared_ptr< PLRUTree > tree)
Default constructor.
Definition: tree_plru_rp.cc:99
const uint64_t index
Theoretical index of this replacement data in the tree.

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