Replace layout pins in the new signal escape router

This commit is contained in:
Eren Dogan 2023-08-02 19:33:48 -07:00
parent 87eca6b7db
commit ba8e80d205
2 changed files with 25 additions and 6 deletions

View File

@ -227,7 +227,8 @@ class router(router_tech):
""" Add the route path to the layout. """
nodes = self.prepare_path(path)
self.add_route(nodes)
shapes = self.add_route(nodes)
return shapes
def prepare_path(self, path):
@ -263,6 +264,7 @@ class router(router_tech):
working for this router.
"""
new_shapes = []
for i in range(0, len(nodes) - 1):
start = nodes[i].center
end = nodes[i + 1].center
@ -276,10 +278,12 @@ class router(router_tech):
self.design.add_via_center(layers=self.layers,
offset=offset)
else: # Wire
self.design.add_rect(layer=self.get_layer(start.z),
offset=offset,
width=abs(diff.x) + self.track_wire,
height=abs(diff.y) + self.track_wire)
shape = self.design.add_rect(layer=self.get_layer(start.z),
offset=offset,
width=abs(diff.x) + self.track_wire,
height=abs(diff.y) + self.track_wire)
new_shapes.append(shape)
return new_shapes
def write_debug_gds(self, gds_name, g=None, source=None, target=None):

View File

@ -79,12 +79,14 @@ class signal_escape_router(router):
debug.info(0, "Retry routing in larger routing region with scale {}".format(scale))
continue
# Create the path shapes on layout
self.add_path(path)
new_shapes = self.add_path(path)
self.new_pins[source.name] = new_shapes[0]
# Find the recently added shapes
self.prepare_gds_reader()
self.find_blockages(name)
self.find_vias()
break
self.replace_layout_pins()
def add_perimeter_fake_pins(self):
@ -152,3 +154,16 @@ class signal_escape_router(router):
fake = self.get_closest_perimeter_fake_pin(pin)
to_route.append((pin, fake, pin.distance(fake)))
return sorted(to_route, key=lambda x: x[2])
def replace_layout_pins(self):
""" """
for name, pin in self.new_pins.items():
pin = graph_shape(pin.name, pin.boundary, pin.lpp)
# Find the intersection of this pin on the perimeter
for fake in self.fake_pins:
edge = pin.intersection(fake)
if edge:
break
self.design.replace_layout_pin(name, edge)