gem5
v24.0.0.0
Loading...
Searching...
No Matches
mem
cache
replacement_policies
second_chance_rp.hh
Go to the documentation of this file.
1
38
#ifndef __MEM_CACHE_REPLACEMENT_POLICIES_SECOND_CHANCE_RP_HH__
39
#define __MEM_CACHE_REPLACEMENT_POLICIES_SECOND_CHANCE_RP_HH__
40
41
#include "
mem/cache/replacement_policies/base.hh
"
42
#include "
mem/cache/replacement_policies/fifo_rp.hh
"
43
44
namespace
gem5
45
{
46
47
struct
SecondChanceRPParams;
48
49
namespace
replacement_policy
50
{
51
52
class
SecondChance
:
public
FIFO
53
{
54
protected
:
56
struct
SecondChanceReplData
:
public
FIFOReplData
57
{
63
bool
hasSecondChance
;
64
68
SecondChanceReplData
() :
FIFOReplData
(),
hasSecondChance
(false) {}
69
};
70
76
void
useSecondChance
(
77
const
std::shared_ptr<SecondChanceReplData>& replacement_data)
const
;
78
79
public
:
80
typedef
SecondChanceRPParams
Params
;
81
SecondChance
(
const
Params
&
p
);
82
~SecondChance
() =
default
;
83
91
void
invalidate
(
const
std::shared_ptr<ReplacementData>& replacement_data)
92
override
;
93
99
void
touch
(
const
std::shared_ptr<ReplacementData>& replacement_data)
const
100
override
;
101
109
void
reset
(
const
std::shared_ptr<ReplacementData>& replacement_data)
const
110
override
;
111
119
ReplaceableEntry
*
getVictim
(
const
ReplacementCandidates
& candidates)
const
120
override
;
121
127
std::shared_ptr<ReplacementData>
instantiateEntry
()
override
;
128
};
129
130
}
// namespace replacement_policy
131
}
// namespace gem5
132
133
#endif
// __MEM_CACHE_REPLACEMENT_POLICIES_SECOND_CHANCE_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::FIFO
Definition
fifo_rp.hh:51
gem5::replacement_policy::SecondChance
Definition
second_chance_rp.hh:53
gem5::replacement_policy::SecondChance::instantiateEntry
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition
second_chance_rp.cc:135
gem5::replacement_policy::SecondChance::getVictim
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using insertion timestamps and second chance bit.
Definition
second_chance_rp.cc:91
gem5::replacement_policy::SecondChance::SecondChance
SecondChance(const Params &p)
Definition
second_chance_rp.cc:41
gem5::replacement_policy::SecondChance::useSecondChance
void useSecondChance(const std::shared_ptr< SecondChanceReplData > &replacement_data) const
Use replacement data's second chance.
Definition
second_chance_rp.cc:47
gem5::replacement_policy::SecondChance::~SecondChance
~SecondChance()=default
gem5::replacement_policy::SecondChance::Params
SecondChanceRPParams Params
Definition
second_chance_rp.hh:80
gem5::replacement_policy::SecondChance::touch
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its re-insertion tick and second chance bit.
Definition
second_chance_rp.cc:69
gem5::replacement_policy::SecondChance::invalidate
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
Definition
second_chance_rp.cc:58
std::vector
STL vector class.
Definition
stl.hh:37
fifo_rp.hh
Copyright (c) 2018-2020 Inria All rights reserved.
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::FIFO::FIFOReplData
FIFO-specific implementation of replacement data.
Definition
fifo_rp.hh:55
gem5::replacement_policy::SecondChance::SecondChanceReplData
Second-Chance-specific implementation of replacement data.
Definition
second_chance_rp.hh:57
gem5::replacement_policy::SecondChance::SecondChanceReplData::SecondChanceReplData
SecondChanceReplData()
Default constructor.
Definition
second_chance_rp.hh:68
gem5::replacement_policy::SecondChance::SecondChanceReplData::hasSecondChance
bool hasSecondChance
This is different from isTouched because isTouched accounts only for insertion, while this bit is res...
Definition
second_chance_rp.hh:63
Generated on Tue Jun 18 2024 16:24:05 for gem5 by
doxygen
1.11.0