gem5  v20.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
second_chance_rp.hh
Go to the documentation of this file.
1 
38 #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_SECOND_CHANCE_RP_HH__
39 #define __MEM_CACHE_REPLACEMENT_POLICIES_SECOND_CHANCE_RP_HH__
40 
43 
44 struct SecondChanceRPParams;
45 
46 class SecondChanceRP : public FIFORP
47 {
48  protected:
51  {
58 
62  SecondChanceReplData() : FIFOReplData(), hasSecondChance(false) {}
63  };
64 
70  void useSecondChance(
71  const std::shared_ptr<SecondChanceReplData>& replacement_data) const;
72 
73  public:
75  typedef SecondChanceRPParams Params;
76 
80  SecondChanceRP(const Params *p);
81 
86 
94  void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
95  const override;
96 
102  void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
103  override;
104 
112  void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
113  override;
114 
122  ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
123  override;
124 
130  std::shared_ptr<ReplacementData> instantiateEntry() override;
131 };
132 
133 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_SECOND_CHANCE_RP_HH__
SecondChanceReplData()
Default constructor.
void useSecondChance(const std::shared_ptr< SecondChanceReplData > &replacement_data) const
Use replacement data&#39;s second chance.
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) const override
Invalidate replacement data to set it as the next probable victim.
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
STL vector class.
Definition: stl.hh:37
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its re-insertion tick and second chance bit.
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Second-Chance-specific implementation of replacement data.
SecondChanceRP(const Params *p)
Construct and initiliaze this replacement policy.
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using insertion timestamps and second chance bit.
SecondChanceRPParams Params
Convenience typedef.
~SecondChanceRP()
Destructor.
bool hasSecondChance
This is different from isTouched because isTouched accounts only for insertion, while this bit is res...
FIFO-specific implementation of replacement data.
Definition: fifo_rp.hh:48
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Copyright (c) 2018 Inria All rights reserved.
Bitfield< 0 > p

Generated on Thu May 28 2020 16:21:34 for gem5 by doxygen 1.8.13