From 7099ee76e9312892f559e6bc7b7c3922362185a6 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Tue, 30 Oct 2018 16:52:11 -0700 Subject: [PATCH] Remove blocked grids from pins and secondary grids --- compiler/router/pin_group.py | 19 ++++++++++++++++--- compiler/router/router.py | 3 ++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/compiler/router/pin_group.py b/compiler/router/pin_group.py index 6b2e925f..55e31ab4 100644 --- a/compiler/router/pin_group.py +++ b/compiler/router/pin_group.py @@ -106,8 +106,9 @@ class pin_group: continue for index2,pin2 in enumerate(pin_list): - # Can't contain yourself - if pin1 == pin2: + # Can't contain yourself, but compare the indices and not the pins + # so you can remove duplicate copies. + if index1==index2: continue # If we already removed it, can't remove it again... if index2 in remove_indices: @@ -420,7 +421,19 @@ class pin_group: # Blockages will be a super-set of pins since it uses the inflated pin shape. blockage_in_tracks = router.convert_blockage(pin) blockage_set.update(blockage_in_tracks) - + + # If we have a blockage, we must remove the grids + # Remember, this excludes the pin blockages already + shared_set = pin_set & router.blocked_grids + if len(shared_set)>0: + debug.info(2,"Removing pins {}".format(shared_set)) + pin_set.difference_update(router.blocked_grids) + + shared_set = blockage_set & router.blocked_grids + if len(shared_set)>0: + debug.info(2,"Removing blocks {}".format(shared_set)) + blockage_set.difference_update(router.blocked_grids) + # At least one of the groups must have some valid tracks if (len(pin_set)==0 and len(blockage_set)==0): self.write_debug_gds("blocked_pin.gds") diff --git a/compiler/router/router.py b/compiler/router/router.py index ee6a9300..dde66a82 100644 --- a/compiler/router/router.py +++ b/compiler/router/router.py @@ -135,7 +135,8 @@ class router(router_tech): Find the pins and blockages in the design """ # This finds the pin shapes and sorts them into "groups" that are connected - # This must come before the blockages, so we can ignore metal shapes that are blockages. + # This must come before the blockages, so we can not count the pins themselves + # as blockages. for pin in pin_list: self.find_pins(pin)