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
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
def get_master(temp_db: TemplateDB, lay_design_params: Dict[str, Any]) -> TemplateBase: module_name = lay_design_params['module'] cls_name = lay_design_params['class'] params = lay_design_params['params'] try: lay_module = importlib.import_module(module_name) except ImportError: raise ImportError( 'Cannot find Python module {} for layout generator. ' 'Is it on your PYTHONPATH?'.format(module_name)) if not hasattr(lay_module, cls_name): raise ImportError('Cannot find layout generator class {} ' 'in module {}'.format(cls_name, module_name)) gen_cls = cast(Type[TemplateType], getattr(lay_module, cls_name)) ans = temp_db.new_master(gen_cls, params=params) return ans
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
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
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')
def temp_db(routing_grid): return TemplateDB(routing_grid, 'PYTEST')