gem5 v24.0.0.0
Loading...
Searching...
No Matches
dueling_rp.hh
Go to the documentation of this file.
1
29#ifndef __MEM_CACHE_REPLACEMENT_POLICIES_DUELING_RP_HH__
30#define __MEM_CACHE_REPLACEMENT_POLICIES_DUELING_RP_HH__
31
32#include <memory>
33
34#include "base/compiler.hh"
35#include "base/statistics.hh"
38
39namespace gem5
40{
41
42struct DuelingRPParams;
43
44namespace replacement_policy
45{
46
52class Dueling : public Base
53{
54 protected:
60 {
61 std::shared_ptr<ReplacementData> replDataA;
62 std::shared_ptr<ReplacementData> replDataB;
63
65 DuelerReplData(const std::shared_ptr<ReplacementData>& repl_data_a,
66 const std::shared_ptr<ReplacementData>& repl_data_b)
67 : ReplacementData(), Dueler(), replDataA(repl_data_a),
68 replDataB(repl_data_b)
69 {
70 }
71 };
72
77
83
94
95 public:
96 PARAMS(DuelingRP);
97 Dueling(const Params &p);
98 ~Dueling() = default;
99
100 void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
101 override;
102 void touch(const std::shared_ptr<ReplacementData>& replacement_data,
103 const PacketPtr pkt) override;
104 void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
105 override;
106 void reset(const std::shared_ptr<ReplacementData>& replacement_data,
107 const PacketPtr pkt) override;
108 void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
109 override;
110 ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
111 override;
112 std::shared_ptr<ReplacementData> instantiateEntry() override;
113};
114
115} // namespace replacement_policy
116} // namespace gem5
117
118#endif // __MEM_CACHE_REPLACEMENT_POLICIES_DUELING_RP_HH__
A dueler is an entry that may or may not be accounted for sampling.
Definition dueling.hh:53
Duel between two sampled options to determine which is the winner.
Definition dueling.hh:108
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
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
BaseReplacementPolicyParams Params
Definition base.hh:57
This replacement policy duels two replacement policies to find out which one provides the best result...
Definition dueling_rp.hh:53
Base *const replPolicyB
Sub-replacement policy used in this multiple container.
Definition dueling_rp.hh:76
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim among candidates.
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
void touch(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt) override
Update replacement data.
Definition dueling_rp.cc:60
DuelingMonitor duelingMonitor
A dueling monitor that decides which is the best sub-policy based on their number of misses.
Definition dueling_rp.hh:82
Base *const replPolicyA
Sub-replacement policy used in this multiple container.
Definition dueling_rp.hh:74
gem5::replacement_policy::Dueling::DuelingStats duelingStats
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
Definition dueling_rp.cc:51
Statistics container.
Definition group.hh:93
This is a simple scalar statistic, like a counter.
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
Declaration of Statistics objects.
Dueler-specific implementation of replacement data.
Definition dueling_rp.hh:60
std::shared_ptr< ReplacementData > replDataB
Definition dueling_rp.hh:62
std::shared_ptr< ReplacementData > replDataA
Definition dueling_rp.hh:61
DuelerReplData(const std::shared_ptr< ReplacementData > &repl_data_a, const std::shared_ptr< ReplacementData > &repl_data_b)
Default constructor.
Definition dueling_rp.hh:65
statistics::Scalar selectedB
Number of times B was selected on victimization.
Definition dueling_rp.hh:92
statistics::Scalar selectedA
Number of times A was selected on victimization.
Definition dueling_rp.hh:89
The replacement data needed by replacement policies.

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