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
mru_rp.cc
Go to the documentation of this file.
1
29
#include "
mem/cache/replacement_policies/mru_rp.hh
"
30
31
#include <cassert>
32
#include <memory>
33
34
#include "params/MRURP.hh"
35
#include "
sim/cur_tick.hh
"
36
37
namespace
gem5
38
{
39
40
namespace
replacement_policy
41
{
42
43
MRU::MRU
(
const
Params
&
p
)
44
:
Base
(
p
)
45
{
46
}
47
48
void
49
MRU::invalidate
(
const
std::shared_ptr<ReplacementData>& replacement_data)
50
{
51
// Reset last touch timestamp
52
std::static_pointer_cast<MRUReplData>(
53
replacement_data)->lastTouchTick =
Tick
(0);
54
}
55
56
void
57
MRU::touch
(
const
std::shared_ptr<ReplacementData>& replacement_data)
const
58
{
59
// Update last touch timestamp
60
std::static_pointer_cast<MRUReplData>(
61
replacement_data)->lastTouchTick =
curTick
();
62
}
63
64
void
65
MRU::reset
(
const
std::shared_ptr<ReplacementData>& replacement_data)
const
66
{
67
// Set last touch timestamp
68
std::static_pointer_cast<MRUReplData>(
69
replacement_data)->lastTouchTick =
curTick
();
70
}
71
72
ReplaceableEntry
*
73
MRU::getVictim
(
const
ReplacementCandidates
& candidates)
const
74
{
75
// There must be at least one replacement candidate
76
assert(candidates.size() > 0);
77
78
// Visit all candidates to find victim
79
ReplaceableEntry
* victim = candidates[0];
80
for
(
const
auto
& candidate : candidates) {
81
std::shared_ptr<MRUReplData> candidate_replacement_data =
82
std::static_pointer_cast<MRUReplData>(candidate->replacementData);
83
84
// Stop searching entry if a cache line that doesn't warm up is found.
85
if
(candidate_replacement_data->lastTouchTick == 0) {
86
victim = candidate;
87
break
;
88
}
else
if
(candidate_replacement_data->lastTouchTick >
89
std::static_pointer_cast<MRUReplData>(
90
victim->
replacementData
)->lastTouchTick) {
91
victim = candidate;
92
}
93
}
94
95
return
victim;
96
}
97
98
std::shared_ptr<ReplacementData>
99
MRU::instantiateEntry
()
100
{
101
return
std::shared_ptr<ReplacementData>(
new
MRUReplData
());
102
}
103
104
}
// namespace replacement_policy
105
}
// namespace gem5
gem5::curTick
Tick curTick()
The universal simulation clock.
Definition:
cur_tick.hh:46
gem5::replacement_policy::Base::Params
BaseReplacementPolicyParams Params
Definition:
base.hh:57
cur_tick.hh
std::vector
STL vector class.
Definition:
stl.hh:37
gem5::replacement_policy::MRU::getVictim
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using access timestamps.
Definition:
mru_rp.cc:73
gem5::VegaISA::p
Bitfield< 54 > p
Definition:
pagetable.hh:70
gem5::Tick
uint64_t Tick
Tick count type.
Definition:
types.hh:58
gem5::replacement_policy::MRU::MRUReplData
MRU-specific implementation of replacement data.
Definition:
mru_rp.hh:54
mru_rp.hh
Copyright (c) 2018-2020 Inria All rights reserved.
gem5::replacement_policy::Base
A common base class of cache replacement policy objects.
Definition:
base.hh:54
gem5::replacement_policy::MRU::MRU
MRU(const Params &p)
Definition:
mru_rp.cc:43
gem5::replacement_policy::MRU::reset
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
Definition:
mru_rp.cc:65
gem5::replacement_policy::MRU::invalidate
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
Definition:
mru_rp.cc:49
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::MRU::touch
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
Definition:
mru_rp.cc:57
gem5::replacement_policy::MRU::instantiateEntry
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition:
mru_rp.cc:99
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
Generated on Sun Jul 30 2023 01:56:57 for gem5 by
doxygen
1.8.17