コード例 #1
0
 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
コード例 #2
0
 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
コード例 #3
0
ファイル: base.py プロジェクト: ucb-art/BAG2_TEMPLATES_EC
 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']
コード例 #4
0
ファイル: cml.py プロジェクト: xyabc/bag_serdes_ec
 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
コード例 #5
0
 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']
コード例 #6
0
ファイル: core.py プロジェクト: xyabc/BAG2_TEMPLATES_EC
    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
コード例 #7
0
    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
コード例 #8
0
ファイル: primitives.py プロジェクト: skyworksinc/xbase
    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()
コード例 #9
0
    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
コード例 #10
0
 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
コード例 #11
0
ファイル: primitives.py プロジェクト: skyworksinc/xbase
    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
コード例 #12
0
ファイル: primitives.py プロジェクト: skyworksinc/xbase
    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
コード例 #13
0
ファイル: base.py プロジェクト: xyabc/BAG2_TEMPLATES_EC
 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
コード例 #14
0
    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
コード例 #15
0
 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
コード例 #16
0
ファイル: AyarLayoutGenerator.py プロジェクト: xlchan/ACG
 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)
コード例 #17
0
ファイル: tap1.py プロジェクト: xyabc/bag_serdes_ec
 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
コード例 #18
0
 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
コード例 #19
0
ファイル: tap1.py プロジェクト: xyabc/bag_serdes_ec
 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
コード例 #20
0
    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
コード例 #21
0
 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)
コード例 #22
0
    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)
コード例 #23
0
ファイル: data.py プロジェクト: skyworksinc/xbase
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
コード例 #24
0
 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)
コード例 #25
0
    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)
コード例 #26
0
 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())
コード例 #27
0
ファイル: inv_mux.py プロジェクト: xlchan/bag_xbase_logic
 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
コード例 #28
0
ファイル: top.py プロジェクト: skyworksinc/xbase
 def __init__(self, temp_db: TemplateDB, params: Param,
              **kwargs: Any) -> None:
     TemplateBase.__init__(self, temp_db, params, **kwargs)
コード例 #29
0
 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
コード例 #30
0
 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