Beispiel #1
0
    def __init__(self, fin_u, fin, finDummy, gate, gateDummy, pdkfile=pdkfile):

        p = Pdk().load(pdkfile)
        super().__init__(p)
        assert 3 * p['Fin']['Pitch'] < 2 * p['M2']['Pitch']

        ######### Derived Parameters ############
        self.gatesPerUnitCell = gate + 2 * gateDummy
        self.finsPerUnitCell = fin + 2 * finDummy
        # Should be a multiple of 4 for maximum utilization
        assert self.finsPerUnitCell % 4 == 0
        assert fin >= fin_u, "number of fins in the transistor is greater than unit cell fins"
        assert fin_u > 3, "number of fins in the transistor must be more than 2"
        assert finDummy % 2 == 0
        assert gateDummy > 0
        self.m2PerUnitCell = self.finsPerUnitCell // 2 + 0
        self.unitCellHeight = self.m2PerUnitCell * p['M2']['Pitch']
        unitCellLength = self.gatesPerUnitCell * p['Poly']['Pitch']
        activeWidth1 = p['Fin']['Pitch'] * fin_u
        activeWidth = p['Fin']['Pitch'] * fin
        activeOffset = activeWidth // 2 + finDummy * p['Fin']['Pitch'] - p[
            'Fin']['Pitch'] // 2
        activePitch = self.unitCellHeight
        RVTWidth = activeWidth1 + 2 * p['Feol']['active_enclosure']

        self.m0 = self.addGen(
            Wire('m0',
                 'M0',
                 'v',
                 clg=UncoloredCenterLineGrid(pitch=p['Feol']['m0Pitch'],
                                             width=p['Feol']['m0Width'],
                                             offset=p['Feol']['m0Pitch'] // 2),
                 spg=EnclosureGrid(pitch=activePitch,
                                   offset=activeOffset,
                                   stoppoint=activeWidth // 2,
                                   check=True)))

        self.pl = self.addGen(
            Wire('pl',
                 'poly',
                 'v',
                 clg=UncoloredCenterLineGrid(pitch=p['Poly']['Pitch'],
                                             width=p['Poly']['Width'],
                                             offset=p['Poly']['Offset']),
                 spg=SingleGrid(offset=p['M2']['Offset'],
                                pitch=self.unitCellHeight)))

        self.fin = self.addGen(
            Wire('fin',
                 'fin',
                 'h',
                 clg=UncoloredCenterLineGrid(pitch=p['Fin']['Pitch'],
                                             width=p['Fin']['Width'],
                                             offset=p['Fin']['Offset']),
                 spg=SingleGrid(offset=0, pitch=unitCellLength)))

        stoppoint = (gateDummy - 1) * p['Poly']['Pitch'] + p['Poly']['Offset']
        self.active = self.addGen(
            Wire('active',
                 'active',
                 'h',
                 clg=UncoloredCenterLineGrid(pitch=activePitch,
                                             width=activeWidth1,
                                             offset=activeOffset),
                 spg=EnclosureGrid(pitch=unitCellLength,
                                   offset=0,
                                   stoppoint=stoppoint,
                                   check=True)))

        self.RVT = self.addGen(
            Wire('RVT',
                 'polycon',
                 'h',
                 clg=UncoloredCenterLineGrid(pitch=activePitch,
                                             width=RVTWidth,
                                             offset=activeOffset),
                 spg=EnclosureGrid(pitch=unitCellLength,
                                   offset=0,
                                   stoppoint=stoppoint,
                                   check=True)))

        self.nselect = self.addGen(
            Region('nselect',
                   'nselect',
                   v_grid=CenteredGrid(offset=p['Poly']['Pitch'] // 2,
                                       pitch=p['Poly']['Pitch']),
                   h_grid=self.fin.clg))
        self.pselect = self.addGen(
            Region('pselect',
                   'pselect',
                   v_grid=CenteredGrid(offset=p['Poly']['Pitch'] // 2,
                                       pitch=p['Poly']['Pitch']),
                   h_grid=self.fin.clg))
        self.nwell = self.addGen(
            Region('nwell',
                   'nwell',
                   v_grid=CenteredGrid(offset=p['Poly']['Pitch'] // 2,
                                       pitch=p['Poly']['Pitch']),
                   h_grid=self.fin.clg))

        self.v0 = self.addGen(
            Via('v0', 'V0', h_clg=CenterLineGrid(), v_clg=self.m1.clg))

        self.v0.h_clg.addCenterLine(0, p['V0']['WidthY'], False)
        for i in range(
                max(activeWidth1 // (2 * p['M2']['Pitch']), 1) +
            ((fin - fin_u) // 2 + finDummy + 1) // 2):
            self.v0.h_clg.addCenterLine(
                (i - 1 + fin_u // fin) * 3 * p['Fin']['Pitch'],
                p['V0']['WidthY'], True)
        self.v0.h_clg.addCenterLine(self.unitCellHeight, p['V0']['WidthY'],
                                    False)
Beispiel #2
0
    def __init__(self):
        super().__init__()

        self.m1Pitch = 64
        self.m1Width = 32
        self.m2Pitch_narrow = 64
        self.m2Pitch_standard = 84
        self.m2Width = 32
        self.m3Pitch = 64
        self.m3Width = 32

        self.v1_xenclosure = 20
        self.v1_yenclosure = 20

        self.v2_xenclosure = 20
        self.v2_yenclosure = 20

        self.m1 = self.addGen(
            Wire('m1',
                 'M1',
                 'v',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=self.m1Pitch,
                                           width=self.m1Width),
                 spg=EnclosureGrid(pitch=self.m2Pitch_standard,
                                   stoppoint=self.v1_yenclosure +
                                   self.m2Width // 2,
                                   check=True)))

        self.m2 = self.addGen(
            Wire('m2',
                 'M2',
                 'h',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=self.m2Pitch_standard,
                                           width=self.m2Width),
                 spg=EnclosureGrid(pitch=self.m1Pitch,
                                   stoppoint=self.v1_xenclosure +
                                   self.m1Width // 2,
                                   check=False)))

        self.m2n = self.addGen(
            Wire('m2n',
                 'M2',
                 'h',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=self.m2Pitch_narrow,
                                           width=self.m2Width),
                 spg=EnclosureGrid(pitch=self.m1Pitch,
                                   stoppoint=self.v1_xenclosure +
                                   self.m1Width // 2)))

        self.m3 = self.addGen(
            Wire('m3',
                 'M3',
                 'v',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=self.m3Pitch,
                                           width=self.m3Width),
                 spg=EnclosureGrid(pitch=self.m2Pitch_standard,
                                   stoppoint=self.v2_yenclosure +
                                   self.m2Width // 2,
                                   check=True)))

        self.boundary = self.addGen(
            Region('nwell', 'nwell', h_grid=self.m2.clg, v_grid=self.m1.clg))

        self.v1 = self.addGen(
            Via('v1', 'via1', h_clg=self.m2.clg, v_clg=self.m1.clg))
        self.v2 = self.addGen(
            Via('v2', 'via2', h_clg=self.m2.clg, v_clg=self.m3.clg))
Beispiel #3
0
    def __init__( self, fin_u, fin, finDummy, gate, gateDummy):
        p = Pdk().load('../PDK_Abstraction/FinFET14nm_Mock_PDK/FinFET_Mock_PDK_Abstraction.json')
        super().__init__(p)
        assert   3*p['Fin']['Pitch'] < 2*p['M2']['Pitch']

######### Derived Parameters ############
        self.gatesPerUnitCell = gate + 2*gateDummy
        self.finsPerUnitCell = fin + 2*finDummy
        # Must be a multiple of 2
        assert self.finsPerUnitCell % 2 == 0
        assert finDummy % 2 == 0
        assert gateDummy > 0
        # Should be a multiple of 4 for maximum utilization
        assert self.finsPerUnitCell % 4 == 0
        self.m2PerUnitCell = self.finsPerUnitCell//2 + 0
        self.unitCellHeight = self.m2PerUnitCell* p['M2']['Pitch']
        unitCellLength = self.gatesPerUnitCell* p['Poly']['Pitch']
        activeWidth =  p['Fin']['Pitch']*fin
        activeOffset = activeWidth//2 + finDummy* p['Fin']['Pitch']-p['M2']['Pitch']//2+p['Fin']['Offset']
        activePitch = self.unitCellHeight
        RVTPitch = activePitch
        RVTWidth = activeWidth + 2*p['Feol']['active_enclosure']
        RVTOffset = RVTWidth//2 + finDummy* p['Fin']['Pitch']-p['Fin']['Pitch']//2-p['Feol']['active_enclosure']+p['Fin']['Offset']

############Include these all ###########

        self.m0 = self.addGen( Wire( 'm0', 'M0', 'v',
                                     clg=UncoloredCenterLineGrid( pitch=   p['Feol']['m0Pitch'], width= p['Feol']['m0Width'], offset= p['Feol']['m0Pitch']//2),
                                     spg=EnclosureGrid( pitch=activePitch, offset=activeOffset, stoppoint=activeWidth//2, check=True)))

        self.pl = self.addGen( Wire( 'pl', 'poly', 'v',
                                     clg=UncoloredCenterLineGrid( pitch= p['Poly']['Pitch'], width= p['Poly']['Width'], offset= p['Poly']['Offset']),
                                     spg=SingleGrid( offset= p['M2']['Offset'], pitch=self.unitCellHeight)))


        self.fin = self.addGen( Wire( 'fin', 'fin', 'h',
                                      clg=UncoloredCenterLineGrid( pitch= p['Fin']['Pitch'], width= p['Fin']['Width'], offset= p['Fin']['Offset']),
                                      spg=SingleGrid( offset=0, pitch=unitCellLength)))

        stoppoint = (gateDummy-1)* p['Poly']['Pitch'] +  p['Poly']['Offset']

        self.active = self.addGen( Wire( 'active', 'active', 'h',
                                         clg=UncoloredCenterLineGrid( pitch=activePitch, width=activeWidth, offset=activeOffset),
                                         spg=EnclosureGrid( pitch=unitCellLength, offset=0, stoppoint=stoppoint, check=True)))

        self.RVT = self.addGen( Wire( 'RVT', 'polycon', 'h',
                                      clg=UncoloredCenterLineGrid( pitch=RVTPitch, width=RVTWidth, offset=RVTOffset),
                                      spg=EnclosureGrid( pitch=unitCellLength, offset=0, stoppoint=stoppoint, check=True)))

        self.nselect = self.addGen( Region( 'nselect', 'nselect',
                                            v_grid=CenteredGrid( offset= p['Poly']['Pitch']//2, pitch= p['Poly']['Pitch']),
                                            h_grid=self.fin.clg))
        self.pselect = self.addGen( Region( 'pselect', 'pselect',
                                            v_grid=CenteredGrid( offset= p['Poly']['Pitch']//2, pitch= p['Poly']['Pitch']),
                                            h_grid=self.fin.clg))
        self.nwell = self.addGen( Region( 'nwell', 'nwell',
                                            v_grid=CenteredGrid( offset= p['Poly']['Pitch']//2, pitch= p['Poly']['Pitch']),
                                            h_grid=self.fin.clg))

        v0x_offset =  p['M2']['Offset'] + (1+finDummy//2)* p['M2']['Pitch']

        self.v0 = self.addGen( Via( 'v0', 'V0',
                                    h_clg=CenterLineGrid(),
                                    v_clg=self.m1.clg))

        self.v0.h_clg.addCenterLine( 0,                 p['V0']['WidthY'], False)
        for i in range(activeWidth//(2* p['M2']['Pitch'])):
            self.v0.h_clg.addCenterLine( v0x_offset+i*  3*p['Fin']['Pitch'],    p['V0']['WidthY'], True)
        self.v0.h_clg.addCenterLine( self.unitCellHeight,    p['V0']['WidthY'], False)
Beispiel #4
0
    def __init__( self):
        super().__init__()

        self.finsPerUnitCell = 14
        self.m2PerUnitCell = 7

        ndPitch = 360
        pdPitch = 360

        m2Pitch = 720 

        self.unitCellHeight = self.m2PerUnitCell*m2Pitch


        pcPitch  = self.unitCellHeight//2
        m1Pitch  = 864
        m1hPitch  = m2Pitch
        m3Pitch  = 720 
        self.unitCellWidth = 2*m1Pitch

        plPitch  = m1Pitch
        plOffset = plPitch//2
        dcPitch  = m1Pitch

        pcWidth = 200
        m1Width = 400
        m2Width = 400
        m3Width = 400
        dcWidth = 200
        plWidth = 200

        ndWidth = 120
        ndPitch = 360

        self.pl = self.addGen( Wire( 'pl', 'poly', 'v',
                                     clg=CenterLineGrid(),
                                     spg=EnclosureGrid( pitch=m2Pitch//2, stoppoint=16)))
        for i in range(5):
            self.pl.clg.addCenterLine( i*plPitch//2, plWidth, i % 2 == 1)
        self.pl.clg.semantic()

        self.nd = self.addGen( Region( 'nd', 'ndiff',
                                       h_grid=SingleGrid( pitch=ndPitch),
                                       v_grid=self.pl.clg))

        self.pd = self.addGen( Region( 'pd', 'pdiff',
                                       h_grid=SingleGrid( pitch=pdPitch),
                                       v_grid=self.pl.clg))

        self.pc = self.addGen( Wire( 'pc', 'polycon', 'h',
                                     clg=UncoloredCenterLineGrid( width=pcWidth, pitch=pcPitch),
                                     spg=EnclosureGrid( pitch=dcPitch, stoppoint=plOffset-plWidth//2)))

        self.m1 = self.addGen( Wire( 'm1', 'M1', 'v',
                                     clg=UncoloredCenterLineGrid( width=m1Width, pitch=m1Pitch, repeat=2),
                                     spg=EnclosureGrid( pitch=m2Pitch, stoppoint=m2Width//2)))

        self.m2 = self.addGen( Wire( 'm2', 'M2', 'h',
                                     clg=UncoloredCenterLineGrid( width=m2Width, pitch=m2Pitch, repeat=self.m2PerUnitCell),
                                     spg=EnclosureGrid( pitch=2*m1Pitch, stoppoint=m1Pitch//2)))

        self.m3 = self.addGen( Wire( 'm3', 'M3', 'v',
                                     clg=UncoloredCenterLineGrid( width=m3Width, pitch=m3Pitch),
                                     spg=EnclosureGrid( pitch=self.unitCellHeight, stoppoint=self.unitCellHeight//2-m2Pitch)))


        self.dc = self.addGen( Wire( 'dc', 'diffcon', 'v',
                                     clg=CenterLineGrid(),
                                     spg=EnclosureGrid( pitch=m2Pitch//2, stoppoint=0)))

        for i in range(5):
            self.dc.clg.addCenterLine( i*dcPitch//2, dcWidth, i % 2 == 0)
        self.dc.clg.semantic()

        self.v0 = self.addGen( Via( 'v0', 'via0', v_clg=self.m1.clg, h_clg=self.pc.clg))
        self.v1 = self.addGen( Via( 'v1', 'via1', v_clg=self.m1.clg, h_clg=self.m2.clg))
        self.v2 = self.addGen( Via( 'v2', 'via2', v_clg=self.m3.clg, h_clg=self.m2.clg))
Beispiel #5
0
    def __init__(self, x_length, y_length):
        super().__init__()
        p = Pdk().load(pdkfile)

        self.x_number = int(2 * round(
            ((x_length + p['Cap']['m1Pitch'] - p['Cap']['m1Width']) /
             (2.0 * p['Cap']['m1Pitch']))))
        self.y_number = int(2 * round(
            ((y_length + p['Cap']['m2Pitch'] - p['Cap']['m2Width']) /
             (2.0 * p['Cap']['m2Pitch']))))

        self.last_y1_track = ((self.y_number - 1) * p['Cap']['m2Pitch'] +
                              p['M2']['Pitch'] - 1) // p['M2']['Pitch']
        self.last_x_track = self.x_number - 1

        self.m1 = self.addGen(
            Wire('m1',
                 'M1',
                 'v',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=p['Cap']['m1Pitch'],
                                           width=p['Cap']['m1Width']),
                 spg=EnclosureGrid(pitch=p['M2']['Pitch'],
                                   stoppoint=p['V1']['VencA_L'] +
                                   p['Cap']['m2Width'] // 2,
                                   check=True)))

        self.m2 = self.addGen(
            Wire('m2',
                 'M2',
                 'h',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=p['M2']['Pitch'],
                                           width=p['Cap']['m2Width']),
                 spg=EnclosureGrid(pitch=p['Cap']['m1Pitch'],
                                   stoppoint=p['V1']['VencA_H'] +
                                   p['Cap']['m1Width'] // 2,
                                   check=False)))

        self.m2n = self.addGen(
            Wire('m2n',
                 'M2',
                 'h',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=p['Cap']['m2Pitch'],
                                           width=p['Cap']['m2Width']),
                 spg=EnclosureGrid(pitch=p['Cap']['m1Pitch'],
                                   stoppoint=p['V1']['VencA_H'] +
                                   p['Cap']['m1Width'] // 2)))

        self.m3 = self.addGen(
            Wire('m3',
                 'M3',
                 'v',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=p['Cap']['m3Pitch'],
                                           width=p['Cap']['m3Width']),
                 spg=EnclosureGrid(pitch=p['M2']['Pitch'],
                                   stoppoint=p['V2']['VencA_H'] +
                                   p['Cap']['m2Width'] // 2,
                                   check=True)))

        self.boundary = self.addGen(
            Region('boundary',
                   'boundary',
                   h_grid=self.m2.clg,
                   v_grid=self.m1.clg))

        self.v1 = self.addGen(
            Via('v1', 'V1', h_clg=self.m2.clg, v_clg=self.m1.clg))
        self.v2 = self.addGen(
            Via('v2', 'V1', h_clg=self.m2.clg, v_clg=self.m3.clg))
Beispiel #6
0
    def __init__(self, x_number, y_length):
        super().__init__()
        p = Pdk().load(pdkfile)

        ga = 2 if x_number == 1 else 1  ## when number of wires is 2 then large spacing req. so contact can be placed without a DRC error
        self.x_length = (x_number - 1) * ga * p['Cap']['m1Pitch']

        self.y_number = int(2 * round(
            ((y_length + p['Cap']['m2Pitch'] - p['Cap']['m2Width']) /
             (2.0 * p['Cap']['m2Pitch']))))

        self.last_y1_track = ((self.y_number - 1) * p['Cap']['m2Pitch'] +
                              p['M2']['Pitch'] - 1) // p['M2']['Pitch']
        self.last_x_track = x_number - 1

        self.m1 = self.addGen(
            Wire('m1',
                 'M1',
                 'v',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=p['Cap']['m1Pitch'],
                                           width=p['Cap']['m1Width']),
                 spg=EnclosureGrid(pitch=p['M2']['Pitch'],
                                   stoppoint=p['V1']['VencA_L'] +
                                   p['Cap']['m2Width'] // 2,
                                   check=True)))

        self.m1h = self.addGen(
            Wire('m1h',
                 'M1',
                 'h',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=p['M2']['Pitch'],
                                           width=p['Cap']['m1Width']),
                 spg=EnclosureGrid(pitch=p['Cap']['m1Pitch'],
                                   stoppoint=p['Cap']['m1Width'] // 2,
                                   check=False)))

        self.m2 = self.addGen(
            Wire('m2',
                 'M2',
                 'h',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=p['M2']['Pitch'],
                                           width=p['Cap']['m2Width']),
                 spg=EnclosureGrid(pitch=p['Cap']['m1Pitch'],
                                   stoppoint=p['V1']['VencA_H'] +
                                   p['Cap']['m1Width'] // 2,
                                   check=False)))

        self.m2n = self.addGen(
            Wire('m2n',
                 'M2',
                 'h',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=p['Cap']['m2Pitch'],
                                           width=p['Cap']['m2Width']),
                 spg=EnclosureGrid(pitch=p['Cap']['m1Pitch'],
                                   stoppoint=p['V1']['VencA_H'] +
                                   p['Cap']['m1Width'] // 2)))

        self.m3 = self.addGen(
            Wire('m3',
                 'M3',
                 'v',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=p['Cap']['m3Pitch'],
                                           width=p['Cap']['m3Width']),
                 spg=EnclosureGrid(pitch=p['M2']['Pitch'],
                                   stoppoint=p['V2']['VencA_H'] +
                                   p['Cap']['m2Width'] // 2,
                                   check=True)))

        self.boundary = self.addGen(
            Region('boundary',
                   'boundary',
                   h_grid=self.m2.clg,
                   v_grid=self.m1.clg))
        self.v1 = self.addGen(
            Via('v1', 'V1', h_clg=self.m2.clg, v_clg=self.m1.clg))
        self.v2 = self.addGen(
            Via('v2', 'V2', h_clg=self.m2.clg, v_clg=self.m3.clg))
Beispiel #7
0
    def __init__(self, gate_u, fin_u, fin_u1):
        super().__init__()

        ##### PDK Abstraction   #####

        self.plPitch = 80  ### Use from DRM
        self.plWidth = 14
        self.finPitch = 42  ### finPitch from DRM
        self.finWidth = 10
        self.m0Pitch = self.plPitch
        self.m0Width = 34
        self.m1Pitch = self.plPitch  ### Distance between Source and Drain
        self.m1Width = 32
        self.m2Pitch = 84  ### Can be directly used from DRM (usually twice of the fin pitch)
        self.m2Width = 32
        self.m3Pitch = self.plPitch  ### Use same as for m1
        self.m3Width = 32
        self.v0Pitch = 3 * self.finPitch  ### V0 spacing rule
        self.v0Width = 32

        self.plActive_s = 73  ### Active horizontal extension over the Gate
        self.plActive = 7
        self.v_enclosure = 20
        self.fin_enclosure = (self.finPitch -
                              self.finWidth) // 2  ### Fin enclosure by active
        self.active_enclosure = 42

        self.finOffset = 0
        self.plOffset = 0

        self.finDummy = 5  ### Number of dummy fins
        self.gateDummy = 3  ### Number of dummy gates
        self.gate = int(
            round(gate_u + 2 *
                  self.gateDummy))  #### Total number of gates per unit cell
        self.extension_x = (
            self.plPitch - self.plWidth
        ) // 2  ### Minimum horizontal extension of GCUT past GATE
        self.activeWidth = self.finPitch * fin_u1
        self.activeWidth_h = (
            (gate_u - 1) * self.plPitch) + (self.plActive_s * 2) + self.plWidth
        self.activePitch = self.finPitch * (fin_u + 2 * self.finDummy)
        self.activeOffset = (
            self.activeWidth // 2
        ) + self.finDummy * self.finPitch - self.fin_enclosure - self.finWidth // 2 + self.finOffset
        self.RVTWidth = self.activeWidth + 2 * self.active_enclosure
        self.RVTPitch = self.activePitch
        self.RVTOffset = (
            self.RVTWidth // 2
        ) + self.finDummy * self.finPitch - self.fin_enclosure - self.active_enclosure - self.finWidth // 2 + self.finOffset

        self.m0 = self.addGen(
            Wire('m0',
                 'M0',
                 'v',
                 clg=UncoloredCenterLineGrid(pitch=self.m0Pitch,
                                             width=self.m0Width,
                                             offset=self.m0Pitch // 2),
                 spg=EnclosureGrid(pitch=self.activePitch,
                                   offset=self.activeOffset,
                                   stoppoint=self.activeWidth // 2,
                                   check=True)))

        self.m1 = self.addGen(
            Wire('m1',
                 'M1',
                 'v',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=self.m1Pitch,
                                           width=self.m1Width,
                                           offset=self.m1Pitch // 2),
                 spg=EnclosureGrid(pitch=self.m2Pitch,
                                   offset=self.m2Pitch // 2,
                                   stoppoint=self.m2Width // 2 +
                                   self.v_enclosure,
                                   check=True)))

        self.m2 = self.addGen(
            Wire('m2',
                 'M2',
                 'h',
                 clg=ColoredCenterLineGrid(colors=['c2', 'c1'],
                                           pitch=self.m2Pitch,
                                           width=self.m2Width,
                                           offset=self.m2Pitch // 2),
                 spg=EnclosureGrid(pitch=self.m1Pitch,
                                   offset=self.m1Pitch // 2,
                                   stoppoint=self.m1Width // 2 +
                                   self.v_enclosure,
                                   check=True)))

        self.m3 = self.addGen(
            Wire('m3',
                 'M3',
                 'v',
                 clg=ColoredCenterLineGrid(colors=['c1', 'c2'],
                                           pitch=self.m3Pitch,
                                           width=self.m3Width,
                                           offset=self.m3Pitch // 2),
                 spg=EnclosureGrid(pitch=self.m2Pitch,
                                   offset=self.m2Pitch // 2,
                                   stoppoint=self.m2Width // 2 +
                                   self.v_enclosure,
                                   check=True)))

        self.pl = self.addGen(
            Wire('pl',
                 'poly',
                 'v',
                 clg=UncoloredCenterLineGrid(pitch=self.plPitch,
                                             width=self.plWidth,
                                             offset=self.plOffset),
                 spg=EnclosureGrid(pitch=self.finPitch,
                                   stoppoint=self.m2Pitch // 2)))

        self.fin = self.addGen(
            Wire('fin',
                 'fin',
                 'h',
                 clg=UncoloredCenterLineGrid(pitch=self.finPitch,
                                             width=self.finWidth,
                                             offset=self.finOffset),
                 spg=CenteredGrid(pitch=self.plPitch)))

        self.active = self.addGen(
            Wire('active',
                 'active',
                 'h',
                 clg=UncoloredCenterLineGrid(pitch=self.activePitch,
                                             width=self.activeWidth,
                                             offset=self.activeOffset),
                 spg=SingleGrid(pitch=self.plPitch)))

        self.RVT = self.addGen(
            Wire('RVT',
                 'polycon',
                 'h',
                 clg=UncoloredCenterLineGrid(pitch=self.RVTPitch,
                                             width=self.RVTWidth,
                                             offset=self.RVTOffset),
                 spg=SingleGrid(pitch=self.plPitch)))

        self.nselect = self.addGen(
            Region('nselect',
                   'nselect',
                   v_grid=CenteredGrid(pitch=self.plPitch),
                   h_grid=self.fin.clg))

        v0x_offset = self.finDummy * self.finPitch - self.fin_enclosure - self.finWidth // 2 + self.finOffset + self.v0Width // 2
        self.v0 = self.addGen(
            Via('v0',
                'via0',
                h_clg=UncoloredCenterLineGrid(pitch=self.v0Pitch,
                                              width=self.v0Width,
                                              offset=v0x_offset),
                v_clg=self.m1.clg))

        self.v1 = self.addGen(
            Via('v1', 'via1', h_clg=self.m2.clg, v_clg=self.m1.clg))

        self.v2 = self.addGen(
            Via('v2', 'via2', h_clg=self.m2.clg, v_clg=self.m3.clg))