From: Andreas Hansson Date: Thu, 7 Mar 2013 10:55:03 +0000 (-0500) Subject: base: Fix address range granularity calculations X-Git-Tag: stable_2013_06_16~62 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=82f600e02ded4d7162dd9286f790462b9ab5d554;p=gem5.git base: Fix address range granularity calculations This patch fixes a bug in the address range granularity calculations. Previously it incorrectly used the high bit to establish the size of the regions created, when it should really be looking at the low bit. --- diff --git a/src/base/addr_range.hh b/src/base/addr_range.hh index 368a96401..1620a00d3 100644 --- a/src/base/addr_range.hh +++ b/src/base/addr_range.hh @@ -140,7 +140,10 @@ class AddrRange * * @return The size of the regions created by the interleaving bits */ - uint64_t granularity() const { return ULL(1) << intlvHighBit; } + uint64_t granularity() const + { + return ULL(1) << (intlvHighBit - intlvBits); + } /** * Determine the number of interleaved address stripes this range