Convert all contacts to use the sram_factory

This commit is contained in:
Matt Guthaus 2019-01-16 16:56:06 -08:00
parent 5192a01f2d
commit 91636be642
7 changed files with 47 additions and 38 deletions

View File

@ -16,7 +16,9 @@ class contact(hierarchy_design.hierarchy_design):
hierarchy as the contact. hierarchy as the contact.
""" """
def __init__(self, layer_stack, dimensions=[1,1], implant_type=None, well_type=None): def __init__(self, layer_stack, dimensions=[1,1], implant_type=None, well_type=None, name=""):
# This will ignore the name parameter since we can guarantee a unique name here
if implant_type or well_type: if implant_type or well_type:
name = "{0}_{1}_{2}_{3}x{4}_{5}{6}".format(layer_stack[0], name = "{0}_{1}_{2}_{3}x{4}_{5}{6}".format(layer_stack[0],
layer_stack[1], layer_stack[1],
@ -164,13 +166,13 @@ class contact(hierarchy_design.hierarchy_design):
""" Get total power of a module """ """ Get total power of a module """
return self.return_power() return self.return_power()
from sram_factory import factory
# This is not instantiated and used for calculations only. # This is not instantiated and used for calculations only.
# These are static 1x1 contacts to reuse in all the design modules. # These are static 1x1 contacts to reuse in all the design modules.
well = contact(layer_stack=("active", "contact", "metal1")) well = factory.create(module_type="contact", layer_stack=("active", "contact", "metal1"))
active = contact(layer_stack=("active", "contact", "poly")) active = factory.create(module_type="contact", layer_stack=("active", "contact", "poly"))
poly = contact(layer_stack=("poly", "contact", "metal1")) poly = factory.create(module_type="contact", layer_stack=("poly", "contact", "metal1"))
m1m2 = contact(layer_stack=("metal1", "via1", "metal2")) m1m2 = factory.create(module_type="contact", layer_stack=("metal1", "via1", "metal2"))
m2m3 = contact(layer_stack=("metal2", "via2", "metal3")) m2m3 = factory.create(module_type="contact", layer_stack=("metal2", "via2", "metal3"))
m3m4 = contact(layer_stack=("metal3", "via3", "metal4")) m3m4 = factory.create(module_type="contact", layer_stack=("metal3", "via3", "metal4"))

View File

@ -378,11 +378,12 @@ class layout():
def add_via(self, layers, offset, size=[1,1], mirror="R0", rotate=0, implant_type=None, well_type=None): def add_via(self, layers, offset, size=[1,1], mirror="R0", rotate=0, implant_type=None, well_type=None):
""" Add a three layer via structure. """ """ Add a three layer via structure. """
import contact from sram_factory import factory
via = contact.contact(layer_stack=layers, via = factory.create(module_type="contact",
dimensions=size, layer_stack=layers,
implant_type=implant_type, dimensions=size,
well_type=well_type) implant_type=implant_type,
well_type=well_type)
self.add_mod(via) self.add_mod(via)
inst=self.add_inst(name=via.name, inst=self.add_inst(name=via.name,
mod=via, mod=via,
@ -395,11 +396,12 @@ class layout():
def add_via_center(self, layers, offset, size=[1,1], mirror="R0", rotate=0, implant_type=None, well_type=None): def add_via_center(self, layers, offset, size=[1,1], mirror="R0", rotate=0, implant_type=None, well_type=None):
""" Add a three layer via structure by the center coordinate accounting for mirroring and rotation. """ """ Add a three layer via structure by the center coordinate accounting for mirroring and rotation. """
import contact from sram_factory import factory
via = contact.contact(layer_stack=layers, via = factory.create(module_type="contact",
dimensions=size, layer_stack=layers,
implant_type=implant_type, dimensions=size,
well_type=well_type) implant_type=implant_type,
well_type=well_type)
height = via.height height = via.height
width = via.width width = via.width
debug.check(mirror=="R0","Use rotate to rotate vias instead of mirror.") debug.check(mirror=="R0","Use rotate to rotate vias instead of mirror.")
@ -1039,9 +1041,11 @@ class layout():
# Find the number of vias for this pitch # Find the number of vias for this pitch
self.supply_vias = 1 self.supply_vias = 1
import contact from sram_factory import factory
while True: while True:
c=contact.contact(("metal1","via1","metal2"), (self.supply_vias, self.supply_vias)) c=factory.create(module_type="contact",
layer_stack=("metal1","via1","metal2"),
dimensions=(self.supply_vias, self.supply_vias))
if c.second_layer_width < self.supply_rail_width and c.second_layer_height < self.supply_rail_width: if c.second_layer_width < self.supply_rail_width and c.second_layer_height < self.supply_rail_width:
self.supply_vias += 1 self.supply_vias += 1
else: else:

View File

@ -1,10 +1,10 @@
from tech import drc from tech import drc
import debug import debug
from design import design from design import design
from contact import contact
from itertools import tee from itertools import tee
from vector import vector from vector import vector
from vector3d import vector3d from vector3d import vector3d
from sram_factory import factory
class route(design): class route(design):
""" """
@ -45,7 +45,9 @@ class route(design):
self.horiz_layer_width = drc("minwidth_{0}".format(self.horiz_layer_name)) self.horiz_layer_width = drc("minwidth_{0}".format(self.horiz_layer_name))
# offset this by 1/2 the via size # offset this by 1/2 the via size
self.c=contact(self.layer_stack, (self.num_vias, self.num_vias)) self.c=factory.create(module_type="contact",
layer_stack=self.layer_stack,
dimensions=(self.num_vias, self.num_vias))
def create_wires(self): def create_wires(self):

View File

@ -1,7 +1,7 @@
from tech import drc from tech import drc
import debug import debug
from contact import contact
from path import path from path import path
from sram_factory import factory
class wire(path): class wire(path):
""" """
@ -37,15 +37,18 @@ class wire(path):
self.horiz_layer_name = horiz_layer self.horiz_layer_name = horiz_layer
self.horiz_layer_width = drc("minwidth_{0}".format(horiz_layer)) self.horiz_layer_width = drc("minwidth_{0}".format(horiz_layer))
via_connect = contact(self.layer_stack, via_connect = factory.create(module_type="contact",
(1, 1)) layer_stack=self.layer_stack,
dimensions=(1, 1))
self.node_to_node = [drc("minwidth_" + str(self.horiz_layer_name)) + via_connect.width, self.node_to_node = [drc("minwidth_" + str(self.horiz_layer_name)) + via_connect.width,
drc("minwidth_" + str(self.horiz_layer_name)) + via_connect.height] drc("minwidth_" + str(self.horiz_layer_name)) + via_connect.height]
# create a 1x1 contact # create a 1x1 contact
def create_vias(self): def create_vias(self):
""" Add a via and corner square at every corner of the path.""" """ Add a via and corner square at every corner of the path."""
self.c=contact(self.layer_stack, (1, 1)) self.c=factory.create(module_type="contact",
layer_stack=self.layer_stack,
dimensions=(1, 1))
c_width = self.c.width c_width = self.c.width
c_height = self.c.height c_height = self.c.height

View File

@ -82,6 +82,7 @@ class options(optparse.Values):
dff_array = "dff_array" dff_array = "dff_array"
dff = "dff" dff = "dff"
precharge_array = "precharge_array" precharge_array = "precharge_array"
ptx = "ptx"
replica_bitcell = "replica_bitcell" replica_bitcell = "replica_bitcell"
replica_bitline = "replica_bitline" replica_bitline = "replica_bitline"
sense_amp_array = "sense_amp_array" sense_amp_array = "sense_amp_array"

View File

@ -1,9 +1,9 @@
import contact
import pgate import pgate
import debug import debug
from tech import drc, parameter, spice from tech import drc, parameter, spice
from vector import vector from vector import vector
from globals import OPTS from globals import OPTS
import contact
from sram_factory import factory from sram_factory import factory
class pnor2(pgate.pgate): class pnor2(pgate.pgate):
@ -72,15 +72,11 @@ class pnor2(pgate.pgate):
def setup_layout_constants(self): def setup_layout_constants(self):
""" Pre-compute some handy layout parameters. """ """ Pre-compute some handy layout parameters. """
poly_contact = contact.contact(("poly","contact","metal1"))
m1m2_via = contact.contact(("metal1","via1","metal2"))
m2m3_via = contact.contact(("metal2","via2","metal3"))
# metal spacing to allow contacts on any layer # metal spacing to allow contacts on any layer
self.input_spacing = max(self.poly_space + poly_contact.first_layer_width, self.input_spacing = max(self.poly_space + contact.poly.first_layer_width,
self.m1_space + m1m2_via.first_layer_width, self.m1_space + contact.m1m2.first_layer_width,
self.m2_space + m2m3_via.first_layer_width, self.m2_space + contact.m2m3.first_layer_width,
self.m3_space + m2m3_via.second_layer_width) self.m3_space + contact.m2m3.second_layer_width)
# Compute the other pmos2 location, but determining offset to overlap the # Compute the other pmos2 location, but determining offset to overlap the
# source and drain pins # source and drain pins

View File

@ -2,9 +2,9 @@ import design
import debug import debug
from tech import drc, spice from tech import drc, spice
from vector import vector from vector import vector
from contact import contact
from globals import OPTS from globals import OPTS
import path import path
from sram_factory import factory
class ptx(design.design): class ptx(design.design):
""" """
@ -97,8 +97,9 @@ class ptx(design.design):
# This is not actually instantiated but used for calculations # This is not actually instantiated but used for calculations
self.active_contact = contact(layer_stack=("active", "contact", "metal1"), self.active_contact = factory.create(module_type="contact",
dimensions=(1, self.num_contacts)) layer_stack=("active", "contact", "metal1"),
dimensions=(1, self.num_contacts))
# The contacted poly pitch (or uncontacted in an odd technology) # The contacted poly pitch (or uncontacted in an odd technology)