34#include "params/LFURP.hh"
39namespace replacement_policy
51 std::static_pointer_cast<LFUReplData>(replacement_data)->refCount = 0;
55LFU::touch(
const std::shared_ptr<ReplacementData>& replacement_data)
const
58 std::static_pointer_cast<LFUReplData>(replacement_data)->refCount++;
62LFU::reset(
const std::shared_ptr<ReplacementData>& replacement_data)
const
65 std::static_pointer_cast<LFUReplData>(replacement_data)->refCount = 1;
72 assert(candidates.size() > 0);
76 for (
const auto& candidate : candidates) {
78 if (std::static_pointer_cast<LFUReplData>(
79 candidate->replacementData)->refCount <
80 std::static_pointer_cast<LFUReplData>(
89std::shared_ptr<ReplacementData>
92 return std::shared_ptr<ReplacementData>(
new LFUReplData());
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.
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
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.
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim using reference frequency.
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
Copyright (c) 2018-2020 Inria All rights reserved.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
LFU-specific implementation of replacement data.