mem-cache: Encapsulate CacheBlk's tickInserted
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Mon, 21 Sep 2020 15:40:45 +0000 (17:40 +0200)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Tue, 6 Oct 2020 09:05:49 +0000 (09:05 +0000)
commitb6209eb91163d8739e263751bd83e0e21d4097cf
tree3f8101d383229b5666b62e1c007b22b7dc45ead0
parent2c21052fa6f410f0fbd62647a1922e42c228c8e1
mem-cache: Encapsulate CacheBlk's tickInserted

Encapsulate this variable to facilitate polymorphism.

- tickInserted was renamed to _tickInserted and was privatized.
- The insertion tick should always be set to the current tick,
  and only on insertion; thus, its setter is not public and
  does not take arguments.
- An additional function was created to get the age since of
  the block relative to its insertion tick.
- There is no current need for a getter.

Change-Id: I81d4009abec5e9633e10f1e851e3a524553c98a4
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34958
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/cache/cache_blk.cc
src/mem/cache/cache_blk.hh
src/mem/cache/tags/base.cc