mem-cache: Encapsulate CacheBlk's refCount
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Mon, 21 Sep 2020 15:32:01 +0000 (17:32 +0200)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Tue, 6 Oct 2020 09:05:49 +0000 (09:05 +0000)
commit2c21052fa6f410f0fbd62647a1922e42c228c8e1
tree6448587cf253d86824d96784f6ec74e18dabc608
parente2a1dd1f2ae03452af69fff3e1016291002c2bfe
mem-cache: Encapsulate CacheBlk's refCount

Encapsulate this variable to facilitate polymorphism.

- refCount was renamed to _refCount and was privatized.
- The reference count should only be reset at invalidation;
  thus, its setter is not public.
- An additional function was created to increment the number
  of references by 1.

Change-Id: Ibc8799a8dcb7c53c651de3eb1c9b86118a297b9d
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34957
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
src/mem/cache/tags/base.hh
src/mem/cache/tags/base_set_assoc.hh
src/mem/cache/tags/sector_tags.cc