Layouts and hierarchy¶
Use a Layout context for execution. Local and top coordinates are distinct; cross-input Booleans require an explicit transform into one context.
| Call / property | Returns / behavior | What it does and why |
|---|---|---|
context.extent() |
Bounding Region |
Returns a box enclosing the selected context. Use it for overall layout bounds or a reporting marker around the input area. |
context.regions_on_layers(...) |
Region; inclusive layer/datatype ranges |
Reads polygons from all layers and datatypes inside the given inclusive ranges. Use it for rules covering a range of layer numbers rather than one named layer. |
context.read_regions((10, 0), within=None, shapes="implicit", point_touch="join") |
Read whole shapes within the search area; do not clip them | Finds whole source shapes through a search area without cutting their outlines. Use it when a confined read is needed but clipped edges would change the rule. |
context.marked_cell_regions((10, 0), marker=(100, 0)) |
Shapes below marked cells; nested marks do not duplicate shapes | Reads source shapes below cells carrying local marker records. Use it to select marked cell subtrees; nested marks do not count the same placed shape twice. |
context.scaled_regions((10, 0), factor=..., hierarchical=False) |
Scale before merging, clipping, or rounding | Scales source geometry before merging, clipping, or rounding its coordinates. Use it when the scale order is part of the rule; scaling a later result may differ. |
layout.dbu, layout.top_count |
Physical DBU / top-cell count Number |
dbu gives one input-grid step in deck units; top_count counts cells with no parent. Use them for grid-aware measurements and top-cell checks. |
context.has_complex_instances() |
Predicate; source contains complex instance transforms |
Tests for source instances with complex transforms. Use it before a workflow that cannot handle those placements. |
context.max_local_extent((10, 0)) |
Number; largest local bounding-box side |
Finds the largest bounding-box side of a local source shape on the layer. Use it to derive a physical limit or read margin without flattening the whole layout. |
context.local_regions(within=search, options=options) |
Nearby Region; empty if the bounded read is unavailable |
Reads nearby complete polygons under explicit limits on count, vertices, and read steps. Use it for bounded local work; an unavailable read returns empty. |
context.local_read_available(within=search, options=options) |
Predicate; whether the bounded read can complete |
Tests whether the same bounded local read can finish within its limits. Use it to distinguish a failed read from a genuinely empty result. |
context.regions((10, 0), ...) |
Region; coordinates also "local", shapes also "raw", "implicit" |
Reads polygons from the chosen GDS layer in the context. Use its read options to choose recursion, coordinates, and handling of stored versus merged shapes. |
context.name |
Runtime String |
Reads the context name as runtime text. Use it for name-based conditions or report messages. |
Read options
context.regions() defaults to recursive=True, coordinates="top",
shapes="merged", within=None, point_touch="separate".
regions_on_layers() uses inclusive ranges: layer_minimum=0,
layer_maximum=None, datatype_minimum=0, datatype_maximum=None;
shapes="implicit", point_touch="separate".
Bounded reads use fabcheck.parameters.LocalRead(gds=..., margin=...,
maximum_seed_polygons=..., maximum_polygons=..., maximum_vertices=...,
maximum_iterations=1, connected=False). Limits are explicit; complex instance
transforms make the read unavailable. Check local_read_available() to
distinguish an unavailable read from an empty layer.
Hierarchical reads require backend support. Flat and hierarchical algorithms can differ at rounded intersections.
Source stream checks¶
context.stream_check(kind, marker_grid=..., marker_half_size=..., ...) returns
Check from original source records, before polygon merging.
| Kind | Additional parameters / purpose | What it does and why |
|---|---|---|
"grid" |
Required grid; coordinates="top" / "source"; optional source instance_origins=True |
Checks original source coordinates against the requested grid, before or after placement as selected. Use it to report off-grid data without repairing it. |
"text" |
Original text records | Finds text records in the selected source layers. Use it to flag text where labels are forbidden or need a separate report. |
"self_overlap", "self_crossing", "zero_area" |
Original polygon integrity | Checks original polygons for self-overlap, crossing edges, or zero area. Use it before merging would hide problems in individual source records. |
"path_bend" |
Required angle; source path bends |
Checks source path bends against the selected angle. Use it for path-shape rules that would lose their original bend information after polygon conversion. |
"path_end" |
Required ratio; source path ends |
Checks source path ends with the selected end-ratio limit. Use it when the path end construction itself matters to the rule. |
"cell_name" |
Required name_pattern; regular-expression search on original names |
Finds source cell names matching the regular-expression pattern. Use it to report forbidden or specially classified names from the original layout records. |
Common options: layers=None, epsilon=1e-9, polygonize_paths=True,
coordinates="top", instance_origins=False, exempt=None.
Coordinates and source integrity
Source mode checks original cell definitions, then places markers through the hierarchy. Top mode checks transformed occurrences. Source grid checks can also include instance origins. Marker grid and half-size are always required.
Polygon checks allow point self-abutment and opposite non-adjacent keyhole retraces. Cell-name patterns use regex search on original GDS STRNAME records when available. Exemptions apply to top-coordinate point markers using a one-input-DBU probe.