gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
47namespace gem5
48{
49
50struct SHiPRPParams;
51struct SHiPMemRPParams;
52struct SHiPPCRPParams;
53
54namespace replacement_policy
55{
56
57class SHiP : public BRRIP
58{
59 protected:
60 typedef std::size_t SignatureType;
61
64 {
65 private:
68
70 bool outcome;
71
72 public:
73 SHiPReplData(int num_bits);
74
77
84
86 void setReReferenced();
87
93 bool wasReReferenced() const;
94 };
95
100 const double insertionThreshold;
101
108
115 virtual SignatureType getSignature(const PacketPtr pkt) const = 0;
116
117 public:
118 typedef SHiPRPParams Params;
119 SHiP(const Params &p);
120 ~SHiP() = default;
121
128 void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
129 override;
130
138 void touch(const std::shared_ptr<ReplacementData>& replacement_data,
139 const PacketPtr pkt) override;
140 void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
141 override;
142
150 void reset(const std::shared_ptr<ReplacementData>& replacement_data,
151 const PacketPtr pkt) override;
152 void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
153 override;
154
160 std::shared_ptr<ReplacementData> instantiateEntry() override;
161};
162
164class SHiPMem : public SHiP
165{
166 protected:
167 SignatureType getSignature(const PacketPtr pkt) const override;
168
169 public:
170 SHiPMem(const SHiPMemRPParams &p);
171 ~SHiPMem() = default;
172};
173
175class SHiPPC : public SHiP
176{
177 private:
180
181 protected:
182 SignatureType getSignature(const PacketPtr pkt) const override;
183
184 public:
185 SHiPPC(const SHiPPCRPParams &p);
186 ~SHiPPC() = default;
187};
188
189} // namespace replacement_policy
190} // namespace gem5
191
192#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:295
SHiP that Uses memory addresses as signatures.
Definition ship_rp.hh:165
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:176
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:179
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:64
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:70
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:67
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.
const double insertionThreshold
Saturation percentage at which an entry starts being inserted as intermediate re-reference.
Definition ship_rp.hh:100
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 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:107
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition ship_rp.cc:145
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 the Packet class.
BRRIP-specific implementation of replacement data.
Definition brrip_rp.hh:71

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