Removed unique id for contacts. Contact/via name, however, must distinguish types of contacts based on layers used.

This commit is contained in:
Matt Guthaus 2017-04-26 10:24:51 -07:00
parent d85f78a54c
commit 1e8743f5a5
2 changed files with 9 additions and 12 deletions

View File

@ -5,25 +5,23 @@ from vector import vector
class contact(design.design): class contact(design.design):
""" """
Object for a contact shape with its conductor enclosures Object for a contact shape with its conductor enclosures.
Creates a contact array minimum active or poly enclosure and metal1 enclosure. Creates a contact array minimum active or poly enclosure and metal1 enclosure.
This class has enclosure on multiple sides of the contact whereas a via may This class has enclosure on multiple sides of the contact whereas a via may
have extension on two or four sides. have extension on two or four sides.
""" """
unique_contact_id = 1 def __init__(self, layer_stack, dimensions=[1,1]):
name = "{0}_{1}_{2}_{3}x{4}".format(layer_stack[0],
def __init__(self, layer_stack, dimensions=[1,1], offset=(0,0)): layer_stack[1],
name = "{0}_{1}x{2}_num{3}".format(layer_stack[1], layer_stack[2],
dimensions[0], dimensions[0],
dimensions[1], dimensions[1])
contact.unique_contact_id)
design.design.__init__(self, name) design.design.__init__(self, name)
debug.info(3, "create contact object {0}".format(name)) debug.info(3, "create contact object {0}".format(name))
contact.unique_contact_id += 1
self.layer_stack = layer_stack self.layer_stack = layer_stack
self.dimensions = dimensions self.dimensions = dimensions
self.offset = offset self.offset = vector(0,0)
self.pins = [] # used for matching parm lengths self.pins = [] # used for matching parm lengths
self.create_layout() self.create_layout()

View File

@ -220,8 +220,7 @@ class layout:
""" Add a three layer via structure. """ """ Add a three layer via structure. """
import contact import contact
via = contact.contact(layer_stack=layers, via = contact.contact(layer_stack=layers,
dimensions=size, dimensions=size)
offset=offset)
self.add_mod(via) self.add_mod(via)
self.add_inst(name=via.name, self.add_inst(name=via.name,
mod=via, mod=via,