36 #include "params/BRRIPRP.hh"
40 numRRPVBits(
p->num_bits), hitPriority(
p->hit_priority), btp(
p->btp)
49 std::shared_ptr<BRRIPReplData> casted_replacement_data =
50 std::static_pointer_cast<BRRIPReplData>(replacement_data);
53 casted_replacement_data->valid =
false;
57 BRRIPRP::touch(
const std::shared_ptr<ReplacementData>& replacement_data)
const
59 std::shared_ptr<BRRIPReplData> casted_replacement_data =
60 std::static_pointer_cast<BRRIPReplData>(replacement_data);
66 casted_replacement_data->rrpv.reset();
68 casted_replacement_data->rrpv--;
73 BRRIPRP::reset(
const std::shared_ptr<ReplacementData>& replacement_data)
const
75 std::shared_ptr<BRRIPReplData> casted_replacement_data =
76 std::static_pointer_cast<BRRIPReplData>(replacement_data);
81 casted_replacement_data->rrpv.saturate();
83 casted_replacement_data->rrpv--;
87 casted_replacement_data->valid =
true;
94 assert(candidates.size() > 0);
100 int victim_RRPV = std::static_pointer_cast<BRRIPReplData>(
104 for (
const auto& candidate : candidates) {
105 std::shared_ptr<BRRIPReplData> candidate_repl_data =
106 std::static_pointer_cast<BRRIPReplData>(
107 candidate->replacementData);
110 if (!candidate_repl_data->valid) {
115 int candidate_RRPV = candidate_repl_data->rrpv;
116 if (candidate_RRPV > victim_RRPV) {
118 victim_RRPV = candidate_RRPV;
124 int diff = std::static_pointer_cast<BRRIPReplData>(
130 for (
const auto& candidate : candidates) {
131 std::static_pointer_cast<BRRIPReplData>(
132 candidate->replacementData)->rrpv += diff;
139 std::shared_ptr<ReplacementData>
146 BRRIPRPParams::create()