From 382510a4cbdded64b6405f9ef45349be414e3afa Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 25 May 2021 10:41:12 +0100 Subject: [PATCH] add add setting of LR so that code jumps outside of executable range when done --- media/Makefile | 1 + media/audio/mp3/mp3_0.spr | 1 + src/openpower/decoder/isa/pypowersim.py | 6 ++++++ 3 files changed, 8 insertions(+) create mode 100644 media/audio/mp3/mp3_0.spr diff --git a/media/Makefile b/media/Makefile index dc233552..9f59c297 100644 --- a/media/Makefile +++ b/media/Makefile @@ -34,4 +34,5 @@ wget: tests: $(OBJ) echo juuh pypowersim -g audio/mp3/mp3_0.gpr \ + -s audio/mp3/mp3_0.spr \ -i audio/mp3/mp3_0_apply_window_float.bin diff --git a/media/audio/mp3/mp3_0.spr b/media/audio/mp3/mp3_0.spr new file mode 100644 index 00000000..0a615d76 --- /dev/null +++ b/media/audio/mp3/mp3_0.spr @@ -0,0 +1 @@ +LR: 0xffffffff diff --git a/src/openpower/decoder/isa/pypowersim.py b/src/openpower/decoder/isa/pypowersim.py index f1577eb7..767344f2 100644 --- a/src/openpower/decoder/isa/pypowersim.py +++ b/src/openpower/decoder/isa/pypowersim.py @@ -43,6 +43,7 @@ def read_entries(fname, listqty=None): start with "0x" or "0b" for hex or binary """ regs = {} + allints = True with open(fname) as f: for line in f.readlines(): # split line "x : y" into ["x", "y"], remove spaces @@ -53,8 +54,13 @@ def read_entries(fname, listqty=None): reg = convert_to_num(reg) val = convert_to_num(val) assert reg not in regs, "duplicate entry %s" % (repr(reg)) + allints = allints and isinstance(reg, int) regs[reg] = val + # SPRs can be named + if not allints: + return regs + # post-process into a list. if listqty is None: return regs -- 2.30.2