From: Luke Kenneth Casson Leighton Date: Fri, 21 May 2021 13:54:45 +0000 (+0100) Subject: return dump of SPRs (to be used for saving, later) X-Git-Tag: xlen-bcd~577 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bb10e0c2dcf726b25fe889f3354ec04a17093abd;p=openpower-isa.git return dump of SPRs (to be used for saving, later) --- 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: