sv_binutils: generate entries and num_entries via classes
[openpower-isa.git] / src / openpower / sv / sv_analysis.py
index f0a6601dbb35e40bc27c52a40a9a1752b36ce6a6..d2b7c7abcd2dd4ad065e5704b115f6c1a9e0a2a1 100644 (file)
@@ -691,6 +691,12 @@ def process_csvs(format):
 
     # now write out the csv files
     for value, csv in svp64.items():
+        if value == '-':
+            from time import sleep
+            print ("WARNING, filename '-' should NOT exist. instrs missing")
+            print ("TODO: fix this (and put in the bugreport number here)")
+            sleep(2)
+            continue
         # print out svp64 tables by category
         print("## %s" % value)
         print('')
@@ -817,10 +823,16 @@ def output(format, svt, csvcols, insns, csvs_svp64, stream):
         stream.write(f"{line}\n")
 
 
-if __name__ == '__main__':
+def main():
     parser = argparse.ArgumentParser()
     parser.add_argument("-f", "--format",
                         type=Format, choices=Format, default=Format.VHDL,
                         help="format to be used (binutils or VHDL)")
     args = parser.parse_args()
     process_csvs(args.format)
+
+
+if __name__ == '__main__':
+    # don't do anything other than call main() here, cuz this code is bypassed
+    # by the sv_analysis command created by setup.py
+    main()