Move parameter setting to config reading rather than status function.

This commit is contained in:
mguthaus 2018-02-09 09:26:13 -08:00
parent f4a99be9d8
commit 8719a19377
1 changed files with 7 additions and 5 deletions

View File

@ -167,6 +167,13 @@ def read_config(config_file):
OPTS.output_path += "/" OPTS.output_path += "/"
debug.info(1, "Output saved in " + OPTS.output_path) debug.info(1, "Output saved in " + OPTS.output_path)
# If config didn't set output name, make a reasonable default.
if (OPTS.output_name == ""):
OPTS.output_name = "sram_{0}_{1}_{2}_{3}".format(OPTS.word_size,
OPTS.num_words,
OPTS.num_banks,
OPTS.OPTS.tech_name)
# Don't delete the output dir, it may have other files! # Don't delete the output dir, it may have other files!
# make the directory if it doesn't exist # make the directory if it doesn't exist
try: try:
@ -302,11 +309,6 @@ def report_status():
if not OPTS.tech_name: if not OPTS.tech_name:
debug.error("Tech name must be specified in config file.") debug.error("Tech name must be specified in config file.")
if (OPTS.output_name == ""):
OPTS.output_name = "sram_{0}_{1}_{2}_{3}".format(OPTS.word_size,
OPTS.num_words,
OPTS.num_banks,
OPTS.OPTS.tech_name)
if not OPTS.is_unit_test: if not OPTS.is_unit_test:
print("Output files are " + OPTS.output_name + ".(sp|gds|v|lib|lef)") print("Output files are " + OPTS.output_name + ".(sp|gds|v|lib|lef)")
print("Technology: {0}".format(OPTS.tech_name)) print("Technology: {0}".format(OPTS.tech_name))