gem5  v22.1.0.0
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 
39 namespace gem5
40 {
41 
42 struct DuelingRPParams;
43 
44 GEM5_DEPRECATED_NAMESPACE(ReplacementPolicy, replacement_policy);
45 namespace replacement_policy
46 {
47 
53 class Dueling : public Base
54 {
55  protected:
61  {
62  std::shared_ptr<ReplacementData> replDataA;
63  std::shared_ptr<ReplacementData> replDataB;
64 
66  DuelerReplData(const std::shared_ptr<ReplacementData>& repl_data_a,
67  const std::shared_ptr<ReplacementData>& repl_data_b)
68  : ReplacementData(), Dueler(), replDataA(repl_data_a),
69  replDataB(repl_data_b)
70  {
71  }
72  };
73 
75  Base* const replPolicyA;
77  Base* const replPolicyB;
78 
84 
85  mutable struct DuelingStats : public statistics::Group
86  {
88 
91 
95 
96  public:
97  PARAMS(DuelingRP);
98  Dueling(const Params &p);
99  ~Dueling() = default;
100 
101  void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
102  override;
103  void touch(const std::shared_ptr<ReplacementData>& replacement_data,
104  const PacketPtr pkt) override;
105  void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
106  override;
107  void reset(const std::shared_ptr<ReplacementData>& replacement_data,
108  const PacketPtr pkt) override;
109  void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
110  override;
111  ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
112  override;
113  std::shared_ptr<ReplacementData> instantiateEntry() override;
114 };
115 
116 } // namespace replacement_policy
117 } // namespace gem5
118 
119 #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:294
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:56
BaseReplacementPolicyParams Params
Definition: base.hh:58
This replacement policy duels two replacement policies to find out which one provides the best result...
Definition: dueling_rp.hh:54
Base *const replPolicyB
Sub-replacement policy used in this multiple container.
Definition: dueling_rp.hh:77
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim among candidates.
Definition: dueling_rp.cc:110
void reset(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt) override
Reset replacement data.
Definition: dueling_rp.cc:79
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition: dueling_rp.cc:177
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:83
Base *const replPolicyA
Sub-replacement policy used in this multiple container.
Definition: dueling_rp.hh:75
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:94
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:1931
STL vector class.
Definition: stl.hh:37
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)
Declaration of Statistics objects.
Dueler-specific implementation of replacement data.
Definition: dueling_rp.hh:61
std::shared_ptr< ReplacementData > replDataB
Definition: dueling_rp.hh:63
std::shared_ptr< ReplacementData > replDataA
Definition: dueling_rp.hh:62
DuelerReplData(const std::shared_ptr< ReplacementData > &repl_data_a, const std::shared_ptr< ReplacementData > &repl_data_b)
Default constructor.
Definition: dueling_rp.hh:66
statistics::Scalar selectedB
Number of times B was selected on victimization.
Definition: dueling_rp.hh:93
statistics::Scalar selectedA
Number of times A was selected on victimization.
Definition: dueling_rp.hh:90
The replacement data needed by replacement policies.

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