From f690532563daaed178afbf4ce3523c2c98162393 Mon Sep 17 00:00:00 2001 From: mguthaus Date: Sun, 11 Feb 2018 16:35:10 -0800 Subject: [PATCH] Add new corner-based lib files to unit tests. --- compiler/tests/23_lib_sram_model_test.py | 4 +-- compiler/tests/23_lib_sram_prune_test.py | 26 ++++++++++++------- compiler/tests/23_lib_sram_test.py | 4 +-- ...b => sram_2_16_1_freepdk45_TT_10V_25C.lib} | 4 +-- ..._16_1_freepdk45_TT_10V_25C_analytical.lib} | 4 +-- ...am_2_16_1_freepdk45_TT_10V_25C_pruned.lib} | 4 +-- ...=> sram_2_16_1_scn3me_subm_TT_50V_25C.lib} | 4 +-- ...6_1_scn3me_subm_TT_50V_25C_analytical.lib} | 4 +-- ..._2_16_1_scn3me_subm_TT_50V_25C_pruned.lib} | 4 +-- 9 files changed, 32 insertions(+), 26 deletions(-) rename compiler/tests/golden/{sram_2_16_1_freepdk45.lib => sram_2_16_1_freepdk45_TT_10V_25C.lib} (99%) rename compiler/tests/golden/{sram_2_16_1_freepdk45_analytical.lib => sram_2_16_1_freepdk45_TT_10V_25C_analytical.lib} (99%) rename compiler/tests/golden/{sram_2_16_1_freepdk45_pruned.lib => sram_2_16_1_freepdk45_TT_10V_25C_pruned.lib} (99%) rename compiler/tests/golden/{sram_2_16_1_scn3me_subm.lib => sram_2_16_1_scn3me_subm_TT_50V_25C.lib} (99%) rename compiler/tests/golden/{sram_2_16_1_scn3me_subm_analytical.lib => sram_2_16_1_scn3me_subm_TT_50V_25C_analytical.lib} (99%) rename compiler/tests/golden/{sram_2_16_1_scn3me_subm_pruned.lib => sram_2_16_1_scn3me_subm_TT_50V_25C_pruned.lib} (99%) diff --git a/compiler/tests/23_lib_sram_model_test.py b/compiler/tests/23_lib_sram_model_test.py index 9e4734e2..7c0f18a0 100644 --- a/compiler/tests/23_lib_sram_model_test.py +++ b/compiler/tests/23_lib_sram_model_test.py @@ -22,8 +22,8 @@ class lib_test(openram_test): debug.info(1, "Testing timing for sample 2 bit, 16 words SRAM with 1 bank") s = sram.sram(word_size=2, - num_words=OPTS.num_words, - num_banks=OPTS.num_banks, + num_words=16, + num_banks=1, name="sram_2_16_1_{0}".format(OPTS.tech_name)) OPTS.check_lvsdrc = True diff --git a/compiler/tests/23_lib_sram_prune_test.py b/compiler/tests/23_lib_sram_prune_test.py index 668a56e1..c8b7218f 100644 --- a/compiler/tests/23_lib_sram_prune_test.py +++ b/compiler/tests/23_lib_sram_prune_test.py @@ -5,7 +5,7 @@ Check the .lib file for an SRAM with pruning import unittest from testutils import header,openram_test -import sys,os +import sys,os,re sys.path.append(os.path.join(sys.path[0],"..")) import globals from globals import OPTS @@ -31,21 +31,27 @@ class lib_test(openram_test): debug.info(1, "Testing timing for sample 2 bit, 16 words SRAM with 1 bank") s = sram.sram(word_size=2, - num_words=OPTS.num_words, - num_banks=OPTS.num_banks, + num_words=16, + num_banks=1, name="sram_2_16_1_{0}".format(OPTS.tech_name)) OPTS.check_lvsdrc = True tempspice = OPTS.openram_temp + "temp.sp" s.sp_write(tempspice) - filename = s.name + "_pruned.lib" - libname = OPTS.openram_temp + filename - lib.lib(libname=libname,sram=s,sp_file=tempspice,use_model=False) - - # let's diff the result with a golden model - golden = "{0}/golden/{1}".format(os.path.dirname(os.path.realpath(__file__)),filename) - self.isapproxdiff(libname,golden,0.30) + lib.lib(out_dir=OPTS.openram_temp, sram=s, sp_file=tempspice, use_model=False) + + # get all of the .lib files generated + files = os.listdir(OPTS.openram_temp) + nametest = re.compile("\.lib$", re.IGNORECASE) + lib_files = filter(nametest.search, files) + + # and compare them with the golden model + for filename in lib_files: + newname = filename.replace(".lib","_pruned.lib") + libname = "{0}/{1}".format(OPTS.openram_temp,filename) + golden = "{0}/golden/{1}".format(os.path.dirname(os.path.realpath(__file__)),newname) + self.isapproxdiff(libname,golden,0.15) OPTS.analytical_delay = True reload(characterizer) diff --git a/compiler/tests/23_lib_sram_test.py b/compiler/tests/23_lib_sram_test.py index d58c50dd..74568940 100644 --- a/compiler/tests/23_lib_sram_test.py +++ b/compiler/tests/23_lib_sram_test.py @@ -31,8 +31,8 @@ class lib_test(openram_test): debug.info(1, "Testing timing for sample 2 bit, 16 words SRAM with 1 bank") s = sram.sram(word_size=2, - num_words=OPTS.num_words, - num_banks=OPTS.num_banks, + num_words=16, + num_banks=1, name="sram_2_16_1_{0}".format(OPTS.tech_name)) OPTS.check_lvsdrc = True diff --git a/compiler/tests/golden/sram_2_16_1_freepdk45.lib b/compiler/tests/golden/sram_2_16_1_freepdk45_TT_10V_25C.lib similarity index 99% rename from compiler/tests/golden/sram_2_16_1_freepdk45.lib rename to compiler/tests/golden/sram_2_16_1_freepdk45_TT_10V_25C.lib index 5bae0bc7..435a4f75 100644 --- a/compiler/tests/golden/sram_2_16_1_freepdk45.lib +++ b/compiler/tests/golden/sram_2_16_1_freepdk45_TT_10V_25C.lib @@ -1,4 +1,4 @@ -library (sram_2_16_1_freepdk45_lib){ +library (sram_2_16_1_freepdk45_TT_10V_25C_lib){ delay_model : "table_lookup"; time_unit : "1ns" ; voltage_unit : "1v" ; @@ -9,7 +9,7 @@ library (sram_2_16_1_freepdk45_lib){ pulling_resistance_unit :"1kohm" ; operating_conditions(TT){ voltage : 1.0 ; - temperature : 25.000 ; + temperature : 25; } input_threshold_pct_fall : 50.0 ; diff --git a/compiler/tests/golden/sram_2_16_1_freepdk45_analytical.lib b/compiler/tests/golden/sram_2_16_1_freepdk45_TT_10V_25C_analytical.lib similarity index 99% rename from compiler/tests/golden/sram_2_16_1_freepdk45_analytical.lib rename to compiler/tests/golden/sram_2_16_1_freepdk45_TT_10V_25C_analytical.lib index aabc209b..63e510fd 100644 --- a/compiler/tests/golden/sram_2_16_1_freepdk45_analytical.lib +++ b/compiler/tests/golden/sram_2_16_1_freepdk45_TT_10V_25C_analytical.lib @@ -1,4 +1,4 @@ -library (sram_2_16_1_freepdk45_lib){ +library (sram_2_16_1_freepdk45_TT_10V_25C_lib){ delay_model : "table_lookup"; time_unit : "1ns" ; voltage_unit : "1v" ; @@ -9,7 +9,7 @@ library (sram_2_16_1_freepdk45_lib){ pulling_resistance_unit :"1kohm" ; operating_conditions(TT){ voltage : 1.0 ; - temperature : 25.000 ; + temperature : 25; } input_threshold_pct_fall : 50.0 ; diff --git a/compiler/tests/golden/sram_2_16_1_freepdk45_pruned.lib b/compiler/tests/golden/sram_2_16_1_freepdk45_TT_10V_25C_pruned.lib similarity index 99% rename from compiler/tests/golden/sram_2_16_1_freepdk45_pruned.lib rename to compiler/tests/golden/sram_2_16_1_freepdk45_TT_10V_25C_pruned.lib index e0360805..06b9f36d 100644 --- a/compiler/tests/golden/sram_2_16_1_freepdk45_pruned.lib +++ b/compiler/tests/golden/sram_2_16_1_freepdk45_TT_10V_25C_pruned.lib @@ -1,4 +1,4 @@ -library (sram_2_16_1_freepdk45_lib){ +library (sram_2_16_1_freepdk45_TT_10V_25C_lib){ delay_model : "table_lookup"; time_unit : "1ns" ; voltage_unit : "1v" ; @@ -9,7 +9,7 @@ library (sram_2_16_1_freepdk45_lib){ pulling_resistance_unit :"1kohm" ; operating_conditions(TT){ voltage : 1.0 ; - temperature : 25.000 ; + temperature : 25; } input_threshold_pct_fall : 50.0 ; diff --git a/compiler/tests/golden/sram_2_16_1_scn3me_subm.lib b/compiler/tests/golden/sram_2_16_1_scn3me_subm_TT_50V_25C.lib similarity index 99% rename from compiler/tests/golden/sram_2_16_1_scn3me_subm.lib rename to compiler/tests/golden/sram_2_16_1_scn3me_subm_TT_50V_25C.lib index 40941598..d08de617 100644 --- a/compiler/tests/golden/sram_2_16_1_scn3me_subm.lib +++ b/compiler/tests/golden/sram_2_16_1_scn3me_subm_TT_50V_25C.lib @@ -1,4 +1,4 @@ -library (sram_2_16_1_scn3me_subm_lib){ +library (sram_2_16_1_scn3me_subm_TT_50V_25C_lib){ delay_model : "table_lookup"; time_unit : "1ns" ; voltage_unit : "1v" ; @@ -9,7 +9,7 @@ library (sram_2_16_1_scn3me_subm_lib){ pulling_resistance_unit :"1kohm" ; operating_conditions(TT){ voltage : 5.0 ; - temperature : 25.000 ; + temperature : 25; } input_threshold_pct_fall : 50.0 ; diff --git a/compiler/tests/golden/sram_2_16_1_scn3me_subm_analytical.lib b/compiler/tests/golden/sram_2_16_1_scn3me_subm_TT_50V_25C_analytical.lib similarity index 99% rename from compiler/tests/golden/sram_2_16_1_scn3me_subm_analytical.lib rename to compiler/tests/golden/sram_2_16_1_scn3me_subm_TT_50V_25C_analytical.lib index 59607107..52ecdb72 100644 --- a/compiler/tests/golden/sram_2_16_1_scn3me_subm_analytical.lib +++ b/compiler/tests/golden/sram_2_16_1_scn3me_subm_TT_50V_25C_analytical.lib @@ -1,4 +1,4 @@ -library (sram_2_16_1_scn3me_subm_lib){ +library (sram_2_16_1_scn3me_subm_TT_50V_25C_lib){ delay_model : "table_lookup"; time_unit : "1ns" ; voltage_unit : "1v" ; @@ -9,7 +9,7 @@ library (sram_2_16_1_scn3me_subm_lib){ pulling_resistance_unit :"1kohm" ; operating_conditions(TT){ voltage : 5.0 ; - temperature : 25.000 ; + temperature : 25; } input_threshold_pct_fall : 50.0 ; diff --git a/compiler/tests/golden/sram_2_16_1_scn3me_subm_pruned.lib b/compiler/tests/golden/sram_2_16_1_scn3me_subm_TT_50V_25C_pruned.lib similarity index 99% rename from compiler/tests/golden/sram_2_16_1_scn3me_subm_pruned.lib rename to compiler/tests/golden/sram_2_16_1_scn3me_subm_TT_50V_25C_pruned.lib index 201f0467..b2c93949 100644 --- a/compiler/tests/golden/sram_2_16_1_scn3me_subm_pruned.lib +++ b/compiler/tests/golden/sram_2_16_1_scn3me_subm_TT_50V_25C_pruned.lib @@ -1,4 +1,4 @@ -library (sram_2_16_1_scn3me_subm_lib){ +library (sram_2_16_1_scn3me_subm_TT_50V_25C_lib){ delay_model : "table_lookup"; time_unit : "1ns" ; voltage_unit : "1v" ; @@ -9,7 +9,7 @@ library (sram_2_16_1_scn3me_subm_lib){ pulling_resistance_unit :"1kohm" ; operating_conditions(TT){ voltage : 5.0 ; - temperature : 25.000 ; + temperature : 25; } input_threshold_pct_fall : 50.0 ;