From f17d661e3ac6c1b19bef84f5a61116f7e6745ecd Mon Sep 17 00:00:00 2001 From: mrg Date: Mon, 7 Mar 2022 07:58:41 -0800 Subject: [PATCH] Add spare column option to tests for sky130 --- compiler/tests/21_hspice_delay_test.py | 11 ++++++++++- compiler/tests/21_model_delay_test.py | 11 ++++++++++- compiler/tests/21_ngspice_delay_global_test.py | 11 ++++++++++- compiler/tests/21_ngspice_delay_test.py | 11 ++++++++++- compiler/tests/21_regression_delay_test.py | 11 ++++++++++- compiler/tests/21_xyce_delay_test.py | 11 ++++++++++- compiler/tests/22_sram_1bank_2mux_func_test.py | 11 ++++++++++- .../tests/22_sram_1bank_2mux_global_func_test.py | 11 ++++++++++- .../tests/22_sram_1bank_2mux_sparecols_func_test.py | 12 ++++++++++-- compiler/tests/22_sram_1bank_4mux_func_test.py | 11 ++++++++++- compiler/tests/22_sram_1bank_8mux_func_test.py | 11 ++++++++++- compiler/tests/22_sram_1bank_nomux_func_test.py | 11 ++++++++++- .../tests/22_sram_1bank_nomux_sparecols_func_test.py | 12 ++++++++++-- .../tests/22_sram_1bank_wmask_1rw_1r_func_test.py | 11 ++++++++++- compiler/tests/22_sram_wmask_func_test.py | 11 ++++++++++- compiler/tests/Makefile | 9 +++++---- 16 files changed, 155 insertions(+), 21 deletions(-) diff --git a/compiler/tests/21_hspice_delay_test.py b/compiler/tests/21_hspice_delay_test.py index 4f8ba8ec..987fffa8 100755 --- a/compiler/tests/21_hspice_delay_test.py +++ b/compiler/tests/21_hspice_delay_test.py @@ -31,9 +31,18 @@ class timing_sram_test(openram_test): reload(characterizer) from characterizer import delay from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=4, num_words=16, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row=1 c.recompute_sizes() debug.info(1, "Testing timing for sample 1bit, 16words SRAM with 1 bank") diff --git a/compiler/tests/21_model_delay_test.py b/compiler/tests/21_model_delay_test.py index cf320208..71b002e1 100755 --- a/compiler/tests/21_model_delay_test.py +++ b/compiler/tests/21_model_delay_test.py @@ -33,9 +33,18 @@ class model_delay_test(openram_test): from characterizer import elmore from sram import sram from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=1, num_words=16, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row=1 c.recompute_sizes() debug.info(1, "Testing timing for sample 1bit, 16words SRAM with 1 bank") diff --git a/compiler/tests/21_ngspice_delay_global_test.py b/compiler/tests/21_ngspice_delay_global_test.py index b71313f8..f826880c 100755 --- a/compiler/tests/21_ngspice_delay_global_test.py +++ b/compiler/tests/21_ngspice_delay_global_test.py @@ -33,9 +33,18 @@ class timing_sram_test(openram_test): from characterizer import delay from sram_config import sram_config OPTS.local_array_size = 2 + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=4, num_words=16, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row=1 c.recompute_sizes() # c = sram_config(word_size=8, diff --git a/compiler/tests/21_ngspice_delay_test.py b/compiler/tests/21_ngspice_delay_test.py index 15fdaca3..e13eada8 100755 --- a/compiler/tests/21_ngspice_delay_test.py +++ b/compiler/tests/21_ngspice_delay_test.py @@ -30,9 +30,18 @@ class timing_sram_test(openram_test): reload(characterizer) from characterizer import delay from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=4, num_words=16, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row=1 c.recompute_sizes() debug.info(1, "Testing timing for sample 1bit, 16words SRAM with 1 bank") diff --git a/compiler/tests/21_regression_delay_test.py b/compiler/tests/21_regression_delay_test.py index 9d0c50c8..c79f0218 100755 --- a/compiler/tests/21_regression_delay_test.py +++ b/compiler/tests/21_regression_delay_test.py @@ -33,9 +33,18 @@ class regression_model_test(openram_test): from characterizer import neural_network from sram import sram from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=1, num_words=16, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row=1 c.recompute_sizes() debug.info(1, "Testing timing for sample 1bit, 16words SRAM with 1 bank") diff --git a/compiler/tests/21_xyce_delay_test.py b/compiler/tests/21_xyce_delay_test.py index 16fdc2f6..6592b50e 100755 --- a/compiler/tests/21_xyce_delay_test.py +++ b/compiler/tests/21_xyce_delay_test.py @@ -31,9 +31,18 @@ class timing_sram_test(openram_test): reload(characterizer) from characterizer import delay from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=4, num_words=16, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row=1 c.recompute_sizes() debug.info(1, "Testing timing for sample 1bit, 16words SRAM with 1 bank") diff --git a/compiler/tests/22_sram_1bank_2mux_func_test.py b/compiler/tests/22_sram_1bank_2mux_func_test.py index cca6aeeb..dedbba0c 100755 --- a/compiler/tests/22_sram_1bank_2mux_func_test.py +++ b/compiler/tests/22_sram_1bank_2mux_func_test.py @@ -32,9 +32,18 @@ class sram_1bank_2mux_func_test(openram_test): reload(characterizer) from characterizer import functional from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=4, num_words=32, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row=2 c.recompute_sizes() debug.info(1, "Functional test for sram with " diff --git a/compiler/tests/22_sram_1bank_2mux_global_func_test.py b/compiler/tests/22_sram_1bank_2mux_global_func_test.py index 14de7ba8..664815e7 100755 --- a/compiler/tests/22_sram_1bank_2mux_global_func_test.py +++ b/compiler/tests/22_sram_1bank_2mux_global_func_test.py @@ -33,9 +33,18 @@ class sram_1bank_2mux_func_test(openram_test): from characterizer import functional from sram_config import sram_config OPTS.local_array_size = 8 + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=8, num_words=32, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row=2 c.recompute_sizes() debug.info(1, "Functional test for sram with " diff --git a/compiler/tests/22_sram_1bank_2mux_sparecols_func_test.py b/compiler/tests/22_sram_1bank_2mux_sparecols_func_test.py index 0e3a0f27..0466af79 100755 --- a/compiler/tests/22_sram_1bank_2mux_sparecols_func_test.py +++ b/compiler/tests/22_sram_1bank_2mux_sparecols_func_test.py @@ -32,10 +32,18 @@ class sram_1bank_2mux_sparecols_func_test(openram_test): reload(characterizer) from characterizer import functional from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=4, num_words=32, - num_spare_cols=3, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols+2, + num_spare_rows=num_spare_rows) c.words_per_row=2 c.recompute_sizes() debug.info(1, "Functional test for sram with " diff --git a/compiler/tests/22_sram_1bank_4mux_func_test.py b/compiler/tests/22_sram_1bank_4mux_func_test.py index 4f7035cc..c08a4fef 100755 --- a/compiler/tests/22_sram_1bank_4mux_func_test.py +++ b/compiler/tests/22_sram_1bank_4mux_func_test.py @@ -32,9 +32,18 @@ class sram_1bank_4mux_func_test(openram_test): reload(characterizer) from characterizer import functional from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=4, num_words=128, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row=4 c.recompute_sizes() debug.info(1, "Functional test for sram with " diff --git a/compiler/tests/22_sram_1bank_8mux_func_test.py b/compiler/tests/22_sram_1bank_8mux_func_test.py index cc6456cf..6e6190e4 100755 --- a/compiler/tests/22_sram_1bank_8mux_func_test.py +++ b/compiler/tests/22_sram_1bank_8mux_func_test.py @@ -35,9 +35,18 @@ class sram_1bank_8mux_func_test(openram_test): debug.error("Could not find {} simulator.".format(OPTS.spice_name),-1) from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=4, num_words=128, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row=8 c.recompute_sizes() debug.info(1, "Functional test for sram with " diff --git a/compiler/tests/22_sram_1bank_nomux_func_test.py b/compiler/tests/22_sram_1bank_nomux_func_test.py index ff33ead5..c0e4e19a 100755 --- a/compiler/tests/22_sram_1bank_nomux_func_test.py +++ b/compiler/tests/22_sram_1bank_nomux_func_test.py @@ -32,9 +32,18 @@ class sram_1bank_nomux_func_test(openram_test): reload(characterizer) from characterizer import functional from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=4, num_words=16, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row=1 c.recompute_sizes() debug.info(1, "Functional test for sram with " diff --git a/compiler/tests/22_sram_1bank_nomux_sparecols_func_test.py b/compiler/tests/22_sram_1bank_nomux_sparecols_func_test.py index a2fa6d88..0116f444 100755 --- a/compiler/tests/22_sram_1bank_nomux_sparecols_func_test.py +++ b/compiler/tests/22_sram_1bank_nomux_sparecols_func_test.py @@ -32,10 +32,18 @@ class sram_1bank_nomux_sparecols_func_test(openram_test): reload(characterizer) from characterizer import functional from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=4, num_words=16, - num_spare_cols=3, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols+2, + num_spare_rows=num_spare_rows) c.words_per_row=1 c.recompute_sizes() debug.info(1, "Functional test for sram with " diff --git a/compiler/tests/22_sram_1bank_wmask_1rw_1r_func_test.py b/compiler/tests/22_sram_1bank_wmask_1rw_1r_func_test.py index 6808462e..d2b62470 100755 --- a/compiler/tests/22_sram_1bank_wmask_1rw_1r_func_test.py +++ b/compiler/tests/22_sram_1bank_wmask_1rw_1r_func_test.py @@ -36,10 +36,19 @@ class sram_wmask_1w_1r_func_test(openram_test): reload(characterizer) from characterizer import functional from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=8, num_words=16, write_size=2, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row = 1 c.recompute_sizes() debug.info(1, diff --git a/compiler/tests/22_sram_wmask_func_test.py b/compiler/tests/22_sram_wmask_func_test.py index f41b3d98..de10d9f6 100755 --- a/compiler/tests/22_sram_wmask_func_test.py +++ b/compiler/tests/22_sram_wmask_func_test.py @@ -32,10 +32,19 @@ class sram_wmask_func_test(openram_test): reload(characterizer) from characterizer import functional from sram_config import sram_config + if OPTS.tech_name == "sky130": + num_spare_rows = 1 + num_spare_cols = 1 + else: + num_spare_rows = 0 + num_spare_cols = 0 + c = sram_config(word_size=8, num_words=16, write_size=4, - num_banks=1) + num_banks=1, + num_spare_cols=num_spare_cols, + num_spare_rows=num_spare_rows) c.words_per_row=1 c.recompute_sizes() debug.info(1, "Functional test for sram with " diff --git a/compiler/tests/Makefile b/compiler/tests/Makefile index bf8f20ae..54cc13c5 100644 --- a/compiler/tests/Makefile +++ b/compiler/tests/Makefile @@ -96,7 +96,7 @@ WORKING_TECH_TEST_STAMPS=$(shell shuf -e -- $(filter-out $(BROKEN_STAMPS), $(TEC # Run all technologies -all: $(WORKING_TECH_TEST_STAMPS) +all: clean $(WORKING_TECH_TEST_STAMPS) @ls -1 $(TOP_DIR)/compiler/tests/results/*/*.bad 1> /dev/null 2>&1 && echo "FAILING TESTS" && ls -1 $(TOP_DIR)/compiler/tests/results/*/*.bad | sed -e "s#^.*results\/##" && exit 1 || exit 0 .PHONY: all @@ -120,8 +120,8 @@ $(TEST_BASES): @mkdir -p results/$*/tmp @docker run \ -v $(TOP_DIR):/openram \ - -v $(FREEPDK45):/pdk/freepdk45\ - -e FREEPDK45=/pdk/freepdk45\ + -v $(FREEPDK45):/freepdk45\ + -e FREEPDK45=/freepdk45\ -v $(PDK_ROOT):/pdk \ -e PDK_ROOT=/pdk \ -e PDKPATH=/pdk/sky130A \ @@ -144,7 +144,8 @@ docker-pull: mount: docker run -it \ -v $(TOP_DIR):/openram \ - -v $(FREEPDK45):/pdk/freepdk45 \ + -v $(FREEPDK45):/freepdk45 \ + -e FREEPDK45=/freepdk45\ -v $(PDK_ROOT):/pdk \ -e PDK_ROOT=/pdk \ -e PDKPATH=/pdk/sky130A \