DIRECTORY Atom, CD, CDBasics, CDCSUtil, CDErrors, CDInstances, CDProperties, CDSequencer, CDSimpleRules, CDValue, CDViewer, CedarProcess, Process, Rope, TerminalIO, ViewerClasses, ViewerOps; CDBackgroundCheck: CEDAR PROGRAM IMPORTS Atom, CD, CDBasics, CDCSUtil, CDErrors, CDInstances, CDProperties, CDSequencer, CDSimpleRules, CDValue, CDViewer, CedarProcess, Process, Rope, TerminalIO, ViewerOps = BEGIN Message: PROC [comm: CDSequencer.Command] = { h: CDCSUtil.CDWorld ~ NARROW[comm.data]; errors: CDCSUtil.Tesselation ~ NARROW[CDProperties.GetProp[h.propRef, $err]]; layerName: Rope.ROPE ~ NARROW[CDProperties.GetProp[h.propRef, $layer]]; key: ATOM ~ Atom.MakeAtom[Rope.Concat["||ck-", layerName]]; IF CDValue.Fetch[h.design, key]=h.design.actual.first.dummyCell.ob THEN CDErrors.RemoveMessages[h.design, NIL, key] ELSE CDErrors.RemoveAllMessages[h.design, key]; [] _ CDCSUtil.ExtractErrors[h, errors, Rope.Concat[layerName, " spacing"], key]; CDValue.Store[h.design, key, h.design.actual.first.dummyCell.ob]; }; CheckSpacing: PROC [d: CD.Design, r: CD.Rect, layer: CD.Layer] = { scaleNum: INT = 2; h: CDCSUtil.CDWorld _ NEW[CDCSUtil.CDWorldRec _ [design: d, restrict: r, scale: [num: scaleNum], propRef: CD.InitPropRef[]]]; original: CDCSUtil.Tesselation _ CDCSUtil.Make[h, LIST[NEW[CDCSUtil.LayerDescRec_[layer]]]]; distRule: CD.Number _ CDSimpleRules.MinDist[layer, layer]; amount: INT _ (scaleNum*distRule)/2-1; grown: CDCSUtil.Tesselation _ CDCSUtil.Grow[original, amount]; again: CDCSUtil.Tesselation _ CDCSUtil.Grow[grown, -amount]; errors: CDCSUtil.Tesselation _ CDCSUtil.AndNot[again, original]; CDProperties.PutProp[h.propRef, $err, errors]; CDProperties.PutProp[h.propRef, $layer, Atom.GetPName[CD.LayerKey[layer]]]; CDSequencer.ExecuteProc[proc: Message, queue: doQueueAndMark, comm: NEW[CDSequencer.CommandRec _ [data: h, design: d]] ]; }; CheckProcess: PROC [] = { d: CD.Design; md: CD.Number; CedarProcess.SetPriority[CedarProcess.Priority[background]]; DO -- forever v: ViewerClasses.Viewer _ CDViewer.LastViewer[]; IF v#NIL AND ViewerOps.FetchProp[v, $backCheck]=$y AND (d_CDViewer.DesignOf[v])#NIL THEN { r: CD.Rect _ CDViewer.VisibleRect[v]; --handle view rect only for speed up IF d.actual.rest#NIL THEN r _ CDBasics.Intersection[r, CDInstances.InstRectO[d.actual.first.mightReplace]]; IF r.y2-r.y1<150*d.technology.lambda THEN FOR ll: LIST OF CD.Layer _ d.technology.usedLayers, ll.rest WHILE ll#NIL DO IF (md_CDSimpleRules.MinDist[ll.first, ll.first])>0 THEN CheckSpacing[d, CDBasics.Extend[r, md+d.technology.lambda], ll.first]; Process.Pause[Process.MsecToTicks[1]]; ENDLOOP; }; d _ NIL; --gc Process.Pause[Process.MsecToTicks[500]]; ENDLOOP; }; CheckStartCommand: PROC [comm: CDSequencer.Command] = { v: ViewerClasses.Viewer _ CDViewer.GetViewer[comm]; TerminalIO.PutRope[" start background checking for this viewer\n"]; IF v#NIL THEN ViewerOps.AddProp[v, $backCheck, $y]; }; CheckStopCommand: PROC [comm: CDSequencer.Command] = { v: ViewerClasses.Viewer _ CDViewer.GetViewer[comm]; TerminalIO.PutRope[" stop background checking in this viewer\n"]; IF v#NIL THEN ViewerOps.AddProp[v, $backCheck, NIL]; }; CDSequencer.ImplementCommand[$BackgroundCheckStart, CheckStartCommand,, dontQueue]; CDSequencer.ImplementCommand[$BackgroundCheckStop, CheckStopCommand,, dontQueue]; TRUSTED { Process.Detach[FORK CheckProcess[]] }; END. $CDBackgroundCheck.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, February 19, 1986 10:12:40 am PST Last Edited by: Christian Jacobi, December 1, 1986 7:05:17 pm PST --restrict further to pushed in cell --restrict further to handy scales ÊF˜codešœ™Kšœ Ïmœ1™K™A—Kšž œžœ¬˜¾K˜šÏnœžœž˜ Kšžœžœž˜®—Kšžœ˜K˜K˜šŸœžœ ˜-Kšœžœ ˜(Kšœžœ(˜MKšœžœžœ*˜GKšœžœ2˜;šžœAž˜GJšœ"žœ˜+—šžœ˜Jšœ*˜*—JšœP˜PKšœA˜AKšœ˜—K˜š Ÿ œžœžœ žœžœ ˜BKšœ žœ˜KšœžœQžœ˜}Jšœ2žœžœ"˜\Jšœ žœ.˜:Jšœžœ˜&Kšœ>˜>Kšœ<˜˜>Jšœžœ/˜8Jšœ˜—Kšœ˜—K˜šÐbn œžœ˜Kšœžœ žœ˜Kšœ<˜<šžœÏc ˜ Kšœ0˜0š žœžœžœ'žœžœžœ˜ZKšœžœ!¡$˜JKšœ$™$šžœžœžœ˜KšœQ˜Q—Kšœ"™"šžœ#ž˜)š žœžœžœžœ*žœžœž˜Kšžœ2žœ˜9KšœF˜F—Kšœ&˜&Kšžœ˜——Kšœ˜—Kšœžœ¡˜ Kšœ(˜(Kšžœ˜—Kšœ˜—K˜š œžœ ˜7Kšœ3˜3KšœC˜CKšžœžœžœ&˜3Kšœ˜—K˜š œžœ ˜6Kšœ3˜3KšœA˜AKšžœžœžœ"žœ˜4Kšœ˜—K˜KšœS˜SKšœQ˜QKšžœžœ˜0Kšžœ˜K˜—…— (’