From: Dmitry Selyutin Date: Sun, 4 Jun 2023 09:12:40 +0000 (+0300) Subject: insndb/db: support extras command X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c9ba1a68c862791e849ea607b588888bcae6ea4;p=openpower-isa.git insndb/db: support extras command --- diff --git a/src/openpower/insndb/core.py b/src/openpower/insndb/core.py index 277a5f3d..13f3a62f 100644 --- a/src/openpower/insndb/core.py +++ b/src/openpower/insndb/core.py @@ -832,6 +832,10 @@ class Record: with visitor.record(record=self) as record: pass + @property + def extras(self): + return self.svp64.extras + @property def pcode(self): return self.mdwn.pcode diff --git a/src/openpower/insndb/db.py b/src/openpower/insndb/db.py index 3b79a180..5ed62157 100644 --- a/src/openpower/insndb/db.py +++ b/src/openpower/insndb/db.py @@ -74,6 +74,14 @@ class PCodeVisitor(InstructionVisitor): print(line) +class ExtrasVisitor(InstructionVisitor): + def concrete_record(self, record): + for (key, fields) in record.extras.items(): + print(key) + for (field_key, field_value) in fields.items(): + print(f" {field_key} {field_value}") + + def main(): commands = { "list": ( @@ -92,6 +100,10 @@ def main(): PCodeVisitor, "print instruction pseudocode", ), + "extras": ( + ExtrasVisitor, + "print instruction extras (SVP64)", + ), } main_parser = argparse.ArgumentParser()