mem-cache: Fix DCPT with CircularQueue
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Mon, 30 Dec 2019 00:10:30 +0000 (01:10 +0100)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Fri, 1 May 2020 13:38:16 +0000 (13:38 +0000)
commit01a8783d5840b18c90c3ed245cd32f0ea4a56149
tree301d7e7378eb501e16f6279267354c3d6b657ad0
parentf6ddd4aeb3fb08dffeaf7b032d99ccb00d0a0dbc
mem-cache: Fix DCPT with CircularQueue

This patch fixes the following bugs:

- Previously when deltaPointer was 0 or 1, getting the last or penultimate deltas
  would be wrong for non-pow2 deltas.size(). For example, if the last added delta
  was to position 0, the previous should be in position 19, if deltas.size() = 20.
  However, 0-1=4294967295, and 4294967295%20=15.

- When searching for the previous late and penultimate, the oldest entry was being
  skipped.

Change-Id: Id800b60b77531ac4c2920bb90c15cc8cebb137a9
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24538
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Javier Bueno Hedo <javier.bueno@metempsy.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/cache/prefetch/delta_correlating_prediction_tables.cc
src/mem/cache/prefetch/delta_correlating_prediction_tables.hh