diff --git a/compiler/router/router.py b/compiler/router/router.py index c5fa65d4..aa66833e 100644 --- a/compiler/router/router.py +++ b/compiler/router/router.py @@ -104,12 +104,21 @@ class router: for layer in self.layers: self.write_obstacle(self.top_name) + def clear_pins(self): + self.source = [] + self.dest = [] - def route(self,layers,src, dest): + def route(self, layers, src, dest): + """ + Route a single source-destination net and return + the simplified rectilinear path. + """ + self.clear_pins() self.set_layers(layers) self.create_routing_grid() self.set_source(src) self.set_target(dest) + self.find_blockages() # returns the path in tracks path = self.rg.route() diff --git a/compiler/router/tests/01_no_blockages_test.py b/compiler/router/tests/01_no_blockages_test.py index 47e534e3..984a9037 100644 --- a/compiler/router/tests/01_no_blockages_test.py +++ b/compiler/router/tests/01_no_blockages_test.py @@ -49,7 +49,7 @@ class no_blockages_test(unittest.TestCase): r=router.router(gdsname+".gds") layer_stack =("metal1","via1","metal2") path=r.route(layer_stack,src="A",dest="B") - r.rg.view() + #r.rg.view() self.add_wire(layer_stack,path) diff --git a/compiler/router/tests/02_blockages_test.py b/compiler/router/tests/02_blockages_test.py index 485b39f6..900462b0 100644 --- a/compiler/router/tests/02_blockages_test.py +++ b/compiler/router/tests/02_blockages_test.py @@ -49,7 +49,7 @@ class no_blockages_test(unittest.TestCase): r=router.router(gdsname+".gds") layer_stack =("metal1","via1","metal2") path=r.route(layer_stack,src="A",dest="B") - r.rg.view() + #r.rg.view() self.add_wire(layer_stack,path) diff --git a/compiler/router/tests/03_same_layer_pins_test.py b/compiler/router/tests/03_same_layer_pins_test.py index c8b10142..6a20ef3a 100644 --- a/compiler/router/tests/03_same_layer_pins_test.py +++ b/compiler/router/tests/03_same_layer_pins_test.py @@ -49,7 +49,7 @@ class no_blockages_test(unittest.TestCase): r=router.router(gdsname+".gds") layer_stack =("metal1","via1","metal2") path=r.route(layer_stack,src="A",dest="B") - r.rg.view() + #r.rg.view() self.add_wire(layer_stack,path) diff --git a/compiler/router/tests/04_diff_layer_pins_test.py b/compiler/router/tests/04_diff_layer_pins_test.py index 0577c966..0a7f5bbe 100644 --- a/compiler/router/tests/04_diff_layer_pins_test.py +++ b/compiler/router/tests/04_diff_layer_pins_test.py @@ -49,7 +49,6 @@ class no_blockages_test(unittest.TestCase): r=router.router(gdsname+".gds") layer_stack =("metal1","via1","metal2") path=r.route(layer_stack,src="A",dest="B") - r.rg.view() self.add_wire(layer_stack,path) diff --git a/compiler/router/tests/05_two_nets_test.py b/compiler/router/tests/05_two_nets_test.py index 0577c966..0533a743 100644 --- a/compiler/router/tests/05_two_nets_test.py +++ b/compiler/router/tests/05_two_nets_test.py @@ -49,13 +49,17 @@ class no_blockages_test(unittest.TestCase): r=router.router(gdsname+".gds") layer_stack =("metal1","via1","metal2") path=r.route(layer_stack,src="A",dest="B") + self.add_wire(layer_stack,path) + + path=r.route(layer_stack,src="C",dest="D") + self.add_wire(layer_stack,path) + r.rg.view() - self.add_wire(layer_stack,path) - r = routing("test1", "AB_diff_layer_pins") + r = routing("test1", "ABCD_two_nets") self.local_check(r) # fails if there are any DRC errors on any cells diff --git a/compiler/router/tests/ABCD_m1m2_diff_layer_pins.gds b/compiler/router/tests/ABCD_m1m2_diff_layer_pins.gds deleted file mode 100644 index ea4852c9..00000000 Binary files a/compiler/router/tests/ABCD_m1m2_diff_layer_pins.gds and /dev/null differ diff --git a/compiler/router/tests/ABCD_two_nets.gds b/compiler/router/tests/ABCD_two_nets.gds new file mode 100644 index 00000000..07596ec6 Binary files /dev/null and b/compiler/router/tests/ABCD_two_nets.gds differ diff --git a/compiler/router/tests/ABCD_two_nets.sp b/compiler/router/tests/ABCD_two_nets.sp new file mode 100644 index 00000000..d0b092ca --- /dev/null +++ b/compiler/router/tests/ABCD_two_nets.sp @@ -0,0 +1,3 @@ + +.SUBCKT cell +.ENDS cell