gem5  v22.1.0.0
ship_rp.hh
Go to the documentation of this file.
1 
36 #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_SHIP_RP_HH__
37 #define __MEM_CACHE_REPLACEMENT_POLICIES_SHIP_RP_HH__
38 
39 #include <cstddef>
40 #include <vector>
41 
42 #include "base/compiler.hh"
43 #include "base/sat_counter.hh"
45 #include "mem/packet.hh"
46 
47 namespace gem5
48 {
49 
50 struct SHiPRPParams;
51 struct SHiPMemRPParams;
52 struct SHiPPCRPParams;
53 
54 GEM5_DEPRECATED_NAMESPACE(ReplacementPolicy, replacement_policy);
55 namespace replacement_policy
56 {
57 
58 class SHiP : public BRRIP
59 {
60  protected:
61  typedef std::size_t SignatureType;
62 
64  class SHiPReplData : public BRRIPReplData
65  {
66  private:
69 
71  bool outcome;
72 
73  public:
74  SHiPReplData(int num_bits);
75 
78 
85 
87  void setReReferenced();
88 
94  bool wasReReferenced() const;
95  };
96 
101  const double insertionThreshold;
102 
109 
116  virtual SignatureType getSignature(const PacketPtr pkt) const = 0;
117 
118  public:
119  typedef SHiPRPParams Params;
120  SHiP(const Params &p);
121  ~SHiP() = default;
122 
129  void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
130  override;
131 
139  void touch(const std::shared_ptr<ReplacementData>& replacement_data,
140  const PacketPtr pkt) override;
141  void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
142  override;
143 
151  void reset(const std::shared_ptr<ReplacementData>& replacement_data,
152  const PacketPtr pkt) override;
153  void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
154  override;
155 
161  std::shared_ptr<ReplacementData> instantiateEntry() override;
162 };
163 
165 class SHiPMem : public SHiP
166 {
167  protected:
168  SignatureType getSignature(const PacketPtr pkt) const override;
169 
170  public:
171  SHiPMem(const SHiPMemRPParams &p);
172  ~SHiPMem() = default;
173 };
174 
176 class SHiPPC : public SHiP
177 {
178  private:
181 
182  protected:
183  SignatureType getSignature(const PacketPtr pkt) const override;
184 
185  public:
186  SHiPPC(const SHiPPCRPParams &p);
187  ~SHiPPC() = default;
188 };
189 
190 } // namespace replacement_policy
191 } // namespace gem5
192 
193 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_SHIP_RP_HH__
Copyright (c) 2018-2020 Inria All rights reserved.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
BaseReplacementPolicyParams Params
Definition: base.hh:58
SHiP that Uses memory addresses as signatures.
Definition: ship_rp.hh:166
SHiPMem(const SHiPMemRPParams &p)
Definition: ship_rp.cc:150
SignatureType getSignature(const PacketPtr pkt) const override
Extract signature from packet.
Definition: ship_rp.cc:153
SHiP that Uses PCs as signatures.
Definition: ship_rp.hh:177
SHiPPC(const SHiPPCRPParams &p)
Definition: ship_rp.cc:158
const SignatureType NO_PC_SIGNATURE
Signature to be used when no PC is provided in an access.
Definition: ship_rp.hh:180
SignatureType getSignature(const PacketPtr pkt) const override
Extract signature from packet.
Definition: ship_rp.cc:161
SHiP-specific implementation of replacement data.
Definition: ship_rp.hh:65
SignatureType getSignature() const
Get entry's signature.
Definition: ship_rp.cc:48
bool outcome
Outcome of insertion; set to one if entry is re-referenced.
Definition: ship_rp.hh:71
bool wasReReferenced() const
Get whether entry has been re-referenced since insertion.
Definition: ship_rp.cc:67
void setSignature(SignatureType signature)
Set this entry's signature and reset outcome.
Definition: ship_rp.cc:54
SignatureType signature
Signature that caused the insertion of this entry.
Definition: ship_rp.hh:68
void setReReferenced()
Set that this entry has been re-referenced.
Definition: ship_rp.cc:61
virtual SignatureType getSignature(const PacketPtr pkt) const =0
Extract signature from packet.
SHiP(const Params &p)
Definition: ship_rp.cc:72
const double insertionThreshold
Saturation percentage at which an entry starts being inserted as intermediate re-reference.
Definition: ship_rp.hh:101
void touch(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt) override
Touch an entry to update its replacement data.
Definition: ship_rp.cc:94
void reset(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt) override
Reset replacement data.
Definition: ship_rp.cc:117
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
Definition: ship_rp.cc:79
std::vector< SatCounter8 > SHCT
Signature History Counter Table; learns the re-reference behavior of a signature.
Definition: ship_rp.hh:108
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition: ship_rp.cc:145
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 the Packet class.
BRRIP-specific implementation of replacement data.
Definition: brrip_rp.hh:72

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