summaryrefslogtreecommitdiff
path: root/src/base/sat_counter.test.cc
AgeCommit message (Collapse)Author
2019-12-21base: Fix negative op-assign of SatCounterDaniel R. Carvalho
The value of the add and subtract assignment operations can be negative, and this was not being handled properly previously. Regarding shift assignment, the standard says it is undefined behaviour if a negative number is given, so add assertions for these cases. Change-Id: I2f1e4143c6385caa80fb25f84ca8edb0ca7e62b7 Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23664 Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-08-29base: Add function to saturate SatCounterDaniel R. Carvalho
Create a saturation function for the SatCounter that makes its internal counter reach its maximum value. Change-Id: Ibd30fa27c4ae2714dd48e3eba85addd035fb737c Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20451 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-05-14base: Add operators to SatCounterDaniel
Add shift, add and subtract assignment operators, as well as copy and move constructor and assignments to SatCounter, so that it they can be used by the prefetchers. Also add extra useful functions to calculate saturation oercentile so that the instantiator does not need to be aware of the counter's maximum value. Change-Id: I61d0cb28c8375b9d2774a39011e4a0aa6fe9ccb7 Signed-off-by: Daniel <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17996 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
2019-05-14base: Add GTest to SatCounterDaniel
Add a GTest to the SatCounter class. Change-Id: Iaf1b18db9fe8d7fe32e0e40c7947dcd1fd6cc33b Signed-off-by: Daniel <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17994 Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>