mirror of
https://github.com/YosysHQ/sby.git
synced 2025-04-05 22:14:08 +00:00
use argument for name of .sby and .sv files
This commit is contained in:
parent
f22b6921c5
commit
5eee219127
|
@ -68,9 +68,9 @@ parser.add_argument("--dumpfiles", action="store_true", dest="dump_files",
|
||||||
help="print the list of source files")
|
help="print the list of source files")
|
||||||
parser.add_argument("--setup", action="store_true", dest="setupmode",
|
parser.add_argument("--setup", action="store_true", dest="setupmode",
|
||||||
help="set up the working directory and exit")
|
help="set up the working directory and exit")
|
||||||
parser.add_argument("--init-config", action="store_true", dest="initconfig",
|
|
||||||
help="create a default .sby config file")
|
|
||||||
|
|
||||||
|
parser.add_argument("--init-config-file", dest="init_config_file",
|
||||||
|
help="create a default .sby config file")
|
||||||
parser.add_argument("sbyfile", metavar="<jobname>.sby | <dirname>", nargs="?",
|
parser.add_argument("sbyfile", metavar="<jobname>.sby | <dirname>", nargs="?",
|
||||||
help=".sby file OR directory containing config.sby file")
|
help=".sby file OR directory containing config.sby file")
|
||||||
parser.add_argument("arg_tasknames", metavar="tasknames", nargs="*",
|
parser.add_argument("arg_tasknames", metavar="tasknames", nargs="*",
|
||||||
|
@ -91,23 +91,7 @@ dump_tasks = args.dump_tasks
|
||||||
dump_files = args.dump_files
|
dump_files = args.dump_files
|
||||||
reusedir = False
|
reusedir = False
|
||||||
setupmode = args.setupmode
|
setupmode = args.setupmode
|
||||||
initconfig = args.initconfig
|
init_config_file = args.init_config_file
|
||||||
|
|
||||||
def init_config(filename):
|
|
||||||
with open(filename, 'w') as config:
|
|
||||||
config.write("""
|
|
||||||
[options]
|
|
||||||
mode bmc
|
|
||||||
|
|
||||||
[engines]
|
|
||||||
smtbmc
|
|
||||||
|
|
||||||
[script]
|
|
||||||
read -formal default.v
|
|
||||||
prep -top top
|
|
||||||
|
|
||||||
[files]
|
|
||||||
default.v""")
|
|
||||||
|
|
||||||
if sbyfile is not None:
|
if sbyfile is not None:
|
||||||
if os.path.isdir(sbyfile):
|
if os.path.isdir(sbyfile):
|
||||||
|
@ -134,9 +118,25 @@ if sbyfile is not None:
|
||||||
print("ERROR: Sby file does not have .sby file extension.", file=sys.stderr)
|
print("ERROR: Sby file does not have .sby file extension.", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
elif initconfig:
|
elif init_config_file is not None:
|
||||||
print("default sby config written to default.sby", file=sys.stderr)
|
sv_file = init_config_file + ".sv"
|
||||||
init_config("default.sby")
|
sby_file = init_config_file + ".sby"
|
||||||
|
with open(sby_file, 'w') as config:
|
||||||
|
config.write("""[options]
|
||||||
|
mode bmc
|
||||||
|
|
||||||
|
[engines]
|
||||||
|
smtbmc
|
||||||
|
|
||||||
|
[script]
|
||||||
|
read -formal {0}
|
||||||
|
prep -top top
|
||||||
|
|
||||||
|
[files]
|
||||||
|
{0}
|
||||||
|
""".format(sv_file))
|
||||||
|
|
||||||
|
print("sby config written to {}".format(sby_file), file=sys.stderr)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
early_logmsgs = list()
|
early_logmsgs = list()
|
||||||
|
|
Loading…
Reference in a new issue