From 384e169b5b5ae63540957edace24e517a7ebc0da Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Wed, 31 May 2017 14:59:22 -0700 Subject: [PATCH] Modified unit tests: one for analytical model, one for characterization. --- compiler/tests/23_lib_sram_model_test.py | 24 ++++++++---------------- compiler/tests/23_lib_sram_test.py | 5 +---- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/compiler/tests/23_lib_sram_model_test.py b/compiler/tests/23_lib_sram_model_test.py index ad4f3896..7b699481 100644 --- a/compiler/tests/23_lib_sram_model_test.py +++ b/compiler/tests/23_lib_sram_model_test.py @@ -25,32 +25,24 @@ class lib_test(unittest.TestCase): import lib debug.info(1, "Testing timing for sample 2 bit, 16 words SRAM with 1 bank") - total_size = 1024 - for word_size in [1,2,4,8,16,32,64]: - num_words = total_size/word_size# OPTS.config.num_words - s = sram.sram(word_size=word_size, - num_words=num_words, - num_banks=OPTS.config.num_banks, - name="sram_2_16_1_{0}".format(OPTS.tech_name)) - delay = s.analytical_model(0.1) - - + s = sram.sram(word_size=2, + num_words=OPTS.config.num_words, + num_banks=OPTS.config.num_banks, + 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 + ".lib" + filename = s.name + "_analytical.lib" libname = OPTS.openram_temp + filename - use_model = True - lib.lib(libname,s,tempspice,use_model) + lib.lib(libname,s,tempspice,use_model=True) # let's diff the result with a golden model golden = "{0}/golden/{1}".format(os.path.dirname(os.path.realpath(__file__)),filename) - # Randomly decided 10% difference between spice simulators is ok. - if use_model != True: - self.assertEqual(isapproxdiff(libname,golden,0.10),True) + # Randomly decided 1% difference between spice simulators is ok. + self.assertEqual(isapproxdiff(libname,golden,0.01),True) os.system("rm {0}".format(libname)) diff --git a/compiler/tests/23_lib_sram_test.py b/compiler/tests/23_lib_sram_test.py index 3c78e2ec..f178f148 100644 --- a/compiler/tests/23_lib_sram_test.py +++ b/compiler/tests/23_lib_sram_test.py @@ -34,10 +34,7 @@ class lib_test(unittest.TestCase): tempspice = OPTS.openram_temp + "temp.sp" s.sp_write(tempspice) - if OPTS.analytical_delay == True: - filename = s.name + "_analytical.lib" - else: - filename = s.name + ".lib" + filename = s.name + ".lib" libname = OPTS.openram_temp + filename lib.lib(libname,s,tempspice)