From 1287f3eba436a6e07565ac503ab8b461df5cdf3b Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sun, 4 Jun 2023 12:12:40 +0300 Subject: [PATCH] insndb/db: support extras command --- src/openpower/insndb/core.py | 4 ++++ src/openpower/insndb/db.py | 12 ++++++++++++ 2 files changed, 16 insertions(+) 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() -- 2.30.2