add add setting of LR so that code jumps outside of executable range when done
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 25 May 2021 09:41:12 +0000 (10:41 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 25 May 2021 09:41:12 +0000 (10:41 +0100)
media/Makefile
media/audio/mp3/mp3_0.spr [new file with mode: 0644]
src/openpower/decoder/isa/pypowersim.py

index dc233552ce2e67016611ac4828250c5f78afa428..9f59c29794e3c63994c7bf0c5f6ec979a4ff31fc 100644 (file)
@@ -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 (file)
index 0000000..0a615d7
--- /dev/null
@@ -0,0 +1 @@
+LR: 0xffffffff
index f1577eb723c89a542dc794512fd0bfe5e7879058..767344f22cec97d4fcb46c37958ddbc5cff33eac 100644 (file)
@@ -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