From 1ebec3c8d403a74a495d317d9c722aa4243bd279 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 18 Mar 2021 11:22:05 +0000 Subject: [PATCH] add option to move RS in CSV file reading, for compatibility with microwatt decode1.vhdl; --- src/soc/decoder/power_svp64.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/soc/decoder/power_svp64.py b/src/soc/decoder/power_svp64.py index 43794ed7..bc712af2 100644 --- a/src/soc/decoder/power_svp64.py +++ b/src/soc/decoder/power_svp64.py @@ -61,13 +61,23 @@ def decode_extra(rm, prefix=''): # gets SVP64 ReMap information class SVP64RM: - def __init__(self): + def __init__(self, microwatt_format=False): + """SVP64RM: gets micro-opcode information + + microwatt_format: moves RS to in1 (to match decode1.vhdl) + """ self.instrs = {} self.svp64_instrs = {} pth = find_wiki_dir() for fname in os.listdir(pth): if fname.startswith("RM") or fname.startswith("LDSTRM"): for entry in get_csv(fname): + if microwatt_format: + # move RS from position 1 to position 3, to match + # microwatt decode1.vhdl format + if entry['in1'] == 'RS' and entry['in3'] == 'NONE': + entry['in1'] = 'NONE' + entry['in3'] = 'RS' self.instrs[entry['insn']] = entry -- 2.30.2