From baa7b53de54912d29a75dfd2630a4d4a597a1ac6 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Wed, 1 Dec 2021 16:49:51 -0800 Subject: [PATCH] fix sv_analysis command, cuz script created by setup.py passes no parameters to function --- setup.py | 2 +- src/openpower/sv/sv_analysis.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8220279c..2f505dbf 100644 --- 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' ] diff --git a/src/openpower/sv/sv_analysis.py b/src/openpower/sv/sv_analysis.py index f0a6601d..b14be43f 100644 --- a/src/openpower/sv/sv_analysis.py +++ b/src/openpower/sv/sv_analysis.py @@ -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() -- 2.30.2