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>
6 files changed