fix sv_analysis command, cuz script created by setup.py passes no parameters to function
authorJacob Lifshay <programmerjake@gmail.com>
Thu, 2 Dec 2021 00:49:51 +0000 (16:49 -0800)
committerJacob Lifshay <programmerjake@gmail.com>
Thu, 2 Dec 2021 00:49:51 +0000 (16:49 -0800)
setup.py
src/openpower/sv/sv_analysis.py

index 8220279cb9285e1d19874aac42b2c2204c2dcf01..2f505dbf2876b193ee36167eaac8ae9201a3a8fe 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -60,7 +60,7 @@ setup(
         'console_scripts': [
             'pywriter=openpower.decoder.pseudo.pywriter:pywriter',
             'pyfnwriter=openpower.decoder.pseudo.pyfnwriter:pyfnwriter',
-            'sv_analysis=openpower.sv.sv_analysis:process_csvs',
+            'sv_analysis=openpower.sv.sv_analysis:main',
             'pypowersim=openpower.decoder.isa.pypowersim:run_simulation',
             'pysvp64asm=openpower.sv.trans.svp64:asm_process'
         ]
index f0a6601dbb35e40bc27c52a40a9a1752b36ce6a6..b14be43fb148bbc28e702a6ff6e478bfe3bc54ea 100644 (file)
@@ -817,10 +817,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()