gem5
v24.0.0.0
Loading...
Searching...
No Matches
mem
cache
replacement_policies
base.hh
Go to the documentation of this file.
1
29
#ifndef __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
30
#define __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
31
32
#include <memory>
33
34
#include "
base/compiler.hh
"
35
#include "
mem/cache/replacement_policies/replaceable_entry.hh
"
36
#include "
mem/packet.hh
"
37
#include "params/BaseReplacementPolicy.hh"
38
#include "
sim/sim_object.hh
"
39
40
namespace
gem5
41
{
42
46
typedef
std::vector<ReplaceableEntry*>
ReplacementCandidates
;
47
48
namespace
replacement_policy
49
{
50
54
class
Base
:
public
SimObject
55
{
56
public
:
57
typedef
BaseReplacementPolicyParams
Params
;
58
Base
(
const
Params
&
p
) :
SimObject
(
p
) {}
59
virtual
~Base
() =
default
;
60
66
virtual
void
invalidate
(
const
std::shared_ptr<ReplacementData>&
67
replacement_data) = 0;
68
75
virtual
void
touch
(
const
std::shared_ptr<ReplacementData>&
76
replacement_data,
const
PacketPtr
pkt)
77
{
78
touch
(replacement_data);
79
}
80
virtual
void
touch
(
const
std::shared_ptr<ReplacementData>&
81
replacement_data)
const
= 0;
82
89
virtual
void
reset
(
const
std::shared_ptr<ReplacementData>&
90
replacement_data,
const
PacketPtr
pkt)
91
{
92
reset
(replacement_data);
93
}
94
virtual
void
reset
(
const
std::shared_ptr<ReplacementData>&
95
replacement_data)
const
= 0;
96
103
virtual
ReplaceableEntry
*
getVictim
(
104
const
ReplacementCandidates
& candidates)
const
= 0;
105
111
virtual
std::shared_ptr<ReplacementData>
instantiateEntry
() = 0;
112
};
113
114
}
// namespace replacement_policy
115
}
// namespace gem5
116
117
#endif
// __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition
packet.hh:295
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::SimObject
Abstract superclass for simulation objects.
Definition
sim_object.hh:148
gem5::replacement_policy::Base
A common base class of cache replacement policy objects.
Definition
base.hh:55
gem5::replacement_policy::Base::touch
virtual void touch(const std::shared_ptr< ReplacementData > &replacement_data) const =0
gem5::replacement_policy::Base::reset
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data) const =0
gem5::replacement_policy::Base::invalidate
virtual void invalidate(const std::shared_ptr< ReplacementData > &replacement_data)=0
Invalidate replacement data to set it as the next probable victim.
gem5::replacement_policy::Base::reset
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt)
Reset replacement data.
Definition
base.hh:89
gem5::replacement_policy::Base::Params
BaseReplacementPolicyParams Params
Definition
base.hh:57
gem5::replacement_policy::Base::touch
virtual void touch(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt)
Update replacement data.
Definition
base.hh:75
gem5::replacement_policy::Base::Base
Base(const Params &p)
Definition
base.hh:58
gem5::replacement_policy::Base::getVictim
virtual ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
gem5::replacement_policy::Base::~Base
virtual ~Base()=default
gem5::replacement_policy::Base::instantiateEntry
virtual std::shared_ptr< ReplacementData > instantiateEntry()=0
Instantiate a replacement data entry.
std::vector
STL vector class.
Definition
stl.hh:37
compiler.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::ReplacementCandidates
std::vector< ReplaceableEntry * > ReplacementCandidates
Replacement candidates as chosen by the indexing policy.
Definition
base.hh:46
packet.hh
Declaration of the Packet class.
replaceable_entry.hh
sim_object.hh
Generated on Tue Jun 18 2024 16:24:02 for gem5 by
doxygen
1.11.0