gem5  v19.0.0.0
base.hh
Go to the documentation of this file.
1 
31 #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
32 #define __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
33 
34 #include <memory>
35 
37 #include "params/BaseReplacementPolicy.hh"
38 #include "sim/sim_object.hh"
39 
44 
49 {
50  public:
54  typedef BaseReplacementPolicyParams Params;
55 
59  BaseReplacementPolicy(const Params *p) : SimObject(p) {}
60 
65 
71  virtual void invalidate(const std::shared_ptr<ReplacementData>&
72  replacement_data) const = 0;
73 
79  virtual void touch(const std::shared_ptr<ReplacementData>&
80  replacement_data) const = 0;
81 
87  virtual void reset(const std::shared_ptr<ReplacementData>&
88  replacement_data) const = 0;
89 
96  virtual ReplaceableEntry* getVictim(
97  const ReplacementCandidates& candidates) const = 0;
98 
104  virtual std::shared_ptr<ReplacementData> instantiateEntry() = 0;
105 };
106 
107 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
BaseReplacementPolicyParams Params
Convenience typedef.
Definition: base.hh:54
virtual void touch(const std::shared_ptr< ReplacementData > &replacement_data) const =0
Update replacement data.
virtual ~BaseReplacementPolicy()
Destructor.
Definition: base.hh:64
virtual ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
A common base class of cache replacement policy objects.
Definition: base.hh:48
STL vector class.
Definition: stl.hh:40
virtual std::shared_ptr< ReplacementData > instantiateEntry()=0
Instantiate a replacement data entry.
virtual void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) const =0
Invalidate replacement data to set it as the next probable victim.
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data) const =0
Reset replacement data.
BaseReplacementPolicy(const Params *p)
Construct and initiliaze this replacement policy.
Definition: base.hh:59
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Bitfield< 0 > p
std::vector< ReplaceableEntry * > ReplacementCandidates
Copyright (c) 2018 Inria All rights reserved.
Definition: base.hh:43
Abstract superclass for simulation objects.
Definition: sim_object.hh:96

Generated on Fri Feb 28 2020 16:26:58 for gem5 by doxygen 1.8.13