gem5  v21.2.1.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
94  } duelingStats;
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__
gem5::statistics::Scalar
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:1930
gem5::replacement_policy::Dueling::touch
void touch(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt) override
Update replacement data.
Definition: dueling_rp.cc:60
gem5::replacement_policy::Dueling::DuelerReplData::replDataA
std::shared_ptr< ReplacementData > replDataA
Definition: dueling_rp.hh:62
gem5::replacement_policy::Dueling::DuelingStats
Definition: dueling_rp.hh:85
gem5::replacement_policy::Dueling::getVictim
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim among candidates.
Definition: dueling_rp.cc:110
dueling.hh
gem5::replacement_policy::Base::Params
BaseReplacementPolicyParams Params
Definition: base.hh:58
gem5::replacement_policy::Dueling::reset
void reset(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt) override
Reset replacement data.
Definition: dueling_rp.cc:79
gem5::replacement_policy::Dueling::DuelerReplData
Dueler-specific implementation of replacement data.
Definition: dueling_rp.hh:60
std::vector
STL vector class.
Definition: stl.hh:37
gem5::replacement_policy::Dueling::DuelingStats::selectedA
statistics::Scalar selectedA
Number of times A was selected on victimization.
Definition: dueling_rp.hh:90
gem5::replacement_policy::Dueling::invalidate
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
gem5::replacement_policy::Dueling
This replacement policy duels two replacement policies to find out which one provides the best result...
Definition: dueling_rp.hh:53
gem5::replacement_policy::Dueling::DuelerReplData::replDataB
std::shared_ptr< ReplacementData > replDataB
Definition: dueling_rp.hh:63
gem5::replacement_policy::ReplacementData
The replacement data needed by replacement policies.
Definition: replaceable_entry.hh:49
gem5::replacement_policy::Dueling::replPolicyB
Base *const replPolicyB
Sub-replacement policy used in this multiple container.
Definition: dueling_rp.hh:77
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:283
gem5::replacement_policy::Dueling::DuelerReplData::DuelerReplData
DuelerReplData(const std::shared_ptr< ReplacementData > &repl_data_a, const std::shared_ptr< ReplacementData > &repl_data_b)
Default constructor.
Definition: dueling_rp.hh:66
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
statistics.hh
compiler.hh
gem5::replacement_policy::Dueling::duelingStats
gem5::replacement_policy::Dueling::DuelingStats duelingStats
gem5::replacement_policy::Base
A common base class of cache replacement policy objects.
Definition: base.hh:55
base.hh
gem5::replacement_policy::Dueling::DuelingStats::DuelingStats
DuelingStats(statistics::Group *parent)
Definition: dueling_rp.cc:185
gem5::GEM5_DEPRECATED_NAMESPACE
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
gem5::replacement_policy::Dueling::Dueling
Dueling(const Params &p)
Definition: dueling_rp.cc:40
gem5::replacement_policy::Dueling::~Dueling
~Dueling()=default
gem5::replacement_policy::Dueling::DuelingStats::selectedB
statistics::Scalar selectedB
Number of times B was selected on victimization.
Definition: dueling_rp.hh:93
gem5::replacement_policy::Dueling::PARAMS
PARAMS(DuelingRP)
gem5::replacement_policy::Dueling::replPolicyA
Base *const replPolicyA
Sub-replacement policy used in this multiple container.
Definition: dueling_rp.hh:75
gem5::replacement_policy::Dueling::instantiateEntry
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition: dueling_rp.cc:177
gem5::ReplaceableEntry
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Definition: replaceable_entry.hh:63
gem5::statistics::Group
Statistics container.
Definition: group.hh:93
gem5::Dueler
A dueler is an entry that may or may not be accounted for sampling.
Definition: dueling.hh:52
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: tlb.cc:60
gem5::DuelingMonitor
Duel between two sampled options to determine which is the winner.
Definition: dueling.hh:107
gem5::replacement_policy::Dueling::duelingMonitor
DuelingMonitor duelingMonitor
A dueling monitor that decides which is the best sub-policy based on their number of misses.
Definition: dueling_rp.hh:83

Generated on Wed May 4 2022 12:13:59 for gem5 by doxygen 1.8.17