From bb10e0c2dcf726b25fe889f3354ec04a17093abd Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 21 May 2021 14:54:45 +0100 Subject: [PATCH] return dump of SPRs (to be used for saving, later) --- src/openpower/decoder/isa/caller.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/openpower/decoder/isa/caller.py b/src/openpower/decoder/isa/caller.py index 613ad01c..05bb3fb6 100644 --- a/src/openpower/decoder/isa/caller.py +++ b/src/openpower/decoder/isa/caller.py @@ -191,7 +191,8 @@ class SPR(dict): def __call__(self, ridx): return self[ridx] - def dump(self): + def dump(self, printout=True): + res = [] keys = list(self.keys()) keys.sort() for k in keys: @@ -200,7 +201,11 @@ class SPR(dict): sprname = k else: sprname = sprname.SPR - print(" ", sprname, hex(self[k].value)) + res.append((sprname, self[k].value)) + if printout: + for sprname, value in res: + print(" ", sprname, hex(value)) + return res class PC: -- 2.30.2