34 #include "params/FIFORP.hh" 47 replacement_data)->tickInserted =
Tick(0);
51 FIFORP::touch(
const std::shared_ptr<ReplacementData>& replacement_data)
const 57 FIFORP::reset(
const std::shared_ptr<ReplacementData>& replacement_data)
const 61 replacement_data)->tickInserted =
curTick();
68 assert(candidates.size() > 0);
72 for (
const auto& candidate : candidates) {
74 if (std::static_pointer_cast<FIFOReplData>(
75 candidate->replacementData)->tickInserted <
77 victim->replacementData)->tickInserted) {
85 std::shared_ptr<ReplacementData>
88 return std::shared_ptr<ReplacementData>(
new FIFOReplData());
92 FIFORPParams::create()
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.
A common base class of cache replacement policy objects.
Tick curTick()
The current simulated tick.
FIFORP(const Params *p)
Construct and initiliaze this replacement policy.
uint64_t Tick
Tick count type.
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using insertion timestamps.
FIFO-specific implementation of 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.
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.