gem5
[DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
mem
cache
replacement_policies
random_rp.hh
Go to the documentation of this file.
1
28
34
35
#ifndef __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
36
#define __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
37
38
#include "
base/random.hh
"
39
#include "
mem/cache/replacement_policies/base.hh
"
40
41
namespace
gem5
42
{
43
44
struct
RandomRPParams;
45
46
namespace
replacement_policy
47
{
48
49
class
Random
:
public
Base
50
{
51
protected
:
52
mutable
gem5::Random::RandomPtr
rng
=
gem5::Random::genRandom
();
53
55
struct
RandomReplData
:
ReplacementData
56
{
61
bool
valid
;
62
66
RandomReplData
() :
valid
(false) {}
67
};
68
69
public
:
70
typedef
RandomRPParams
Params
;
71
Random
(
const
Params
&
p
);
72
~Random
() =
default
;
73
80
void
invalidate
(
const
std::shared_ptr<ReplacementData>& replacement_data)
81
override
;
82
89
void
touch
(
const
std::shared_ptr<ReplacementData>& replacement_data)
const
90
override
;
91
98
void
reset
(
const
std::shared_ptr<ReplacementData>& replacement_data)
const
99
override
;
100
107
ReplaceableEntry
*
getVictim
(
const
ReplacementCandidates
& candidates)
const
108
override
;
109
115
std::shared_ptr<ReplacementData>
instantiateEntry
()
override
;
116
};
117
118
}
// namespace replacement_policy
119
}
// namespace gem5
120
121
#endif
// __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
gem5::Random::genRandom
static RandomPtr genRandom(Random *r=nullptr)
Definition
random.hh:68
gem5::Random::RandomPtr
std::shared_ptr< Random > RandomPtr
Definition
random.hh:65
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::Base
Base(const Params &p)
Definition
base.hh:58
gem5::replacement_policy::Random::instantiateEntry
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition
random_rp.cc:92
gem5::replacement_policy::Random::invalidate
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
Definition
random_rp.cc:48
gem5::replacement_policy::Random::rng
gem5::Random::RandomPtr rng
Definition
random_rp.hh:52
gem5::replacement_policy::Random::touch
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
Definition
random_rp.cc:56
gem5::replacement_policy::Random::Params
RandomRPParams Params
Definition
random_rp.hh:70
gem5::replacement_policy::Random::getVictim
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim at random.
Definition
random_rp.cc:69
gem5::replacement_policy::Random::~Random
~Random()=default
gem5::replacement_policy::Random::Random
Random(const Params &p)
Definition
random_rp.cc:42
base.hh
gem5::MipsISA::p
Bitfield< 0 > p
Definition
pra_constants.hh:326
gem5::replacement_policy
Definition
stride.hh:68
gem5::statistics::reset
void reset()
Definition
statistics.cc:309
gem5
Copyright (c) 2024 Arm Limited All rights reserved.
Definition
binary32.hh:36
gem5::ReplacementCandidates
std::vector< ReplaceableEntry * > ReplacementCandidates
Replacement candidates as chosen by the indexing policy.
Definition
base.hh:46
random.hh
gem5::replacement_policy::Random::RandomReplData::valid
bool valid
Flag informing if the replacement data is valid or not.
Definition
random_rp.hh:61
gem5::replacement_policy::Random::RandomReplData::RandomReplData
RandomReplData()
Default constructor.
Definition
random_rp.hh:66
gem5::replacement_policy::ReplacementData
The replacement data needed by replacement policies.
Definition
replaceable_entry.hh:48
Generated on Mon May 26 2025 09:19:11 for gem5 by
doxygen
1.13.2