max_enclosure¶
The mirror image of min_enclosure: every shape on the enclosed layer
(layers[1]) that sits inside an enclosing region (layers[0]) must have no more
than value µm of margin on any side.
Semantics¶
Uses the same facing-edge-pair (projection metric) margin computation as
min_enclosure, but the worst margin here means the largest one, and a shape not
contained by any enclosing region isn’t a “too much margin” case — it’s silently skipped,
since that absence is min_enclosure’s concern, not this rule’s. There’s no
skip_coincident/skip_clipped equivalent: a coincident (0-margin) edge can never
exceed a maximum bound, so it’s harmless to include, and there’s no “wall reality check”
either — a fake wall (from a per-tile union truncated at its halo) can only shrink the
measured worst margin, which for a maximum bound errs toward passing rather than a false
violation.
Typically paired with a min_enclosure entry at the same value, pinning a device’s margin to (near) exactly that value rather than just bounding it from below.
Layers¶
Two layers, positional — same roles as min_enclosure:
layers[0]— the enclosing region.layers[1]— the enclosed shapes being measured.
Parameters¶
sidesOptional.
all(the default): no side may exceedvalue— the shape’s largest margin is the one read.any: at least one side is withinvalue— the shape’s smallest margin is the one read, and a shape enclosed by more thanvalueon every side is the violation. Paired with a min_enclosure at the same value,allpins every side to exactly that value andanypins one side to it (GF180HRES.10: the implant overlaps the salicide block by exactly 0.1 µm where it crosses it, however far it runs past it elsewhere).adjacentandline_endare about a margin falling short and have no maximum.metricOptional.
projection(the default) oreuclidian, as in min_enclosure.interacting_onlyOptional. As in min_enclosure: a shape that partially overlaps an enclosing region is measured on the facing pairs of its contained side — the maximum of an extension, a cover that may reach past the target it crosses by at most
value.
Violation markers¶
One edge marker per offending shape, along the facing outer wall responsible for the largest (worst) margin.
KLayout equivalent¶
inner.enclosed(outer, value, metric: RBA::Region::projection) filtered to the
maximum-margin direction — KLayout doesn’t have a dedicated “max enclosure” primitive
either; this is the same projection-metric measurement as min_enclosure, just compared
against an upper bound.
Example¶
# A Schottky diode's PWell.block enclosure is pinned to exactly 0.25 µm: the min_
# enclosure entry sets the floor, this one the ceiling.
- id: Sdiod.a
check: min_enclosure
layers: [PWell.block, SchottkyContBar]
value: 0.25
params:
interacting_only: 1
- id: Sdiod.a
check: max_enclosure
layers: [PWell.block, SchottkyContBar]
value: 0.25