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)
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) cProfile.runctx( 'temp_db.new_template(params=layout_params, temp_cls=NPassGateWClk, debug=False)', globals(), locals(), filename='passgate_stats.data') temp = temp_db.new_template(params=layout_params, temp_cls=NPassGateWClk, debug=False) temp_db.batch_layout(prj, [temp], [cell_name], debug=True) #temp.write_summary_file('%s.yaml' % cell_name, impl_lib, cell_name) temp.write_summary_file('adc_sampler_ec.yaml', impl_lib, cell_name) ''' #lvs print('running lvs') lvs_passed, lvs_log = prj.run_lvs(impl_lib, cell_name) if not lvs_passed: raise Exception('oops lvs died. See LVS log file %s' % lvs_log) print('lvs passed') '''