def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **kwargs) -> None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self._tech_cls = self.grid.tech_info.tech_params['layout'][ 'mos_tech_class'] self._blk_loc = None
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **kwargs) -> None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self._layout_info = None self._left_edge_info = None self._right_edge_info = None
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **Any) -> None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self._tech_cls = self.grid.tech_info.tech_params['layout'][ 'res_tech_class'] self._well_xl = self.params['layout_info']['well_xl']
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **kwargs) -> None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self._sch_params = None self._ibias_em_specs = None self._in_tid = None
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **Any) -> None self._layout_info = params['res_info'] self._num_tracks = self._layout_info['num_tracks'] self._track_widths = self._layout_info['track_widths'] TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self._tech_cls = self.grid.tech_info.tech_params['layout']['res_tech_class']
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **kwargs) -> None hidden_params = kwargs.pop('hidden_params', {}).copy() hidden_params['digital_edgel'] = None hidden_params['digital_edger'] = None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, hidden_params=hidden_params, **kwargs) # initialize attributes tech_info = temp_db.grid.tech_info self._tech_cls = tech_info.tech_params['layout']['laygo_tech_class'] self._laygo_info = None # type: LaygoBaseInfo self._num_rows = 0 self._row_layout_info = None self._row_height = 0 self._dig_size = None self._ext_params = None self._used_list = None # type: List[LaygoIntvSet] self._ext_end_list = None self._bot_end_master = None self._top_end_master = None self._bot_sub_master = None self._top_sub_master = None self._lr_edge_info = None self._tb_ext_info = None self._ybot = None self._ytop = None self._digital_edgel = None self._digital_edger = None
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # Call TemplateBase's constructor TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self.tech = self.grid.tech_info self._res = .001 # set basic grid size to be 1nm # Create a dictionary that holds all objects required to construct the layout self._db = { 'rect': [], 'via': [], 'prim_via': [], 'instance': [], 'template': [] } # Create an empty database that will store only the relevant layout objects self.loc = {} # Manage the tracks in a track manager self.tracks = TrackManager.from_routing_grid(self.grid) # Pull default layout parameters self.params = self.__class__.get_default_param_values() # Override defaults and add provided parameters for key in params: self.params[key] = params[key] # Set up properties for BAG black-boxing self.temp_boundary = Rectangle(xy=[[0, 0], [.1, .1]], layer='M1', virtual=True) # TODO: Make process agnostic self.prim_bound_box = None self.prim_top_layer = None
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None: TemplateBase.__init__(self, temp_db, params, **kwargs) self.prim_top_layer = self.grid.bot_layer self._corner: Optional[Tuple[int, int]] = None self._edgel = self._edgeb = ImmutableSortedDict()
def __init__( self, temp_db: "PhotonicTemplateDB", lib_name: str, params: Dict[str, Any], used_names: Set[str], **kwargs, ) -> None: use_cybagoa: bool = kwargs.get('use_cybagoa', False) assert isinstance(use_cybagoa, bool) TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) logging.debug(f'Initializing master {self.__class__.__name__}') self._photonic_ports: Dict[str, PhotonicPort] = {} self._layout = PhotonicBagLayout(self._grid, use_cybagoa=use_cybagoa) if temp_db.photonic_tech_info is None: raise ValueError("temp_db.photonic_tech_info was None") self.photonic_tech_info: 'PhotonicTechInfo' = temp_db.photonic_tech_info # Feature flag that when False, prevents users from creating rotated masters that contain other # rotated masters self.allow_rotation_hierarchy = False # This stores the angular offset from the cardinal axes that this master is drawn at self._angle = self.params.get('_angle', 0.0) self._layout.mod_angle = self.angle
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **kwargs) -> None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self._fg_tot = None self._sub_bndx = None self._sub_bndy = None
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None: TemplateBase.__init__(self, temp_db, params, **kwargs) self._left_info: Optional[MOSEdgeInfo] = None self._right_info: Optional[MOSEdgeInfo] = None self._top_info: Optional[BlkExtInfo] = None self._bottom_info: Optional[BlkExtInfo] = None
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None: TemplateBase.__init__(self, temp_db, params, **kwargs) self._left_info: Optional[MOSEdgeInfo] = None self._right_info: Optional[MOSEdgeInfo] = None self._top_info: Optional[BlkExtInfo] = None self._bottom_info: Optional[BlkExtInfo] = None self._shorted_ports: Optional[ImmutableList[MOSPortType]] = None
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **kwargs) -> None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) tech_info = self.grid.tech_info self._tech_cls = tech_info.tech_params['layout'][ 'laygo_tech_class'] # type: LaygoTech self.prim_top_layer = self._tech_cls.get_dig_conn_layer() self._end_info = None
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None: TemplateBase.__init__(self, temp_db, params, **kwargs) # noinspection PyTypeChecker self._arr_info: MOSArrayPlaceInfo = None # noinspection PyTypeChecker self._tinfo_table: TileInfoTable = None # noinspection PyTypeChecker self._used_arr: MOSUsedArray = None
def finalize(self): """ Call the old finalize method, but then also grab the bounding box from the layout content """ TemplateBase.finalize(self) if self._layout._inst_list != [] and self.angle != 0: logging.warning( f"{self.__class__.__name__} requires hierarchical non-cardinal rotation. This feature is " f"currently experimental. Please raise an issue if incorrect results occur" ) self.prim_bound_box = self._layout.bound_box
def create_label(self, label, rect, purpose=None, show=True): if purpose is not None: self.add_rect([rect.layer, purpose], rect.xy) if show is True: TemplateBase.add_label(self, label, rect.layer, rect.to_bbox()) TemplateBase.add_pin_primitive(self, net_name=label, layer=rect.layer, bbox=rect.to_bbox(), show=False)
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **kwargs) -> None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self._sch_params = None self._in_tr_info = None self._out_tr_info = None self._data_tr_info = None self._div_tr_info = None self._sum_row_info = None self._lat_row_info = None self._blockage_intvs = None
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **kwargs) -> None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self._sch_params = None self._x_tapx = None self._x_tap1 = None self._num_dfe = None self._num_ffe = None self._blockage_intvs = None self._sup_y_list = None self._buf_locs = None self._retime_ncol = None self._en_div_tidx = None
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **kwargs) -> None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self._sch_params = None self._fg_tot = None self._fg_core = None self._en_locs = None self._data_tr_info = None self._div_tr_info = None self._sum_row_info = None self._lat_row_info = None self._left_edge_info = None self._div_grp_loc = None
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **kwargs) -> None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self._layout_info = None self._ext_top_info = None self._ext_bot_info = None self._left_edge_info = None self._right_edge_info = None self._g_conn_y = None self._d_conn_y = None self._od_y = None self._po_y = None self._sd_yc = None
def _commit_inst(self) -> None: """ Takes in all inst in the db and creates standard BAG equivalents """ for inst in self._db['instance']: # Get the boundary of the instance try: bound = inst.master.temp_boundary.shift_origin(origin=inst.origin, orient=inst.orient) except AttributeError: # TODO: Get the size properly bound = Rectangle(xy=[[0, 0], [.1, .1]], layer='M1', virtual=True) self.temp_boundary = self.temp_boundary.get_enclosure(bound) TemplateBase.add_instance(self, inst.master, inst_name=inst.inst_name, loc=inst.origin, orient=inst.orient)
def new_template_with(self, angle=0.0, **kwargs): """ Create a new template with the given parameters This method will update the parameter values with the given kwargs, then create a new template with those parameters and return it. This procedure also takes on the angle provided by the caller. Unlike self.new_template the masters initial angle is completely ignored. This method should only be called by PhotonicInstance Parameters ---------- angle : float angle in radians fo the rotation to be performed kwargs : dict a dictionary of new parameter values Returns ------- master : PhotonicTemplateBase Newly created master from the given parameters """ # Create a new parameter dictionary based on the provided changes new_params = copy.deepcopy(self.params) for key, val in kwargs.items(): if key in new_params: new_params[key] = val # Move to populate_params? This deletes the old angle and sets it to the provided value via hidden params new_params.pop('_angle', None) return TemplateBase.new_template(self, params=new_params, temp_cls=self.__class__, hidden_params={'_angle': angle}, **kwargs)
def draw_layout_in_template(template: TemplateBase, lay_info: LayoutInfo, set_bbox: bool = True) -> None: for lay_purp, box_col in lay_info.rect_dict.items(): template.add_bbox_collection(lay_purp, box_col) for winfo in lay_info.warr_list: template.add_wires(winfo.layer, winfo.track, winfo.lower, winfo.upper, width=winfo.width, num=winfo.num, pitch=winfo.pitch) for vinfo in lay_info.via_list: template.add_via_primitive(vinfo.via_type, Transform(vinfo.xc, vinfo.yc), vinfo.w, vinfo.h, num_rows=vinfo.vny, num_cols=vinfo.vnx, sp_rows=vinfo.vspy, sp_cols=vinfo.vspx, enc1=vinfo.enc1, enc2=vinfo.enc2, nx=vinfo.nx, ny=vinfo.ny, spx=vinfo.spx, spy=vinfo.spy) if set_bbox: template.prim_bound_box = lay_info.bound_box
def _commit_via(self) -> None: """ Takes in all vias in the db and creates standard BAG equivalents """ for via in self._db['via']: for connection in via.metal_pairs: TemplateBase.add_via(self, bbox=via.loc['overlap'].to_bbox(), bot_layer=connection[0], top_layer=connection[1], bot_dir=connection[2], extend=via.extend) for via in self._db['prim_via']: TemplateBase.add_via_primitive(self, via_type=via.via_id, loc=via.location, num_rows=via.num_rows, num_cols=via.num_cols, sp_rows=via.sp_rows, sp_cols=via.sp_cols, enc1=via.enc_bot, enc2=via.enc_top, orient=via.orient)
def new_template(self, params: dict = None, temp_cls=None, debug: bool = False, **kwargs): """ Generates a layout master of specified class and parameter set Args: params (dict): dictionary of parameters to specify the layout to be created temp_cls: the layout generator class to be used debug (bool): True to print debug messages """ return TemplateBase.new_template(self, params=params, temp_cls=temp_cls, debug=debug, **kwargs)
def _commit_rect(self) -> None: """ Takes in all rectangles in the db and creates standard BAG equivalents """ for shape in self._db['rect']: self.temp_boundary = self.temp_boundary.get_enclosure(shape) if shape.virtual is False: TemplateBase.add_rect(self, shape.lpp, shape.to_bbox())
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self._sch_params = None
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None: TemplateBase.__init__(self, temp_db, params, **kwargs)
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **kwargs) -> None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self.has_connection = False
def __init__(self, temp_db, lib_name, params, used_names, **kwargs): # type: (TemplateDB, str, Dict[str, Any], Set[str], **kwargs) -> None TemplateBase.__init__(self, temp_db, lib_name, params, used_names, **kwargs) self._route_tids = None self._sup_intv = None