mem-cache: a missing cast was truncating addresses
authorJavier Bueno <javier.bueno@metempsy.com>
Sat, 17 Nov 2018 23:59:09 +0000 (00:59 +0100)
committerJavier Bueno Hedo <javier.bueno@metempsy.com>
Sun, 18 Nov 2018 10:42:24 +0000 (10:42 +0000)
High bits were truncated when computing the block address

Change-Id: Iab2a4c6063ece2d1d4c24ce5686045a6d6d35434
Reviewed-on: https://gem5-review.googlesource.com/c/14415
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

src/mem/cache/prefetch/base.cc

index 3f5b67e6aafc3bb6702cb7f571ea1745944b32b5..53260ae0d23c93806065a27f561a92d4f4c5a7d1 100644 (file)
@@ -140,7 +140,7 @@ BasePrefetcher::samePage(Addr a, Addr b) const
 Addr
 BasePrefetcher::blockAddress(Addr a) const
 {
-    return a & ~(blkSize-1);
+    return a & ~((Addr)blkSize-1);
 }
 
 Addr