gem5  v22.1.0.0
brrip_rp.hh
Go to the documentation of this file.
1 
52 #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_BRRIP_RP_HH__
53 #define __MEM_CACHE_REPLACEMENT_POLICIES_BRRIP_RP_HH__
54 
55 #include "base/sat_counter.hh"
57 
58 namespace gem5
59 {
60 
61 struct BRRIPRPParams;
62 
63 GEM5_DEPRECATED_NAMESPACE(ReplacementPolicy, replacement_policy);
64 namespace replacement_policy
65 {
66 
67 class BRRIP : public Base
68 {
69  protected:
72  {
81 
83  bool valid;
84 
88  BRRIPReplData(const int num_bits)
89  : rrpv(num_bits), valid(false)
90  {
91  }
92  };
93 
100  const unsigned numRRPVBits;
101 
107  const bool hitPriority;
108 
113  const unsigned btp;
114 
115  public:
116  typedef BRRIPRPParams Params;
117  BRRIP(const Params &p);
118  ~BRRIP() = default;
119 
126  void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
127  override;
128 
134  void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
135  override;
136 
143  void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
144  override;
145 
152  ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
153  override;
154 
160  std::shared_ptr<ReplacementData> instantiateEntry() override;
161 };
162 
163 } // namespace replacement_policy
164 } // namespace gem5
165 
166 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_BRRIP_RP_HH__
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using rrpv.
Definition: brrip_rp.cc:97
const unsigned numRRPVBits
Number of RRPV bits.
Definition: brrip_rp.hh:100
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
Definition: brrip_rp.cc:53
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
Definition: brrip_rp.cc:63
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
Definition: brrip_rp.cc:79
const bool hitPriority
The hit priority (HP) policy replaces entries that do not receive cache hits over any cache entry tha...
Definition: brrip_rp.hh:107
const unsigned btp
Bimodal throtle parameter.
Definition: brrip_rp.hh:113
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition: brrip_rp.cc:146
A common base class of cache replacement policy objects.
Definition: base.hh:56
BaseReplacementPolicyParams Params
Definition: base.hh:58
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)
BRRIP-specific implementation of replacement data.
Definition: brrip_rp.hh:72
bool valid
Whether the entry is valid.
Definition: brrip_rp.hh:83
BRRIPReplData(const int num_bits)
Default constructor.
Definition: brrip_rp.hh:88
SatCounter8 rrpv
Re-Reference Interval Prediction Value.
Definition: brrip_rp.hh:80
The replacement data needed by replacement policies.

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