gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
44namespace gem5
45{
46
47struct SecondChanceRPParams;
48
49namespace replacement_policy
50{
51
52class SecondChance : public FIFO
53{
54 protected:
70
76 void useSecondChance(
77 const std::shared_ptr<SecondChanceReplData>& replacement_data) const;
78
79 public:
80 typedef SecondChanceRPParams Params;
81 SecondChance(const Params &p);
82 ~SecondChance() = default;
83
91 void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
92 override;
93
99 void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
100 override;
101
109 void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
110 override;
111
119 ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
120 override;
121
127 std::shared_ptr<ReplacementData> instantiateEntry() override;
128};
129
130} // namespace replacement_policy
131} // namespace gem5
132
133#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...
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 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< 0 > p
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
FIFO-specific implementation of replacement data.
Definition fifo_rp.hh:55
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 Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0