From: Luke Kenneth Casson Leighton Date: Tue, 16 Aug 2022 23:56:20 +0000 (+0100) Subject: add some debug logs to SelectableInt to help track down what is going on X-Git-Tag: sv_maxu_works-initial~56 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=817e735310f37414ee39192fb773cbdceabfe3ff;p=openpower-isa.git add some debug logs to SelectableInt to help track down what is going on --- 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: