From b4c9996d894118be04cdf4ed793b35a1d5001942 Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Fri, 18 Oct 2019 14:43:14 -0400 Subject: base,tests: Expanded GTests for addr_range.hh These tests assume the "end address" is not included in the range. This exposed some bugs in addr_range.hh which have been fixed. Where appropriate code comments in addr_range.hh have been extended to improve understanding of the class's behavior. Hard-coded AddrRange values in the project have been updated to take into account that end address is now exclusive. The python params.py interface has been updated to conform to this new standard. Change-Id: Idd1e75d5771d198c4b8142b28de0f3a6e9007a52 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22427 Maintainer: Bobby R. Bruce Reviewed-by: Nikos Nikoleris Tested-by: kokoro --- src/python/m5/params.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/python/m5/params.py') diff --git a/src/python/m5/params.py b/src/python/m5/params.py index b9afff2a1..9b4198b97 100644 --- a/src/python/m5/params.py +++ b/src/python/m5/params.py @@ -768,7 +768,7 @@ class AddrRange(ParamValue): if 'end' in kwargs: self.end = Addr(kwargs.pop('end')) elif 'size' in kwargs: - self.end = self.start + Addr(kwargs.pop('size')) - 1 + self.end = self.start + Addr(kwargs.pop('size')) else: raise TypeError("Either end or size must be specified") @@ -810,7 +810,7 @@ class AddrRange(ParamValue): self.end = Addr(args[0][1]) else: self.start = Addr(0) - self.end = Addr(args[0]) - 1 + self.end = Addr(args[0]) elif len(args) == 2: self.start = Addr(args[0]) @@ -830,7 +830,7 @@ class AddrRange(ParamValue): def size(self): # Divide the size by the size of the interleaving slice - return (long(self.end) - long(self.start) + 1) >> self.intlvBits + return (long(self.end) - long(self.start)) >> self.intlvBits @classmethod def cxx_predecls(cls, code): -- cgit v1.2.3