gem5
[DEVELOP-FOR-23.0]
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
q
r
s
t
v
x
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
:
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
s
t
v
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Typedefs
a
b
c
d
g
h
i
l
m
r
s
t
u
w
Enumerations
b
h
i
o
p
Enumerator
h
i
o
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
mem
cache
replacement_policies
lfu_rp.cc
Go to the documentation of this file.
1
29
#include "
mem/cache/replacement_policies/lfu_rp.hh
"
30
31
#include <cassert>
32
#include <memory>
33
34
#include "params/LFURP.hh"
35
36
namespace
gem5
37
{
38
39
namespace
replacement_policy
40
{
41
42
LFU::LFU
(
const
Params
&
p
)
43
:
Base
(
p
)
44
{
45
}
46
47
void
48
LFU::invalidate
(
const
std::shared_ptr<ReplacementData>& replacement_data)
49
{
50
// Reset reference count
51
std::static_pointer_cast<LFUReplData>(replacement_data)->refCount = 0;
52
}
53
54
void
55
LFU::touch
(
const
std::shared_ptr<ReplacementData>& replacement_data)
const
56
{
57
// Update reference count
58
std::static_pointer_cast<LFUReplData>(replacement_data)->refCount++;
59
}
60
61
void
62
LFU::reset
(
const
std::shared_ptr<ReplacementData>& replacement_data)
const
63
{
64
// Reset reference count
65
std::static_pointer_cast<LFUReplData>(replacement_data)->refCount = 1;
66
}
67
68
ReplaceableEntry
*
69
LFU::getVictim
(
const
ReplacementCandidates
& candidates)
const
70
{
71
// There must be at least one replacement candidate
72
assert(candidates.size() > 0);
73
74
// Visit all candidates to find victim
75
ReplaceableEntry
* victim = candidates[0];
76
for
(
const
auto
& candidate : candidates) {
77
// Update victim entry if necessary
78
if
(std::static_pointer_cast<LFUReplData>(
79
candidate->replacementData)->refCount <
80
std::static_pointer_cast<LFUReplData>(
81
victim->
replacementData
)->refCount) {
82
victim = candidate;
83
}
84
}
85
86
return
victim;
87
}
88
89
std::shared_ptr<ReplacementData>
90
LFU::instantiateEntry
()
91
{
92
return
std::shared_ptr<ReplacementData>(
new
LFUReplData
());
93
}
94
95
}
// namespace replacement_policy
96
}
// namespace gem5
gem5::replacement_policy::Base::Params
BaseReplacementPolicyParams Params
Definition:
base.hh:57
gem5::replacement_policy::LFU::invalidate
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
Definition:
lfu_rp.cc:48
lfu_rp.hh
Copyright (c) 2018-2020 Inria All rights reserved.
gem5::replacement_policy::LFU::instantiateEntry
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition:
lfu_rp.cc:90
std::vector
STL vector class.
Definition:
stl.hh:37
gem5::replacement_policy::LFU::reset
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
Definition:
lfu_rp.cc:62
gem5::replacement_policy::LFU::LFU
LFU(const Params &p)
Definition:
lfu_rp.cc:42
gem5::VegaISA::p
Bitfield< 54 > p
Definition:
pagetable.hh:70
gem5::replacement_policy::LFU::getVictim
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using reference frequency.
Definition:
lfu_rp.cc:69
gem5::replacement_policy::Base
A common base class of cache replacement policy objects.
Definition:
base.hh:54
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:62
gem5::replacement_policy::LFU::LFUReplData
LFU-specific implementation of replacement data.
Definition:
lfu_rp.hh:54
gem5::ReplaceableEntry::replacementData
std::shared_ptr< replacement_policy::ReplacementData > replacementData
Replacement data associated to this entry.
Definition:
replaceable_entry.hh:83
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition:
gpu_translation_state.hh:37
gem5::replacement_policy::LFU::touch
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
Definition:
lfu_rp.cc:55
Generated on Sun Jul 30 2023 01:56:57 for gem5 by
doxygen
1.8.17