CornerBasedDRCTest.mesa
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
Created by: Christian Jacobi, December 12, 1985 2:19:57 pm PST
Last edited by: Christian Jacobi, December 2, 1986 5:18:13 pm PST
DIRECTORY
Atom,
CD,
CDBasics,
CDCommandOps,
CDCSUtil,
CDErrors,
CDOps,
CDProperties,
CDSequencer,
CDSimpleRules,
CStitching,
CornerBasedDRC,
D2Basic,
IO,
Rope,
TerminalIO;
CornerBasedDRCTest: CEDAR PROGRAM
IMPORTS Atom, CDBasics, CDCommandOps, CDCSUtil, CDErrors, CDOps, CDProperties, CDSequencer, CDSimpleRules, CornerBasedDRC, IO, TerminalIO =
BEGIN
CheckProc: TYPE = PROC [cw: CDCSUtil.CDWorld, errorOwner: ATOMNIL] RETURNS [errNo: INT𡤀];
okIfConnected: BOOL = FALSE; --fails if true
CornerBasedCheckPolySpacing: PROC [cw: CDCSUtil.CDWorld, errorOwner: ATOM] RETURNS [errNo: INT𡤀] = {
tech: CD.Technology ← cw.design.technology;
poly: CD.Layer ← CDSimpleRules.GetLayer[tech, $poly];
pLayers: CDCSUtil.Layers ← LIST[NEW[CDCSUtil.LayerDescRec←[poly]]];
pol: CDCSUtil.Tesselation ← CDCSUtil.Make[cw, pLayers];
rule: CornerBasedDRC.Rule ← NEW[CornerBasedDRC.RuleRep←[
extent: CDSimpleRules.MinDist[poly, poly],
okIfConnected: okIfConnected,
message: "poly spacing"
]];
task: REF CornerBasedDRC.DrcTask ← NEW[CornerBasedDRC.DrcTask←[
geometry: pol,
rules: LIST[rule],
error: CBErrorProc,
properties: Atom.PutPropOnList[NIL, $errorOwner, errorOwner],
data: cw
]];
rule.isStuff[CornerBasedDRC.nodeConstraintIndex] ← TRUE;
rule.isError[CornerBasedDRC.nodeConstraintIndex] ← TRUE;
CornerBasedDRC.Check[task, CDBasics.Extend[cw.restrict, MAX[rule.extent, cw.minGrowClip]]];
};
CBErrorProc: CornerBasedDRC.ErrorProc = {
--PROC [task: REF DrcTask, rule: Rule, r: CD.Rect];
what: CDCSUtil.CDWorld ← NARROW[task.data];
[] ← CDErrors.IncludeMessage[design: what.design, ob: what.ob, rect: CDCSUtil.BackRect[what, r], message: rule.message, owner: NARROW[Atom.GetPropFromList[task.properties, $errorOwner]]];
};
------------------------------------------------
checkProc: CheckProc ← CornerBasedCheckPolySpacing;
CornerBasedDRCTestComm: PROC [comm: CDSequencer.Command] = {
inst: CD.Instance;
inst ← CDOps.TheInstance[design: comm.design, text: "CDCS\n"];
IF inst#NIL THEN {
no: INT;
cw: CDCSUtil.CDWorld ← NEW[CDCSUtil.CDWorldRec ← [
design: comm.design,
ob: inst.ob,
propRef: CDProperties.InitPropRef[]
]];
no ← checkProc[cw, errorOwner].errNo;
TerminalIO.PutF[" CDCS found %g problems\n", IO.int[no]];
};
};
RemErrCommand: PROC [comm: CDSequencer.Command] = {
inst: CD.Instance;
inst ← CDOps.TheInstance[design: comm.design, text: "remove errors"];
IF inst#NIL THEN {
CDErrors.RemoveMessages[design: comm.design, ob: inst.ob, owner: NIL, alsoOthers: TRUE];
};
};
errorOwner: ATOM ← $CornerBasedDRCTest;
[] ← CDProperties.RegisterProperty[errorOwner, $chj];
CDCommandOps.RegisterWithMenu[menu: $ProgramMenu, entry: "CornerBasedDRCTest", key: $CornerBasedDRCTest];
CDSequencer.ImplementCommand[key: $CornerBasedDRCTest, proc: CornerBasedDRCTestComm, queue: doQueue];
CDCommandOps.RegisterWithMenu[menu: $ProgramMenu, entry: "remove errors", key: $CornerBasedDRCTestRemoveErrs];
CDSequencer.ImplementCommand[key: $CornerBasedDRCTestRemoveErrs, proc: RemErrCommand, queue: doQueue];
END.