From 56770f558f252e4c4460f99756271b5718a7bc61 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Mon, 29 Jan 2018 16:59:29 -0800 Subject: [PATCH] Consolidate checking into our own unit test class. Remove all files in temp dir after each test, not just spice and gds. --- compiler/tests/00_code_format_check_test.py | 4 +- compiler/tests/01_library_drc_test.py | 4 +- compiler/tests/02_library_lvs_test.py | 4 +- compiler/tests/03_contact_test.py | 17 +++------ compiler/tests/03_path_test.py | 17 +++------ compiler/tests/03_ptx_1finger_nmos_test.py | 14 +------ compiler/tests/03_ptx_1finger_pmos_test.py | 15 +------- compiler/tests/03_ptx_3finger_nmos_test.py | 15 +------- compiler/tests/03_ptx_3finger_pmos_test.py | 15 +------- compiler/tests/03_ptx_4finger_nmos_test.py | 15 +------- compiler/tests/03_ptx_4finger_pmos_test.py | 15 +------- compiler/tests/03_wire_test.py | 22 ++++------- compiler/tests/04_pinv_10x_test.py | 23 +---------- compiler/tests/04_pinv_1x_beta_test.py | 24 +----------- compiler/tests/04_pinv_1x_test.py | 24 +----------- compiler/tests/04_pinv_2x_test.py | 23 +---------- compiler/tests/04_pnand2_test.py | 18 +-------- compiler/tests/04_pnand3_test.py | 17 +-------- compiler/tests/04_pnor2_test.py | 19 +--------- compiler/tests/04_precharge_test.py | 18 +-------- compiler/tests/04_wordline_driver_test.py | 18 +-------- compiler/tests/05_bitcell_array_test.py | 19 +--------- .../tests/06_hierarchical_decoder_test.py | 22 +---------- .../06_hierarchical_predecode2x4_test.py | 17 +-------- .../06_hierarchical_predecode3x8_test.py | 17 +-------- .../07_single_level_column_mux_array_test.py | 21 +--------- compiler/tests/08_precharge_array_test.py | 17 +-------- compiler/tests/09_sense_amp_array_test.py | 22 +---------- compiler/tests/10_write_driver_array_test.py | 22 +---------- compiler/tests/11_ms_flop_array_test.py | 23 +---------- compiler/tests/12_tri_gate_array_test.py | 22 +---------- compiler/tests/13_delay_chain_test.py | 17 +-------- compiler/tests/14_replica_bitline_test.py | 17 +-------- compiler/tests/16_control_logic_test.py | 18 +-------- compiler/tests/19_multi_bank_test.py | 21 +--------- compiler/tests/19_single_bank_test.py | 21 +--------- compiler/tests/20_sram_1bank_test.py | 18 +-------- compiler/tests/20_sram_2bank_test.py | 18 +-------- compiler/tests/20_sram_4bank_test.py | 18 +-------- compiler/tests/21_hspice_delay_test.py | 4 +- compiler/tests/21_hspice_setuphold_test.py | 4 +- compiler/tests/21_ngspice_delay_test.py | 4 +- compiler/tests/21_ngspice_setuphold_test.py | 4 +- compiler/tests/22_pex_func_test_with_pinv.py | 4 +- compiler/tests/22_sram_func_test.py | 4 +- compiler/tests/23_lib_sram_model_test.py | 4 +- compiler/tests/23_lib_sram_prune_test.py | 4 +- compiler/tests/23_lib_sram_test.py | 4 +- compiler/tests/24_lef_sram_test.py | 4 +- compiler/tests/25_verilog_sram_test.py | 4 +- compiler/tests/30_openram_test.py | 4 +- compiler/tests/regress.py | 2 +- compiler/tests/testutils.py | 38 +++++++++++++++++++ 53 files changed, 155 insertions(+), 624 deletions(-) diff --git a/compiler/tests/00_code_format_check_test.py b/compiler/tests/00_code_format_check_test.py index d94d72ec..41b27d9a 100644 --- a/compiler/tests/00_code_format_check_test.py +++ b/compiler/tests/00_code_format_check_test.py @@ -1,13 +1,13 @@ #!/usr/bin/env python2.7 import unittest -from testutils import header +from testutils import header,openram_test import sys,os,re sys.path.append(os.path.join(sys.path[0],"..")) import globals import debug -class code_format_test(unittest.TestCase): +class code_format_test(openram_test): "Run a test to check for tabs instead of spaces in the all source files." def runTest(self): diff --git a/compiler/tests/01_library_drc_test.py b/compiler/tests/01_library_drc_test.py index a83c5a38..d2c0ff1c 100644 --- a/compiler/tests/01_library_drc_test.py +++ b/compiler/tests/01_library_drc_test.py @@ -2,14 +2,14 @@ "Run a regresion test the library cells for DRC" import unittest -from testutils import header +from testutils import header,openram_test import sys,os,re sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class library_drc_test(unittest.TestCase): +class library_drc_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/02_library_lvs_test.py b/compiler/tests/02_library_lvs_test.py index caa13e42..251347ee 100644 --- a/compiler/tests/02_library_lvs_test.py +++ b/compiler/tests/02_library_lvs_test.py @@ -2,14 +2,14 @@ "Run a regresion test the library cells for LVS" import unittest -from testutils import header +from testutils import header,openram_test import sys,os,re sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class library_lvs_test(unittest.TestCase): +class library_lvs_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/03_contact_test.py b/compiler/tests/03_contact_test.py index eb59a32d..9e939f81 100644 --- a/compiler/tests/03_contact_test.py +++ b/compiler/tests/03_contact_test.py @@ -2,14 +2,14 @@ "Run a regresion test for DRC on basic contacts of different array sizes" import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class contact_test(unittest.TestCase): +class contact_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -26,31 +26,26 @@ class contact_test(unittest.TestCase): # Check single 1 x 1 contact" debug.info(2, "1 x 1 {} test".format(stack_name)) c = contact.contact(layer_stack, (1, 1)) - self.local_check(c) + self.local_drc_check(c) # check vertical array with one in the middle and two ends debug.info(2, "1 x 3 {} test".format(stack_name)) c = contact.contact(layer_stack, (1, 3)) - self.local_check(c) + self.local_drc_check(c) # check horizontal array with one in the middle and two ends debug.info(2, "3 x 1 {} test".format(stack_name)) c = contact.contact(layer_stack, (3, 1)) - self.local_check(c) + self.local_drc_check(c) # check 3x3 array for all possible neighbors debug.info(2, "3 x 3 {} test".format(stack_name)) c = contact.contact(layer_stack, (3, 3)) - self.local_check(c) + self.local_drc_check(c) OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, c): - tempgds = OPTS.openram_temp + "temp.gds" - c.gds_write(tempgds) - self.assertFalse(verify.run_drc(c.name, tempgds)) - os.remove(tempgds) # instantiate a copy of the class to actually run the test diff --git a/compiler/tests/03_path_test.py b/compiler/tests/03_path_test.py index 0739df5f..7a6ef7c0 100644 --- a/compiler/tests/03_path_test.py +++ b/compiler/tests/03_path_test.py @@ -2,14 +2,14 @@ "Run a regresion test on a basic path" import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class path_test(unittest.TestCase): +class path_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -32,7 +32,7 @@ class path_test(unittest.TestCase): [0, 6 * min_space ]] w = design.design("path_test0") path.path(w,layer_stack, position_list) - self.local_check(w) + self.local_drc_check(w) min_space = 2 * tech.drc["minwidth_metal1"] @@ -49,7 +49,7 @@ class path_test(unittest.TestCase): position_list = [[x+min_space, y+min_space] for x,y in old_position_list] w = design.design("path_test1") path.path(w,layer_stack, position_list) - self.local_check(w) + self.local_drc_check(w) min_space = 2 * tech.drc["minwidth_metal2"] layer_stack = ("metal2") @@ -65,7 +65,7 @@ class path_test(unittest.TestCase): position_list = [[x-min_space, y-min_space] for x,y in old_position_list] w = design.design("path_test2") path.path(w, layer_stack, position_list) - self.local_check(w) + self.local_drc_check(w) min_space = 2 * tech.drc["minwidth_metal3"] layer_stack = ("metal3") @@ -82,17 +82,12 @@ class path_test(unittest.TestCase): position_list.reverse() w = design.design("path_test3") path.path(w, layer_stack, position_list) - self.local_check(w) + self.local_drc_check(w) # return it back to it's normal state OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, w): - tempgds = OPTS.openram_temp + "temp.gds" - w.gds_write(tempgds) - self.assertFalse(verify.run_drc(w.name, tempgds)) - os.remove(tempgds) # instantiate a copy of the class to actually run the test diff --git a/compiler/tests/03_ptx_1finger_nmos_test.py b/compiler/tests/03_ptx_1finger_nmos_test.py index 505bb5f7..40a9500f 100644 --- a/compiler/tests/03_ptx_1finger_nmos_test.py +++ b/compiler/tests/03_ptx_1finger_nmos_test.py @@ -2,14 +2,14 @@ "Run a regresion test on a basic parameterized transistors" import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class ptx_test(unittest.TestCase): +class ptx_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -29,16 +29,6 @@ class ptx_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, fet): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - fet.sp_write(tempspice) - fet.gds_write(tempgds) - - self.assertFalse(verify.run_drc(fet.name, tempgds)) - - globals.end_openram() # instantiate a copy of the class to actually run the test if __name__ == "__main__": diff --git a/compiler/tests/03_ptx_1finger_pmos_test.py b/compiler/tests/03_ptx_1finger_pmos_test.py index 5bd8d722..cad75bca 100644 --- a/compiler/tests/03_ptx_1finger_pmos_test.py +++ b/compiler/tests/03_ptx_1finger_pmos_test.py @@ -2,14 +2,14 @@ "Run a regresion test on a basic parameterized transistors" import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class ptx_test(unittest.TestCase): +class ptx_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -29,17 +29,6 @@ class ptx_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, fet): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - fet.sp_write(tempspice) - fet.gds_write(tempgds) - - self.assertFalse(verify.run_drc(fet.name, tempgds)) - - os.remove(tempspice) - os.remove(tempgds) # instantiate a copy of the class to actually run the test if __name__ == "__main__": diff --git a/compiler/tests/03_ptx_3finger_nmos_test.py b/compiler/tests/03_ptx_3finger_nmos_test.py index 40e61ff9..6ff93458 100644 --- a/compiler/tests/03_ptx_3finger_nmos_test.py +++ b/compiler/tests/03_ptx_3finger_nmos_test.py @@ -2,14 +2,14 @@ "Run a regresion test on a basic parameterized transistors" import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class ptx_test(unittest.TestCase): +class ptx_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -31,17 +31,6 @@ class ptx_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, fet): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - fet.sp_write(tempspice) - fet.gds_write(tempgds) - - self.assertFalse(verify.run_drc(fet.name, tempgds)) - - os.remove(tempspice) - os.remove(tempgds) # instantiate a copy of the class to actually run the test if __name__ == "__main__": diff --git a/compiler/tests/03_ptx_3finger_pmos_test.py b/compiler/tests/03_ptx_3finger_pmos_test.py index f49c55e9..55f7d202 100644 --- a/compiler/tests/03_ptx_3finger_pmos_test.py +++ b/compiler/tests/03_ptx_3finger_pmos_test.py @@ -2,14 +2,14 @@ "Run a regresion test on a basic parameterized transistors" import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class ptx_test(unittest.TestCase): +class ptx_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -31,17 +31,6 @@ class ptx_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, fet): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - fet.sp_write(tempspice) - fet.gds_write(tempgds) - - self.assertFalse(verify.run_drc(fet.name, tempgds)) - - os.remove(tempspice) - os.remove(tempgds) # instantiate a copy of the class to actually run the test if __name__ == "__main__": diff --git a/compiler/tests/03_ptx_4finger_nmos_test.py b/compiler/tests/03_ptx_4finger_nmos_test.py index f5ca9752..e109de51 100644 --- a/compiler/tests/03_ptx_4finger_nmos_test.py +++ b/compiler/tests/03_ptx_4finger_nmos_test.py @@ -2,14 +2,14 @@ "Run a regresion test on a basic parameterized transistors" import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class ptx_test(unittest.TestCase): +class ptx_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -31,17 +31,6 @@ class ptx_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, fet): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - fet.sp_write(tempspice) - fet.gds_write(tempgds) - - self.assertFalse(verify.run_drc(fet.name, tempgds)) - - os.remove(tempspice) - os.remove(tempgds) # instantiate a copy of the class to actually run the test if __name__ == "__main__": diff --git a/compiler/tests/03_ptx_4finger_pmos_test.py b/compiler/tests/03_ptx_4finger_pmos_test.py index d35a442f..d38d7981 100644 --- a/compiler/tests/03_ptx_4finger_pmos_test.py +++ b/compiler/tests/03_ptx_4finger_pmos_test.py @@ -2,14 +2,14 @@ "Run a regresion test on a basic parameterized transistors" import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class ptx_test(unittest.TestCase): +class ptx_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -31,17 +31,6 @@ class ptx_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, fet): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - fet.sp_write(tempspice) - fet.gds_write(tempgds) - - self.assertFalse(verify.run_drc(fet.name, tempgds)) - - os.remove(tempspice) - os.remove(tempgds) # instantiate a copy of the class to actually run the test if __name__ == "__main__": diff --git a/compiler/tests/03_wire_test.py b/compiler/tests/03_wire_test.py index 9ae02008..1ab6be98 100644 --- a/compiler/tests/03_wire_test.py +++ b/compiler/tests/03_wire_test.py @@ -2,14 +2,14 @@ "Run a regresion test on a basic wire" import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class wire_test(unittest.TestCase): +class wire_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -36,7 +36,7 @@ class wire_test(unittest.TestCase): position_list = [[x-min_space, y-min_space] for x,y in old_position_list] w = design.design("wire_test1") wire.wire(w, layer_stack, position_list) - self.local_check(w) + self.local_drc_check(w) min_space = 2 * (tech.drc["minwidth_poly"] + tech.drc["minwidth_metal1"]) @@ -53,7 +53,7 @@ class wire_test(unittest.TestCase): position_list = [[x+min_space, y+min_space] for x,y in old_position_list] w = design.design("wire_test2") wire.wire(w, layer_stack, position_list) - self.local_check(w) + self.local_drc_check(w) min_space = 2 * (tech.drc["minwidth_metal2"] + tech.drc["minwidth_metal1"]) @@ -69,7 +69,7 @@ class wire_test(unittest.TestCase): [-1 * min_space, 0]] w = design.design("wire_test3") wire.wire(w, layer_stack, position_list) - self.local_check(w) + self.local_drc_check(w) min_space = 2 * (tech.drc["minwidth_metal2"] + @@ -86,7 +86,7 @@ class wire_test(unittest.TestCase): [-1 * min_space, 0]] w = design.design("wire_test4") wire.wire(w, layer_stack, position_list) - self.local_check(w) + self.local_drc_check(w) min_space = 2 * (tech.drc["minwidth_metal2"] + tech.drc["minwidth_metal3"]) @@ -103,7 +103,7 @@ class wire_test(unittest.TestCase): position_list.reverse() w = design.design("wire_test5") wire.wire(w, layer_stack, position_list) - self.local_check(w) + self.local_drc_check(w) min_space = 2 * (tech.drc["minwidth_metal2"] + tech.drc["minwidth_metal3"]) @@ -120,18 +120,12 @@ class wire_test(unittest.TestCase): position_list.reverse() w = design.design("wire_test6") wire.wire(w, layer_stack, position_list) - self.local_check(w) + self.local_drc_check(w) # return it back to it's normal state OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, w): - tempgds = OPTS.openram_temp + "temp.gds" - w.gds_write(tempgds) - self.assertFalse(verify.run_drc(w.name, tempgds)) - os.remove(tempgds) - # instantiate a copy of the class to actually run the test if __name__ == "__main__": diff --git a/compiler/tests/04_pinv_10x_test.py b/compiler/tests/04_pinv_10x_test.py index 91f9e2a4..ba71ea11 100644 --- a/compiler/tests/04_pinv_10x_test.py +++ b/compiler/tests/04_pinv_10x_test.py @@ -4,14 +4,14 @@ Run regresion tests on a parameterized inverter """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class pinv_test(unittest.TestCase): +class pinv_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -29,25 +29,6 @@ class pinv_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, tx): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - tx.sp_write(tempspice) - tx.gds_write(tempgds) - - self.assertFalse(verify.run_drc(tx.name, tempgds)) - self.assertFalse(verify.run_lvs(tx.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # reset the static duplicate name checker for unit tests - import design - design.design.name_map=[] - - - # instantiate a copy of the class to actually run the test if __name__ == "__main__": diff --git a/compiler/tests/04_pinv_1x_beta_test.py b/compiler/tests/04_pinv_1x_beta_test.py index a9eb39d7..9a530bef 100644 --- a/compiler/tests/04_pinv_1x_beta_test.py +++ b/compiler/tests/04_pinv_1x_beta_test.py @@ -4,14 +4,14 @@ Run regresion tests on a parameterized inverter """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class pinv_test(unittest.TestCase): +class pinv_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -29,26 +29,6 @@ class pinv_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, tx): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - tx.sp_write(tempspice) - tx.gds_write(tempgds) - - self.assertFalse(verify.run_drc(tx.name, tempgds)) - self.assertFalse(verify.run_lvs(tx.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # reset the static duplicate name checker for unit tests - import design - design.design.name_map=[] - - - - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/04_pinv_1x_test.py b/compiler/tests/04_pinv_1x_test.py index 40428edf..3fcb3201 100644 --- a/compiler/tests/04_pinv_1x_test.py +++ b/compiler/tests/04_pinv_1x_test.py @@ -3,14 +3,14 @@ Run regression tests on a parameterized inverter """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class pinv_test(unittest.TestCase): +class pinv_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -29,26 +29,6 @@ class pinv_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, tx): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - tx.sp_write(tempspice) - tx.gds_write(tempgds) - - self.assertFalse(verify.run_drc(tx.name, tempgds)) - self.assertFalse(verify.run_lvs(tx.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # reset the static duplicate name checker for unit tests - import design - design.design.name_map=[] - - - - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/04_pinv_2x_test.py b/compiler/tests/04_pinv_2x_test.py index 75e1f166..f36fbe67 100644 --- a/compiler/tests/04_pinv_2x_test.py +++ b/compiler/tests/04_pinv_2x_test.py @@ -4,14 +4,14 @@ Run regresion tests on a parameterized inverter """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class pinv_test(unittest.TestCase): +class pinv_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -29,25 +29,6 @@ class pinv_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, tx): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - tx.sp_write(tempspice) - tx.gds_write(tempgds) - - self.assertFalse(verify.run_drc(tx.name, tempgds)) - self.assertFalse(verify.run_lvs(tx.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # reset the static duplicate name checker for unit tests - import design - design.design.name_map=[] - - - # instantiate a copy of the class to actually run the test if __name__ == "__main__": diff --git a/compiler/tests/04_pnand2_test.py b/compiler/tests/04_pnand2_test.py index 3c182743..cc5a19a4 100644 --- a/compiler/tests/04_pnand2_test.py +++ b/compiler/tests/04_pnand2_test.py @@ -6,14 +6,14 @@ size 2-input nand gate. """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class pnand2_test(unittest.TestCase): +class pnand2_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -32,20 +32,6 @@ class pnand2_test(unittest.TestCase): globals.end_openram() - def local_check(self, tx): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - tx.sp_write(tempspice) - tx.gds_write(tempgds) - - self.assertFalse(verify.run_drc(tx.name, tempgds)) - self.assertFalse(verify.run_lvs(tx.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/04_pnand3_test.py b/compiler/tests/04_pnand3_test.py index 1ae19f85..60a3b642 100644 --- a/compiler/tests/04_pnand3_test.py +++ b/compiler/tests/04_pnand3_test.py @@ -6,14 +6,14 @@ It generates only a minimum size 3-input nand gate. """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class pnand3_test(unittest.TestCase): +class pnand3_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -31,19 +31,6 @@ class pnand3_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, tx): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - tx.sp_write(tempspice) - tx.gds_write(tempgds) - - self.assertFalse(verify.run_drc(tx.name, tempgds)) - self.assertFalse(verify.run_lvs(tx.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - # instantiate a copy of the class to actually run the test if __name__ == "__main__": diff --git a/compiler/tests/04_pnor2_test.py b/compiler/tests/04_pnor2_test.py index e96c5ee9..f9184e73 100644 --- a/compiler/tests/04_pnor2_test.py +++ b/compiler/tests/04_pnor2_test.py @@ -6,14 +6,14 @@ size 2-input nor gate. """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class pnor2_test(unittest.TestCase): +class pnor2_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -31,21 +31,6 @@ class pnor2_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - - def local_check(self, tx): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - tx.sp_write(tempspice) - tx.gds_write(tempgds) - - self.assertFalse(verify.run_drc(tx.name, tempgds)) - self.assertFalse(verify.run_lvs(tx.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/04_precharge_test.py b/compiler/tests/04_precharge_test.py index 65ac6a2a..eaf6db79 100644 --- a/compiler/tests/04_precharge_test.py +++ b/compiler/tests/04_precharge_test.py @@ -4,14 +4,14 @@ Run a regresion test on a precharge cell """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class precharge_test(unittest.TestCase): +class precharge_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -29,20 +29,6 @@ class precharge_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, tx): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - tx.sp_write(tempspice) - tx.gds_write(tempgds) - - self.assertFalse(verify.run_drc(tx.name, tempgds)) - self.assertFalse(verify.run_lvs(tx.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/04_wordline_driver_test.py b/compiler/tests/04_wordline_driver_test.py index a9459ef5..bb8efe85 100644 --- a/compiler/tests/04_wordline_driver_test.py +++ b/compiler/tests/04_wordline_driver_test.py @@ -4,7 +4,7 @@ Run a regresion test on a wordline_driver array """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals @@ -13,7 +13,7 @@ import debug #@unittest.skip("SKIPPING 04_driver_test") -class wordline_driver_test(unittest.TestCase): +class wordline_driver_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -31,20 +31,6 @@ class wordline_driver_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, tx): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - tx.sp_write(tempspice) - tx.gds_write(tempgds) - - self.assertFalse(verify.run_drc(tx.name, tempgds)) - self.assertFalse(verify.run_lvs(tx.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/05_bitcell_array_test.py b/compiler/tests/05_bitcell_array_test.py index 2c6a67c1..73f13662 100644 --- a/compiler/tests/05_bitcell_array_test.py +++ b/compiler/tests/05_bitcell_array_test.py @@ -4,7 +4,7 @@ Run a regresion test on a basic array """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals @@ -13,7 +13,7 @@ import debug #@unittest.skip("SKIPPING 05_array_test") -class array_test(unittest.TestCase): +class array_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -30,21 +30,6 @@ class array_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - temppdf = OPTS.openram_temp + "temp.pdf" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/06_hierarchical_decoder_test.py b/compiler/tests/06_hierarchical_decoder_test.py index 498de3bb..79ce20d9 100644 --- a/compiler/tests/06_hierarchical_decoder_test.py +++ b/compiler/tests/06_hierarchical_decoder_test.py @@ -4,14 +4,14 @@ Run a regresion test on a hierarchical_decoder. """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class hierarchical_decoder_test(unittest.TestCase): +class hierarchical_decoder_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -47,24 +47,6 @@ class hierarchical_decoder_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # reset the static duplicate name checker for unit tests - import design - design.design.name_map=[] - - # instantiate a copdsay of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/06_hierarchical_predecode2x4_test.py b/compiler/tests/06_hierarchical_predecode2x4_test.py index f9401bac..a510b121 100644 --- a/compiler/tests/06_hierarchical_predecode2x4_test.py +++ b/compiler/tests/06_hierarchical_predecode2x4_test.py @@ -4,14 +4,14 @@ Run a regresion test on a hierarchical_predecode2x4. """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class hierarchical_predecode2x4_test(unittest.TestCase): +class hierarchical_predecode2x4_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -29,19 +29,6 @@ class hierarchical_predecode2x4_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - # instantiate a copdsay of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/06_hierarchical_predecode3x8_test.py b/compiler/tests/06_hierarchical_predecode3x8_test.py index b2d7ddd1..2b20082d 100644 --- a/compiler/tests/06_hierarchical_predecode3x8_test.py +++ b/compiler/tests/06_hierarchical_predecode3x8_test.py @@ -4,14 +4,14 @@ Run a regresion test on a hierarchical_predecode3x8. """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class hierarchical_predecode3x8_test(unittest.TestCase): +class hierarchical_predecode3x8_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -29,19 +29,6 @@ class hierarchical_predecode3x8_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - # instantiate a copdsay of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/07_single_level_column_mux_array_test.py b/compiler/tests/07_single_level_column_mux_array_test.py index cb5cd302..cc5d6c0c 100644 --- a/compiler/tests/07_single_level_column_mux_array_test.py +++ b/compiler/tests/07_single_level_column_mux_array_test.py @@ -3,15 +3,14 @@ Run a regresion test on a single transistor column_mux. """ -import unittest -from testutils import header +from testutils import header,openram_test,unittest import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class single_level_column_mux_test(unittest.TestCase): +class single_level_column_mux_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -36,22 +35,6 @@ class single_level_column_mux_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # reset the static duplicate name checker for unit tests - import design - design.design.name_map=[] # instantiate a copdsay of the class to actually run the test if __name__ == "__main__": diff --git a/compiler/tests/08_precharge_array_test.py b/compiler/tests/08_precharge_array_test.py index 5f169858..3b60c0f5 100644 --- a/compiler/tests/08_precharge_array_test.py +++ b/compiler/tests/08_precharge_array_test.py @@ -4,14 +4,14 @@ Run a regresion test on a precharge array """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class precharge_test(unittest.TestCase): +class precharge_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -29,19 +29,6 @@ class precharge_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, pc): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - pc.sp_write(tempspice) - pc.gds_write(tempgds) - - self.assertFalse(verify.run_drc(pc.name, tempgds)) - self.assertFalse(verify.run_lvs(pc.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - # instantiate a copy of the class to actually run the test if __name__ == "__main__": diff --git a/compiler/tests/09_sense_amp_array_test.py b/compiler/tests/09_sense_amp_array_test.py index 57af1052..814af37f 100644 --- a/compiler/tests/09_sense_amp_array_test.py +++ b/compiler/tests/09_sense_amp_array_test.py @@ -4,14 +4,14 @@ Run a regresion test on a sense amp array """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class sense_amp_test(unittest.TestCase): +class sense_amp_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -33,24 +33,6 @@ class sense_amp_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # reset the static duplicate name checker for unit tests - import design - design.design.name_map=[] - - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/10_write_driver_array_test.py b/compiler/tests/10_write_driver_array_test.py index d8591eed..ef4d8d9d 100644 --- a/compiler/tests/10_write_driver_array_test.py +++ b/compiler/tests/10_write_driver_array_test.py @@ -4,14 +4,14 @@ Run a regresion test on a write driver array """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class write_driver_test(unittest.TestCase): +class write_driver_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -32,24 +32,6 @@ class write_driver_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # reset the static duplicate name checker for unit tests - import design - design.design.name_map=[] - - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/11_ms_flop_array_test.py b/compiler/tests/11_ms_flop_array_test.py index dcdc48c5..c0bb2556 100644 --- a/compiler/tests/11_ms_flop_array_test.py +++ b/compiler/tests/11_ms_flop_array_test.py @@ -4,14 +4,14 @@ Run a regresion test on a dff_array. """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class dff_array_test(unittest.TestCase): +class dff_array_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -32,25 +32,6 @@ class dff_array_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # reset the static duplicate name checker for unit tests - import design - design.design.name_map=[] - - - # instantiate a copdsay of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/12_tri_gate_array_test.py b/compiler/tests/12_tri_gate_array_test.py index 3ca7f475..3ae37b0d 100644 --- a/compiler/tests/12_tri_gate_array_test.py +++ b/compiler/tests/12_tri_gate_array_test.py @@ -4,14 +4,14 @@ Run a regresion test on a tri_gate_array. """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class tri_gate_array_test(unittest.TestCase): +class tri_gate_array_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -32,24 +32,6 @@ class tri_gate_array_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # reset the static duplicate name checker for unit tests - import design - design.design.name_map=[] - - # instantiate a copdsay of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/13_delay_chain_test.py b/compiler/tests/13_delay_chain_test.py index faf6529c..57ace373 100644 --- a/compiler/tests/13_delay_chain_test.py +++ b/compiler/tests/13_delay_chain_test.py @@ -4,14 +4,14 @@ Run a test on a delay chain """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class delay_chain_test(unittest.TestCase): +class delay_chain_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -28,19 +28,6 @@ class delay_chain_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/14_replica_bitline_test.py b/compiler/tests/14_replica_bitline_test.py index 6ed487b8..d54878d7 100644 --- a/compiler/tests/14_replica_bitline_test.py +++ b/compiler/tests/14_replica_bitline_test.py @@ -4,14 +4,14 @@ Run a test on a delay chain """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class replica_bitline_test(unittest.TestCase): +class replica_bitline_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -28,19 +28,6 @@ class replica_bitline_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/16_control_logic_test.py b/compiler/tests/16_control_logic_test.py index 5f501b2b..d826d989 100644 --- a/compiler/tests/16_control_logic_test.py +++ b/compiler/tests/16_control_logic_test.py @@ -4,14 +4,14 @@ Run a regresion test on a control_logic """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class control_logic_test(unittest.TestCase): +class control_logic_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -29,20 +29,6 @@ class control_logic_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # instantiate a copdsay of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/19_multi_bank_test.py b/compiler/tests/19_multi_bank_test.py index a829b319..ef4c38cd 100644 --- a/compiler/tests/19_multi_bank_test.py +++ b/compiler/tests/19_multi_bank_test.py @@ -4,14 +4,14 @@ Run a regresion test on various srams """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class multi_bank_test(unittest.TestCase): +class multi_bank_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -41,23 +41,6 @@ class multi_bank_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # reset the static duplicate name checker for unit tests - import design - design.design.name_map=[] - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/19_single_bank_test.py b/compiler/tests/19_single_bank_test.py index b90c0b2a..5eb9af3f 100644 --- a/compiler/tests/19_single_bank_test.py +++ b/compiler/tests/19_single_bank_test.py @@ -4,14 +4,14 @@ Run a regresion test on various srams """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class single_bank_test(unittest.TestCase): +class single_bank_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -41,23 +41,6 @@ class single_bank_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - - os.remove(tempspice) - os.remove(tempgds) - - # reset the static duplicate name checker for unit tests - import design - design.design.name_map=[] - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/20_sram_1bank_test.py b/compiler/tests/20_sram_1bank_test.py index f36046b8..da54691e 100644 --- a/compiler/tests/20_sram_1bank_test.py +++ b/compiler/tests/20_sram_1bank_test.py @@ -4,14 +4,14 @@ Run a regresion test on a 1 bank SRAM """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class sram_1bank_test(unittest.TestCase): +class sram_1bank_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -40,20 +40,6 @@ class sram_1bank_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - #self.assertFalse(verify.run_pex(a.name, tempgds, tempspice, output=OPTS.openram_temp+"temp_pex.sp")) - - os.remove(tempspice) - os.remove(tempgds) - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/20_sram_2bank_test.py b/compiler/tests/20_sram_2bank_test.py index c35761ec..9c5c7376 100644 --- a/compiler/tests/20_sram_2bank_test.py +++ b/compiler/tests/20_sram_2bank_test.py @@ -4,14 +4,14 @@ Run a regresion test on a 2 bank SRAM """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class sram_2bank_test(unittest.TestCase): +class sram_2bank_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -40,20 +40,6 @@ class sram_2bank_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - #self.assertFalse(verify.run_pex(a.name, tempgds, tempspice, output=OPTS.openram_temp+"temp_pex.sp")) - - os.remove(tempspice) - os.remove(tempgds) - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/20_sram_4bank_test.py b/compiler/tests/20_sram_4bank_test.py index 842c152f..192fd377 100644 --- a/compiler/tests/20_sram_4bank_test.py +++ b/compiler/tests/20_sram_4bank_test.py @@ -4,14 +4,14 @@ Run a regresion test on a 4 bank SRAM """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class sram_4bank_test(unittest.TestCase): +class sram_4bank_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) @@ -40,20 +40,6 @@ class sram_4bank_test(unittest.TestCase): OPTS.check_lvsdrc = True globals.end_openram() - def local_check(self, a): - tempspice = OPTS.openram_temp + "temp.sp" - tempgds = OPTS.openram_temp + "temp.gds" - - a.sp_write(tempspice) - a.gds_write(tempgds) - - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) - #self.assertFalse(verify.run_pex(a.name, tempgds, tempspice, output=OPTS.openram_temp+"temp_pex.sp")) - - os.remove(tempspice) - os.remove(tempgds) - # instantiate a copy of the class to actually run the test if __name__ == "__main__": (OPTS, args) = globals.parse_args() diff --git a/compiler/tests/21_hspice_delay_test.py b/compiler/tests/21_hspice_delay_test.py index 8c52afdb..b2568fd3 100644 --- a/compiler/tests/21_hspice_delay_test.py +++ b/compiler/tests/21_hspice_delay_test.py @@ -4,14 +4,14 @@ Run a regresion test on various srams """ import unittest -from testutils import header,isclose +from testutils import header,openram_test,isclose import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class timing_sram_test(unittest.TestCase): +class timing_sram_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/21_hspice_setuphold_test.py b/compiler/tests/21_hspice_setuphold_test.py index b246f5c5..ab0964fb 100644 --- a/compiler/tests/21_hspice_setuphold_test.py +++ b/compiler/tests/21_hspice_setuphold_test.py @@ -4,14 +4,14 @@ Run a regresion test on various srams """ import unittest -from testutils import header,isclose +from testutils import header,openram_test,isclose import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class timing_setup_test(unittest.TestCase): +class timing_setup_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/21_ngspice_delay_test.py b/compiler/tests/21_ngspice_delay_test.py index b313d0ec..fb1c2134 100644 --- a/compiler/tests/21_ngspice_delay_test.py +++ b/compiler/tests/21_ngspice_delay_test.py @@ -4,14 +4,14 @@ Run a regresion test on various srams """ import unittest -from testutils import header,isclose +from testutils import header,openram_test,isclose import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class timing_sram_test(unittest.TestCase): +class timing_sram_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/21_ngspice_setuphold_test.py b/compiler/tests/21_ngspice_setuphold_test.py index 6b1c4d8c..9cd9001c 100644 --- a/compiler/tests/21_ngspice_setuphold_test.py +++ b/compiler/tests/21_ngspice_setuphold_test.py @@ -4,14 +4,14 @@ Run a regresion test on various srams """ import unittest -from testutils import header,isclose +from testutils import header,openram_test,isclose import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class timing_setup_test(unittest.TestCase): +class timing_setup_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/22_pex_func_test_with_pinv.py b/compiler/tests/22_pex_func_test_with_pinv.py index 706d19d6..3a550ed9 100644 --- a/compiler/tests/22_pex_func_test_with_pinv.py +++ b/compiler/tests/22_pex_func_test_with_pinv.py @@ -4,7 +4,7 @@ Run a regression test on an extracted SRAM to ensure functionality. """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals @@ -12,7 +12,7 @@ from globals import OPTS import debug @unittest.skip("SKIPPING 22_sram_func_test") -class sram_func_test(unittest.TestCase): +class sram_func_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/22_sram_func_test.py b/compiler/tests/22_sram_func_test.py index 524904ef..4e42a775 100644 --- a/compiler/tests/22_sram_func_test.py +++ b/compiler/tests/22_sram_func_test.py @@ -4,14 +4,14 @@ Run a regresion test on various srams """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class sram_func_test(unittest.TestCase): +class sram_func_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/23_lib_sram_model_test.py b/compiler/tests/23_lib_sram_model_test.py index f1d1e8c8..0b318831 100644 --- a/compiler/tests/23_lib_sram_model_test.py +++ b/compiler/tests/23_lib_sram_model_test.py @@ -4,14 +4,14 @@ Check the .lib file for an SRAM """ import unittest -from testutils import header,isapproxdiff +from testutils import header,openram_test,isapproxdiff import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class lib_test(unittest.TestCase): +class lib_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/23_lib_sram_prune_test.py b/compiler/tests/23_lib_sram_prune_test.py index 7a1b32ee..0c5a5324 100644 --- a/compiler/tests/23_lib_sram_prune_test.py +++ b/compiler/tests/23_lib_sram_prune_test.py @@ -4,14 +4,14 @@ Check the .lib file for an SRAM with pruning """ import unittest -from testutils import header,isapproxdiff +from testutils import header,openram_test,isapproxdiff import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class lib_test(unittest.TestCase): +class lib_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/23_lib_sram_test.py b/compiler/tests/23_lib_sram_test.py index 7244760e..37fa7d67 100644 --- a/compiler/tests/23_lib_sram_test.py +++ b/compiler/tests/23_lib_sram_test.py @@ -4,14 +4,14 @@ Check the .lib file for an SRAM """ import unittest -from testutils import header,isapproxdiff +from testutils import header,openram_test,isapproxdiff import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class lib_test(unittest.TestCase): +class lib_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/24_lef_sram_test.py b/compiler/tests/24_lef_sram_test.py index e142c1f0..b85e7a83 100644 --- a/compiler/tests/24_lef_sram_test.py +++ b/compiler/tests/24_lef_sram_test.py @@ -4,14 +4,14 @@ Check the LEF file for an SRMA """ import unittest -from testutils import header,isdiff +from testutils import header,openram_test,isdiff import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class lef_test(unittest.TestCase): +class lef_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/25_verilog_sram_test.py b/compiler/tests/25_verilog_sram_test.py index 9d74d612..319ffe2a 100644 --- a/compiler/tests/25_verilog_sram_test.py +++ b/compiler/tests/25_verilog_sram_test.py @@ -4,14 +4,14 @@ Check the .v file for an SRAM """ import unittest -from testutils import header,isdiff +from testutils import header,openram_test,isdiff import sys,os sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class verilog_test(unittest.TestCase): +class verilog_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/30_openram_test.py b/compiler/tests/30_openram_test.py index f0ad17f4..30392fa5 100644 --- a/compiler/tests/30_openram_test.py +++ b/compiler/tests/30_openram_test.py @@ -6,14 +6,14 @@ check that these files are right. """ import unittest -from testutils import header +from testutils import header,openram_test import sys,os,re,shutil sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS import debug -class openram_test(unittest.TestCase): +class openram_test(openram_test): def runTest(self): globals.init_openram("config_20_{0}".format(OPTS.tech_name)) diff --git a/compiler/tests/regress.py b/compiler/tests/regress.py index 5b958faf..c7b253af 100644 --- a/compiler/tests/regress.py +++ b/compiler/tests/regress.py @@ -9,7 +9,7 @@ import globals (OPTS, args) = globals.parse_args() del sys.argv[1:] -from testutils import header +from testutils import header,openram_test header(__file__, OPTS.tech_name) # get a list of all files in the tests directory diff --git a/compiler/tests/testutils.py b/compiler/tests/testutils.py index 63b98f95..c1b0fe1a 100644 --- a/compiler/tests/testutils.py +++ b/compiler/tests/testutils.py @@ -1,3 +1,41 @@ +import unittest +import sys,os,glob +sys.path.append(os.path.join(sys.path[0],"..")) +import globals +from globals import OPTS + +class openram_test(unittest.TestCase): + """ Base unit test that we have some shared classes in. """ + + def local_drc_check(self, w): + tempgds = OPTS.openram_temp + "temp.gds" + w.gds_write(tempgds) + import verify + self.assertFalse(verify.run_drc(w.name, tempgds)) + + files = glob.glob(OPTS.openram_temp + '*') + for f in files: + os.remove(f) + + def local_check(self, a): + + tempspice = OPTS.openram_temp + "temp.sp" + tempgds = OPTS.openram_temp + "temp.gds" + + a.sp_write(tempspice) + a.gds_write(tempgds) + + import verify + self.assertFalse(verify.run_drc(a.name, tempgds)) + self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) + + files = glob.glob(OPTS.openram_temp + '*') + for f in files: + os.remove(f) + + # reset the static duplicate name checker for unit tests + import design + design.design.name_map=[] def isclose(value1,value2,error_tolerance=1e-2): """ This is used to compare relative values. """