1 # SPDX-License-Identifier: LGPLv3+
2 # Copyright (C) 2021 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
3 # Funded by NLnet http://nlnet.nl
5 from soc
.decoder
.power_enums
import get_csv
, find_wiki_dir
8 # gets SVP64 ReMap information
13 for fname
in os
.listdir(pth
):
14 if fname
.startswith("RM") or fname
.startswith("LDSTRM"):
15 for entry
in get_csv(fname
):
16 self
.instrs
[entry
['insn']] = entry
19 def get_svp64_csv(self
, fname
):
20 # first get the v3.0B entries
23 # now add the RM fields (for each instruction)
25 # dummy (blank) fields, first
26 entry
.update({'EXTRA0': '0', 'EXTRA1': '0', 'EXTRA2': '0',
28 'SV_Ptype': 'NONE', 'SV_Etype': 'NONE'})
30 # is this SVP64-augmented?
31 asmcode
= entry
['comment']
32 if asmcode
not in self
.instrs
:
35 # start updating the fields, merge relevant info
36 svp64
= self
.instrs
[asmcode
]
37 for k
, v
in {'EXTRA0': '0', 'EXTRA1': '1', 'EXTRA2': '2',
39 'SV_Ptype': 'Ptype', 'SV_Etype': 'Etype'}.items():
44 if __name__
== '__main__':
46 minor_30
= isa
.get_svp64_csv("minor_30.csv")
47 for entry
in minor_30
: