From 817e735310f37414ee39192fb773cbdceabfe3ff Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 17 Aug 2022 00:56:20 +0100 Subject: [PATCH] add some debug logs to SelectableInt to help track down what is going on --- src/openpower/decoder/selectable_int.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/openpower/decoder/selectable_int.py b/src/openpower/decoder/selectable_int.py index 5855cc8f..b0181b0c 100644 --- a/src/openpower/decoder/selectable_int.py +++ b/src/openpower/decoder/selectable_int.py @@ -136,6 +136,7 @@ class FieldSelectableInt: res = 0 brlen = len(self.br) for i, key in self.br.items(): + log("asint", i, key, self.si[key]) bit = self.si[key].value #log("asint", i, key, bit) res |= bit << ((brlen-i-1) if msb0 else i) @@ -310,6 +311,8 @@ class SelectableInt: return SelectableInt(self.value >> b.value, self.bits) def __getitem__(self, key): + print ("SelectableInt.__getitem__", self, key, type(key)) + assert type(key) != tuple # XXX error here if isinstance(key, SelectableInt): key = key.value if isinstance(key, int): @@ -332,7 +335,7 @@ class SelectableInt: start = self.bits - key.stop bits = stop - start - #log ("__getitem__ slice num bits", start, stop, bits) + log ("__getitem__ slice num bits", start, stop, bits) mask = (1 << bits) - 1 value = (self.value >> start) & mask log("getitem", stop, start, self.bits, hex(self.value), value) @@ -485,6 +488,7 @@ class SelectableIntMappingMeta(type): if instance is None: return self.__field res = FieldSelectableInt(si=instance, br=self.__field) + print ("FieldProperty", res, type(res.br)) return res.asint(msb0=True) class BitsProperty: -- 2.30.2