From 40410cc9f5db760f249f6d4be43960e3a7a876a6 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Tue, 14 Nov 2017 15:31:58 -0800 Subject: [PATCH] Clean up code to work when no drc/lvs/pex is found. --- compiler/globals.py | 18 +++++------------- compiler/verify.py | 12 +++++++++--- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/compiler/globals.py b/compiler/globals.py index d25d64fd..57743ccd 100644 --- a/compiler/globals.py +++ b/compiler/globals.py @@ -168,7 +168,7 @@ def find_exe(check_exe): # if it is found, then break and use first version if is_exe(exe): return exe - return None + return "" def get_tool(tool_type, preferences): """ @@ -179,11 +179,11 @@ def get_tool(tool_type, preferences): if not OPTS.check_lvsdrc: debug.info(1,"LVS/DRC/PEX disabled.") - return + return None else: for name in preferences: exe_name = find_exe(name) - if exe_name!=None: + if exe_name!="": debug.info(1, "Using {0}: {1}".format(tool_type,exe_name)) return(exe_name) else: @@ -255,18 +255,10 @@ def set_spice(): else: if OPTS.spice_version != "": OPTS.spice_exe=find_exe(OPTS.spice_version) - if OPTS.spice_exe==None: + if OPTS.spice_exe=="": debug.error("{0} not found. Unable to perform characterization.".format(OPTS.spice_version),1) else: - spice_preferences = ["xa", "hspice", "ngspice", "ngspice.exe"] - for spice_name in spice_preferences: - OPTS.spice_exe = find_exe(spice_name) - if OPTS.spice_exe!=None: - OPTS.spice_version=spice_name - debug.info(1, "Using spice: " + OPTS.spice_exe) - break - else: - debug.info(1, "Could not find {}, trying next spice simulator. ".format(spice_name)) + OPTS.spice_exe = get_tool("spice",["xa", "hspice", "ngspice", "ngspice.exe"]) # set the input dir for spice files if using ngspice if OPTS.spice_version == "ngspice": diff --git a/compiler/verify.py b/compiler/verify.py index 10a21c25..fb44e22b 100644 --- a/compiler/verify.py +++ b/compiler/verify.py @@ -13,14 +13,18 @@ import tech from globals import OPTS -if "calibre" in OPTS.drc_exe: +if OPTS.drc_exe == None: + pass +elif "calibre" in OPTS.drc_exe: from calibre import run_drc elif "magic" in OPTS.drc_exe: from magic import run_drc else: debug.warning("Did not find a supported DRC tool.") -if "calibre" in OPTS.lvs_exe: +if OPTS.lvs_exe == None: + pass +elif "calibre" in OPTS.lvs_exe: from calibre import run_lvs elif "netgen" in OPTS.lvs_exe: from magic import run_lvs @@ -28,7 +32,9 @@ else: debug.warning("Did not find a supported LVS tool.") -if "calibre" in OPTS.pex_exe: +if OPTS.pex_exe == None: + pass +elif "calibre" in OPTS.pex_exe: from calibre import run_pex elif "magic" in OPTS.pex_exe: from magic import run_pex