Deleted Added
sdiff udiff text old ( 13849:858526a875ab ) new ( 14211:acfef4916339 )
full compact
1/**
2 * Copyright (c) 2018 Inria
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 40 unchanged lines hidden (view full) ---

49 *
50 * From the original paper, this implementation of RRIP is also called
51 * Static RRIP (SRRIP), as it always inserts entries with the same RRPV.
52 */
53
54#ifndef __MEM_CACHE_REPLACEMENT_POLICIES_BRRIP_RP_HH__
55#define __MEM_CACHE_REPLACEMENT_POLICIES_BRRIP_RP_HH__
56
57#include "mem/cache/replacement_policies/base.hh"
58
59struct BRRIPRPParams;
60
61class BRRIPRP : public BaseReplacementPolicy
62{
63 protected:
64 /** BRRIP-specific implementation of replacement data. */
65 struct BRRIPReplData : ReplacementData
66 {
67 /**
68 * Re-Reference Interval Prediction Value.
69 * Some values have specific names (according to the paper):
70 * 0 -> near-immediate re-rereference interval
71 * max_RRPV-1 -> long re-rereference interval
72 * max_RRPV -> distant re-rereference interval
73 * A value equal to max_RRPV + 1 indicates an invalid entry.
74 */
75 int rrpv;
76
77 /**
78 * Default constructor. Invalidate data.
79 */
80 BRRIPReplData(const int max_RRPV) : rrpv(max_RRPV + 1) {}
81 };
82
83 /**
84 * Maximum Re-Reference Prediction Value possible. An entry with this
85 * value as the rrpv has the longest possible re-reference interval,
86 * that is, it is likely not to be used in the near future, and is
87 * among the best eviction candidates.
88 * A maxRRPV of 1 implies in a NRU.
89 */
90 const int maxRRPV;
91
92 /**
93 * The hit priority (HP) policy replaces entries that do not receive cache
94 * hits over any cache entry that receives a hit, while the frequency
95 * priority (FP) policy replaces infrequently re-referenced entries.
96 */
97 const bool hitPriority;
98

--- 64 unchanged lines hidden ---