gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
78namespace gem5
79{
80
81struct TreePLRURPParams;
82
83namespace replacement_policy
84{
85
86class TreePLRU : public Base
87{
88 private:
109
113 const uint64_t numLeaves;
114
120 uint64_t count;
121
126
127 protected:
133 {
139 const uint64_t index;
140
146 std::shared_ptr<PLRUTree> tree;
147
154 TreePLRUReplData(const uint64_t index, std::shared_ptr<PLRUTree> tree);
155 };
156
157 public:
158 typedef TreePLRURPParams Params;
159 TreePLRU(const Params &p);
160 ~TreePLRU() = default;
161
168 void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
169 override;
170
177 void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
178 override;
179
186 void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
187 override;
188
196 ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
197 override;
198
209 std::shared_ptr<ReplacementData> instantiateEntry() override;
210};
211
212} // namespace replacement_policy
213} // namespace gem5
214
215#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:55
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().
STL vector class.
Definition stl.hh:37
Bitfield< 0 > p
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
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.
const uint64_t index
Theoretical index of this replacement data in the tree.

Generated on Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0