gem5 v24.0.0.0
Loading...
Searching...
No Matches
random_rp.hh
Go to the documentation of this file.
1
35#ifndef __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
36#define __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
37
39
40namespace gem5
41{
42
43struct RandomRPParams;
44
45namespace replacement_policy
46{
47
48class Random : public Base
49{
50 protected:
53 {
58 bool valid;
59
63 RandomReplData() : valid(false) {}
64 };
65
66 public:
67 typedef RandomRPParams Params;
68 Random(const Params &p);
69 ~Random() = default;
70
77 void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
78 override;
79
86 void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
87 override;
88
95 void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
96 override;
97
104 ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
105 override;
106
112 std::shared_ptr<ReplacementData> instantiateEntry() override;
113};
114
115} // namespace replacement_policy
116} // namespace gem5
117
118#endif // __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
A common base class of cache replacement policy objects.
Definition base.hh:55
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition random_rp.cc:93
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
Definition random_rp.cc:49
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
Definition random_rp.cc:57
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim at random.
Definition random_rp.cc:70
STL vector class.
Definition stl.hh:37
Bitfield< 0 > p
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
Random-specific implementation of replacement data.
Definition random_rp.hh:53
bool valid
Flag informing if the replacement data is valid or not.
Definition random_rp.hh:58
The replacement data needed by replacement policies.

Generated on Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0