rename topcell->cell

This commit is contained in:
jan 2022-03-31 00:00:11 -07:00
parent 58df8a0d3c
commit c4a8e10021

View File

@ -11,8 +11,8 @@ from ..types import layer_t
from ..utils import connectivity2layers from ..utils import connectivity2layers
def read_topcell( def read_cell(
topcell: Pattern, cell: Pattern,
connectivity: Sequence[Tuple[layer_t, Optional[layer_t], layer_t]], connectivity: Sequence[Tuple[layer_t, Optional[layer_t], layer_t]],
label_mapping: Optional[Mapping[layer_t, layer_t]] = None, label_mapping: Optional[Mapping[layer_t, layer_t]] = None,
) -> Tuple[ ) -> Tuple[
@ -26,19 +26,19 @@ def read_topcell(
label_mapping = {layer: layer for layer in metal_layers} label_mapping = {layer: layer for layer in metal_layers}
label_layers = {label_layer for label_layer in label_mapping.keys()} label_layers = {label_layer for label_layer in label_mapping.keys()}
topcell = topcell.deepcopy().subset( cell = cell.deepcopy().subset(
shapes_func=lambda ss: ss.layer in poly_layers, shapes_func=lambda ss: ss.layer in poly_layers,
labels_func=lambda ll: ll.layer in label_layers, labels_func=lambda ll: ll.layer in label_layers,
subpatterns_func=lambda ss: True, subpatterns_func=lambda ss: True,
) )
topcell = topcell.flatten() cell = cell.flatten()
polys = load_polys(topcell, list(poly_layers)) polys = load_polys(cell, list(poly_layers))
metal_labels = defaultdict(list) metal_labels = defaultdict(list)
for label_layer, metal_layer in label_mapping.items(): for label_layer, metal_layer in label_mapping.items():
labels = [] labels = []
for ll in topcell.labels: for ll in cell.labels:
if ll.layer != label_layer: if ll.layer != label_layer:
continue continue
@ -57,11 +57,11 @@ def read_topcell(
def load_polys( def load_polys(
topcell: Pattern, cell: Pattern,
layers: Sequence[layer_t], layers: Sequence[layer_t],
) -> defaultdict[layer_t, List[NDArray[numpy.float64]]]: ) -> defaultdict[layer_t, List[NDArray[numpy.float64]]]:
polys = defaultdict(list) polys = defaultdict(list)
for ss in topcell.shapes: for ss in cell.shapes:
if ss.layer not in layers: if ss.layer not in layers:
continue continue