Use None instead of empty string for tool names.

This commit is contained in:
mrg 2021-06-01 16:41:14 -07:00
parent 1ded978256
commit 537fd6eff9
3 changed files with 9 additions and 9 deletions

View File

@ -24,7 +24,7 @@ debug.info(1, "Initializing characterizer...")
OPTS.spice_exe = "" OPTS.spice_exe = ""
if not OPTS.analytical_delay: if not OPTS.analytical_delay:
if OPTS.spice_name != "": if OPTS.spice_name:
# Capitalize Xyce # Capitalize Xyce
if OPTS.spice_name == "xyce": if OPTS.spice_name == "xyce":
OPTS.spice_name = "Xyce" OPTS.spice_name = "Xyce"
@ -45,7 +45,7 @@ if not OPTS.analytical_delay:
if OPTS.spice_name == "ngspice": if OPTS.spice_name == "ngspice":
os.environ["NGSPICE_INPUT_DIR"] = "{0}".format(OPTS.openram_temp) os.environ["NGSPICE_INPUT_DIR"] = "{0}".format(OPTS.openram_temp)
if OPTS.spice_exe == "": if not OPTS.spice_exe:
debug.error("No recognizable spice version found. Unable to perform characterization.", 1) debug.error("No recognizable spice version found. Unable to perform characterization.", 1)
else: else:
debug.info(1, "Finding spice simulator: {} ({})".format(OPTS.spice_name, OPTS.spice_exe)) debug.info(1, "Finding spice simulator: {} ({})".format(OPTS.spice_name, OPTS.spice_exe))

View File

@ -276,8 +276,8 @@ class stimuli():
self.sf.write(".OPTIONS MEASURE MEASFAIL=1\n") self.sf.write(".OPTIONS MEASURE MEASFAIL=1\n")
self.sf.write(".OPTIONS LINSOL type=klu\n") self.sf.write(".OPTIONS LINSOL type=klu\n")
self.sf.write(".TRAN {0}p {1}n\n".format(timestep, end_time)) self.sf.write(".TRAN {0}p {1}n\n".format(timestep, end_time))
else: elif OPTS.spice_name:
debug.error("Unkown spice simulator {}".format(OPTS.spice_name)) debug.error("Unkown spice simulator {}".format(OPTS.spice_name), -1)
# create plots for all signals # create plots for all signals
if not OPTS.use_pex: # Don't save all for extracted simulations if not OPTS.use_pex: # Don't save all for extracted simulations

View File

@ -120,13 +120,13 @@ class options(optparse.Values):
# Tool options # Tool options
################### ###################
# Variable to select the variant of spice # Variable to select the variant of spice
spice_name = "" spice_name = None
# The spice executable being used which is derived from the user PATH. # The spice executable being used which is derived from the user PATH.
spice_exe = "" spice_exe = None
# Variable to select the variant of drc, lvs, pex # Variable to select the variant of drc, lvs, pex
drc_name = "" drc_name = None
lvs_name = "" lvs_name = None
pex_name = "" pex_name = None
# The DRC/LVS/PEX executable being used # The DRC/LVS/PEX executable being used
# which is derived from the user PATH. # which is derived from the user PATH.
drc_exe = None drc_exe = None