DIRECTORY CD USING [LayerKey], CDBasicsInline USING [MapRect, Rect], CDProperties USING [RegisterProperty], Core USING [Wire], CoreGeometry USING [Decoration, EachInstanceProc, EnumerateGeometry, FlattenInstance, InlineBBox, Transformation], CoreProperties USING [RegisterProperty], CoreOps USING [GetShortWireName], DrcDebug, IO USING [atom, card, int, noWhereStream, PutF, refAny, rope, STREAM], MessageWindow USING [Append, Blink, Clear], Rope USING [ROPE], UserProfile USING [Boolean, CallWhenProfileChanges, ProfileChangedProc], ViewerIO USING [CreateViewerStreams], ViewerTools USING [FindExistingViewer, Viewer]; DrcDebugImpl: CEDAR PROGRAM IMPORTS CD, CDBasicsInline, CDProperties, CoreGeometry, CoreOps, CoreProperties, IO, MessageWindow, UserProfile, ViewerIO, ViewerTools EXPORTS DrcDebug ~ BEGIN OPEN DrcDebug; debug: PUBLIC BOOL _ UserProfile.Boolean [key: "Genista.Debug", default: FALSE]; trace: PUBLIC ATOM _ CoreProperties.RegisterProperty [$DrcTrace]; pause: PUBLIC ATOM _ CoreProperties.RegisterProperty [$break]; break: PUBLIC SIGNAL ~ CODE; dLog: PUBLIC IO.STREAM _ IO.noWhereStream; ActivateDebug: UserProfile.ProfileChangedProc ~ BEGIN profile: BOOL ~ UserProfile.Boolean [key: "Genista.Debug", default: FALSE]; IF debug THEN {IF (debug # profile) THEN debug _ FALSE} ELSE {IF (debug # profile) THEN Debug} END; -- ActivateDebug Debug: PUBLIC PROC ~ BEGIN viewerName: Rope.ROPE ~ "Genista debug"; viewer: ViewerTools.Viewer _ ViewerTools.FindExistingViewer [viewerName]; debug _ TRUE; -- Get all in one dLog _ ViewerIO.CreateViewerStreams [viewerName, viewer].out END; -- Debug PrintWire: PUBLIC PROC [w: Core.Wire] ~ BEGIN dLog.PutF ["%g %g %g\n", IO.rope [CoreOps.GetShortWireName[w]], IO.card [LOOPHOLE[w]], IO.refAny [w]]; FOR i: NAT IN [0 .. w.size) DO dLog.PutF ["\t(%g) %g %g %g\n", IO.card [i], IO.rope [CoreOps.GetShortWireName[w[i]]], IO.card [LOOPHOLE[w[i]]], IO.refAny [w[i]]] ENDLOOP END; -- PrintWire GeometryInWire: PUBLIC PROC [w: Core.Wire, transf: CoreGeometry.Transformation, handle: CoreGeometry.Decoration] ~ BEGIN ListRect: CoreGeometry.EachInstanceProc ~ BEGIN SELECT instance.obj.class.objectType FROM $Rect, $WellRect => BEGIN r: CDBasicsInline.Rect _ CDBasicsInline.MapRect [CoreGeometry.InlineBBox [instance], transf]; dLog.PutF ["\t%g [x1: %g, y1: %g, x2: %g, y2: %g]\n", IO.atom [CD.LayerKey [instance.obj.layer]], IO.int [r.x1], IO.int [r.y1], IO.int [r.x2], IO.int [r.y2]] END; $AlignmentMarkOb, $SymbolicSegment, $PinOb0 => NULL; ENDCASE => quit _ CoreGeometry.FlattenInstance [instance, ListRect] END; -- ListRect dLog.PutF ["Wire %g:\n", IO.rope [CoreOps.GetShortWireName [w]]]; [] _ handle.EnumerateGeometry [w, ListRect]; dLog.PutF ["\n"] END; -- GeometryInWire ImportantMessage: PUBLIC PROC [msg: Rope.ROPE] ~ BEGIN MessageWindow.Clear []; MessageWindow.Append [msg]; MessageWindow.Blink [] END; -- ImportantMessage [] _ CDProperties.RegisterProperty [trace, $gbb]; [] _ CDProperties.RegisterProperty [pause, $gbb]; IF debug THEN Debug[]; UserProfile.CallWhenProfileChanges [ActivateDebug] END. ΄DrcDebugImpl.mesa Copyright Σ 1987, 1988 by Xerox Corporation. All rights reserved. Written by gbb, January 12, 1987 11:47:17 am PST gbb January 16, 1988 3:25:33 pm PST Note: Output to noWhereStream passes all I/O code, and hence is very slow ! For convenience in debugging. Call this procedure in the Interpreter. PROC [instance: CdInsts] RETURNS [quit: BOOL _ FALSE] Displays the message in the message viewer and blinks it. Κ™˜codešœ™KšœC™CKšœ0™0K™#K™—code2šΟk ˜ Kšœœ ˜Kšœœ˜%Kšœ œ˜&Kšœœ˜Kšœ œ`˜rKšœœ˜(Kšœœ˜!Kšœ ˜ Kšœœ6œ˜FKšœœ˜+Kšœœœ˜Kšœ œ7˜HKšœ œ˜%Kšœ œ˜/—LšΠblΠlnœ ˜LšœœGœ3˜†Lšœ ˜šœœœ ˜Lšœœœ7œ˜PKšœœœ/˜AKšœœœ,˜>Kšœœœœ˜šœœœ œ˜*KšœΟe œ.™K—šΟn œ#˜5Lšœ œ7œ˜KKš œœœœ œ˜7Kšœœœ˜&LšœΟc˜—š‘œœœ˜K™EKšœœ˜(KšœI˜IKšœœ’˜Kšœ<˜