mirror of https://github.com/VLSIDA/OpenRAM.git
Remove redundant pins when adding each pin
This commit is contained in:
parent
db142bcd5a
commit
eebc2a93b6
|
|
@ -1235,7 +1235,6 @@ class layout():
|
|||
self.add_power_pin(new_name, pin.center(), start_layer=start_layer)
|
||||
|
||||
def add_power_pin(self, name, loc, directions=None, start_layer="m1"):
|
||||
|
||||
# Hack for min area
|
||||
if OPTS.tech_name == "sky130":
|
||||
min_area = drc["minarea_{}".format(self.pwr_grid_layer)]
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@ class pin_group:
|
|||
# Flag for when it is enclosed
|
||||
self.enclosed = False
|
||||
|
||||
# Remove any redundant pins (i.e. contained in other pins)
|
||||
irredundant_pin_set = self.remove_redundant_shapes(list(pin_set))
|
||||
|
||||
# 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 = set(irredundant_pin_set)
|
||||
self.pins = set(pin_set)
|
||||
# Remove any redundant pins (i.e. contained in other pins)
|
||||
self.remove_redundant_pins()
|
||||
|
||||
|
||||
self.router = router
|
||||
# These are the corresponding pin grids for each pin group.
|
||||
|
|
@ -68,6 +68,10 @@ class pin_group:
|
|||
total_string += ")"
|
||||
return total_string
|
||||
|
||||
def add_pin(self, pin):
|
||||
self.pins.add(pin)
|
||||
self.remove_redundant_pins()
|
||||
|
||||
def __repr__(self):
|
||||
""" override repr function output """
|
||||
return str(self)
|
||||
|
|
@ -81,6 +85,13 @@ class pin_group:
|
|||
def is_routed(self):
|
||||
return self.routed
|
||||
|
||||
def remove_redundant_pins(self):
|
||||
"""
|
||||
Remove redundant pin shapes
|
||||
"""
|
||||
new_pin_list = self.remove_redundant_shapes(list(self.pins))
|
||||
self.pins = set(new_pin_list)
|
||||
|
||||
def remove_redundant_shapes(self, pin_list):
|
||||
"""
|
||||
Remove any pin layout that is contained within another.
|
||||
|
|
@ -90,7 +101,6 @@ class pin_group:
|
|||
if local_debug:
|
||||
debug.info(0, "INITIAL: {}".format(pin_list))
|
||||
|
||||
# Make a copy of the list to start
|
||||
new_pin_list = pin_list.copy()
|
||||
|
||||
remove_indices = set()
|
||||
|
|
|
|||
|
|
@ -824,8 +824,7 @@ class router(router_tech):
|
|||
group_map[gid] = pin_group(name=pin_name,
|
||||
pin_set=[],
|
||||
router=self)
|
||||
# We always add it to the first set since they are touching
|
||||
group_map[gid].pins.add(pin)
|
||||
group_map[gid].add_pin(pin)
|
||||
|
||||
self.pin_groups[pin_name] = list(group_map.values())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue