36c36
< * to determine if a block is going to be re-referenced in the near or distant
---
> * to determine if an entry is going to be re-referenced in the near or distant
40c40
< * re-reference prediction value to determine if blocks are going to be re-
---
> * re-reference prediction value to determine if entries are going to be re-
43,44c43,44
< * The higher the value of the RRPV, the more distant the block is from
< * its next access.
---
> * The higher the value of the RRPV, the more distant the entry is from its
> * next access.
47c47
< * that has a probability of not inserting blocks as the LRU. This probability
---
> * that has a probability of not inserting entries as the LRU. This probability
51c51
< * Static RRIP (SRRIP), as it always inserts blocks with the same RRPV.
---
> * Static RRIP (SRRIP), as it always inserts entries with the same RRPV.
62a63,77
> /** BRRIP-specific implementation of replacement data. */
> struct BRRIPReplData : ReplacementData
> {
> /**
> * Re-Reference Interval Prediction Value.
> * A value equal to max_RRPV + 1 indicates an invalid entry.
> */
> int rrpv;
>
> /**
> * Default constructor. Invalidate data.
> */
> BRRIPReplData(const int max_RRPV) : rrpv(max_RRPV + 1) {}
> };
>
64c79
< * Maximum Re-Reference Prediction Value possible. A block with this
---
> * Maximum Re-Reference Prediction Value possible. An entry with this
70c85
< const unsigned maxRRPV;
---
> const int maxRRPV;
73,75c88,90
< * The hit priority (HP) policy replaces blocks that do not receive cache
< * hits over any cache block that receives a hit, while the frequency
< * priority (FP) policy replaces infrequently re-referenced blocks.
---
> * The hit priority (HP) policy replaces entries that do not receive cache
> * hits over any cache entry that receives a hit, while the frequency
> * priority (FP) policy replaces infrequently re-referenced entries.
81c96
< * if a new block is inserted with long or distant re-reference.
---
> * if a new entry is inserted with long or distant re-reference.
100c115,116
< * Touch a block to update its replacement data.
---
> * Invalidate replacement data to set it as the next probable victim.
> * Set RRPV as the the most distant re-reference.
102c118
< * @param blk Cache block to be touched.
---
> * @param replacement_data Replacement data to be invalidated.
104c120,121
< void touch(CacheBlk *blk) override;
---
> void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
> const override;
107,108c124,132
< * Reset replacement data for a block. Used when a block is inserted.
< * Sets the insertion tick, and update correspondent replacement data.
---
> * Touch an entry to update its replacement data.
> *
> * @param replacement_data Replacement data to be touched.
> */
> void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
> override;
>
> /**
> * Reset replacement data. Used when an entry is inserted.
111c135
< * @param blk Cache block to be reset.
---
> * @param replacement_data Replacement data to be reset.
113c137,138
< void reset(CacheBlk *blk) override;
---
> void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
> override;
119c144
< * @return Cache block to be replaced.
---
> * @return Replacement entry to be replaced.
121c146,154
< CacheBlk* getVictim(const ReplacementCandidates& candidates) override;
---
> ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
> override;
>
> /**
> * Instantiate a replacement data entry.
> *
> * @return A shared pointer to the new replacement data.
> */
> std::shared_ptr<ReplacementData> instantiateEntry() override;