def make_tdb(self):
        # type: () -> TemplateDB
        """Create and return a new TemplateDB object.

        Returns
        -------
        tdb : TemplateDB
            the TemplateDB object.
        """
        if self.prj is None:
            raise ValueError('BagProject instance is not given.')

        target_lib = self.specs['impl_lib']
        grid_specs = self.specs['routing_grid']
        layers = grid_specs['layers']
        spaces = grid_specs['spaces']
        widths = grid_specs['widths']
        bot_dir = grid_specs['bot_dir']
        width_override = grid_specs.get('width_override', None)

        routing_grid = RoutingGrid(self.prj.tech_info,
                                   layers,
                                   spaces,
                                   widths,
                                   bot_dir,
                                   width_override=width_override)
        tdb = TemplateDB('', routing_grid, target_lib, use_cybagoa=True)
        return tdb
Ejemplo n.º 2
0
def make_tdb(prj, target_lib, specs):
    grid_specs = specs['routing_grid']
    layers = grid_specs['layers']
    spaces = grid_specs['spaces']
    widths = grid_specs['widths']
    bot_dir = grid_specs['bot_dir']

    routing_grid = RoutingGrid(prj.tech_info, layers, spaces, widths, bot_dir)
    tdb = TemplateDB('template_libs.def', routing_grid, target_lib, use_cybagoa=True)
    return tdb
Ejemplo n.º 3
0
def make_tdb(prj, specs):

    grid_opts = specs['grid_opts'].copy()

    layers = grid_opts['layers']
    spaces = grid_opts['spaces']
    widths = grid_opts['widths']
    bot_dir = grid_opts['bot_dir']

    routing_grid = RoutingGrid(bprj.tech_info, layers, spaces, widths, bot_dir)

    tdb = TemplateDB('template_libs.def', routing_grid, impl_lib)
    return tdb
Ejemplo n.º 4
0
    if run_rcx:
        print('run rcx')
        success, log_fname = prj.run_rcx(impl_lib, cell_name)
        if not success:
            raise ValueError('rcx failed.  Check log file: %s' % log_fname)
        else:
            print('rcx passed')


if __name__ == '__main__':

    local_dict = locals()
    if 'bprj' not in local_dict:
        print('creating BAG project')
        bprj = BagProject()
        temp = 70.0
        layers = [4, 5, 6, 7]
        spaces = [0.084, 0.080, 0.084, 0.080]
        widths = [0.060, 0.100, 0.060, 0.100]
        bot_dir = 'x'

        routing_grid = RoutingGrid(bprj.tech_info, layers, spaces, widths,
                                   bot_dir)

        tdb = TemplateDB('template_libs.def',
                         routing_grid,
                         impl_lib,
                         use_cybagoa=True)
    else:
        print('loading BAG project')
Ejemplo n.º 5
0
def run_main(project):

    layout_params = dict(
        track_width=0.3e-6,
        track_space=0.4e-6,
        ptap_w=0.52e-6,
        ntap_w=0.52e-6,
        vm_layer='M3',
        hm_layer='M4',
        num_track_sep=0,
    )
    rcx_params = {'pexPexGroundNameValue': 'b'}
    impl_lib = 'mos_char_1'

    mos_type_list = ['nch', 'pch']
    l_list = [60e-9]
    w_list = [0.32e-6, 0.72e-6, 1.12e-6, 1.52e-6]
    intent_list = ['lvt', 'standard']
    env_list = ['tt', 'ff', 'ss', 'sf', 'fs', 'ss_hot', 'ff_hot']
    char_freq = 10e3
    vgs_abs = (0.0, 1.2, 41)
    vds_abs = (0.0, 1.2, 21)
    vbs_abs = (0.0, 1.0, 5)
    fg = 10
    fg_dum = 4

    layers = [4, 5, 6]
    spaces = [0.1, 0.1, 0.1]
    widths = [0.1, 0.1, 0.1]
    bot_dir = 'x'
    routing_grid = RoutingGrid(project.tech_info, layers, spaces, widths,
                               bot_dir)
    temp_db = TemplateDB('template_libs.def', routing_grid, impl_lib)

    my_mos_char = AnalogMosCharacterization(project,
                                            os.path.abspath('mos_data'),
                                            impl_lib, 'mos_char',
                                            layout_params)

    sweep_attrs = dict(
        l=l_list,
        w=w_list,
        intent=intent_list,
    )

    for mos_type in mos_type_list:
        if mos_type == 'nch':
            sweep_params = dict(
                vgs=vgs_abs,
                vds=vds_abs,
                vbs=(-vbs_abs[1], -vbs_abs[0], vbs_abs[2]),
            )
        else:
            sweep_params = dict(
                vgs=(-vgs_abs[1], -vgs_abs[0], vgs_abs[2]),
                vds=(-vds_abs[1], -vds_abs[0], vds_abs[2]),
                vbs=vbs_abs,
            )

        constants = dict(
            mos_type=mos_type,
            fg=fg,
            fg_dum=fg_dum,
            char_freq=char_freq,
        )
        my_mos_char.simulate(temp_db,
                             constants,
                             sweep_attrs,
                             sweep_params,
                             env_list,
                             extracted=True,
                             rcx_params=rcx_params)
Ejemplo n.º 6
0
        params['fg_inbuf_list']=[]
        params['fg_outbuf_list']=[]
        for m in sizedict['sarsamp']['m_inbuf_list']:
             params['fg_inbuf_list']+=[(m, m)]
        for m in sizedict['sarsamp']['m_outbuf_list']:
             params['fg_outbuf_list']+=[(m, m)]
        '''

    # template and grid information
    layers = [4, 5, 6, 7]
    spaces = [0.056, 0.100, 0.092, 0.100]
    widths = [0.040, 0.080, 0.100, 0.080]
    bot_dir = 'x'
    routing_grid = RoutingGrid(prj.tech_info, layers, spaces, widths, bot_dir)
    temp_db = TemplateDB('template_libs.def',
                         routing_grid,
                         impl_lib,
                         use_cybagoa=True)

    # create design module and run design method.
    print('designing module')
    dsn = prj.create_design_module(lib_name, cell_name)
    print('design parameters:\n%s' % pprint.pformat(params))
    dsn.design_specs(**params)

    # implement the design
    print('implementing design with library %s' % impl_lib)
    dsn.implement_design(impl_lib, top_cell_name=cell_name, erase=True)

    # generate the layout
    layout_params = dsn.get_layout_params(**layout_params)
    pprint.pprint(layout_params)
Ejemplo n.º 7
0
        sub_type='ptap',
        threshold='ulvt',
        fg=4,
        is_corner=False,
    )

    template = temp_db.new_template(params=layout_params,
                                    temp_cls=AnalogGuardRingTSMC16,
                                    debug=True)
    temp_db.instantiate_layout(prj, template, cell_name, debug=True)


if __name__ == '__main__':

    local_dict = locals()
    if 'bprj' not in local_dict:
        print('creating BAG project')
        bprj = bag.BagProject()
        temp = 70.0
        layers = [4, 5, 6]
        spaces = [0.1, 0.1, 0.1]
        widths = [0.1, 0.1, 0.1]
        bot_dir = 'x'

        routing_grid = RoutingGrid(bprj.tech_info, layers, spaces, widths,
                                   bot_dir)

        tdb = TemplateDB('template_libs.def', routing_grid, impl_lib)
    else:
        print('loading BAG project')
Ejemplo n.º 8
0
import bag
from abs_templates_ec.serdes import DynamicLatchChain
from bag.layout import RoutingGrid, TemplateDB

params = dict(
    lch=60e-9,
    pw=0.72e-6,
    pfg=6,
    nw_list=[0.52e-6, 0.72e-6, 0.52e-6, 0.72e-6],
    nfg_list=[4, 6, 4, 6],
    nduml=3,
    ndumr=3,
    nsep=2,
    input_intent='standard',
    tail_intent='lvt',
    device_intent='lvt',
)

layers = [4, 5, 6]
spaces = [0.2, 0.2, 0.2]
widths = [0.1, 0.1, 0.1]
bot_dir = 'x'

routing_grid = RoutingGrid(prj.tech_info, layers, spaces, widths, bot_dir)

temp_db = TemplateDB('template_libs.def', routing_grid, impl_lib)
template = temp_db.new_template(params=layout_params,
                                temp_cls=DynamicLatchChain,
                                debug=True)
temp_db.instantiate_layout(prj, template, cell_name, debug=True)
Ejemplo n.º 9
0
import bag
from abs_templates_ec.serdes import DynamicLatchChain
from bag.layout import RoutingGrid, TemplateDB

params = dict(
    lch=60e-9,
    pw=0.72e-6,
    pfg=6,
    nw_list=[0.52e-6, 0.72e-6, 0.52e-6, 0.72e-6],
    nfg_list=[4, 6, 4, 6],
    nduml=3,
    ndumr=3,
    nsep=2,
    input_intent='standard',
    tail_intent='lvt',
    device_intent='lvt',
    )

layers = [4, 5, 6]
spaces = [0.2, 0.2, 0.2]
widths = [0.1, 0.1, 0.1]
bot_dir = 'x'

routing_grid = RoutingGrid(prj.tech_info, layers, spaces, widths, bot_dir)

temp_db = TemplateDB('template_libs.def', routing_grid, impl_lib)
template = temp_db.new_template(params=layout_params, temp_cls=DynamicLatchChain, debug=True)
temp_db.instantiate_layout(prj, template, cell_name, debug=True)