From: Dmitry Selyutin Date: Wed, 17 Aug 2022 11:55:26 +0000 (+0300) Subject: pysvp64dis: consult the instruction database X-Git-Tag: sv_maxu_works-initial~47 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=51cc2ee5dc06567329f05c8c9279730839fc1165;p=openpower-isa.git pysvp64dis: consult the instruction database --- diff --git a/src/openpower/sv/trans/pysvp64dis.py b/src/openpower/sv/trans/pysvp64dis.py index dbbdce94..5d11a796 100644 --- a/src/openpower/sv/trans/pysvp64dis.py +++ b/src/openpower/sv/trans/pysvp64dis.py @@ -48,6 +48,13 @@ class Instruction(_SelectableInt): def major(self): return self[0:6] + @property + def dbrecord(self): + try: + return DATABASE[int(self)] + except KeyError: + return None + class PrefixedInstruction(_SelectableInt): def __init__(self, prefix, suffix, byteorder=ByteOrder.LITTLE): @@ -70,6 +77,10 @@ class PrefixedInstruction(_SelectableInt): def suffix(self): return Instruction(self[32:64]) + @cached_property + def dbrecord(self): + return self.suffix.dbrecord + class SVP64Instruction(PrefixedInstruction): class PrefixError(ValueError):