diff --git a/compiler/base/geometry.py b/compiler/base/geometry.py index 1de435f1..b766b1af 100644 --- a/compiler/base/geometry.py +++ b/compiler/base/geometry.py @@ -143,7 +143,10 @@ class instance(geometry): self.rotate = rotate self.offset = vector(offset).snap_to_grid() self.mirror = mirror - if not OPTS.netlist_only: + if OPTS.netlist_only: + self.width = 0 + self.height = 0 + else: self.width = round_to_grid(mod.width) self.height = round_to_grid(mod.height) self.compute_boundary(offset,mirror,rotate) diff --git a/compiler/modules/replica_bitcell.py b/compiler/bitcells/replica_bitcell.py similarity index 100% rename from compiler/modules/replica_bitcell.py rename to compiler/bitcells/replica_bitcell.py diff --git a/compiler/modules/replica_pbitcell.py b/compiler/bitcells/replica_pbitcell.py similarity index 100% rename from compiler/modules/replica_pbitcell.py rename to compiler/bitcells/replica_pbitcell.py diff --git a/compiler/characterizer/functional.py b/compiler/characterizer/functional.py index 2fc7dcc4..34df6efb 100644 --- a/compiler/characterizer/functional.py +++ b/compiler/characterizer/functional.py @@ -267,7 +267,7 @@ class functional(simulation): t_intital=t_intital, t_final=t_final) - self.stim.write_control(self.cycle_times[-1] + self.period) + self.stim.write_control(self.cycle_times[-1] + self.period, runlvl=1) self.sf.close() diff --git a/compiler/characterizer/stimuli.py b/compiler/characterizer/stimuli.py index 14f780c2..6fa7a481 100644 --- a/compiler/characterizer/stimuli.py +++ b/compiler/characterizer/stimuli.py @@ -232,8 +232,19 @@ class stimuli(): measure_string=".meas tran {0} AVG v({1}) FROM={2}n TO={3}n\n\n".format(meas_name, dout, t_intital, t_final) self.sf.write(measure_string) - def write_control(self, end_time): + def write_control(self, end_time, runlvl=4): """ Write the control cards to run and end the simulation """ + + # These are guesses... + if runlvl==1: + reltol = 0.02 # 2% + elif runlvl==2: + reltol = 0.01 # 1% + elif runlvl==3: + reltol = 0.005 # 0.5% + else: + reltol = 0.001 # 0.1% + # UIC is needed for ngspice to converge self.sf.write(".TRAN 5p {0}n UIC\n".format(end_time)) if OPTS.spice_name == "ngspice": @@ -241,9 +252,9 @@ class stimuli(): # which is more accurate, but slower than the default trapezoid method # Do not remove this or it may not converge due to some "pa_00" nodes # unless you figure out what these are. - self.sf.write(".OPTIONS POST=1 RUNLVL=4 PROBE method=gear TEMP={}\n".format(self.temperature)) + self.sf.write(".OPTIONS POST=1 RELTOL={0} PROBE method=gear TEMP={1}\n".format(reltol,self.temperature)) else: - self.sf.write(".OPTIONS POST=1 RUNLVL=4 PROBE TEMP={}\n".format(self.temperature)) + self.sf.write(".OPTIONS POST=1 RUNLVL={0} PROBE TEMP={1}\n".format(runlvl,self.temperature)) # create plots for all signals self.sf.write("* probe is used for hspice/xa, while plot is used in ngspice\n") diff --git a/compiler/tests/20_psram_1bank_test.py b/compiler/tests/20_psram_1bank_nomux_test.py similarity index 100% rename from compiler/tests/20_psram_1bank_test.py rename to compiler/tests/20_psram_1bank_nomux_test.py diff --git a/compiler/tests/22_psram_func_test.py b/compiler/tests/22_psram_func_test.py index ab59b8b8..6a527754 100755 --- a/compiler/tests/22_psram_func_test.py +++ b/compiler/tests/22_psram_func_test.py @@ -11,12 +11,11 @@ import globals from globals import OPTS import debug -@unittest.skip("SKIPPING 22_psram_func_test") +#@unittest.skip("SKIPPING 22_psram_func_test") class psram_func_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) - #OPTS.spice_name="hspice" OPTS.analytical_delay = False OPTS.netlist_only = True OPTS.bitcell = "pbitcell" @@ -49,7 +48,7 @@ class psram_func_test(openram_test): corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) f = functional(s.s, tempspice, corner) - f.num_cycles = 5 + f.num_cycles = 10 (fail,error) = f.run() self.assertTrue(fail,error) diff --git a/compiler/tests/22_sram_func_test.py b/compiler/tests/22_sram_func_test.py index 15382b1f..de55c2ce 100755 --- a/compiler/tests/22_sram_func_test.py +++ b/compiler/tests/22_sram_func_test.py @@ -11,13 +11,13 @@ import globals from globals import OPTS import debug -@unittest.skip("SKIPPING 22_sram_func_test") +#@unittest.skip("SKIPPING 22_sram_func_test") class sram_func_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) - #OPTS.spice_name="hspice" OPTS.analytical_delay = False + OPTS.netlist_only = True # This is a hack to reload the characterizer __init__ with the spice version from importlib import reload