DIRECTORY
CD USING [DrawProc, DrawContextProc],
CMosB USING [ndif, nwell, nwellCont, pdif, pwell, pwellCont, wndif, wnwellCont, wpdif, wpwellCont],
CoreProperties USING [PropPrintProc],
CoreOps USING [GetFullWireName, GetShortWireName],
CStitching USING [ChangeRect],
Drc USING [State, Rect, Wire, WireInstance],
DrcDebug USING [ImportantMessage],
DrcUtilities,
IO USING [card, Put1, PutFR, rope],
Rope USING [IsEmpty, ROPE],
UserProfile USING [Boolean, CallWhenProfileChanges, ProfileChangedProc];
DrcUtilitiesImpl:
CEDAR
PROGRAM
IMPORTS CMosB, CoreOps, CStitching, DrcDebug, IO, Rope, UserProfile
EXPORTS DrcUtilities
SHARES Drc
Utilities
diffContactLayer: PUBLIC ARRAY Layer OF BOOL ← ALL [FALSE];
ignoreConnectivity: PUBLIC BOOL ← UserProfile.Boolean ["Genista.EmulateMayday", TRUE];
empty: REF ~ NIL;
DeleteRect:
PUBLIC
PROC [plane: Tess, rect: Rect] ~
BEGIN
plane.ChangeRect [rect, empty]
END;
CoreWireName:
PUBLIC
PROC [w: Wire]
RETURNS [name:
ROPE] ~
BEGIN
Hides all the wire name hokus-pokus.
name ← CoreOps.GetShortWireName [w];
IF name.IsEmpty THEN name ← CoreOps.GetFullWireName [w, w];
IF name.IsEmpty THEN name ← IO.PutFR ["[%g]", IO.card [LOOPHOLE [w]]]
END; -- CoreWireName
WireName:
PUBLIC
PROC [w: WireInstance]
RETURNS [name:
ROPE] ~
BEGIN
Hides all the wire name hokus-pokus.
name ← CoreOps.GetShortWireName [w.global];
IF name.IsEmpty THEN name ← CoreOps.GetFullWireName [w.global, w.local];
IF name.IsEmpty THEN name ← CoreOps.GetShortWireName [w.local];
IF name.IsEmpty THEN name ← IO.PutFR ["[%g]", IO.card [LOOPHOLE [w.global]]]
END; -- WireName
PrintChecked:
PUBLIC CoreProperties.PropPrintProc ~
BEGIN
to.Put1 [IO.rope ["Verified by Genista. "]]
END; -- PrintChecked
EmulateMayday: UserProfile.ProfileChangedProc ~
BEGIN
old: BOOL ~ ignoreConnectivity;
ignoreConnectivity ← UserProfile.Boolean ["Genista.EmulateMayday", TRUE];
IF (ignoreConnectivity # old)
THEN
DrcDebug.ImportantMessage [IF ignoreConnectivity THEN "Will ignore Core's connectivity information" ELSE "Rectangles on the same wire are supposed to be correct"]
END; -- EmulateMayday
DoNotDrawContext: PUBLIC CD.DrawContextProc ~ {};
DoNotDrawObject: PUBLIC CD.DrawProc ~ {};
Anathema:
PUBLIC
PROC [dogma:
CARDINAL, state: State] ~
BEGIN
Called every time a dogma is violated, but not a design rule. The cost of fixing this is exponential, so the time to communicate an anathema is irrelevant.
SELECT dogma FROM
0 => "Cell not correct in isolation but correct in context",
1 => "Rectangle pair not correct in isolation but correct in context",
2 => "Rectangle pair not permitted but allowed by technology",
3 => "Rule is an exception",
ENDCASE => "Religion of pairwise correctness at every level was broken but is forgiven (exponentially)"
state.anathemas[dogma] ← state.anathemas[dogma].SUCC
END; -- Anathema
diffContactLayer[ndif] ← diffContactLayer[pdif] ← diffContactLayer[wndif] ← diffContactLayer[wpdif] ← diffContactLayer[pwell] ← diffContactLayer[nwell] ← diffContactLayer[pwellCont] ← diffContactLayer[nwellCont] ← diffContactLayer[wpwellCont] ← diffContactLayer[wnwellCont] ← TRUE;
UserProfile.CallWhenProfileChanges [EmulateMayday]