Must transitively cut blockages until no more.

This commit is contained in:
mrg 2021-05-05 13:44:06 -07:00
parent 19ea33d43d
commit 2243761500
1 changed files with 16 additions and 12 deletions

View File

@ -112,18 +112,22 @@ class lef:
for pin_name in self.pins: for pin_name in self.pins:
pin = self.get_pin(pin_name) pin = self.get_pin(pin_name)
inflated_pin = pin.inflated_pin(multiple=1) inflated_pin = pin.inflated_pin(multiple=1)
for blockage in self.blockages[pin.layer]: another_iteration_needed = True
if blockage.overlaps(inflated_pin): while another_iteration_needed:
intersection_shape = blockage.intersection(inflated_pin) another_iteration_needed = False
# If it is zero area, don't add the pin old_blockages = list(self.blockages[pin.layer])
if intersection_shape[0][0]==intersection_shape[1][0] or intersection_shape[0][1]==intersection_shape[1][1]: for blockage in old_blockages:
continue if blockage.overlaps(inflated_pin):
# Remove the old blockage and add the new ones intersection_shape = blockage.intersection(inflated_pin)
self.blockages[pin.layer].remove(blockage) # If it is zero area, don't add the pin
intersection_pin = pin_layout("", intersection_shape, inflated_pin.layer) if intersection_shape[0][0]==intersection_shape[1][0] or intersection_shape[0][1]==intersection_shape[1][1]:
new_blockages = blockage.cut(intersection_pin) continue
self.blockages[pin.layer].extend(new_blockages) another_iteration_needed = True
# Remove the old blockage and add the new ones
self.blockages[pin.layer].remove(blockage)
intersection_pin = pin_layout("", intersection_shape, inflated_pin.layer)
new_blockages = blockage.cut(intersection_pin)
self.blockages[pin.layer].extend(new_blockages)
def lef_write_header(self): def lef_write_header(self):
""" Header of LEF file """ """ Header of LEF file """