34#include "params/FIFORP.hh"
40namespace replacement_policy
52 std::static_pointer_cast<FIFOReplData>(
53 replacement_data)->tickInserted = ++
timeTicks;
57FIFO::touch(
const std::shared_ptr<ReplacementData>& replacement_data)
const
63FIFO::reset(
const std::shared_ptr<ReplacementData>& replacement_data)
const
66 std::static_pointer_cast<FIFOReplData>(
67 replacement_data)->tickInserted = ++
timeTicks;
74 assert(candidates.size() > 0);
78 for (
const auto& candidate : candidates) {
80 if (std::static_pointer_cast<FIFOReplData>(
81 candidate->replacementData)->tickInserted <
82 std::static_pointer_cast<FIFOReplData>(
91std::shared_ptr<ReplacementData>
94 return std::shared_ptr<ReplacementData>(
new FIFOReplData());
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
std::shared_ptr< replacement_policy::ReplacementData > replacementData
Replacement data associated to this entry.
A common base class of cache replacement policy objects.
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.
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using insertion timestamps.
Tick timeTicks
A counter that tracks the number of ticks since being created to avoid a tie.
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.
Copyright (c) 2018-2020 Inria All rights reserved.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
FIFO-specific implementation of replacement data.