From: Luke Kenneth Casson Leighton Date: Sat, 6 Aug 2022 12:58:11 +0000 (+0100) Subject: split cav reading into separate function X-Git-Tag: sv_maxu_works-initial~178 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6383a59214f12b624f3d8f04914152d863354500;p=openpower-isa.git split cav reading into separate function --- diff --git a/src/openpower/sv/sv_analysis.py b/src/openpower/sv/sv_analysis.py index 0fa0d7b3..95364aa8 100644 --- a/src/openpower/sv/sv_analysis.py +++ b/src/openpower/sv/sv_analysis.py @@ -271,7 +271,7 @@ class Format(enum.Enum): }[self](lines) -def process_csvs(format): +def read_csvs(): csvs = {} csvs_svp64 = {} bykey = {} @@ -281,12 +281,6 @@ def process_csvs(format): insns = {} # dictionary of CSV row, by instruction insn_to_csv = {} - print("# Draft SVP64 Power ISA register 'profile's") - print('') - print("this page is auto-generated, do not edit") - print("created by http://libre-soc.org/openpower/sv_analysis.py") - print('') - # Expand that (all .csv files) pth = find_wiki_file("*.csv") @@ -352,6 +346,21 @@ def process_csvs(format): primarykeys = list(primarykeys) primarykeys.sort() + return (csvs, csvs_svp64, primarykeys, bykey, insn_to_csv, insns, + dictkeys, immediates) + + +def process_csvs(format): + + print("# Draft SVP64 Power ISA register 'profile's") + print('') + print("this page is auto-generated, do not edit") + print("created by http://libre-soc.org/openpower/sv_analysis.py") + print('') + + (csvs, csvs_svp64, primarykeys, bykey, insn_to_csv, insns, + dictkeys, immediates) = read_csvs() + # mapping to old SVPrefix "Forms" mapsto = {'3R-1W-CRo': 'RM-1P-3S1D', '2R-1W-CRio': 'RM-1P-2S1D',