gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
lfu_rp.hh
Go to the documentation of this file.
1 
39 #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_LFU_RP_HH__
40 #define __MEM_CACHE_REPLACEMENT_POLICIES_LFU_RP_HH__
41 
43 
44 struct LFURPParams;
45 
47 {
48  protected:
51  {
53  unsigned refCount;
54 
58  LFUReplData() : refCount(0) {}
59  };
60 
61  public:
63  typedef LFURPParams Params;
64 
68  LFURP(const Params *p);
69 
73  ~LFURP() {}
74 
81  void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
82  const override;
83 
90  void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
91  override;
92 
99  void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
100  override;
101 
108  ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
109  override;
110 
116  std::shared_ptr<ReplacementData> instantiateEntry() override;
117 };
118 
119 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_LFU_RP_HH__
LFURP(const Params *p)
Construct and initiliaze this replacement policy.
Definition: lfu_rp.cc:38
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
Definition: lfu_rp.cc:52
LFURPParams Params
Convenience typedef.
Definition: lfu_rp.hh:63
Definition: lfu_rp.hh:46
A common base class of cache replacement policy objects.
Definition: base.hh:48
STL vector class.
Definition: stl.hh:40
Copyright (c) 2018 Inria All rights reserved.
LFU-specific implementation of replacement data.
Definition: lfu_rp.hh:50
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
Definition: lfu_rp.cc:59
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using reference frequency.
Definition: lfu_rp.cc:66
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition: lfu_rp.cc:87
LFUReplData()
Default constructor.
Definition: lfu_rp.hh:58
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
~LFURP()
Destructor.
Definition: lfu_rp.hh:73
Bitfield< 0 > p
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) const override
Invalidate replacement data to set it as the next probable victim.
Definition: lfu_rp.cc:44
unsigned refCount
Number of references to this entry since it was reset.
Definition: lfu_rp.hh:53

Generated on Fri Feb 28 2020 16:27:02 for gem5 by doxygen 1.8.13