From: Dmitry Selyutin Date: Thu, 22 Jun 2023 18:57:48 +0000 (+0300) Subject: insndb/db: introduce ptype command X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fbeedfd8895d3b05d6f18d32c1eaa4ff32108c12;p=openpower-isa.git insndb/db: introduce ptype command --- diff --git a/src/openpower/insndb/db.py b/src/openpower/insndb/db.py index 4d3b91da..e64fdc1e 100644 --- a/src/openpower/insndb/db.py +++ b/src/openpower/insndb/db.py @@ -18,6 +18,7 @@ from openpower.insndb.core import ( Walker, ) from openpower.decoder.power_enums import ( + SVPType, SVExtra, In1Sel, In2Sel, @@ -121,6 +122,14 @@ class SelectorsVisitor(InstructionVisitor): yield node +class PTypeVisitor(SVP64InstructionVisitor): + @mdis.dispatcher.Hook(SVPType) + @contextlib.contextmanager + def dispatch_ptype(self, node): + print(node) + yield node + + class ExtrasVisitor(SVP64InstructionVisitor, SelectorsVisitor): @mdis.dispatcher.Hook(SVP64Record.ExtraMap) @contextlib.contextmanager @@ -169,6 +178,10 @@ def main(): SelectorsVisitor, "print instruction selectors", ), + "ptype": ( + PTypeVisitor, + "print instruction ptype", + ), "extras": ( ExtrasVisitor, "print instruction extras (SVP64)",