33c33
< #include "debug/CacheRepl.hh"
---
> #include <memory>
41c41,42
< MRURP::touch(CacheBlk *blk)
---
> MRURP::invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
> const
43c44,47
< BaseReplacementPolicy::touch(blk);
---
> // Reset last touch timestamp
> std::static_pointer_cast<MRUReplData>(
> replacement_data)->lastTouchTick = Tick(0);
> }
44a49,51
> void
> MRURP::touch(const std::shared_ptr<ReplacementData>& replacement_data) const
> {
46c53,54
< blk->lastTouchTick = curTick();
---
> std::static_pointer_cast<MRUReplData>(
> replacement_data)->lastTouchTick = curTick();
50c58
< MRURP::reset(CacheBlk *blk)
---
> MRURP::reset(const std::shared_ptr<ReplacementData>& replacement_data) const
52,53d59
< BaseReplacementPolicy::reset(blk);
<
55c61,62
< blk->lastTouchTick = blk->tickInserted;
---
> std::static_pointer_cast<MRUReplData>(
> replacement_data)->lastTouchTick = curTick();
58,59c65,66
< CacheBlk*
< MRURP::getVictim(const ReplacementCandidates& candidates)
---
> ReplaceableEntry*
> MRURP::getVictim(const ReplacementCandidates& candidates) const
65c72
< CacheBlk* blk = candidates[0];
---
> ReplaceableEntry* victim = candidates[0];
67,73c74,79
< // Stop iteration if found an invalid block
< if (!candidate->isValid()) {
< blk = candidate;
< break;
< // Update victim block if necessary
< } else if (candidate->lastTouchTick > blk->lastTouchTick) {
< blk = candidate;
---
> // Update victim entry if necessary
> if (std::static_pointer_cast<MRUReplData>(
> candidate->replacementData)->lastTouchTick >
> std::static_pointer_cast<MRUReplData>(
> victim->replacementData)->lastTouchTick) {
> victim = candidate;
77,78c83,84
< DPRINTF(CacheRepl, "set %x, way %x: selecting blk for replacement\n",
< blk->set, blk->way);
---
> return victim;
> }
80c86,89
< return blk;
---
> std::shared_ptr<ReplacementData>
> MRURP::instantiateEntry()
> {
> return std::shared_ptr<ReplacementData>(new MRUReplData());