DrcUtilities.mesa
Copyright © 1988 by Xerox Corporation. All rights reserved.
Opera di Giordano Bruno Beretta January 4, 1988 1:43:57 pm PST
gbb January 4, 1988 2:15:54 pm PST
Spinned out of DrcCMOSBimpl.Mesa because of "Storage overflow in pass 4" of compiler.
DIRECTORY
Atom USING [GetPName],
CD USING [DrawContextProc, DrawProc, LayerKey, Number, Position],
CMosB USING [cut, cut2, ndif, nwell, nwellCont, pdif, pol, pwell, pwellCont, wndif, wnwellCont, wpdif, wpwellCont],
CoreGeometry USING [Layer],
CoreProperties USING [PropPrintProc],
CStitching USING [Tesselation],
Drc USING [Rect, State, Wire, WireInstance],
Rope USING [ROPE],
Saguaro USING [gate];
DrcUtilities: CEDAR DEFINITIONS
IMPORTS Atom, CD, CMosB, Saguaro
SHARES Drc ~ BEGIN OPEN Drc;
Layer: TYPE ~ CoreGeometry.Layer;
ROPE: TYPE ~ Rope.ROPE;
Tess: TYPE ~ CStitching.Tesselation;
diffContactLayer: ARRAY Layer OF BOOL;
ignoreConnectivity: BOOL;
IsCut: PROC [layer: Layer] RETURNS [BOOL] ~ INLINE BEGIN
RETURN [(layer = CMosB.cut) OR (layer = CMosB.cut2)]
END; -- IsCut
IsWell: PROC [layer: Layer] RETURNS [BOOL] ~ INLINE BEGIN
RETURN [(layer = CMosB.pwell) OR (layer = CMosB.nwell)]
END; -- IsWell
IsDiffContact: PROC [class: ATOM, layer: Layer] RETURNS [BOOL] ~ INLINE BEGIN
All 8 layers are used by ChipNDale for diffusion contacts.
RETURN [(((class = $C2SimpleCon) OR (class = $C2WellSimpleCon) OR (class = $C2DiffShortCon) OR (class = $C2DifShortCon) OR (class = $C2WellDifShortCon)) AND (diffContactLayer[layer]))]
END; -- IsDiffContact
IsLargeDiffContact: PROC [class: ATOM, layer: Layer] RETURNS [BOOL] ~ INLINE BEGIN
All 8 layers are used by ChipNDale for diffusion contacts.
RETURN [(((class = $C2LargeSimpleCon) OR (class = $C2LargeWellSimpleCon)) AND (diffContactLayer[layer]))]
END; -- IsLargeDiffContact
IsAbstract: PROC [layer: Layer] RETURNS [BOOL] ~ INLINE BEGIN
RETURN [(layer = CMosB.wndif) OR (layer = CMosB.wpdif) OR (layer = CMosB.wpwellCont) OR (layer = CMosB.wnwellCont)]
END; -- IsAbstract
SameRect: PROC [r1, r2: Rect, l1, l2: Layer] RETURNS [BOOL] ~ INLINE BEGIN
RETURN [(r1 = r2) AND (SameLayer [l1, l2])]
END; -- SameRect
SameLayer: PROC [l1, l2: Layer] RETURNS [BOOL] ~ INLINE BEGIN
RETURN [(l1 = l2) OR ((l1 = CMosB.pol) AND (l2 = Saguaro.gate)) OR ((l1 = Saguaro.gate) AND (l2 = CMosB.pol)) OR ((l1 = CMosB.nwellCont) AND (l2 = CMosB.pdif)) OR ((l1 = CMosB.pdif) AND (l2 = CMosB.nwellCont)) OR ((l1 = CMosB.pwellCont) AND (l2 = CMosB.ndif)) OR ((l1 = CMosB.ndif) AND (l2 = CMosB.pwellCont))]
END; -- SameLayer
Intersecting: PROC [r1, r2: Rect] RETURNS [BOOL] ~ INLINE BEGIN
r1 and r2 are assumed to be closed.
RETURN [(r1.x1 <= r2.x2) AND (r2.x1 <= r1.x2) AND (r1.y1 <= r2.y2) AND (r2.y1 <= r1.y2)]
END; -- Intersecting
IntersectingOpen: PROC [r1, r2: Rect] RETURNS [BOOL] ~ INLINE BEGIN
r1 and r2 are assumed to be open.
RETURN [(r1.x1 < r2.x2) AND (r2.x1 < r1.x2) AND (r1.y1 < r2.y2) AND (r2.y1 < r1.y2)]
END; -- IntersectingOpen
Contains: PROC [r1, r2: Rect] RETURNS [BOOL] ~ INLINE BEGIN
Returns r1 r2.
RETURN [(r1.x1 <= r2.x1) AND (r1.x2 >= r2.x2) AND (r1.y1 <= r2.y1) AND (r1.y2 >= r2.y2)]
END; -- Contains
Intersection: PROC [r1, r2: Rect] RETURNS [Rect] ~ INLINE BEGIN
r1 and r2 are assumed to be closed and intersecting.
RETURN [[MAX [r1.x1, r2.x1], MAX [r1.y1, r2.y1], MIN [r1.x2, r2.x2], MIN [r1.y2, r2.y2]]]
END; -- Intersection
Size: PROC [r: Rect] RETURNS [s: CD.Position] ~ INLINE BEGIN
s.x ← (r.x2 - r.x1); s.y ← (r.y2 - r.y1)
END; -- Size
Bloat: PROC [r: Rect, a: CD.Number] RETURNS [Rect] ~ INLINE BEGIN
r1 and r2 are assumed to be closed and intersecting.
RETURN [[(r.x1 - a), (r.y1 - a), (r.x2 + a), (r.y2 + a)]]
END; -- Bloat
Normalize: PROC [r: Rect] RETURNS [Rect] ~ INLINE BEGIN
RETURN [[MIN [r.x1, r.x2], MIN [r.y1, r.y2], MAX [r.x1, r.x2], MAX [r.y1, r.y2]]]
END; -- Normalize
DeleteRect: PROC [plane: Tess, rect: Rect];
LayerName: PROC [l: Layer] RETURNS [ROPE] ~ INLINE BEGIN
RETURN [Atom.GetPName [CD.LayerKey [l]]]
END; -- LayerName
CoreWireName: PROC [w: Wire] RETURNS [name: ROPE];
WireName: PROC [w: WireInstance] RETURNS [name: ROPE];
PrintChecked: CoreProperties.PropPrintProc;
DoNotDrawContext: CD.DrawContextProc;
DoNotDrawObject: CD.DrawProc;
Anathema: PROC [dogma: CARDINAL, state: State]
END.