mem-cache: Fixed a bug in MRU replacement policy
authorMingyuan <xiang_my@outlook.com>
Mon, 2 Sep 2019 22:43:59 +0000 (17:43 -0500)
committerMingyuan Xiang <mxiang6@wisc.edu>
Sat, 12 Oct 2019 20:50:48 +0000 (20:50 +0000)
commitb8ecd2784c24879712b598fe940d8a73ec6842b1
treede38581e1cd4d0279073e8b21e861d9515377c4f
parent75b19403a75f35f19773a387b3da698722d26924
mem-cache: Fixed a bug in MRU replacement policy

The lastTouchTick is set to 0 when instantiate. This will cause the
candidate[0] to get evicted over and over again in MRU replacement
policy. To resolve this, break the search loop whenever it finds a
cold cache line.

Change-Id: I33aa57ebe0efca15986f62c3ae10a146bd2b779f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20881
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
src/mem/cache/replacement_policies/mru_rp.cc