insndb/db: introduce etype command
authorDmitry Selyutin <ghostmansd@gmail.com>
Thu, 22 Jun 2023 19:09:07 +0000 (22:09 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Fri, 23 Jun 2023 07:40:44 +0000 (10:40 +0300)
src/openpower/insndb/db.py

index e64fdc1ee7a9bba4d7ff9198a1520762ac75d396..b0411d25b0136fa7c6c382429ff45441d407ec95 100644 (file)
@@ -18,6 +18,7 @@ from openpower.insndb.core import (
     Walker,
 )
 from openpower.decoder.power_enums import (
+    SVEType,
     SVPType,
     SVExtra,
     In1Sel,
@@ -122,6 +123,14 @@ class SelectorsVisitor(InstructionVisitor):
         yield node
 
 
+class ETypeVisitor(SVP64InstructionVisitor):
+    @mdis.dispatcher.Hook(SVEType)
+    @contextlib.contextmanager
+    def dispatch_ptype(self, node):
+        print(node)
+        yield node
+
+
 class PTypeVisitor(SVP64InstructionVisitor):
     @mdis.dispatcher.Hook(SVPType)
     @contextlib.contextmanager
@@ -178,6 +187,10 @@ def main():
             SelectorsVisitor,
             "print instruction selectors",
         ),
+        "etype": (
+            ETypeVisitor,
+            "print instruction etype",
+        ),
         "ptype": (
             PTypeVisitor,
             "print instruction ptype",