34 #include "params/LRURP.hh" 47 replacement_data)->lastTouchTick =
Tick(0);
51 LRURP::touch(
const std::shared_ptr<ReplacementData>& replacement_data)
const 55 replacement_data)->lastTouchTick =
curTick();
59 LRURP::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) {
76 if (std::static_pointer_cast<LRUReplData>(
77 candidate->replacementData)->lastTouchTick <
79 victim->replacementData)->lastTouchTick) {
87 std::shared_ptr<ReplacementData>
90 return std::shared_ptr<ReplacementData>(
new LRUReplData());
96 return new LRURP(
this);
BaseReplacementPolicyParams Params
Convenience typedef.
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) const override
Invalidate replacement data to set it as the next probable victim.
LRURP(const Params *p)
Construct and initiliaze this replacement policy.
A common base class of cache replacement policy objects.
LRU-specific implementation of replacement data.
Tick curTick()
The current simulated tick.
uint64_t Tick
Tick count type.
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using LRU timestamps.
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
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.
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.