xbase.layout.mos.placement.data

Module Contents

Classes

MOSArrayPlaceInfo

A class that stores layout information of a transistor array island.

MOSBasePlaceInfo

A class that stores layout information of a single tile in MOSBase.

TilePatternElement

A single element inside a tile pattern.

TilePattern

A recursive list of tile layout information objects.

TileInfoTable

A table storing various compatible tiles.

Functions

make_pinfo_compact(→ MOSBasePlaceInfo)

make_pinfo_compact_specs(→ MOSBasePlaceInfo)

_save_arr_info(→ None)

_save_place_info(→ None)

class xbase.layout.mos.placement.data.MOSArrayPlaceInfo(parent_grid: bag.layout.routing.grid.RoutingGrid, lch: int, tr_widths: bag.layout.routing.base.WDictType, tr_spaces: bag.layout.routing.base.SpDictType, *, top_layer: Optional[int] = None, conn_layer: Optional[int] = None, half_space: bool = True, arr_options: Optional[Mapping[str, Any]] = None)[source]

A class that stores layout information of a transistor array island.

This class stores information common to all tiles within the array.

Parameters:
  • parent_grid (RoutingGrid) – the RoutingGrid object.

  • lch (int) – the transistor channel length.

  • tr_widths (WDictType) – dictionary from wire types to its width on each layer.

  • tr_spaces (SpDictType) – dictionary from wire types to its spaces on each layer.

  • top_layer (Optional[int]) – the top layer ID.

  • conn_layer (Optional[int]) – the connection layer ID.

  • half_space (bool) – True to allow half-track spaces.

  • arr_options (Optional[Mapping[str, Any]]) – Process-specific options for the entire array.

property grid: bag.layout.routing.grid.RoutingGrid[source]
property tr_manager: bag.layout.routing.base.TrackManager[source]

The TrackManager object.

Type:

TrackManager

property tech_cls: xbase.layout.mos.tech.MOSTech[source]

The primitive technology object.

Type:

MOSTech

property lch: int[source]

The channel length.

Type:

int

property top_layer: int[source]

The top layer ID.

Type:

int

property conn_layer: int[source]

The transistor port layer ID.

Type:

int

property sd_pitch: int[source]
property half_space: int[source]
property arr_options: bag.util.immutable.Param[source]
__hash__() int[source]

Return hash(self).

__eq__(other: Any) bool[source]

Return self==value.

classmethod get_conn_layer(tech_info: bag.layout.tech.TechInfo, lch: int, arr_options: Optional[Mapping[str, Any]] = None) int[source]
classmethod make_array_info(grid: bag.layout.routing.grid.RoutingGrid, val: Mapping[str, Any]) MOSArrayPlaceInfo[source]
get_tile_blk_h(half_blk: bool = True) int[source]
get_source_track(col_idx: int) bag.util.math.HalfInt[source]
get_source_track_col(track_index: bag.util.math.HalfInt) int[source]
coord_to_col(coord: int, round_mode: pybag.enum.RoundMode = RoundMode.NONE) int[source]
col_to_coord(col: int) int[source]
col_to_track(layer: int, col: int, mode: pybag.enum.RoundMode = RoundMode.NONE, even: bool = False) bag.util.math.HalfInt[source]
track_to_col(layer: int, track_index: bag.util.math.HalfInt, mode: pybag.enum.RoundMode = RoundMode.NEAREST) int[source]
get_column_span(vm_layer: int, num_tracks: bag.util.math.HalfInt) int[source]

Returns the minimum number of columns to fit given number of tracks.

Parameters:
  • vm_layer (int) – the vertical routing layer ID.

  • num_tracks (HalfInt) – number of tracks.

Returns:

num_col – number of MOSBase columns.

Return type:

int

get_block_ncol(vm_layer: int, half_blk: bool = False) int[source]

Returns the number of columns in a unit block for the given vertical routing layer.

this is the number of columns of the smallest unit block that you can tile and guarantee that the wires on the given vertical layers will stay on grid.

Parameters:
  • vm_layer (int) – a vertical routing layer ID.

  • half_blk (bool) – True to allow half-block size. Defaults to False.

round_up_to_block_size(vm_layer: int, ncol: int, even_diff: bool = False, half_blk: bool = False) int[source]
xbase.layout.mos.placement.data.make_pinfo_compact(arr_info: MOSArrayPlaceInfo, row_specs: Sequence[xbase.layout.mos.data.MOSRowSpecs], bot_mirror: bool, top_mirror: bool, name: str = '', min_height: int = 0, tile_options: Optional[bag.util.immutable.Param] = None, priority: int = 0, wire_graphs: Optional[Dict[int, xbase.layout.wires.WireGraph]] = None) MOSBasePlaceInfo[source]
xbase.layout.mos.placement.data.make_pinfo_compact_specs(arr_info: MOSArrayPlaceInfo, name: str, specs: Mapping[str, Any]) MOSBasePlaceInfo[source]
class xbase.layout.mos.placement.data.MOSBasePlaceInfo(name: str, arr_info: MOSArrayPlaceInfo, rp_list: bag.util.immutable.ImmutableList[xbase.layout.mos.data.RowPlaceInfo], bot_mirror: bool, top_mirror: bool, options: bag.util.immutable.Param, rg_list: Optional[List[Tuple[xbase.layout.wires.WireGraph, xbase.layout.wires.WireGraph]]] = None, priority: int = 0, wire_lookup: Optional[Dict[int, xbase.layout.wires.WireLookup]] = None)[source]

A class that stores layout information of a single tile in MOSBase.

Parameters:
  • name (str) – name of this tile.

  • arr_info (MOSArrayPlaceInfo) – the transistor array information object.

  • rp_list (ImmutableList[RowPlaceInfo]) – list of placement information of each transistor row in this tile.

  • bot_mirror (bool) – True to satisfy mirror placement constraint on the bottom edge.

  • top_mirror (bool) – True to satisfy mirror placement constraint on the top edge.

  • options (Param) – process-specific options for this tile.

  • rg_list (Optional[List[Tuple[WireGraph, WireGraph]]]) – list of wire graph objects for each transistor row. optional. Only use for debugging/visualization purposes.

property name: str[source]
property num_rows: int[source]
property height: int[source]
property true_height: int[source]
property ext_h_bot: int[source]
property ext_h_top: int[source]
property extend_priority: int[source]
property wire_lookup: bag.util.immutable.ImmutableSortedDict[int, xbase.layout.wires.WireLookup][source]
property tile_options: bag.util.immutable.Param[source]
property arr_info: MOSArrayPlaceInfo[source]
property grid: bag.layout.routing.grid.RoutingGrid[source]
property tr_manager: bag.layout.routing.base.TrackManager[source]
property lch: int[source]
property top_layer: int[source]
property conn_layer: int[source]
property tech_cls: xbase.layout.mos.tech.MOSTech[source]
property sd_pitch: int[source]
property is_complementary: bool[source]
__hash__() int[source]

Return hash(self).

__eq__(other: Any) bool[source]

Return self==value.

classmethod get_conn_layer(tech_info: bag.layout.tech.TechInfo, lch: int) int[source]
classmethod make_place_info(grid: bag.layout.routing.grid.RoutingGrid, val: Union[MOSBasePlaceInfo, Tuple[Union[MOSBasePlaceInfo, TilePattern], TileInfoTable], Mapping[str, Any]], name: str = '') Union[MOSBasePlaceInfo, Tuple[Union[MOSBasePlaceInfo, TilePattern], TileInfoTable]][source]
get_mirror(top_edge: bool) bool[source]

Returns True if the specify edge satisfies mirror placement constraint.

get_row_place_info(row_idx: int) xbase.layout.mos.data.RowPlaceInfo[source]
get_hm_track_info(hm_layer: int, wire_name: str, wire_idx: int = 0) Tuple[bag.util.math.HalfInt, int][source]
get_abut_info(rhs: MOSBasePlaceInfo, top_edge: bool, rhs_top_edge: bool, shared: Sequence[str], rhs_shared: Sequence[str]) Tuple[int, xbase.layout.mos.data.ExtWidthInfo, int, int][source]

Returns the margin needed to abut this tile with the given tile.

Parameters:
  • rhs (MOSBasePlaceInfo) – the other tile.

  • top_edge (bool) – True if rhs is abutting to top edge of this tile.

  • rhs_top_edge (bool) – True if we’re abutting to top edge of the other tile.

  • shared (Sequence[str]) – list of edge wires shared with the other tile.

  • rhs_shared (Sequence[str]) – list of edge wires from the other tile shared with this tile.

Returns:

  • margin (int) – the margin in resolution units.

  • ext_w_info (ExtWidthInfo) – the ExtWidthInfo object.

  • em1 (int) – the existing extension margin (in resolution units).

  • em2 (int) – the existing extension margin on the other tile (in resolution units).

get_source_track(col_idx: int) bag.util.math.HalfInt[source]
get_source_track_col(track_index: bag.util.math.HalfInt) int[source]
coord_to_col(coord: int, round_mode: pybag.enum.RoundMode = RoundMode.NONE) int[source]
col_to_coord(col: int) int[source]
get_column_span(vm_layer: int, num_tracks: bag.util.math.HalfInt) int[source]
get_block_ncol(vm_layer: int) int[source]
show_wire_graph(row_idx: int, top_or_bot: str = 'bot') None[source]
get_extend(margin: int, top_edge: bool, ext_w_info: xbase.layout.mos.data.ExtWidthInfo, cur_em: int, other_em: int, shared: Sequence[str], max_iter: int = 1000) MOSBasePlaceInfo[source]
_get_extend_helper(delta: int, top_edge: bool, shared: Sequence[str]) MOSBasePlaceInfo[source]
class xbase.layout.mos.placement.data.TilePatternElement(info: Union[MOSBasePlaceInfo, TilePattern], mirror: bool = True, flip: bool = False, mult: int = 1)[source]

A single element inside a tile pattern.

A tile pattern element consists of a single tile or a tile pattern repeated multiple times, with possible mirroring.

NOTE: the multiplier parameter is only used to compute num_rows, num_tiles, and height properties. All other methods assumes that the unit element is repeated indefinitely. This design choice allows us to use one class to represent both a given element that repeats a finite amount, or a dynamically growing repeating tile pattern.

property name: str[source]
property arr_info: MOSArrayPlaceInfo[source]
property num_rows: int[source]
property num_tiles: int[source]
property num_tiles_unit: int[source]
property height: int[source]
property mult: int[source]
__hash__() int[source]

Return hash(self).

__eq__(other: Any) bool[source]

Return self==value.

__bool__() bool[source]
classmethod make_element(table: Mapping[str, MOSBasePlaceInfo], specs: Union[str, Mapping[str, Any]]) TilePatternElement[source]
get_flip_unit(unit_idx: int) bool[source]
num_tiles_to_rows(num_tiles: int) int[source]
get_tile_info(tile_idx: int) Tuple[MOSBasePlaceInfo, int, bool][source]

Returns the tile information for the given tile index.

Parameters:

tile_idx (int) – the tile index.

Returns:

  • pinfo (MOSBasePlaceInfo) – the tile layout information object.

  • y0 (int) – the bottom Y coordinate of the tile.

  • flip (bool) – True if this tile is flipped.

get_tile_pinfo(tile_idx: int) MOSBasePlaceInfo[source]
get_hm_track_info(hm_layer: int, wire_name: str, wire_idx: int = 0, *, tile_idx: int = 0) Tuple[bag.util.math.HalfInt, int][source]
get_hm_track_id(hm_layer: int, wire_name: str, wire_idx: int = 0, *, tile_idx: int = 0) bag.layout.routing.base.TrackID[source]
get_hm_track_index(hm_layer: int, wire_name: str, wire_idx: int = 0, *, tile_idx: int = 0) bag.util.math.HalfInt[source]
get_track_info(row_idx: int, wire_type: Union[xbase.layout.enum.MOSWireType, bool], wire_name: str, wire_idx: int = 0, *, tile_idx: int = 0) Tuple[bag.util.math.HalfInt, int][source]
get_track_index(row_idx: int, wire_type: Union[xbase.layout.enum.MOSWireType, bool], wire_name: str, wire_idx: int = 0, *, tile_idx: int = 0) bag.util.math.HalfInt[source]
get_track_id(row_idx: int, wire_type: Union[xbase.layout.enum.MOSWireType, bool], wire_name: str, wire_idx: int = 0, *, tile_idx: int = 0) bag.layout.routing.base.TrackID[source]
get_wire_range(row_idx: int, wire_type: Union[xbase.layout.enum.MOSWireType, bool], wire_name: str, *, tile_idx: int = 0) Tuple[int, int][source]
get_num_wires(row_idx: int, wire_type: Union[xbase.layout.enum.MOSWireType, bool], wire_name: str, *, tile_idx: int = 0) int[source]
get_flat_row_idx_and_flip(tile_idx: int, row_idx: int) Tuple[int, bool][source]
flat_row_to_tile_row(flat_row_idx: int) Tuple[int, int][source]
get_sub_pattern_element(num_tiles: int, mult: int, mirror: bool, flip: bool, start_idx: int = 0) TilePatternElement[source]

Returns a repeated sub-pattern (analogous to substrings).

get_reverse(mult: int) TilePatternElement[source]
append_sub_pattern(ele_list: List[TilePatternElement], num_tiles: int, flip_element: bool) None[source]
_get_sub_pattern_element_helper(num_tiles: int, mult: int, mirror: bool, flip: bool) TilePatternElement[source]
_get_wire_info(row_idx: int, wire_type: Union[xbase.layout.enum.MOSWireType, bool], tile_idx: int) Tuple[xbase.layout.wires.WireLookup, int, int][source]
class xbase.layout.mos.placement.data.TilePattern(data: List[TilePatternElement])[source]

A recursive list of tile layout information objects.

Used to represent repeating/fractal tile patterns in a transistor array.

property arr_info: MOSArrayPlaceInfo[source]
property num_rows: int[source]
property num_tiles: int[source]
property height: int[source]
__hash__() int[source]

Return hash(self).

__eq__(other: Any) bool[source]

Return self==value.

__bool__() bool[source]
classmethod make_pattern(table: Mapping[str, MOSBasePlaceInfo], spec_list: Iterable[Mapping[str, Any]]) TilePattern[source]
get_element_idx(tile_idx: int) int[source]
num_tiles_to_rows(num_tiles: int) int[source]
get_tile_info(tile_idx: int) Tuple[MOSBasePlaceInfo, int, bool][source]

Returns the tile information for the given tile index.

Parameters:

tile_idx (int) – the tile index.

Returns:

  • pinfo (MOSBasePlaceInfo) – the tile layout information object.

  • y0 (int) – the bottom Y coordinate of the tile.

  • flip (bool) – True if this tile is flipped.

get_tile_pinfo(tile_idx: int) MOSBasePlaceInfo[source]
flat_row_to_tile_row(flat_row_idx: int) Tuple[int, int][source]
get_sub_pattern_element(num_tiles: int, mult: int, mirror: bool, flip: bool, start_idx: int = 0) TilePatternElement[source]
append_sub_pattern(ele_list: List[TilePatternElement], num_tiles: int, flip_pattern: bool) None[source]
class xbase.layout.mos.placement.data.TileInfoTable(ainfo: MOSArrayPlaceInfo, pinfo_dict: Mapping[str, MOSBasePlaceInfo])[source]

A table storing various compatible tiles.

property arr_info: MOSArrayPlaceInfo[source]
_arr_info_fname = 'arr_info'[source]
__hash__() int[source]

Return hash(self).

__eq__(rhs: TileInfoTable) bool[source]

Return self==value.

__getitem__(name: str) MOSBasePlaceInfo[source]
classmethod load(grid: bag.layout.routing.grid.RoutingGrid, root_dir: pathlib.Path) TileInfoTable[source]
classmethod make_tiles_dir(grid: bag.layout.routing.grid.RoutingGrid, root_dir: Union[str, pathlib.Path]) TileInfoTable[source]

Create a new TileInfoTable from spec file.

classmethod make_tiles(grid: bag.layout.routing.grid.RoutingGrid, specs: Mapping[str, Any]) TileInfoTable[source]

Create a new TileInfoTable from specification dictionary.

Tile extension rule:

  1. If a tile does not have mirror placement constraint on its edge, and the other one does, then the tile with no mirror placement constraint gets extended.

  2. Otherwise, we extend the tile that has lower priority.

Parameters:
  • grid (RoutingGrid) – the routing grid object.

  • specs (Mapping[str, Any]) – tile specifications dictionary.

Returns:

table – a table of all created tiles.

Return type:

TileInfoTable

save(root_dir: pathlib.Path) None[source]
make_place_info(val: Mapping[str, Any]) Union[MOSBasePlaceInfo, TilePattern][source]
make_tile_pattern(tiles: Iterable[Mapping[str, Any]]) TilePattern[source]
xbase.layout.mos.placement.data._save_arr_info(ainfo: MOSArrayPlaceInfo, fname: pathlib.Path) None[source]
xbase.layout.mos.placement.data._save_place_info(pinfo: MOSBasePlaceInfo, fname: pathlib.Path) None[source]