From cda2e93cd7ca887229a9c6e89e688418bf2901d1 Mon Sep 17 00:00:00 2001 From: Michael Timothy Grimes Date: Mon, 22 Oct 2018 09:17:03 -0700 Subject: [PATCH 1/5] Adding fix to netlist_only mode in geometry.py. Uncommenting functional tests and running both tests in netlist_only mode. --- compiler/base/geometry.py | 8 ++++++-- compiler/tests/22_psram_func_test.py | 5 ++--- compiler/tests/22_sram_func_test.py | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/compiler/base/geometry.py b/compiler/base/geometry.py index 8f0edb29..b766b1af 100644 --- a/compiler/base/geometry.py +++ b/compiler/base/geometry.py @@ -143,8 +143,12 @@ class instance(geometry): self.rotate = rotate self.offset = vector(offset).snap_to_grid() self.mirror = mirror - self.width = round_to_grid(mod.width) - self.height = round_to_grid(mod.height) + 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) debug.info(4, "creating instance: " + self.name) 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 From e90f9be6f5b6c5c154bd6d2ba49ea32638cce058 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Wed, 24 Oct 2018 09:06:29 -0700 Subject: [PATCH 2/5] Move replica bitcells to new bitcells subdir --- compiler/{modules => bitcells}/replica_bitcell.py | 0 compiler/{modules => bitcells}/replica_pbitcell.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename compiler/{modules => bitcells}/replica_bitcell.py (100%) rename compiler/{modules => bitcells}/replica_pbitcell.py (100%) 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 From 33c716eda8f72ee5f3acd5db3b9e21b6aeede044 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Wed, 24 Oct 2018 09:08:54 -0700 Subject: [PATCH 3/5] Rename psram bank test like sram bank testss --- .../{20_psram_1bank_test.py => 20_psram_1bank_nomux_test.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename compiler/tests/{20_psram_1bank_test.py => 20_psram_1bank_nomux_test.py} (100%) 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 From 5f17525501063673afc4a12a5aac45516dc134b4 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Wed, 24 Oct 2018 09:32:44 -0700 Subject: [PATCH 4/5] Added run-level option for write_control and enabled fast mode in functional tests --- compiler/characterizer/functional.py | 2 +- compiler/characterizer/stimuli.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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..70351f2a 100644 --- a/compiler/characterizer/stimuli.py +++ b/compiler/characterizer/stimuli.py @@ -232,7 +232,7 @@ 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 """ # UIC is needed for ngspice to converge self.sf.write(".TRAN 5p {0}n UIC\n".format(end_time)) @@ -241,9 +241,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 RUNLVL={0} PROBE method=gear TEMP={1}\n".format(runlvl,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") From cccde193d06c6098a3bf50e8fa7505efb1eec02d Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Wed, 24 Oct 2018 10:31:27 -0700 Subject: [PATCH 5/5] Add ngspice equivalents of RUNLVL --- compiler/characterizer/stimuli.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/compiler/characterizer/stimuli.py b/compiler/characterizer/stimuli.py index 70351f2a..6fa7a481 100644 --- a/compiler/characterizer/stimuli.py +++ b/compiler/characterizer/stimuli.py @@ -234,6 +234,17 @@ class stimuli(): 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,7 +252,7 @@ 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={0} PROBE method=gear TEMP={1}\n".format(runlvl,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={0} PROBE TEMP={1}\n".format(runlvl,self.temperature))