From 6383a59214f12b624f3d8f04914152d863354500 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 6 Aug 2022 13:58:11 +0100 Subject: [PATCH] split cav reading into separate function --- src/openpower/sv/sv_analysis.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) 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', -- 2.30.2