From a831d400ef05e0d554ca79a9b75cdaa4b6927387 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Thu, 22 Jun 2023 21:57:48 +0300 Subject: [PATCH] insndb/db: introduce ptype command --- src/openpower/insndb/db.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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)", -- 2.30.2