diff --git a/compiler/openram.py b/compiler/openram.py index cbff2bf4..ba344262 100755 --- a/compiler/openram.py +++ b/compiler/openram.py @@ -22,10 +22,6 @@ import re import importlib import globals -global OPTS - -(OPTS, args) = globals.parse_args() - # These depend on arguments, so don't load them until now. import debug @@ -34,11 +30,11 @@ if len(args) < 1: print globals.USAGE sys.exit(2) +globals.init_openram(args[0]) + if OPTS.print_banner: print globals.BANNER -globals.init_openram(args[0]) - # Check if all arguments are integers for bits, size, banks if type(OPTS.config.word_size)!=int: debug.error("{0} is not an integer in config file.".format(OPTS.config.word_size)) @@ -94,7 +90,7 @@ s.gds_write(gdsname) # Run Characterizer on the design sram_file = spname -if OPTS.run_pex: +if OPTS.use_pex: sram_file = OPTS.out_path + "temp_pex.sp" calibre.run_pex(s.name, gdsname, spname, output=sram_file) diff --git a/compiler/options.py b/compiler/options.py index f224ed6d..ffe7f01d 100644 --- a/compiler/options.py +++ b/compiler/options.py @@ -29,7 +29,7 @@ class options(optparse.Values): # The spice executable being used which is derived from the user PATH. spice_exe = "" # Run with extracted parasitics - run_pex = False + use_pex = False # Trim noncritical memory cells for simulation speed-up trim_noncritical = False # Define the output file paths diff --git a/compiler/tests/21_hspice_delay_test.py b/compiler/tests/21_hspice_delay_test.py index eef6b3e2..c1354790 100644 --- a/compiler/tests/21_hspice_delay_test.py +++ b/compiler/tests/21_hspice_delay_test.py @@ -22,7 +22,6 @@ class timing_sram_test(unittest.TestCase): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) # we will manually run lvs/drc OPTS.check_lvsdrc = False - OPTS.use_pex = False OPTS.spice_version="hspice" OPTS.force_spice = True globals.set_spice() diff --git a/compiler/tests/21_hspice_hold_test.py b/compiler/tests/21_hspice_hold_test.py index 54385898..533a0afd 100644 --- a/compiler/tests/21_hspice_hold_test.py +++ b/compiler/tests/21_hspice_hold_test.py @@ -22,7 +22,6 @@ class timing_setup_test(unittest.TestCase): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) # we will manually run lvs/drc OPTS.check_lvsdrc = False - OPTS.use_pex = False OPTS.spice_version="hspice" OPTS.force_spice = True globals.set_spice() diff --git a/compiler/tests/21_hspice_setup_test.py b/compiler/tests/21_hspice_setup_test.py index 9e15b990..6e264531 100644 --- a/compiler/tests/21_hspice_setup_test.py +++ b/compiler/tests/21_hspice_setup_test.py @@ -23,7 +23,6 @@ class timing_setup_test(unittest.TestCase): # we will manually run lvs/drc OPTS.check_lvsdrc = False - OPTS.use_pex = False OPTS.spice_version="hspice" OPTS.force_spice = True globals.set_spice() diff --git a/compiler/tests/21_ngspice_delay_test.py b/compiler/tests/21_ngspice_delay_test.py index 747362c4..bb136b05 100644 --- a/compiler/tests/21_ngspice_delay_test.py +++ b/compiler/tests/21_ngspice_delay_test.py @@ -20,7 +20,6 @@ class timing_sram_test(unittest.TestCase): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) # we will manually run lvs/drc OPTS.check_lvsdrc = False - OPTS.use_pex = False OPTS.spice_version="ngspice" OPTS.force_spice = True globals.set_spice() @@ -33,7 +32,11 @@ class timing_sram_test(unittest.TestCase): num_banks=OPTS.config.num_banks, name="test_sram1") + # reset these options OPTS.check_lvsdrc = True + OPTS.spice_version="hspice" + OPTS.force_spice = False + globals.set_spice() import delay diff --git a/compiler/tests/21_ngspice_hold_test.py b/compiler/tests/21_ngspice_hold_test.py index de7c77c7..f8c891ee 100644 --- a/compiler/tests/21_ngspice_hold_test.py +++ b/compiler/tests/21_ngspice_hold_test.py @@ -22,7 +22,6 @@ class timing_setup_test(unittest.TestCase): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) # we will manually run lvs/drc OPTS.check_lvsdrc = False - OPTS.use_pex = False OPTS.spice_version="ngspice" OPTS.force_spice = True globals.set_spice() @@ -33,7 +32,11 @@ class timing_setup_test(unittest.TestCase): sh = setup_hold.setup_hold() [one_setup_time, zero_setup_time] = sh.hold_time() + # reset these options OPTS.check_lvsdrc = True + OPTS.spice_version="hspice" + OPTS.force_spice = False + globals.set_spice() if OPTS.tech_name == "freepdk45": self.assertTrue(isclose(one_setup_time,-0.0048828125)) diff --git a/compiler/tests/21_ngspice_setup_test.py b/compiler/tests/21_ngspice_setup_test.py index 902f3c03..79d1b218 100644 --- a/compiler/tests/21_ngspice_setup_test.py +++ b/compiler/tests/21_ngspice_setup_test.py @@ -22,7 +22,6 @@ class timing_setup_test(unittest.TestCase): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) # we will manually run lvs/drc OPTS.check_lvsdrc = False - OPTS.use_pex = False OPTS.spice_version="ngspice" OPTS.force_spice = True globals.set_spice() @@ -33,7 +32,12 @@ class timing_setup_test(unittest.TestCase): sh = setup_hold.setup_hold() [one_setup_time, zero_setup_time] = sh.setup_time() + # reset these options OPTS.check_lvsdrc = True + OPTS.spice_version="hspice" + OPTS.force_spice = False + globals.set_spice() + if OPTS.tech_name == "freepdk45": self.assertTrue(isclose(one_setup_time,0.0146484375)) self.assertTrue(isclose(zero_setup_time,0.008544921875)) diff --git a/compiler/tests/22_sram_func_test.py b/compiler/tests/22_sram_func_test.py index c549d27c..bc4b876b 100644 --- a/compiler/tests/22_sram_func_test.py +++ b/compiler/tests/22_sram_func_test.py @@ -22,7 +22,6 @@ class sram_func_test(unittest.TestCase): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) # we will manually run lvs/drc OPTS.check_lvsdrc = False - OPTS.use_pex = False import sram diff --git a/compiler/tests/23_lib_sram_test.py b/compiler/tests/23_lib_sram_test.py index 07b9f927..6ad3041a 100644 --- a/compiler/tests/23_lib_sram_test.py +++ b/compiler/tests/23_lib_sram_test.py @@ -20,7 +20,6 @@ class lib_test(unittest.TestCase): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) # we will manually run lvs/drc OPTS.check_lvsdrc = False - OPTS.use_pex = False import sram import lib