From 4d359725533d369b7e0184784bd4f0597ac395a2 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Fri, 9 Feb 2018 15:49:55 -0800 Subject: [PATCH] Get default corner options from tech file --- compiler/globals.py | 17 +++++++++++++---- compiler/options.py | 7 ++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/compiler/globals.py b/compiler/globals.py index 11a8854f..21c108df 100644 --- a/compiler/globals.py +++ b/compiler/globals.py @@ -177,7 +177,7 @@ def read_config(config_file, is_unit_test=True): OPTS.num_words, OPTS.num_banks, OPTS.OPTS.tech_name) - + # Don't delete the output dir, it may have other files! # make the directory if it doesn't exist try: @@ -263,9 +263,8 @@ def import_tech(): # Set the tech to the config file we read in instead of the command line value. OPTS.tech_name = OPTS.tech_name - - - # environment variable should point to the technology dir + + # environment variable should point to the technology dir try: OPENRAM_TECH = os.path.abspath(os.environ.get("OPENRAM_TECH")) except: @@ -289,6 +288,16 @@ def import_tech(): debug.error("Nonexistent technology_setup_file: {0}.py".format(filename)) sys.exit(1) + import tech + # Set some default options now based on the technology... + if (OPTS.process_corners == ""): + OPTS.process_corners = [tech.spice["nom_corner"][0]] + if (OPTS.supply_voltages == ""): + OPTS.supply_voltages = [tech.spice["nom_corner"][1]] + if (OPTS.temperatures == ""): + OPTS.temperatures = [tech.spice["nom_corner"][2]] + + def print_time(name, now_time, last_time=None): """ Print a statement about the time delta. """ if last_time: diff --git a/compiler/options.py b/compiler/options.py index 738b1907..133ee926 100644 --- a/compiler/options.py +++ b/compiler/options.py @@ -48,9 +48,10 @@ class options(optparse.Values): # These are the configuration parameters rw_ports = 1 r_ports = 0 - supply_voltages = [3] - temperatures = [25] - process_corners = ["TT"] + # These will get initialized by the the file + supply_voltages = "" + temperatures = "" + process_corners = "" # These are the default modules that can be over-riden