gem5
v20.1.0.0
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 "
mem/cache/replacement_policies/replaceable_entry.hh
"
35
#include "params/BaseReplacementPolicy.hh"
36
#include "
sim/sim_object.hh
"
37
41
typedef
std::vector<ReplaceableEntry*>
ReplacementCandidates
;
42
46
class
BaseReplacementPolicy
:
public
SimObject
47
{
48
public
:
52
typedef
BaseReplacementPolicyParams
Params
;
53
57
BaseReplacementPolicy
(
const
Params
*
p
) :
SimObject
(
p
) {}
58
62
virtual
~BaseReplacementPolicy
() {}
63
69
virtual
void
invalidate
(
const
std::shared_ptr<ReplacementData>&
70
replacement_data)
const
= 0;
71
77
virtual
void
touch
(
const
std::shared_ptr<ReplacementData>&
78
replacement_data)
const
= 0;
79
85
virtual
void
reset
(
const
std::shared_ptr<ReplacementData>&
86
replacement_data)
const
= 0;
87
94
virtual
ReplaceableEntry
*
getVictim
(
95
const
ReplacementCandidates
& candidates)
const
= 0;
96
102
virtual
std::shared_ptr<ReplacementData>
instantiateEntry
() = 0;
103
};
104
105
#endif // __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
ReplacementCandidates
std::vector< ReplaceableEntry * > ReplacementCandidates
Copyright (c) 2018 Inria All rights reserved.
Definition:
base.hh:41
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
BaseReplacementPolicy::Params
BaseReplacementPolicyParams Params
Convenience typedef.
Definition:
base.hh:52
BaseReplacementPolicy::BaseReplacementPolicy
BaseReplacementPolicy(const Params *p)
Construct and initiliaze this replacement policy.
Definition:
base.hh:57
BaseReplacementPolicy::invalidate
virtual void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) const =0
Invalidate replacement data to set it as the next probable victim.
std::vector
STL vector class.
Definition:
stl.hh:37
BaseReplacementPolicy::instantiateEntry
virtual std::shared_ptr< ReplacementData > instantiateEntry()=0
Instantiate a replacement data entry.
replaceable_entry.hh
sim_object.hh
BaseReplacementPolicy
A common base class of cache replacement policy objects.
Definition:
base.hh:46
BaseReplacementPolicy::getVictim
virtual ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
BaseReplacementPolicy::~BaseReplacementPolicy
virtual ~BaseReplacementPolicy()
Destructor.
Definition:
base.hh:62
BaseReplacementPolicy::touch
virtual void touch(const std::shared_ptr< ReplacementData > &replacement_data) const =0
Update replacement data.
BaseReplacementPolicy::reset
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data) const =0
Reset replacement data.
MipsISA::p
Bitfield< 0 > p
Definition:
pra_constants.hh:323
SimObject
Abstract superclass for simulation objects.
Definition:
sim_object.hh:92
Generated on Wed Sep 30 2020 14:02:07 for gem5 by
doxygen
1.8.17