diff options
author | Catherine <whitequark@whitequark.org> | 2023-02-27 20:24:47 +0000 |
---|---|---|
committer | Catherine <whitequark@whitequark.org> | 2023-02-27 20:31:00 +0000 |
commit | 4bb173e25609b836fc83473b544f404f8f76d2ff (patch) | |
tree | 254e90e2fbb57e1293432a46fc04c990e027955a /backends/smt2 | |
parent | ef8ed21a2e7ccaea468baef293fc497d430960b6 (diff) | |
download | yosys-4bb173e25609b836fc83473b544f404f8f76d2ff.tar.gz yosys-4bb173e25609b836fc83473b544f404f8f76d2ff.tar.bz2 yosys-4bb173e25609b836fc83473b544f404f8f76d2ff.zip |
yosys-smtbmc: support -h/--help (and exit with code 0).
Diffstat (limited to 'backends/smt2')
-rw-r--r-- | backends/smt2/smtbmc.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/backends/smt2/smtbmc.py b/backends/smt2/smtbmc.py index cb21eb3aa..6b81740a2 100644 --- a/backends/smt2/smtbmc.py +++ b/backends/smt2/smtbmc.py @@ -59,9 +59,12 @@ detect_loops = False so = SmtOpts() -def usage(): +def help(): print(os.path.basename(sys.argv[0]) + """ [options] <yosys_smt2_output> + -h, --help + show this message + -t <num_steps> -t <skip_steps>:<num_steps> -t <skip_steps>:<step_size>:<num_steps> @@ -181,19 +184,25 @@ def usage(): (this feature is experimental and incomplete) """ + so.helpmsg()) + +def usage(): + help() sys.exit(1) try: - opts, args = getopt.getopt(sys.argv[1:], so.shortopts + "t:igcm:", so.longopts + - ["final-only", "assume-skipped=", "smtc=", "cex=", "aig=", "aig-noheader", "yw=", "btorwit=", "presat", + opts, args = getopt.getopt(sys.argv[1:], so.shortopts + "t:higcm:", so.longopts + + ["help", "final-only", "assume-skipped=", "smtc=", "cex=", "aig=", "aig-noheader", "yw=", "btorwit=", "presat", "dump-vcd=", "dump-yw=", "dump-vlogtb=", "vlogtb-top=", "dump-smtc=", "dump-all", "noinfo", "append=", "smtc-init", "smtc-top=", "noinit", "binary", "keep-going", "check-witness", "detect-loops"]) except: usage() for o, a in opts: - if o == "-t": + if o in ("-h", "--help"): + help() + sys.exit(0) + elif o == "-t": got_topt = True a = a.split(":") if len(a) == 1: |