From d98a13d9145ce646d836d6afa5f19c3dbbec43c1 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 27 Jan 2021 12:49:05 +0000 Subject: [PATCH] provide "merger" of SVP64 RM info into v3.0B CSV files --- src/soc/decoder/power_svp64.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/soc/decoder/power_svp64.py b/src/soc/decoder/power_svp64.py index b7c7cde1..df496d24 100644 --- a/src/soc/decoder/power_svp64.py +++ b/src/soc/decoder/power_svp64.py @@ -16,4 +16,33 @@ class SVP64RM: self.instrs[entry['insn']] = entry + def get_svp64_csv(self, fname): + # first get the v3.0B entries + v30b = get_csv(fname) + # now add the RM fields (for each instruction) + for entry in v30b: + # dummy (blank) fields, first + entry.update({'EXTRA0': '0', 'EXTRA1': '0', 'EXTRA2': '0', + 'EXTRA3': '0', + 'SV_Ptype': 'NONE', 'SV_Etype': 'NONE'}) + + # is this SVP64-augmented? + asmcode = entry['comment'] + if asmcode not in self.instrs: + continue + + # start updating the fields, merge relevant info + svp64 = self.instrs[asmcode] + for k, v in {'EXTRA0': '0', 'EXTRA1': '1', 'EXTRA2': '2', + 'EXTRA3': '3', + 'SV_Ptype': 'Ptype', 'SV_Etype': 'Etype'}.items(): + entry[k] = svp64[v] + + return v30b + +if __name__ == '__main__': + isa = SVP64RM() + minor_30 = isa.get_svp64_csv("minor_30.csv") + for entry in minor_30: + print (entry) -- 2.30.2