mirror of https://github.com/VLSIDA/OpenRAM.git
Convert pins and blockages for graph router
This commit is contained in:
parent
8522e0108c
commit
091d0f8775
|
|
@ -75,6 +75,10 @@ class graph_router(router_tech):
|
|||
self.find_blockages()
|
||||
self.find_vias()
|
||||
|
||||
# Convert blockages and vias if they overlap a pin
|
||||
self.convert_vias()
|
||||
self.convert_blockages()
|
||||
|
||||
# Add side pins
|
||||
self.calculate_ring_bbox()
|
||||
if self.pin_type in ["top", "bottom", "right", "left"]:
|
||||
|
|
@ -229,6 +233,40 @@ class graph_router(router_tech):
|
|||
self.vias.append(self.inflate_shape(new_shape, is_via=True))
|
||||
|
||||
|
||||
def convert_vias(self):
|
||||
""" Convert the vias that overlap a pin. """
|
||||
|
||||
for via in self.vias:
|
||||
via_core = via.get_core()
|
||||
for pin in self.all_pins:
|
||||
pin_core = pin.get_core()
|
||||
via_core.lpp = pin_core.lpp
|
||||
if via_core.overlaps(pin_core):
|
||||
via.rename(pin.name)
|
||||
break
|
||||
|
||||
|
||||
def convert_blockages(self):
|
||||
""" Convert the blockages that overlap a pin. """
|
||||
|
||||
for blockage in self.blockages:
|
||||
blockage_core = blockage.get_core()
|
||||
for pin in self.all_pins:
|
||||
pin_core = pin.get_core()
|
||||
if blockage_core.overlaps(pin_core):
|
||||
blockage.rename(pin.name)
|
||||
break
|
||||
else:
|
||||
for via in self.vias:
|
||||
if via.name == "via":
|
||||
continue
|
||||
via_core = via.get_core()
|
||||
via_core.lpp = blockage_core.lpp
|
||||
if blockage_core.overlaps(via_core):
|
||||
blockage.rename(via.name)
|
||||
break
|
||||
|
||||
|
||||
def inflate_shape(self, shape, is_pin=False, is_via=False):
|
||||
""" Inflate a given shape with spacing rules. """
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,13 @@ class graph_shape(pin_layout):
|
|||
return snap(super().width())
|
||||
|
||||
|
||||
def rename(self, new_name):
|
||||
""" Change the name of `self` and `self.core`. """
|
||||
|
||||
self.name = new_name
|
||||
self.get_core().name = new_name
|
||||
|
||||
|
||||
def get_core(self):
|
||||
"""
|
||||
Return `self` if `self.core` is None. Otherwise, return `self.core`.
|
||||
|
|
|
|||
Loading…
Reference in New Issue