From 468a759d1e99ad270e75b77164ea6dfb4206fbeb Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Sat, 27 Jul 2019 11:09:08 -0700 Subject: [PATCH] Fixed control problems (probably) Extended functional tests for 15 cycles (slow, but more checking) Fixed s_en to be gated AFTER the RBL. --- compiler/characterizer/functional.py | 7 +++-- compiler/modules/control_logic.py | 26 ++++++------------- .../tests/22_psram_1bank_2mux_func_test.py | 19 +++++++------- .../tests/22_psram_1bank_4mux_func_test.py | 19 +++++++------- .../tests/22_psram_1bank_8mux_func_test.py | 19 +++++++------- .../tests/22_psram_1bank_nomux_func_test.py | 19 +++++++------- compiler/tests/22_psram_wmask_func_test.py | 6 ++--- .../tests/22_sram_1bank_2mux_func_test.py | 15 +++++------ .../tests/22_sram_1bank_4mux_func_test.py | 15 +++++------ .../tests/22_sram_1bank_8mux_func_test.py | 15 +++++------ .../tests/22_sram_1bank_nomux_func_test.py | 15 +++++------ .../22_sram_1rw_1r_1bank_nomux_func_test.py | 4 +-- compiler/tests/22_sram_wmask_func_test.py | 4 +-- 13 files changed, 79 insertions(+), 104 deletions(-) diff --git a/compiler/characterizer/functional.py b/compiler/characterizer/functional.py index 3b3f7efd..0b3e7b4b 100644 --- a/compiler/characterizer/functional.py +++ b/compiler/characterizer/functional.py @@ -51,11 +51,12 @@ class functional(simulation): self.initialize_wmask() # Number of checks can be changed - self.num_cycles = 2 + self.num_cycles = 15 self.stored_words = {} self.write_check = [] self.read_check = [] + def initialize_wmask(self): self.wmask = "" if self.write_size is not None: @@ -294,9 +295,7 @@ class functional(simulation): self.stim = stimuli(self.sf,self.corner) #Write include statements - self.sram_sp_file = "{}sram.sp".format(OPTS.openram_temp) - shutil.copy(self.sp_file, self.sram_sp_file) - self.stim.write_include(self.sram_sp_file) + self.stim.write_include(self.sp_file) #Write Vdd/Gnd statements self.sf.write("\n* Global Power Supplies\n") diff --git a/compiler/modules/control_logic.py b/compiler/modules/control_logic.py index e9b212fa..9cabb6c4 100644 --- a/compiler/modules/control_logic.py +++ b/compiler/modules/control_logic.py @@ -95,16 +95,10 @@ class control_logic(design.design): height=dff_height) self.add_mod(self.and2) - if self.port_type=="rw": - self.rbl_driver = factory.create(module_type="pand2", - size=self.num_cols, - height=dff_height) - self.add_mod(self.rbl_driver) - elif self.port_type=="r": - self.rbl_driver = factory.create(module_type="pbuf", - size=self.num_cols, - height=dff_height) - self.add_mod(self.rbl_driver) + self.rbl_driver = factory.create(module_type="pbuf", + size=self.num_cols, + height=dff_height) + self.add_mod(self.rbl_driver) # clk_buf drives a flop for every address and control bit @@ -607,12 +601,8 @@ class control_logic(design.design): self.rbl_inst=self.add_inst(name="rbl_driver", mod=self.rbl_driver) - if self.port_type == "rw": - # input: gated_clk_bar, we_bar, output: rbl_wl - self.connect_inst(["gated_clk_bar", "we_bar", "rbl_wl", "vdd", "gnd"]) - elif self.port_type == "r": - # input: gated_clk_bar, output: rbl_wl - self.connect_inst(["gated_clk_bar", "rbl_wl", "vdd", "gnd"]) + # input: gated_clk_bar, output: rbl_wl + self.connect_inst(["gated_clk_bar", "rbl_wl", "vdd", "gnd"]) def place_rbl_row(self,row): x_off = self.control_x_offset @@ -665,7 +655,7 @@ class control_logic(design.design): # GATE FOR S_EN self.s_en_gate_inst = self.add_inst(name="buf_s_en_and", mod=self.sen_and2) - self.connect_inst(["pre_s_en", "gated_clk_bar", "s_en", "vdd", "gnd"]) + self.connect_inst(["pre_s_en", "we_bar", "s_en", "vdd", "gnd"]) def place_sen_row(self,row): @@ -684,7 +674,7 @@ class control_logic(design.design): def route_sen(self): - sen_map = zip(["B"], ["gated_clk_bar"]) + sen_map = zip(["B"], ["we_bar"]) self.connect_vertical_bus(sen_map, self.s_en_gate_inst, self.rail_offsets) out_pos = self.delay_inst.get_pin("out").bc() diff --git a/compiler/tests/22_psram_1bank_2mux_func_test.py b/compiler/tests/22_psram_1bank_2mux_func_test.py index 90cc8bd2..035f6b41 100755 --- a/compiler/tests/22_psram_1bank_2mux_func_test.py +++ b/compiler/tests/22_psram_1bank_2mux_func_test.py @@ -42,21 +42,20 @@ class psram_1bank_2mux_func_test(openram_test): num_banks=1) c.words_per_row=2 c.recompute_sizes() - debug.info(1, "Functional test for {}rw,{}r,{}w psram with {} bit words, {} words, {} words per row, {} banks".format(OPTS.num_rw_ports, - OPTS.num_r_ports, - OPTS.num_w_ports, - c.word_size, - c.num_words, - c.words_per_row, - c.num_banks)) + debug.info(1, "Functional test for {}rw,{}r,{}w psram with" + "{} bit words, {} words, {} words per row, {} banks".format(OPTS.num_rw_ports, + OPTS.num_r_ports, + OPTS.num_w_ports, + c.word_size, + c.num_words, + c.words_per_row, + c.num_banks)) s = factory.create(module_type="sram", sram_config=c) - tempspice = OPTS.openram_temp + "temp.sp" + tempspice = OPTS.openram_temp + "sram.sp" s.sp_write(tempspice) corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) f = functional(s.s, tempspice, corner) - - f.num_cycles = 10 (fail, error) = f.run() self.assertTrue(fail,error) diff --git a/compiler/tests/22_psram_1bank_4mux_func_test.py b/compiler/tests/22_psram_1bank_4mux_func_test.py index ac0b733c..9a280492 100755 --- a/compiler/tests/22_psram_1bank_4mux_func_test.py +++ b/compiler/tests/22_psram_1bank_4mux_func_test.py @@ -43,21 +43,20 @@ class psram_1bank_4mux_func_test(openram_test): num_banks=1) c.words_per_row=4 c.recompute_sizes() - debug.info(1, "Functional test for {}rw,{}r,{}w psram with {} bit words, {} words, {} words per row, {} banks".format(OPTS.num_rw_ports, - OPTS.num_r_ports, - OPTS.num_w_ports, - c.word_size, - c.num_words, - c.words_per_row, - c.num_banks)) + debug.info(1, "Functional test for {}rw,{}r,{}w psram with" + "{} bit words, {} words, {} words per row, {} banks".format(OPTS.num_rw_ports, + OPTS.num_r_ports, + OPTS.num_w_ports, + c.word_size, + c.num_words, + c.words_per_row, + c.num_banks)) s = factory.create(module_type="sram", sram_config=c) - tempspice = OPTS.openram_temp + "temp.sp" + tempspice = OPTS.openram_temp + "sram.sp" s.sp_write(tempspice) corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) f = functional(s.s, tempspice, corner) - - f.num_cycles = 10 (fail, error) = f.run() self.assertTrue(fail,error) diff --git a/compiler/tests/22_psram_1bank_8mux_func_test.py b/compiler/tests/22_psram_1bank_8mux_func_test.py index 8b1881fb..d99a0959 100755 --- a/compiler/tests/22_psram_1bank_8mux_func_test.py +++ b/compiler/tests/22_psram_1bank_8mux_func_test.py @@ -43,21 +43,20 @@ class psram_1bank_8mux_func_test(openram_test): num_banks=1) c.words_per_row=8 c.recompute_sizes() - debug.info(1, "Functional test for {}rw,{}r,{}w psram with {} bit words, {} words, {} words per row, {} banks".format(OPTS.num_rw_ports, - OPTS.num_r_ports, - OPTS.num_w_ports, - c.word_size, - c.num_words, - c.words_per_row, - c.num_banks)) + debug.info(1, "Functional test for {}rw,{}r,{}w psram with" + "{} bit words, {} words, {} words per row, {} banks".format(OPTS.num_rw_ports, + OPTS.num_r_ports, + OPTS.num_w_ports, + c.word_size, + c.num_words, + c.words_per_row, + c.num_banks)) s = factory.create(module_type="sram", sram_config=c) - tempspice = OPTS.openram_temp + "temp.sp" + tempspice = OPTS.openram_temp + "sram.sp" s.sp_write(tempspice) corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) f = functional(s.s, tempspice, corner) - - f.num_cycles = 10 (fail, error) = f.run() self.assertTrue(fail,error) diff --git a/compiler/tests/22_psram_1bank_nomux_func_test.py b/compiler/tests/22_psram_1bank_nomux_func_test.py index 323282e5..78da5a11 100755 --- a/compiler/tests/22_psram_1bank_nomux_func_test.py +++ b/compiler/tests/22_psram_1bank_nomux_func_test.py @@ -43,21 +43,20 @@ class psram_1bank_nomux_func_test(openram_test): num_banks=1) c.words_per_row=1 c.recompute_sizes() - debug.info(1, "Functional test for {}rw,{}r,{}w psram with {} bit words, {} words, {} words per row, {} banks".format(OPTS.num_rw_ports, - OPTS.num_r_ports, - OPTS.num_w_ports, - c.word_size, - c.num_words, - c.words_per_row, - c.num_banks)) + debug.info(1, "Functional test for {}rw,{}r,{}w psram with" + "{} bit words, {} words, {} words per row, {} banks".format(OPTS.num_rw_ports, + OPTS.num_r_ports, + OPTS.num_w_ports, + c.word_size, + c.num_words, + c.words_per_row, + c.num_banks)) s = factory.create(module_type="sram", sram_config=c) - tempspice = OPTS.openram_temp + "temp.sp" + tempspice = OPTS.openram_temp + "sram.sp" s.sp_write(tempspice) corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) f = functional(s.s, tempspice, corner) - - f.num_cycles = 10 (fail, error) = f.run() self.assertTrue(fail,error) diff --git a/compiler/tests/22_psram_wmask_func_test.py b/compiler/tests/22_psram_wmask_func_test.py index bbf28331..75e3cbf1 100644 --- a/compiler/tests/22_psram_wmask_func_test.py +++ b/compiler/tests/22_psram_wmask_func_test.py @@ -52,13 +52,11 @@ class psram_wmask_func_test(openram_test): c.write_size, c.num_banks)) s = factory.create(module_type="sram", sram_config=c) - tempspice = OPTS.openram_temp + "temp.sp" + tempspice = OPTS.openram_temp + "sram.sp" s.sp_write(tempspice) corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) - f = functional(s.s, tempspice, corner) - f.num_cycles = 10 (fail, error) = f.run() self.assertTrue(fail, error) @@ -70,4 +68,4 @@ if __name__ == "__main__": (OPTS, args) = globals.parse_args() del sys.argv[1:] header(__file__, OPTS.tech_name) - unittest.main(testRunner=debugTestRunner()) \ No newline at end of file + unittest.main(testRunner=debugTestRunner()) diff --git a/compiler/tests/22_sram_1bank_2mux_func_test.py b/compiler/tests/22_sram_1bank_2mux_func_test.py index d60d7040..2037169e 100755 --- a/compiler/tests/22_sram_1bank_2mux_func_test.py +++ b/compiler/tests/22_sram_1bank_2mux_func_test.py @@ -31,22 +31,21 @@ class sram_1bank_2mux_func_test(openram_test): from characterizer import functional, delay from sram_config import sram_config c = sram_config(word_size=4, - num_words=64, + num_words=32, num_banks=1) c.words_per_row=2 c.recompute_sizes() - debug.info(1, "Functional test for sram with {} bit words, {} words, {} words per row, {} banks".format(c.word_size, - c.num_words, - c.words_per_row, - c.num_banks)) + debug.info(1, "Functional test for sram with " + "{} bit words, {} words, {} words per row, {} banks".format(c.word_size, + c.num_words, + c.words_per_row, + c.num_banks)) s = factory.create(module_type="sram", sram_config=c) - tempspice = OPTS.openram_temp + "temp.sp" + tempspice = OPTS.openram_temp + "sram.sp" s.sp_write(tempspice) corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) f = functional(s.s, tempspice, corner) - - f.num_cycles = 10 (fail, error) = f.run() self.assertTrue(fail,error) diff --git a/compiler/tests/22_sram_1bank_4mux_func_test.py b/compiler/tests/22_sram_1bank_4mux_func_test.py index e81b3682..178f955b 100755 --- a/compiler/tests/22_sram_1bank_4mux_func_test.py +++ b/compiler/tests/22_sram_1bank_4mux_func_test.py @@ -31,22 +31,21 @@ class sram_1bank_4mux_func_test(openram_test): from characterizer import functional, delay from sram_config import sram_config c = sram_config(word_size=4, - num_words=256, + num_words=128, num_banks=1) c.words_per_row=4 c.recompute_sizes() - debug.info(1, "Functional test for sram with {} bit words, {} words, {} words per row, {} banks".format(c.word_size, - c.num_words, - c.words_per_row, - c.num_banks)) + debug.info(1, "Functional test for sram with " + "{} bit words, {} words, {} words per row, {} banks".format(c.word_size, + c.num_words, + c.words_per_row, + c.num_banks)) s = factory.create(module_type="sram", sram_config=c) - tempspice = OPTS.openram_temp + "temp.sp" + tempspice = OPTS.openram_temp + "sram.sp" s.sp_write(tempspice) corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) f = functional(s.s, tempspice, corner) - - f.num_cycles = 10 (fail, error) = f.run() self.assertTrue(fail,error) diff --git a/compiler/tests/22_sram_1bank_8mux_func_test.py b/compiler/tests/22_sram_1bank_8mux_func_test.py index 33151f0f..d531163a 100755 --- a/compiler/tests/22_sram_1bank_8mux_func_test.py +++ b/compiler/tests/22_sram_1bank_8mux_func_test.py @@ -34,22 +34,21 @@ class sram_1bank_8mux_func_test(openram_test): from sram_config import sram_config c = sram_config(word_size=4, - num_words=256, + num_words=128, num_banks=1) c.words_per_row=8 c.recompute_sizes() - debug.info(1, "Functional test for sram with {} bit words, {} words, {} words per row, {} banks".format(c.word_size, - c.num_words, - c.words_per_row, - c.num_banks)) + debug.info(1, "Functional test for sram with " + "{} bit words, {} words, {} words per row, {} banks".format(c.word_size, + c.num_words, + c.words_per_row, + c.num_banks)) s = factory.create(module_type="sram", sram_config=c) - tempspice = OPTS.openram_temp + "temp.sp" + tempspice = OPTS.openram_temp + "sram.sp" s.sp_write(tempspice) corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) f = functional(s.s, tempspice, corner) - - f.num_cycles = 10 (fail, error) = f.run() self.assertTrue(fail,error) diff --git a/compiler/tests/22_sram_1bank_nomux_func_test.py b/compiler/tests/22_sram_1bank_nomux_func_test.py index 9f777dc1..eb6d2412 100755 --- a/compiler/tests/22_sram_1bank_nomux_func_test.py +++ b/compiler/tests/22_sram_1bank_nomux_func_test.py @@ -30,22 +30,21 @@ class sram_1bank_nomux_func_test(openram_test): from characterizer import functional from sram_config import sram_config c = sram_config(word_size=4, - num_words=32, + num_words=16, num_banks=1) c.words_per_row=1 c.recompute_sizes() - debug.info(1, "Functional test for sram with {} bit words, {} words, {} words per row, {} banks".format(c.word_size, - c.num_words, - c.words_per_row, - c.num_banks)) + debug.info(1, "Functional test for sram with " + "{} bit words, {} words, {} words per row, {} banks".format(c.word_size, + c.num_words, + c.words_per_row, + c.num_banks)) s = factory.create(module_type="sram", sram_config=c) - tempspice = OPTS.openram_temp + "temp.sp" + tempspice = OPTS.openram_temp + "sram.sp" s.sp_write(tempspice) corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) f = functional(s.s, tempspice, corner) - - f.num_cycles = 10 (fail, error) = f.run() self.assertTrue(fail,error) diff --git a/compiler/tests/22_sram_1rw_1r_1bank_nomux_func_test.py b/compiler/tests/22_sram_1rw_1r_1bank_nomux_func_test.py index 293d52d8..c7de01ee 100755 --- a/compiler/tests/22_sram_1rw_1r_1bank_nomux_func_test.py +++ b/compiler/tests/22_sram_1rw_1r_1bank_nomux_func_test.py @@ -46,13 +46,11 @@ class psram_1bank_nomux_func_test(openram_test): c.words_per_row, c.num_banks)) s = factory.create(module_type="sram", sram_config=c) - tempspice = OPTS.openram_temp + "temp.sp" + tempspice = OPTS.openram_temp + "sram.sp" s.sp_write(tempspice) corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) f = functional(s.s, tempspice, corner) - - f.num_cycles = 10 (fail, error) = f.run() self.assertTrue(fail,error) diff --git a/compiler/tests/22_sram_wmask_func_test.py b/compiler/tests/22_sram_wmask_func_test.py index 9a7b04fd..f45f57b3 100755 --- a/compiler/tests/22_sram_wmask_func_test.py +++ b/compiler/tests/22_sram_wmask_func_test.py @@ -42,13 +42,11 @@ class sram_wmask_func_test(openram_test): c.write_size, c.num_banks)) s = factory.create(module_type="sram", sram_config=c) - tempspice = OPTS.openram_temp + "temp.sp" + tempspice = OPTS.openram_temp + "sram.sp" s.sp_write(tempspice) corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) - f = functional(s.s, tempspice, corner) - f.num_cycles = 10 (fail, error) = f.run() self.assertTrue(fail, error)