#laygen.pin_from_rect('RST2', laygen.layers['pin'][3], rrstv0, gridname=rg_m3m4, netname='RST')
    laygen.pin_from_rect('RST2', laygen.layers['pin'][3], rrstv1, gridname=rg_m3m4, netname='RST')
    laygen.create_boundary_pin_form_rect(rextsel0, rg_m3m4, "EXTSEL", laygen.layers['pin'][4], size=6, direction='left')
    laygen.pin_from_rect('EXTSEL2', laygen.layers['pin'][3], rextselv0, gridname=rg_m3m4, netname='EXTSEL')
    laygen.create_boundary_pin_form_rect(rext_zpb0, rg_m3m4, "EXT_ZPB", laygen.layers['pin'][4], size=4, direction='left')
    laygen.create_boundary_pin_form_rect(rext_zmb0, rg_m3m4, "EXT_ZMB", laygen.layers['pin'][4], size=4, direction='left')
    laygen.create_boundary_pin_form_rect(rext_zmidb0, rg_m3m4, "EXT_ZMIDB", laygen.layers['pin'][4], size=4, direction='left')
    laygen.create_boundary_pin_form_rect(rzp0, rg_m3m4, "ZP", laygen.layers['pin'][4], size=6, direction='right')
    laygen.create_boundary_pin_form_rect(rzm0, rg_m3m4, "ZM", laygen.layers['pin'][4], size=6, direction='right')
    laygen.create_boundary_pin_form_rect(rzmid0, rg_m3m4, "ZMID", laygen.layers['pin'][4], size=6, direction='right')

    # power pin
    create_power_pin_from_inst(laygen, layer=laygen.layers['pin'][2], gridname=rg_m1m2, inst_left=isaopb0, inst_right=izmid0)

if __name__ == '__main__':
    laygen = laygo.GridLayoutGenerator(config_file="laygo_config.yaml")

    import imp
    try:
        imp.find_module('bag')
        laygen.use_phantom = False
    except ImportError:
        laygen.use_phantom = True

    tech=laygen.tech
    utemplib = tech+'_microtemplates_dense'
    logictemplib = tech+'_logic_templates'
    laygen.load_template(filename=tech+'_microtemplates_dense_templates.yaml', libname=utemplib)
    laygen.load_grid(filename=tech+'_microtemplates_dense_grids.yaml', libname=utemplib)
    laygen.load_template(filename=logictemplib+'.yaml', libname=logictemplib)
    laygen.templates.sel_library(utemplib)
Ejemplo n.º 2
0
            y_ser += size_ser2to1[1]


if __name__ == '__main__':
    import os.path
    with open("laygo_config.yaml", 'r') as stream:
        techdict = yaml.load(stream)
        tech = techdict['tech_lib']
        metal = techdict['metal_layers']
        pin = techdict['pin_layers']
        text = techdict['text_layer']
        prbnd = techdict['prboundary_layer']
        res = techdict['physical_resolution']
        print(tech + " loaded sucessfully")

    laygen = laygo.GridLayoutGenerator(physical_res=res)
    laygen.layers['metal'] = metal
    laygen.layers['pin'] = pin
    laygen.layers['prbnd'] = prbnd

    import imp
    try:
        imp.find_module('bag')
        laygen.use_phantom = False
    except ImportError:
        laygen.use_phantom = True

    utemplib = tech + '_microtemplates_dense'
    logictemplib = tech + '_logic_templates'
    laygen.load_template(filename=utemplib + '_templates.yaml',
                         libname=utemplib)
Ejemplo n.º 3
0
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
########################################################################################################################
"""Lab2: generate layout on abstract grid
   1. Copy this file to working directory
   2. For GDS export, prepare a layermap file
"""
import laygo
#import logging; logging.basicConfig(level=logging.DEBUG)

laygen = laygo.GridLayoutGenerator(
    config_file="laygo_config.yaml")  #change physical grid resolution
workinglib = 'laygo_working'
utemplib = laygen.tech + '_microtemplates_dense'
if laygen.tech == 'laygo10n' or laygen.tech == 'layge_faketech':  #fake technology
    laygen.use_phantom = True

laygen.add_library(workinglib)
laygen.sel_library(workinglib)

#bag import, if bag does not exist, gds import
import imp
try:
    imp.find_module('bag')
    #bag import
    print("import from BAG")
    import bag
Ejemplo n.º 4
0
        ['metal3', 'pin'],
        ['metal4', 'pin'],
        ['metal5', 'pin'],
        ['metal6', 'pin'],
        ['metal7', 'pin'],
        ['metal8', 'pin'],
        ['metal9', 'pin'],
    ]
    text = ['text', 'drawing']
    prbnd = ['prBoundary', 'drawing']
    res = 0.0025

workinglib = 'laygo_working'
utemplib = tech + '_microtemplates_dense'

laygen = laygo.GridLayoutGenerator(
    physical_res=res)  #change physical grid resolution
laygen.layers['metal'] = metal
laygen.layers['pin'] = pin
laygen.layers['prbnd'] = prbnd
if tech == 'laygo10n':  #fake technology
    laygen.use_phantom = True

laygen.add_library(workinglib)
laygen.sel_library(workinglib)

#bag import, if bag does not exist, gds import
import imp
try:
    imp.find_module('bag')
    #bag import
    print("import from BAG")
Ejemplo n.º 5
0
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
########################################################################################################################

"""Logic layout demo
"""
if __name__ == '__main__':
    import laygo
    import numpy as np

    # initialize #######################################################################################################
    import imp
    try:
        imp.find_module('bag')
        lib_path = ''
        laygen = laygo.GridLayoutGenerator(config_file=lib_path+"laygo_config.yaml")
        use_phantom = False
    except ImportError:
        # if bag does not exist, load faketech lib and export phantom to gds
        lib_path = '../../labs/'
        use_phantom = True
    laygen = laygo.GridLayoutGenerator(config_file=lib_path + "laygo_config.yaml")
    laygen.use_phantom = use_phantom

    # template and grid load
    utemplib = laygen.tech + '_microtemplates_dense'  # device template library name
    laygen.load_template(filename=lib_path + utemplib + '_templates.yaml', libname=utemplib)
    laygen.load_grid(filename=lib_path + utemplib + '_grids.yaml', libname=utemplib)
    laygen.templates.sel_library(utemplib)
    laygen.grids.sel_library(utemplib)