def add_base(builder: LayoutInfoBuilder, row_type: MOSType, threshold: str, imp_y: Tuple[int, int], rect: BBox, well_x: Optional[Tuple[int, int]] = None) -> None: if rect.is_physical(): if not row_type.is_pwell: well_lp = ('nwell', 'drawing') if well_x is None: builder.add_rect_arr(well_lp, rect) else: builder.add_rect_arr( well_lp, BBox(well_x[0], rect.yl, well_x[1], rect.yh)) if row_type.is_n_plus: builder.add_rect_arr(('nsdm', 'drawing'), rect) else: pimp_lp = ('psdm', 'drawing') nimp_lp = ('nsdm', 'drawing') if rect.yl < imp_y[0]: builder.add_rect_arr(nimp_lp, BBox(rect.xl, rect.yl, rect.xh, imp_y[0])) if imp_y[1] < rect.yh: builder.add_rect_arr(nimp_lp, BBox(rect.xl, imp_y[1], rect.xh, rect.yh)) if imp_y[0] < imp_y[1]: builder.add_rect_arr( pimp_lp, BBox(rect.xl, imp_y[0], rect.xh, imp_y[1])) thres_lp = _get_thres_lp(row_type, threshold) if thres_lp[0] != '': builder.add_rect_arr(thres_lp, rect)
def test_physical_valid(xl, yl, xh, yh, physical, valid): ans = BBox(xl, yl, xh, yh) assert ans.is_physical() == physical assert ans.is_valid() == valid # check orientation based constructor works b1 = BBox(Orient2D.x, xl, xh, yl, yh) b2 = BBox(Orient2D.y, yl, yh, xl, xh) assert b1 == ans assert b2 == ans
def add_cell_boundary(self, template: TemplateBase, box: BBox) -> None: if box.is_physical(): pt_list = [(box.xl, box.yl), (box.xl, box.yh), (box.xh, box.yh), (box.xh, box.yl)] template.add_boundary(BoundaryType.PR, pt_list)