Add error check requiring non-zero area pin layouts.

This commit is contained in:
Matt Guthaus 2018-10-29 10:32:42 -07:00
parent 851aeae8c4
commit 6990773ea1
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,10 @@ class pin_layout:
self.rect = [vector(rect[0]),vector(rect[1])]
# snap the rect to the grid
self.rect = [x.snap_to_grid() for x in self.rect]
debug.check(self.width()>0,"Zero width pin.")
debug.check(self.height()>0,"Zero height pin.")
# if it's a layer number look up the layer name. this assumes a unique layer number.
if type(layer_name_num)==int:
self.layer = list(layer.keys())[list(layer.values()).index(layer_name_num)]