From f51e82e75af4cbda3117989ac086633b8334fe3d Mon Sep 17 00:00:00 2001 From: mguthaus Date: Sun, 16 Apr 2017 08:04:06 -0700 Subject: [PATCH] Commented unit tests. Added negative coordinate test on test 03. --- compiler/router/router.py | 2 +- compiler/router/tests/01_no_blockages_test.py | 3 +++ compiler/router/tests/02_blockages_test.py | 3 +++ .../router/tests/03_same_layer_pins_test.gds | Bin 4096 -> 4096 bytes .../router/tests/03_same_layer_pins_test.py | 6 ++++-- .../router/tests/04_diff_layer_pins_test.py | 4 ++++ compiler/router/tests/05_two_nets_test.py | 6 +++++- 7 files changed, 20 insertions(+), 4 deletions(-) diff --git a/compiler/router/router.py b/compiler/router/router.py index 04e24111..4d0f76b3 100644 --- a/compiler/router/router.py +++ b/compiler/router/router.py @@ -118,7 +118,7 @@ class router: for layer in self.layers: self.write_obstacle(self.top_name) - def clear(self): + def clear_pins(self): """ Reset the source and destination pins to start a new routing. Convert the source/dest to blockages. diff --git a/compiler/router/tests/01_no_blockages_test.py b/compiler/router/tests/01_no_blockages_test.py index b4524c48..b7c82943 100644 --- a/compiler/router/tests/01_no_blockages_test.py +++ b/compiler/router/tests/01_no_blockages_test.py @@ -12,6 +12,9 @@ import calibre class no_blockages_test(unittest.TestCase): + """ + Simplest two pin route test with no blockages. + """ def runTest(self): globals.init_openram("config_{0}".format(OPTS.tech_name)) diff --git a/compiler/router/tests/02_blockages_test.py b/compiler/router/tests/02_blockages_test.py index f1fcc4d5..4d9546aa 100644 --- a/compiler/router/tests/02_blockages_test.py +++ b/compiler/router/tests/02_blockages_test.py @@ -12,6 +12,9 @@ import calibre class blockages_test(unittest.TestCase): + """ + Simple two pin route test with multilayer blockages. + """ def runTest(self): globals.init_openram("config_{0}".format(OPTS.tech_name)) diff --git a/compiler/router/tests/03_same_layer_pins_test.gds b/compiler/router/tests/03_same_layer_pins_test.gds index 80fe96e1fab84304b8b5771c875c8b0e11dabfa4..07214708de7ee7e1a76332c23481f4b7af2d7b94 100644 GIT binary patch literal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router/tests/03_same_layer_pins_test.py index f40965c6..79c399bd 100644 --- a/compiler/router/tests/03_same_layer_pins_test.py +++ b/compiler/router/tests/03_same_layer_pins_test.py @@ -12,7 +12,9 @@ import calibre class same_layer_pins_test(unittest.TestCase): - + """ + Checks two pins on the same layer with positive and negative coordinates. + """ def runTest(self): globals.init_openram("config_{0}".format(OPTS.tech_name)) @@ -51,7 +53,7 @@ class same_layer_pins_test(unittest.TestCase): layer_stack =("metal1","via1","metal2") r.route(layer_stack,src="A",dest="B") r.add_route(self) - + self.gds_write("temp.gds") r = routing("test1", "03_same_layer_pins_test") self.local_check(r) diff --git a/compiler/router/tests/04_diff_layer_pins_test.py b/compiler/router/tests/04_diff_layer_pins_test.py index 6cfb7784..03dad3af 100644 --- a/compiler/router/tests/04_diff_layer_pins_test.py +++ b/compiler/router/tests/04_diff_layer_pins_test.py @@ -12,6 +12,10 @@ import calibre class diff_layer_pins_test(unittest.TestCase): + """ + Two pin route test with pins on different layers and blockages. + Pins are smaller than grid size. + """ def runTest(self): globals.init_openram("config_{0}".format(OPTS.tech_name)) diff --git a/compiler/router/tests/05_two_nets_test.py b/compiler/router/tests/05_two_nets_test.py index f12c6d16..c4661e16 100644 --- a/compiler/router/tests/05_two_nets_test.py +++ b/compiler/router/tests/05_two_nets_test.py @@ -12,6 +12,10 @@ import calibre class two_nets_test(unittest.TestCase): + """ + Route two nets in the same GDS file. The routes will interact, + so they must block eachother. + """ def runTest(self): globals.init_openram("config_{0}".format(OPTS.tech_name)) @@ -51,7 +55,7 @@ class two_nets_test(unittest.TestCase): layer_stack =("metal1","via1","metal2") r.route(layer_stack,src="A",dest="B") r.add_route(self) - + r.route(layer_stack,src="A",dest="B") r.add_route(self)