gem5
v24.0.0.0
Loading...
Searching...
No Matches
mem
cache
replacement_policies
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
76
#include "
mem/cache/replacement_policies/base.hh
"
77
78
namespace
gem5
79
{
80
81
struct
TreePLRURPParams;
82
83
namespace
replacement_policy
84
{
85
86
class
TreePLRU
:
public
Base
87
{
88
private
:
108
typedef
std::vector<bool>
PLRUTree
;
109
113
const
uint64_t
numLeaves
;
114
120
uint64_t
count
;
121
125
PLRUTree
*
treeInstance
;
126
127
protected
:
132
struct
TreePLRUReplData
:
ReplacementData
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__
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::replacement_policy::Base
A common base class of cache replacement policy objects.
Definition
base.hh:55
gem5::replacement_policy::TreePLRU
Definition
tree_plru_rp.hh:87
gem5::replacement_policy::TreePLRU::numLeaves
const uint64_t numLeaves
Number of leaves that share a single replacement data.
Definition
tree_plru_rp.hh:113
gem5::replacement_policy::TreePLRU::getVictim
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using TreePLRU bits.
Definition
tree_plru_rp.cc:171
gem5::replacement_policy::TreePLRU::invalidate
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
Definition
tree_plru_rp.cc:112
gem5::replacement_policy::TreePLRU::Params
TreePLRURPParams Params
Definition
tree_plru_rp.hh:158
gem5::replacement_policy::TreePLRU::~TreePLRU
~TreePLRU()=default
gem5::replacement_policy::TreePLRU::count
uint64_t count
Count of the number of sharers of a replacement data.
Definition
tree_plru_rp.hh:120
gem5::replacement_policy::TreePLRU::touch
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
Definition
tree_plru_rp.cc:137
gem5::replacement_policy::TreePLRU::PLRUTree
std::vector< bool > PLRUTree
Instead of implementing the tree itself with pointers, it is implemented as an array of bits.
Definition
tree_plru_rp.hh:108
gem5::replacement_policy::TreePLRU::instantiateEntry
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition
tree_plru_rp.cc:199
gem5::replacement_policy::TreePLRU::treeInstance
PLRUTree * treeInstance
Holds the latest temporary tree instance created by instantiateEntry().
Definition
tree_plru_rp.hh:125
gem5::replacement_policy::TreePLRU::TreePLRU
TreePLRU(const Params &p)
Definition
tree_plru_rp.cc:104
std::vector
STL vector class.
Definition
stl.hh:37
base.hh
gem5::MipsISA::p
Bitfield< 0 > p
Definition
pra_constants.hh:326
gem5::statistics::reset
void reset()
Definition
statistics.cc:309
gem5
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition
binary32.hh:36
gem5::replacement_policy::ReplacementData
The replacement data needed by replacement policies.
Definition
replaceable_entry.hh:48
gem5::replacement_policy::TreePLRU::TreePLRUReplData
Tree-PLRU-specific implementation of replacement data.
Definition
tree_plru_rp.hh:133
gem5::replacement_policy::TreePLRU::TreePLRUReplData::tree
std::shared_ptr< PLRUTree > tree
Shared tree pointer.
Definition
tree_plru_rp.hh:146
gem5::replacement_policy::TreePLRU::TreePLRUReplData::TreePLRUReplData
TreePLRUReplData(const uint64_t index, std::shared_ptr< PLRUTree > tree)
Default constructor.
Definition
tree_plru_rp.cc:98
gem5::replacement_policy::TreePLRU::TreePLRUReplData::index
const uint64_t index
Theoretical index of this replacement data in the tree.
Definition
tree_plru_rp.hh:139
Generated on Tue Jun 18 2024 16:24:05 for gem5 by
doxygen
1.11.0