gem5  v22.1.0.0
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 namespace gem5
45 {
46 
47 struct SecondChanceRPParams;
48 
49 GEM5_DEPRECATED_NAMESPACE(ReplacementPolicy, replacement_policy);
50 namespace replacement_policy
51 {
52 
53 class SecondChance : public FIFO
54 {
55  protected:
58  {
65 
70  };
71 
77  void useSecondChance(
78  const std::shared_ptr<SecondChanceReplData>& replacement_data) const;
79 
80  public:
81  typedef SecondChanceRPParams Params;
82  SecondChance(const Params &p);
83  ~SecondChance() = default;
84 
92  void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
93  override;
94 
100  void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
101  override;
102 
110  void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
111  override;
112 
120  ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
121  override;
122 
128  std::shared_ptr<ReplacementData> instantiateEntry() override;
129 };
130 
131 } // namespace replacement_policy
132 } // namespace gem5
133 
134 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_SECOND_CHANCE_RP_HH__
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
BaseReplacementPolicyParams Params
Definition: base.hh:58
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using insertion timestamps and second chance bit.
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
void useSecondChance(const std::shared_ptr< SecondChanceReplData > &replacement_data) const
Use replacement data's second chance.
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its re-insertion tick and second chance bit.
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
STL vector class.
Definition: stl.hh:37
Copyright (c) 2018-2020 Inria All rights reserved.
Bitfield< 54 > p
Definition: pagetable.hh:70
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
FIFO-specific implementation of replacement data.
Definition: fifo_rp.hh:56
Second-Chance-specific implementation of replacement data.
bool hasSecondChance
This is different from isTouched because isTouched accounts only for insertion, while this bit is res...

Generated on Wed Dec 21 2022 10:22:36 for gem5 by doxygen 1.9.1