From 4ce6b040fd42ef65864c7d00259f99fe6548f3aa Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Fri, 26 Oct 2018 09:25:10 -0700 Subject: [PATCH] Debugging missing enclosures --- compiler/router/pin_group.py | 113 ++++++++++++++++++++----------- compiler/router/router.py | 46 ++++++------- compiler/router/supply_router.py | 14 ++-- 3 files changed, 101 insertions(+), 72 deletions(-) diff --git a/compiler/router/pin_group.py b/compiler/router/pin_group.py index d6344fb6..00664e14 100644 --- a/compiler/router/pin_group.py +++ b/compiler/router/pin_group.py @@ -1,10 +1,12 @@ +from pin_layout import pin_layout from vector3d import vector3d +from vector import vector from tech import drc import debug class pin_group: """ - A class to represent a group of touching rectangular design pin. + A class to represent a group of rectangular design pin. It requires a router to define the track widths and blockages which determine how pin shapes get mapped to tracks. """ @@ -12,7 +14,9 @@ class pin_group: self.name = name # Flag for when it is routed self.routed = False - self.pins = pin_shapes + # This is a list because we can have a pin group of disconnected sets of pins + # and these are represented by separate lists + self.pins = [pin_shapes] self.router = router # These are the corresponding pin grids for each pin group. self.grids = set() @@ -52,7 +56,7 @@ class pin_group: debug.info(0,"FINAL :",new_pin_list) return new_pin_list - # FIXME: This relies on some technology parameters from router which is not clearn. + # FIXME: This relies on some technology parameters from router which is not clean. def compute_enclosures(self): """ Find the minimum rectangle enclosures of the given tracks. @@ -64,6 +68,7 @@ class pin_group: enclosure = self.router.compute_pin_enclosure(ll, ur, ll.z) pin_list.append(enclosure) + print("ENCLOS",pin_list) #return pin_list # We used to do this, but smaller enclosures can be return self.remove_redundant_shapes(pin_list) @@ -115,32 +120,48 @@ class pin_group: Return the smallest. """ smallest = None - for pin in self.pins: - for enclosure in enclosure_list: - new_enclosure = self.compute_enclosure(pin, enclosure) - if smallest == None or new_enclosure.area() min_width: - if smallest_shape == None or other.area() min_width: + if smallest_shape == None or other.area()= self.supply_rail_wire_width**2: - debug.info(2,"Via overlap {0} {1} {2}".format(len(overlap),self.supply_rail_wire_width**2,overlap)) - connections.add(i1) - connections.add(i2) + debug.info(3,"Via overlap {0} {1} {2}".format(len(overlap),self.supply_rail_wire_width**2,overlap)) + connections.update([i1,i2]) via_areas.append(overlap) # Go through and add the vias at the center of the intersection @@ -239,11 +238,12 @@ class supply_router(router): self.add_via(center,self.rail_track_width) # Determien which indices were not connected to anything above - all_indices = set([x for x in range(len(self.supply_rails[name]))]) - missing_indices = all_indices ^ connections + missing_indices = set([x for x in range(len(self.supply_rails[name]))]) + missing_indices.difference_update(connections) + # Go through and remove those disconnected indices # (No via was added, so that doesn't need to be removed) - for rail_index in missing_indices: + for rail_index in sorted(missing_indices, reverse=True): ll = grid_utils.get_lower_left(all_rails[rail_index]) ur = grid_utils.get_upper_right(all_rails[rail_index]) debug.info(1,"Removing disconnected supply rail {0} .. {1}".format(ll,ur))