From: Dmitry Selyutin Date: Sat, 2 Sep 2023 18:33:02 +0000 (+0300) Subject: insndb/core: walk over record opcodes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=35a4c7293e48b9a35245b6e159b13913b9e9197a;p=openpower-isa.git insndb/core: walk over record opcodes --- diff --git a/src/openpower/insndb/core.py b/src/openpower/insndb/core.py index 403bacab..903f55bd 100644 --- a/src/openpower/insndb/core.py +++ b/src/openpower/insndb/core.py @@ -807,6 +807,9 @@ class Record(Dataclass): mdwn: MarkdownRecord svp64: SVP64Record = None + class Opcodes(tuple): + pass + @property def extras(self): if self.svp64 is not None: @@ -893,7 +896,7 @@ class Record(Dataclass): mask = Opcode.Mask(binary(mask)) result.append(Opcode(value=value, mask=mask)) - return tuple(result) + return self.__class__.Opcodes(result) @cached_property def PO(self): @@ -3740,6 +3743,8 @@ class Walker(mdis.walker.Walker): value = getattr(node, key) yield (value, node, key, mdis.walker.AttributePath) + yield (node.opcodes, node, "opcodes", mdis.walker.AttributePath) + @mdis.dispatcher.Hook(Operands) def dispatch_operands(self, node): def hook(cls_kwargs):