Exemple #1
0
    def make_tdb(self, layermap=''):
        """
        Makes a new TemplateDB object. If no routing grid parameters are sent in, dummy parameters are used.
        """
        self.impl_lib = self.specs['impl_lib']
        if 'routing_grid' in self.specs:
            layers = self.specs['routing_grid']['layers']
            spaces = self.specs['routing_grid']['spaces']
            widths = self.specs['routing_grid']['widths']
            bot_dir = self.specs['routing_grid']['bot_dir']
        else:
            # Use dummy routing grid settings
            layers = [1, 2, 3, 4, 5]
            spaces = [0.1, 0.1, 0.1, 0.1, 0.2]
            widths = [0.1, 0.1, 0.1, 0.1, 0.2]
            bot_dir = 'y'

        routing_grid = RoutingGrid(self.prj.tech_info, layers, spaces, widths,
                                   bot_dir)
        self.tdb = TemplateDB('template_libs.def',
                              routing_grid,
                              self.impl_lib,
                              use_cybagoa=True,
                              name_prefix=self.specs.get('name_prefix', ''),
                              name_suffix=self.specs.get('name_suffix', ''),
                              prj=self.prj,
                              gds_lay_file=layermap)
Exemple #2
0
    def __init__(self, bprj: BagProject, spec_file: str = '',
                 spec_dict: Optional[Mapping[str, Any]] = None,
                 sch_db: Optional[ModuleDB] = None, lay_db: Optional[TemplateDB] = None,
                 extract: bool = False) -> None:
        if spec_dict:
            params = spec_dict
        else:
            params = read_yaml(spec_file)

        self.params = cast(Dict[str, Any], params)

        self._root_dir = Path(self.params['root_dir']).resolve()

        self._prj = bprj

        if sch_db is None:
            self._sch_db = ModuleDB(bprj.tech_info, self.params['impl_lib'], prj=bprj)
        else:
            self._sch_db = sch_db

        if lay_db is None:
            self._lay_db = TemplateDB(bprj.grid, self.params['impl_lib'], prj=bprj)
        else:
            self._lay_db = lay_db

        self.extract = extract
        self.data = {}  # a dictionary to access package resources
        self.designed_params = {}  # the parameters after design has been done
        self.designed_performance = {}  # the performance metrics that designed params satisfy
Exemple #3
0
def make_tdb(prj, target_lib):
    layers = [3, 4, 5, 6, 7, 8, 9, 10]
    spaces = [0.1, 0.1, 0.2, 0.2, 0.2, 0.2, 0.4, 0.4]
    widths = [0.1, 0.1, 0.2, 0.2, 0.2, 0.2, 0.4, 0.4]
    bot_dir = 'y'

    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
Exemple #4
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
Exemple #5
0
def make_tdb(prj, specs, impl_lib):
    grid_specs = specs['routing_grid']
    layers = grid_specs['layers']
    spaces = grid_specs['spaces']
    widths = grid_specs['widths']
    bot_dir = grid_specs['bot_dir']

    # create RoutingGrid object
    routing_grid = RoutingGrid(prj.tech_info, layers, spaces, widths, bot_dir)
    # create layout template database
    tdb = TemplateDB('template_libs.def', routing_grid, impl_lib, use_cybagoa=True)
    return tdb
Exemple #6
0
def run_main(prj: BagProject, gen_sch: bool = True, gen_cdl: bool = True, run_lvs: bool = True) \
        -> None:
    lib_name = 'AAA_XBASE_TEST'
    fname = '00_mom_cap.yaml'

    impl_cell = 'MOMCap_core'
    fname_cdl = 'pvs_run/lvs_run_dir/' + lib_name + '/' + impl_cell + '/schematic.net'

    params = read_yaml(Path('specs_test', 'xbase', fname))

    db = TemplateDB(prj.grid, lib_name, prj=prj)

    print('creating new template')
    master = db.new_template(MOMCapCore, params)
    print('creating batch layout')
    # db.batch_layout([(master, '')], DesignOutput.LAYOUT)
    db.batch_layout([(master, impl_cell)], DesignOutput.LAYOUT)
    print('done')

    if gen_sch or gen_cdl:
        sch_db = ModuleDB(prj.tech_info, lib_name, prj=prj)

        sch_master = sch_db.new_master(xbase__momcap_core, master.sch_params)
        cv_info_list = []

        print('creating schematic')
        sch_db.batch_schematic([(sch_master, impl_cell)],
                               cv_info_out=cv_info_list)
        print('schematic creation done')

        if gen_cdl:
            print('creating CDL netlist')
            sch_db.batch_schematic([(sch_master, impl_cell)],
                                   output=DesignOutput.CDL,
                                   fname=fname_cdl,
                                   cv_info_list=cv_info_list)
            print('netlist creation done')

    if run_lvs:
        print('Running LVS ...')
        lvs_passed, lvs_log = prj.run_lvs(lib_name,
                                          impl_cell,
                                          netlist=fname_cdl)
        print('LVS log file:' + lvs_log)
        if lvs_passed:
            print('LVS passed!')
        else:
            print('LVS failed :(')
Exemple #7
0
def run_main(prj: BagProject, idx: int) -> None:
    lib_name = 'AAA_XBASE_TEST'
    specs_root = Path('specs_test', 'xbase_test')

    db = TemplateDB(prj.grid, lib_name, prj=prj)
    lay_list = []
    test_dict = get_test_dict(specs_root)
    if idx < 0:
        for i in sorted(test_dict.keys()):
            run_test(db, lay_list, test_dict[i])
    else:
        run_test(db, lay_list, test_dict[idx])

    print('batch layout')
    db.batch_layout(lay_list, DesignOutput.LAYOUT)
    print('done')
Exemple #8
0
def make_tdb(prj, impl_lib, grid_opts):
    """
        make layout database.
    """

    layers = grid_opts['layers']
    widths = grid_opts['widths']
    spaces = grid_opts['spaces']
    bot_dir = grid_opts['bot_dir']
    width_override = grid_opts.get('width_override', None)

    routing_grid = RoutingGrid(prj.tech_info,
                               layers,
                               spaces,
                               widths,
                               bot_dir,
                               width_override=width_override)
    tdb = TemplateDB('template_libs.def',
                     routing_grid,
                     impl_lib,
                     use_cybagoa=True)

    return tdb
Exemple #9
0
    template.write_summary_file('%s.yaml' % cell_name, impl_lib, cell_name)


if __name__ == '__main__':

    local_dict = locals()
    if 'bprj' not in local_dict:
        print('creating BAG project')
        bprj = bag.BagProject()
        temp = 70.0
        layers = [3, 4, 5, 6]
        spaces = [0.058, 0.04, 0.04, 0.112]
        widths = [0.032, 0.04, 0.04, 0.080]
        bot_dir = 'y'
        #layers = [3, 4, 5, 6]
        #spaces = [0.052, 0.040, 0.044, 0.096]
        #widths = [0.032, 0.040, 0.040, 0.064]
        #bot_dir = 'y'
        width_override = {
            4: {2: 0.120},
            5: {2: 0.120}
        }

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

        tdb = TemplateDB('template_libs.def', routing_grid, impl_lib, use_cybagoa=True)

        latch_adc(bprj, tdb)
    else:
        print('loading BAG project')
Exemple #10
0
def temp_db(routing_grid):
    return TemplateDB(routing_grid, 'PYTEST')