Add parameters to give preference to DRC/LVS/PEX tools like we do for spice.

This commit is contained in:
Matt Guthaus 2018-08-28 13:41:26 -07:00
parent 309bfaea2a
commit e804f36bec
3 changed files with 29 additions and 16 deletions

View File

@ -142,22 +142,31 @@ def init_openram(config_file, is_unit_test=True):
def get_tool(tool_type, preferences): def get_tool(tool_type, preferences, default_name=None):
""" """
Find which tool we have from a list of preferences and return the Find which tool we have from a list of preferences and return the
one selected and its full path. one selected and its full path. If default is specified,
find that one only and error otherwise.
""" """
debug.info(2,"Finding {} tool...".format(tool_type)) debug.info(2,"Finding {} tool...".format(tool_type))
for name in preferences: if default_name:
exe_name = find_exe(name) exe_name=find_exe(default_name)
if exe_name != None: if exe_name == None:
debug.info(1, "Using {0}: {1}".format(tool_type,exe_name)) debug.error("{0} not found. Cannot find {1} tool.".format(default_name,tool_type),2)
return(name,exe_name)
else: else:
debug.info(1, "Could not find {0}, trying next {1} tool.".format(name,tool_type)) debug.info(1, "Using {0}: {1}".format(tool_type,exe_name))
return(default_name,exe_name)
else: else:
return(None,"") for name in preferences:
exe_name = find_exe(name)
if exe_name != None:
debug.info(1, "Using {0}: {1}".format(tool_type,exe_name))
return(name,exe_name)
else:
debug.info(1, "Could not find {0}, trying next {1} tool.".format(name,tool_type))
else:
return(None,"")
def read_config(config_file, is_unit_test=True): def read_config(config_file, is_unit_test=True):

View File

@ -24,14 +24,18 @@ class options(optparse.Values):
check_lvsdrc = True check_lvsdrc = True
# Variable to select the variant of spice # Variable to select the variant of spice
spice_name = "" spice_name = ""
# Should we print out the banner at startup # The spice executable being used which is derived from the user PATH.
print_banner = True spice_exe = ""
# Variable to select the variant of drc, lvs, pex
drc_name = ""
lvs_name = ""
pex_name = ""
# The DRC/LVS/PEX executable being used which is derived from the user PATH. # The DRC/LVS/PEX executable being used which is derived from the user PATH.
drc_exe = None drc_exe = None
lvs_exe = None lvs_exe = None
pex_exe = None pex_exe = None
# The spice executable being used which is derived from the user PATH. # Should we print out the banner at startup
spice_exe = "" print_banner = True
# Run with extracted parasitics # Run with extracted parasitics
use_pex = False use_pex = False
# Remove noncritical memory cells for characterization speed-up # Remove noncritical memory cells for characterization speed-up

View File

@ -22,9 +22,9 @@ if not OPTS.check_lvsdrc:
OPTS.pex_exe = None OPTS.pex_exe = None
else: else:
debug.info(1, "Finding DRC/LVS/PEX tools.") debug.info(1, "Finding DRC/LVS/PEX tools.")
OPTS.drc_exe = get_tool("DRC",["calibre","assura","magic"]) OPTS.drc_exe = get_tool("DRC", ["calibre","assura","magic"], OPTS.drc_name)
OPTS.lvs_exe = get_tool("LVS",["calibre","assura","netgen"]) OPTS.lvs_exe = get_tool("LVS", ["calibre","assura","netgen"], OPTS.lvs_name)
OPTS.pex_exe = get_tool("PEX",["calibre","magic"]) OPTS.pex_exe = get_tool("PEX", ["calibre","magic"], OPTS.pex_name)
if OPTS.check_lvsdrc and OPTS.tech_name == "freepdk45": if OPTS.check_lvsdrc and OPTS.tech_name == "freepdk45":
debug.check(OPTS.drc_exe[0]!="magic","Magic does not support FreePDK45 for DRC.") debug.check(OPTS.drc_exe[0]!="magic","Magic does not support FreePDK45 for DRC.")