Only do reverse lookup on valid interconnect layers since layer numbers can be shared.

This commit is contained in:
Matt Guthaus 2020-06-29 14:42:24 -07:00
parent 07d0f3af8e
commit e97644c424
1 changed files with 5 additions and 2 deletions

View File

@ -8,7 +8,7 @@
import debug import debug
from tech import GDS, drc from tech import GDS, drc
from vector import vector from vector import vector
from tech import layer from tech import layer, layer_indices
import math import math
@ -31,12 +31,15 @@ class pin_layout:
debug.check(self.width() > 0, "Zero width pin.") debug.check(self.width() > 0, "Zero width pin.")
debug.check(self.height() > 0, "Zero height pin.") debug.check(self.height() > 0, "Zero height pin.")
# These are the valid pin layers
valid_layers = { x: layer[x] for x in layer_indices.keys()}
# if it's a string, use the name # if it's a string, use the name
if type(layer_name_pp) == str: if type(layer_name_pp) == str:
self._layer = layer_name_pp self._layer = layer_name_pp
# else it is required to be a lpp # else it is required to be a lpp
else: else:
for (layer_name, lpp) in layer.items(): for (layer_name, lpp) in valid_layers.items():
if not lpp: if not lpp:
continue continue
if self.same_lpp(layer_name_pp, lpp): if self.same_lpp(layer_name_pp, lpp):