From e804f36bec81f928b37f1f92f7c12d4ac76b3424 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Tue, 28 Aug 2018 13:41:26 -0700 Subject: [PATCH] Add parameters to give preference to DRC/LVS/PEX tools like we do for spice. --- compiler/globals.py | 27 ++++++++++++++++++--------- compiler/options.py | 12 ++++++++---- compiler/verify/__init__.py | 6 +++--- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/compiler/globals.py b/compiler/globals.py index ff07906f..52b33450 100644 --- a/compiler/globals.py +++ b/compiler/globals.py @@ -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 - 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)) - 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) + if default_name: + exe_name=find_exe(default_name) + if exe_name == None: + debug.error("{0} not found. Cannot find {1} tool.".format(default_name,tool_type),2) 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: - 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): diff --git a/compiler/options.py b/compiler/options.py index 5360515d..04d546d4 100644 --- a/compiler/options.py +++ b/compiler/options.py @@ -24,14 +24,18 @@ class options(optparse.Values): check_lvsdrc = True # Variable to select the variant of spice spice_name = "" - # Should we print out the banner at startup - print_banner = True + # The spice executable being used which is derived from the user PATH. + 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. drc_exe = None lvs_exe = None pex_exe = None - # The spice executable being used which is derived from the user PATH. - spice_exe = "" + # Should we print out the banner at startup + print_banner = True # Run with extracted parasitics use_pex = False # Remove noncritical memory cells for characterization speed-up diff --git a/compiler/verify/__init__.py b/compiler/verify/__init__.py index 2199e765..91c52a90 100644 --- a/compiler/verify/__init__.py +++ b/compiler/verify/__init__.py @@ -22,9 +22,9 @@ if not OPTS.check_lvsdrc: OPTS.pex_exe = None else: debug.info(1, "Finding DRC/LVS/PEX tools.") - OPTS.drc_exe = get_tool("DRC",["calibre","assura","magic"]) - OPTS.lvs_exe = get_tool("LVS",["calibre","assura","netgen"]) - OPTS.pex_exe = get_tool("PEX",["calibre","magic"]) + OPTS.drc_exe = get_tool("DRC", ["calibre","assura","magic"], OPTS.drc_name) + OPTS.lvs_exe = get_tool("LVS", ["calibre","assura","netgen"], OPTS.lvs_name) + OPTS.pex_exe = get_tool("PEX", ["calibre","magic"], OPTS.pex_name) if OPTS.check_lvsdrc and OPTS.tech_name == "freepdk45": debug.check(OPTS.drc_exe[0]!="magic","Magic does not support FreePDK45 for DRC.")