32#include "params/SHiPMemRP.hh"
33#include "params/SHiPPCRP.hh"
34#include "params/SHiPRP.hh"
39namespace replacement_policy
56 signature = new_signature;
81 std::shared_ptr<SHiPReplData> casted_replacement_data =
82 std::static_pointer_cast<SHiPReplData>(replacement_data);
86 if (casted_replacement_data->wasReReferenced()) {
87 SHCT[casted_replacement_data->getSignature()]--;
94SHiP::touch(
const std::shared_ptr<ReplacementData>& replacement_data,
97 std::shared_ptr<SHiPReplData> casted_replacement_data =
98 std::static_pointer_cast<SHiPReplData>(replacement_data);
103 casted_replacement_data->setReReferenced();
110SHiP::touch(
const std::shared_ptr<ReplacementData>& replacement_data)
113 panic(
"Cant train SHiP's predictor without access information.");
117SHiP::reset(
const std::shared_ptr<ReplacementData>& replacement_data,
120 std::shared_ptr<SHiPReplData> casted_replacement_data =
121 std::static_pointer_cast<SHiPReplData>(replacement_data);
127 casted_replacement_data->setSignature(signature);
133 casted_replacement_data->rrpv--;
138SHiP::reset(
const std::shared_ptr<ReplacementData>& replacement_data)
141 panic(
"Cant train SHiP's predictor without access information.");
144std::shared_ptr<ReplacementData>
165 if (pkt->
req->hasPC()) {
171 return signature %
SHCT.size();
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
RequestPtr req
A pointer to the original request.
const unsigned numRRPVBits
Number of RRPV bits.
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
SHiPMem(const SHiPMemRPParams &p)
SignatureType getSignature(const PacketPtr pkt) const override
Extract signature from packet.
SHiPPC(const SHiPPCRPParams &p)
const SignatureType NO_PC_SIGNATURE
Signature to be used when no PC is provided in an access.
SignatureType getSignature(const PacketPtr pkt) const override
Extract signature from packet.
SHiP-specific implementation of replacement data.
SignatureType getSignature() const
Get entry's signature.
bool wasReReferenced() const
Get whether entry has been re-referenced since insertion.
SHiPReplData(int num_bits)
void setSignature(SignatureType signature)
Set this entry's signature and reset outcome.
void setReReferenced()
Set that this entry has been re-referenced.
std::size_t SignatureType
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.
void touch(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt) override
Touch an entry to update its replacement data.
void reset(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt) override
Reset replacement data.
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) override
Invalidate replacement data to set it as the next probable victim.
std::vector< SatCounter8 > SHCT
Signature History Counter Table; learns the re-reference behavior of a signature.
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
#define panic(...)
This implements a cprintf based panic() function.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Copyright (c) 2019, 2020 Inria All rights reserved.
BRRIP-specific implementation of replacement data.