From 41226087bac97962b590037c649fb6ae362ac0b6 Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 14 Apr 2021 13:55:21 -0700 Subject: [PATCH] Use separate mXp pin layer if it exists --- compiler/base/pin_layout.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/compiler/base/pin_layout.py b/compiler/base/pin_layout.py index eb4cb2ad..e8c6f0a5 100644 --- a/compiler/base/pin_layout.py +++ b/compiler/base/pin_layout.py @@ -369,11 +369,23 @@ class pin_layout: debug.info(4, "writing pin (" + str(self.layer) + "):" + str(self.width()) + "x" + str(self.height()) + " @ " + str(self.ll())) - (layer_num, purpose) = layer[self.layer] + + # Try to use the pin layer if it exists, otherwise + # use the regular layer try: - from tech import pin_purpose + (pin_layer_num, pin_purpose) = layer[self.layer + "p"] + except KeyError: + (pin_layer_num, pin_purpose) = layer[self.layer] + (layer_num, purpose) = layer[self.layer] + + # Try to use a global pin purpose if it exists, + # otherwise, use the regular purpose + try: + from tech import pin_purpose as global_pin_purpose + pin_purpose = global_pin_purpose except ImportError: - pin_purpose = purpose + pass + try: from tech import label_purpose except ImportError: @@ -385,9 +397,9 @@ class pin_layout: width=self.width(), height=self.height(), center=False) - # Draw a second pin shape too - if pin_purpose != purpose: - newLayout.addBox(layerNumber=layer_num, + # Draw a second pin shape too if it is different + if not self.same_lpp((pin_layer_num, pin_purpose), (layer_num, purpose)): + newLayout.addBox(layerNumber=pin_layer_num, purposeNumber=pin_purpose, offsetInMicrons=self.ll(), width=self.width(),