Exemplo n.º 1
0
    def draw_layout(self):
        lch: int = self.params['lch']
        fg: int = self.params['fg']
        row_list: List[Tuple[str, int, str]] = self.params['row_list']
        min_ntr: int = self.params['min_ntr']
        w_list: Optional[List[int]] = self.params['w_list']

        if not row_list:
            raise ValueError('Cannot draw empty rows.')
        if w_list is None:
            w_list = [info[1] for info in row_list]
        elif len(w_list) != len(row_list):
            raise ValueError('width list length mismatch')

        row_specs = []
        hm_layer = MOSBasePlaceInfo.get_conn_layer(self.grid.tech_info,
                                                   lch) + 1
        empty_wires = WireData.make_wire_data([], Alignment.CENTER_COMPACT, '')
        for info in row_list:
            mtype, w, th = info[:3]
            if len(info) > 3:
                flip = info[3]
            else:
                flip = False
            row_specs.append(
                MOSRowSpecs(MOSType[mtype],
                            w,
                            th,
                            empty_wires,
                            empty_wires,
                            flip=flip))

        ainfo = MOSArrayPlaceInfo(self.grid, lch, {}, {})
        min_height = self.grid.get_track_pitch(hm_layer) * min_ntr
        pinfo = make_pinfo_compact(ainfo,
                                   row_specs,
                                   True,
                                   True,
                                   min_height=min_height)

        self.draw_base(pinfo)
        self.set_mos_size(fg)

        for ridx in range(len(row_list)):
            self.add_mos(ridx, 0, fg, w=w_list[ridx])
Exemplo n.º 2
0
    def draw_layout(self):
        lch: int = self.params['lch']
        fg: int = self.params['fg']
        fg_sp: int = self.params['fg_sp']
        row_list: List[Tuple[str, int, str]] = self.params['row_list']
        min_ntr: int = self.params['min_ntr']
        mos_sub: bool = self.params['mos_sub']

        if not row_list:
            raise ValueError('Cannot draw empty rows.')

        row_specs = []
        empty_wires = WireData.make_wire_data([], Alignment.CENTER_COMPACT, '')
        hm_layer = MOSBasePlaceInfo.get_conn_layer(self.grid.tech_info,
                                                   lch) + 1
        for mtype, w, th in row_list:
            row_specs.append(
                MOSRowSpecs(MOSType[mtype], w, th, empty_wires, empty_wires))

        ainfo = MOSArrayPlaceInfo(self.grid, lch, {}, {})
        min_height = self.grid.get_track_pitch(hm_layer) * min_ntr
        pinfo = make_pinfo_compact(ainfo,
                                   row_specs,
                                   True,
                                   True,
                                   min_height=min_height)

        self.draw_base(pinfo)
        self.set_mos_size(2 * fg + fg_sp)

        for ridx in range(len(row_list)):
            self.add_mos(ridx, 0, fg)
            if mos_sub:
                self.add_substrate_contact(ridx, fg + fg_sp, seg=fg)
            else:
                self.add_mos(ridx, fg + fg_sp, fg)