34 #include "params/MRURP.hh" 47 replacement_data)->lastTouchTick =
Tick(0);
51 MRURP::touch(
const std::shared_ptr<ReplacementData>& replacement_data)
const 55 replacement_data)->lastTouchTick =
curTick();
59 MRURP::reset(
const std::shared_ptr<ReplacementData>& replacement_data)
const 63 replacement_data)->lastTouchTick =
curTick();
70 assert(candidates.size() > 0);
74 for (
const auto& candidate : candidates) {
75 std::shared_ptr<MRUReplData> candidate_replacement_data =
76 std::static_pointer_cast<
MRUReplData>(candidate->replacementData);
79 if (candidate_replacement_data->lastTouchTick == 0) {
82 }
else if (candidate_replacement_data->lastTouchTick >
83 std::static_pointer_cast<MRUReplData>(
84 victim->replacementData)->lastTouchTick) {
92 std::shared_ptr<ReplacementData>
95 return std::shared_ptr<ReplacementData>(
new MRUReplData());
101 return new MRURP(
this);
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) const override
Invalidate replacement data to set it as the next probable victim.
BaseReplacementPolicyParams Params
Convenience typedef.
MRURP(const Params *p)
Construct and initiliaze this replacement policy.
A common base class of cache replacement policy objects.
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Tick curTick()
The current simulated tick.
uint64_t Tick
Tick count type.
MRU-specific implementation of replacement data.
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Copyright (c) 2018 Inria All rights reserved.
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using access timestamps.