From e97c359c44133cf98c3ccebba04edbe9df583c2c Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 25 May 2021 14:02:38 +0100 Subject: [PATCH] allow comments in SPR / GPR / FPR files --- media/audio/mp3/mp3_0.gpr | 15 +++++++++------ src/openpower/decoder/isa/pypowersim.py | 4 ++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/media/audio/mp3/mp3_0.gpr b/media/audio/mp3/mp3_0.gpr index eaf8511b..3318e6a4 100644 --- a/media/audio/mp3/mp3_0.gpr +++ b/media/audio/mp3/mp3_0.gpr @@ -1,6 +1,9 @@ -1: 0x4000 -3: 0x100000 -4: 0x200000 -5: 0x300000 -6: 0x400000 -7: 1 +# void ff_mpadsp_apply_window_float(float *synth_buf, float *window, +# int *dither_state, float *samples, +# ptrdiff_t incr); +1: 0x4000 # stack pointer +3: 0x100000 # param 1: float *sunth_buf buf +4: 0x200000 # param 2: float *window win +5: 0x300000 # param 3: int *dither_state &unused +6: 0x400000 # param 3: float *samples out +7: 1 # param 5: ptr_diff_t incr 1 diff --git a/src/openpower/decoder/isa/pypowersim.py b/src/openpower/decoder/isa/pypowersim.py index 0a973541..59f21f7c 100644 --- a/src/openpower/decoder/isa/pypowersim.py +++ b/src/openpower/decoder/isa/pypowersim.py @@ -56,6 +56,10 @@ def read_entries(fname, listqty=None): allints = True with open(fname) as f: for line in f.readlines(): + # split out comments + if line.startswith("#"): + continue + line = line.split("#")[0] # split line "x : y" into ["x", "y"], remove spaces line = list(map(str.strip, line.strip().split(":"))) assert len(line) == 2, "regfile line must be formatted 'x : y'" -- 2.30.2