From 851aeae8c4ad6c710b0d6da98483080ea2e81e83 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Mon, 29 Oct 2018 10:28:57 -0700 Subject: [PATCH] Add pins_enclosed function to pin_group --- compiler/router/pin_group.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/compiler/router/pin_group.py b/compiler/router/pin_group.py index 9ab52045..032c4fa4 100644 --- a/compiler/router/pin_group.py +++ b/compiler/router/pin_group.py @@ -30,6 +30,25 @@ class pin_group: def is_routed(self): return self.routed + def pins_enclosed(self): + """ + Check if all of the pin shapes are enclosed. + Does not check if the DRC is correct, but just touching. + """ + for pin_list in self.pins: + pin_is_enclosed=False + for pin in pin_list: + if pin_is_enclosed: + break + for encosure in self.enclosures: + if pin.overlaps(enclosure): + pin_is_enclosed=True + break + else: + return False + + return True + def remove_redundant_shapes(self, pin_list): """ Remove any pin layout that is contained within another.