gem5
v20.1.0.0
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
struct
TreePLRURPParams;
79
80
class
TreePLRURP
:
public
BaseReplacementPolicy
81
{
82
private
:
102
typedef
std::vector<bool>
PLRUTree
;
103
107
const
uint64_t
numLeaves
;
108
114
uint64_t
count
;
115
119
PLRUTree
*
treeInstance
;
120
121
protected
:
126
struct
TreePLRUReplData
:
ReplacementData
127
{
133
const
uint64_t
index
;
134
140
std::shared_ptr<PLRUTree>
tree
;
141
148
TreePLRUReplData
(
const
uint64_t
index
, std::shared_ptr<PLRUTree>
tree
);
149
};
150
151
public
:
153
typedef
TreePLRURPParams
Params
;
154
158
TreePLRURP
(
const
Params
*
p
);
159
163
~TreePLRURP
() {}
164
171
void
invalidate
(
const
std::shared_ptr<ReplacementData>& replacement_data)
172
const override
;
173
180
void
touch
(
const
std::shared_ptr<ReplacementData>& replacement_data)
const
181
override
;
182
189
void
reset
(
const
std::shared_ptr<ReplacementData>& replacement_data)
const
190
override
;
191
199
ReplaceableEntry
*
getVictim
(
const
ReplacementCandidates
& candidates)
const
200
override
;
201
212
std::shared_ptr<ReplacementData>
instantiateEntry
()
override
;
213
};
214
215
#endif // __MEM_CACHE_REPLACEMENT_POLICIES_TREE_PLRU_RP_HH__
ReplaceableEntry
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Definition:
replaceable_entry.hh:53
TreePLRURP::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:102
BaseReplacementPolicy::Params
BaseReplacementPolicyParams Params
Convenience typedef.
Definition:
base.hh:52
TreePLRURP::Params
TreePLRURPParams Params
Convenience typedef.
Definition:
tree_plru_rp.hh:153
TreePLRURP::TreePLRUReplData
Tree-PLRU-specific implementation of replacement data.
Definition:
tree_plru_rp.hh:126
TreePLRURP::getVictim
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using TreePLRU bits.
Definition:
tree_plru_rp.cc:167
std::vector< bool >
ReplacementData
Copyright (c) 2018 Inria All rights reserved.
Definition:
replaceable_entry.hh:41
TreePLRURP::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:133
TreePLRURP::~TreePLRURP
~TreePLRURP()
Destructor.
Definition:
tree_plru_rp.hh:163
TreePLRURP::TreePLRUReplData::TreePLRUReplData
TreePLRUReplData(const uint64_t index, std::shared_ptr< PLRUTree > tree)
Default constructor.
Definition:
tree_plru_rp.cc:92
BaseReplacementPolicy
A common base class of cache replacement policy objects.
Definition:
base.hh:46
TreePLRURP
Definition:
tree_plru_rp.hh:80
TreePLRURP::TreePLRUReplData::index
const uint64_t index
Theoretical index of this replacement data in the tree.
Definition:
tree_plru_rp.hh:133
TreePLRURP::reset
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
Definition:
tree_plru_rp.cc:159
base.hh
TreePLRURP::instantiateEntry
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition:
tree_plru_rp.cc:195
TreePLRURP::invalidate
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) const override
Invalidate replacement data to set it as the next probable victim.
Definition:
tree_plru_rp.cc:107
TreePLRURP::numLeaves
const uint64_t numLeaves
Number of leaves that share a single replacement data.
Definition:
tree_plru_rp.hh:107
TreePLRURP::count
uint64_t count
Count of the number of sharers of a replacement data.
Definition:
tree_plru_rp.hh:114
MipsISA::p
Bitfield< 0 > p
Definition:
pra_constants.hh:323
TreePLRURP::treeInstance
PLRUTree * treeInstance
Holds the latest temporary tree instance created by instantiateEntry().
Definition:
tree_plru_rp.hh:119
TreePLRURP::TreePLRURP
TreePLRURP(const Params *p)
Construct and initiliaze this replacement policy.
Definition:
tree_plru_rp.cc:98
TreePLRURP::TreePLRUReplData::tree
std::shared_ptr< PLRUTree > tree
Shared tree pointer.
Definition:
tree_plru_rp.hh:140
Generated on Wed Sep 30 2020 14:02:12 for gem5 by
doxygen
1.8.17