gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tree_plru_rp.hh
Go to the documentation of this file.
1 
71 #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_TREE_PLRU_RP_HH__
72 #define __MEM_CACHE_REPLACEMENT_POLICIES_TREE_PLRU_RP_HH__
73 
74 #include <cstdint>
75 #include <memory>
76 #include <vector>
77 
79 
80 struct TreePLRURPParams;
81 
83 {
84  private:
105 
109  const uint64_t numLeaves;
110 
116  uint64_t count;
117 
121  PLRUTree* treeInstance;
122 
123  protected:
129  {
135  const uint64_t index;
136 
142  std::shared_ptr<PLRUTree> tree;
143 
150  TreePLRUReplData(const uint64_t index, std::shared_ptr<PLRUTree> tree);
151  };
152 
153  public:
155  typedef TreePLRURPParams Params;
156 
160  TreePLRURP(const Params *p);
161 
166 
173  void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
174  const override;
175 
182  void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
183  override;
184 
191  void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
192  override;
193 
201  ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
202  override;
203 
214  std::shared_ptr<ReplacementData> instantiateEntry() override;
215 };
216 
217 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_TREE_PLRU_RP_HH__
uint64_t count
Count of the number of sharers of a replacement data.
TreePLRUReplData(const uint64_t index, std::shared_ptr< PLRUTree > tree)
Default constructor.
Definition: tree_plru_rp.cc:94
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.
PLRUTree * treeInstance
Holds the latest temporary tree instance created by instantiateEntry().
A common base class of cache replacement policy objects.
Definition: base.hh:48
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) const override
Invalidate replacement data to set it as the next probable victim.
Copyright (c) 2018 Inria All rights reserved.
TreePLRURPParams Params
Convenience typedef.
TreePLRURP(const Params *p)
Construct and initiliaze this replacement policy.
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
Tree-PLRU-specific implementation of replacement data.
~TreePLRURP()
Destructor.
std::vector< bool > PLRUTree
Instead of implementing the tree itself with pointers, it is implemented as an array of bits...
std::shared_ptr< PLRUTree > tree
Shared tree pointer.
const uint64_t index
Theoretical index of this replacement data in the tree.
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using TreePLRU bits.
Bitfield< 0 > p
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.

Generated on Fri Feb 28 2020 16:27:02 for gem5 by doxygen 1.8.13