configs: Fix read_config to work with new AddrRange serialization
authorNikos Nikoleris <nikos.nikoleris@arm.com>
Fri, 7 Jun 2019 12:31:09 +0000 (13:31 +0100)
committerNikos Nikoleris <nikos.nikoleris@arm.com>
Mon, 10 Jun 2019 17:36:55 +0000 (17:36 +0000)
Change-Id: I122c77c34c2f8c75f8b32682be858f651112ce89
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19151
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
configs/example/read_config.py

index b1e820c628695acfdb1caa9f3ae0fb46a15c7f1d..167815c70218de28155b9591746d8bb2ff665fc4 100644 (file)
@@ -89,12 +89,17 @@ def tick_parser(cast=lambda i: i):
 
 def addr_range_parser(cls, flags, param):
     sys.stdout.flush()
-    (low, high, intlv_high_bit, xor_high_bit,
-     intlv_bits, intlv_match) = param.split(':')
-    return m5.objects.AddrRange(
-        start=long(low), end=long(high),
-        intlvHighBit=long(intlv_high_bit), xorHighBit=long(xor_high_bit),
-        intlvBits=long(intlv_bits), intlvMatch=long(intlv_match))
+    _param = param.split(':')
+    (start, end) = _param[0:2]
+    if len(_param) == 2:
+        return m5.objects.AddrRange(start=long(start), end=long(end))
+    else:
+        assert len(_param) > 2
+        intlv_match = _param[2]
+        masks = [ long(m) for m in _param[3:] ]
+        return m5.objects.AddrRange(start=long(start), end=long(end),
+                                    masks=masks, intlvMatch=long(intlv_match))
+
 
 def memory_bandwidth_parser(cls, flags, param):
     # The string will be in tick/byte