gem5
v20.1.0.0
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
struct
SecondChanceRPParams;
45
46
class
SecondChanceRP
:
public
FIFORP
47
{
48
protected
:
50
struct
SecondChanceReplData
:
public
FIFOReplData
51
{
57
bool
hasSecondChance
;
58
62
SecondChanceReplData
() :
FIFOReplData
(),
hasSecondChance
(false) {}
63
};
64
70
void
useSecondChance
(
71
const
std::shared_ptr<SecondChanceReplData>& replacement_data)
const
;
72
73
public
:
75
typedef
SecondChanceRPParams
Params
;
76
80
SecondChanceRP
(
const
Params
*
p
);
81
85
~SecondChanceRP
() {}
86
94
void
invalidate
(
const
std::shared_ptr<ReplacementData>& replacement_data)
95
const override
;
96
102
void
touch
(
const
std::shared_ptr<ReplacementData>& replacement_data)
const
103
override
;
104
112
void
reset
(
const
std::shared_ptr<ReplacementData>& replacement_data)
const
113
override
;
114
122
ReplaceableEntry
*
getVictim
(
const
ReplacementCandidates
& candidates)
const
123
override
;
124
130
std::shared_ptr<ReplacementData>
instantiateEntry
()
override
;
131
};
132
133
#endif // __MEM_CACHE_REPLACEMENT_POLICIES_SECOND_CHANCE_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
FIFORP::FIFOReplData
FIFO-specific implementation of replacement data.
Definition:
fifo_rp.hh:48
BaseReplacementPolicy::Params
BaseReplacementPolicyParams Params
Convenience typedef.
Definition:
base.hh:52
fifo_rp.hh
Copyright (c) 2018 Inria All rights reserved.
SecondChanceRP::instantiateEntry
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition:
second_chance_rp.cc:129
SecondChanceRP::getVictim
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using insertion timestamps and second chance bit.
Definition:
second_chance_rp.cc:85
std::vector
STL vector class.
Definition:
stl.hh:37
SecondChanceRP::SecondChanceReplData::SecondChanceReplData
SecondChanceReplData()
Default constructor.
Definition:
second_chance_rp.hh:62
SecondChanceRP::Params
SecondChanceRPParams Params
Convenience typedef.
Definition:
second_chance_rp.hh:75
base.hh
SecondChanceRP::SecondChanceReplData
Second-Chance-specific implementation of replacement data.
Definition:
second_chance_rp.hh:50
SecondChanceRP::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:63
SecondChanceRP::useSecondChance
void useSecondChance(const std::shared_ptr< SecondChanceReplData > &replacement_data) const
Use replacement data's second chance.
Definition:
second_chance_rp.cc:41
SecondChanceRP::~SecondChanceRP
~SecondChanceRP()
Destructor.
Definition:
second_chance_rp.hh:85
SecondChanceRP::invalidate
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) const override
Invalidate replacement data to set it as the next probable victim.
Definition:
second_chance_rp.cc:52
FIFORP
Definition:
fifo_rp.hh:44
SecondChanceRP::SecondChanceRP
SecondChanceRP(const Params *p)
Construct and initiliaze this replacement policy.
Definition:
second_chance_rp.cc:35
MipsISA::p
Bitfield< 0 > p
Definition:
pra_constants.hh:323
SecondChanceRP::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:57
SecondChanceRP::reset
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
Definition:
second_chance_rp.cc:74
SecondChanceRP
Definition:
second_chance_rp.hh:46
Generated on Wed Sep 30 2020 14:02:12 for gem5 by
doxygen
1.8.17