DIRECTORY BasicTime USING [GMT, Now, Period], CD USING [CreateDrawRef, Design, DrawProc, DrawRef, Instance, InstanceList, Layer, Number, Object], CDCommandOps USING [CallWithResource], CDInstances USING [NewInstance], CDMenus USING [CreateEntry], CDOps USING [InstList, LayerName], CDProperties USING [GetPropFromObject], CDSequencer USING [Command, ImplementCommand], Core USING [CellType], CoreOps USING [PrintCellType], IO USING [int, noWhereStream, PutF, PutFR1, rope, STREAM], PrincOpsUtils USING [], Process USING [priorityBackground, SetPriority], Rope USING [Cat, ROPE], Sinix USING [ExtractCell, Mode], SinixCMos USING [extractAMode, extractBMode], TerminalIO USING [WriteRope], ViewerIO USING [CreateViewerStreams], ViewerTools USING [FindExistingViewer, Viewer], SoS USING [coreInconsistent, CheckDesignRules]; SoSCommandImpl: CEDAR PROGRAM IMPORTS BasicTime, CD, CDCommandOps, CDInstances, CDMenus, CDOps, CDProperties, CDSequencer, CoreOps, IO, Process, Rope, Sinix, SinixCMos, TerminalIO, ViewerIO, ViewerTools, SoS ~ BEGIN debug: BOOL _ FALSE; -- to start debugging enter: _ SoSCommandImpl.Debug[] timing: BOOL _ FALSE; -- turn off fast mouse dLog: IO.STREAM _ IO.noWhereStream; currentLambda: CD.Number; -- sorry for the hack instead of using the handle Execute: PROC [comm: CDSequencer.Command] ~ BEGIN ENABLE SoS.coreInconsistent => GOTO failure; abort: REF BOOL _ NEW [BOOL_FALSE]; ExtractAndCheck: PROC [comm: CDSequencer.Command] ~ BEGIN startTime1, startTime2, lapTime, stopTime: BasicTime.GMT; tech: Sinix.Mode; cdObjHint: ATOM _ $PWCoreLayout; SELECT comm.design.technology.key FROM $cmos => tech _ SinixCMos.extractAMode; $cmosB => tech _ SinixCMos.extractBMode; ENDCASE => BEGIN TerminalIO.WriteRope [Rope.Cat ["The technology ", comm.design.technology.name, " is not implemented in SoS.\n"]]; RETURN END; FOR all: CD.InstanceList _ CDOps.InstList [comm.design], all.rest WHILE all # NIL DO IF all.first.selected THEN BEGIN coreCell: Core.CellType; TRUSTED {Process.SetPriority [Process.priorityBackground]}; BEGIN startTime1 _ BasicTime.Now []; coreCell _ Sinix.ExtractCell [obj: all.first.ob, mode: tech].cellType; lapTime _ BasicTime.Now []; IF debug THEN CoreOps.PrintCellType [coreCell, dLog]; END; -- Extraction BEGIN startTime2 _ BasicTime.Now []; SoS.CheckDesignRules [coreCell, comm.design, abort, FALSE, cdObjHint, tech.instanceProp, tech.wireGeometryProp ! SoS.coreInconsistent => {TerminalIO.WriteRope ["\nCore data structure is inconsistent. You problably did not use today's keys.\n"]}]; stopTime _ BasicTime.Now []; IF debug THEN BEGIN currentLambda _ comm.design.technology.lambda; VerifyObjects [comm.design, all.first.ob] END END; IF timing THEN BEGIN TerminalIO.WriteRope [Rope.Cat ["\nElapsed time for extraction: ", TimeToRope [startTime1, lapTime]]]; TerminalIO.WriteRope [Rope.Cat [". Elapsed time for DRC: ", TimeToRope [startTime2, stopTime]]]; TerminalIO.WriteRope [Rope.Cat ["\nTotal elapsed time: ", TimeToRope [startTime1, stopTime], "\n"]] END END -- if selected ENDLOOP END; -- ExtractAndCheck TerminalIO.WriteRope ["SoS.\n"]; [] _ CDCommandOps.CallWithResource [ExtractAndCheck, comm, $SoS, abort]; TerminalIO.WriteRope ["SoS done.\n"]; EXITS failure => TerminalIO.WriteRope ["Core structure inconsistent. SoS aborted.\n"]; END; -- Execute VerifyRect: CD.DrawProc ~ BEGIN specialLayers: CD.Layer = 5; -- combined, highLightShade, highLightError, pinRepresentation IF (inst.ob.class.objectType = $Rect) AND (inst.ob.layer >= specialLayers) AND (CDProperties.GetPropFromObject [inst.ob, $SoSSeparationChecked] = NIL) THEN IO.PutF [stream: dLog, format: "Failed to check rectangle at [%g, %g] %l %g%l\n", v1: IO.int [pos.x / currentLambda], v2: IO.int [pos.y / currentLambda], v3: IO.rope ["b"], v4: IO.rope [CDOps.LayerName[inst.ob.layer]], v5: IO.rope ["B"]] END; -- VerifyRect VerifyObjects: PROC [design: CD.Design, obj: CD.Object] ~ BEGIN envelope: CD.Instance = CDInstances.NewInstance [obj]; drawRef: CD.DrawRef _ CD.CreateDrawRef [design]; drawRef.drawChild _ VerifyRect; envelope.location _ [0, 0]; obj.class.drawMe [envelope, envelope.location, 0, drawRef] END; -- VerifyObjects TimeToRope: PROC [from, to: BasicTime.GMT] RETURNS [time: Rope.ROPE] ~ BEGIN tmp: Rope.ROPE; sec: INT = BasicTime.Period [from, to]; min: INT = sec / 60; h: INT = min / 60; tmp _ IO.PutFR1 [value: IO.int [h]]; time _ SELECT h FROM = 0 => "00", < 10 => Rope.Cat ["0", tmp], ENDCASE => tmp; tmp _ IO.PutFR1 [value: IO.int [min MOD 60]]; time _ Rope.Cat [time, ":", SELECT min FROM = 0 => "00", < 10 => Rope.Cat ["0", tmp], ENDCASE => tmp]; tmp _ IO.PutFR1 [value: IO.int [sec MOD 60]]; time _ Rope.Cat [time, ":", SELECT sec FROM = 0 => "00", < 10 => Rope.Cat ["0", tmp], ENDCASE => tmp] END; -- TimeToRope Debug: PROC ~ BEGIN viewer: ViewerTools.Viewer; dummy: IO.STREAM; debug _ TRUE; -- Get all in one viewer _ ViewerTools.FindExistingViewer ["SoS debug"]; IF viewer # NIL THEN [in: dummy, out: dLog] _ ViewerIO.CreateViewerStreams ["SoS debug", viewer] ELSE BEGIN viewer _ ViewerTools.FindExistingViewer ["Terminal"]; [in: dummy, out: dLog] _ ViewerIO.CreateViewerStreams ["Terminal", viewer] END END; -- Debug CDSequencer.ImplementCommand [a: $SoSSel, p: Execute, queue: doQueue]; CDMenus.CreateEntry [menu: $ProgramMenu, entry: "Extract & DRC", key: $SoSSel]; IF debug THEN Debug []; TerminalIO.WriteRope ["SoS package loaded.\n"] END. ΞSoSCommandImpl.mesa Copyright (C) 1985 by Xerox Corporation. All rights reserved. Written by gbb September 20, 1985 11:52:24 am PDT gbb March 7, 1986 10:22:18 am PST Interface to ChipNDale. Called by ChipNDale upon activation of the command Protected procedure $nmos => tech _ $SinixNMosExtractProc; [inst: Instance, pos: Position, orient: Orientation, pr: REF DrawInformation] Traverses the cell and reports undiscovered rectangles. Although the INT returned BasicTime.Period is the same as GMT and might hence be loopholed to use IO.time from Conversions, the latter uses BasicTime.Unpack which allows only values that give a valid date. For convenience in debugging. Call this procedure in the Interpreter. ΚΣ˜™J™>Icode™1K™!—Icode2™šΟk ˜ Kšœ œœ˜#Kšœœ[˜cKšœ œ˜&Kšœ œ˜ Kšœœ˜Kšœœ˜"Kšœ œ˜'Kšœ œ˜.Kšœœ ˜Kšœœ˜Kšœœ*œ˜:Kšœœ˜Kšœœ#˜0Kšœœœ˜Kšœœ˜ Kšœ œ˜-Kšœ œ ˜Kšœ œ˜%Kšœ œ˜/Kšœœ&˜/—K˜LšΠlnœ ˜Lšœ œQœI˜±šœ˜LšœœœΟcΟo˜JKšœœœŸ˜,Kšœœ œ˜#Kšœœ Ÿ1˜KšΟnœœ˜1L™2Kšœœ ˜,Lš œœœœœœ˜#unitš‘œœ˜9K™Kšœ5œ˜9Kšœ˜Kšœ œ˜ šœ˜&Kšœ'˜'Kšœ(˜(Kšœ&™&šœ˜Kšœr˜rKš˜Kšœ˜——š œœ7œœ˜Tšœœ˜ Jšœ˜Kšœ4˜;š˜Kšœ˜KšœF˜FKšœ˜Kšœœ(˜5KšœŸ ˜—š˜Kšœ˜Kšœ4œ½˜φKšœ˜šœœ˜Kšœ.˜.Kšœ)˜)Kš˜—Kš˜—šœœ˜Kšœf˜fKšœa˜aKšœc˜cKš˜—KšœŸ˜—Jš˜—KšœŸ˜—Mšœ ˜ KšœH˜HKšœ%˜%š˜KšœP˜P—LšœŸ ˜—š‘ œœ ˜Kšœ9œ™MKšœœ Ÿ>˜[š œ$œ"œDœ˜›Kš œTœ"œ"œœ,œ ˜νKšœ˜—KšœŸ ˜—š ‘ œœ œœ ˜?K™7Kšœ œ*˜6Kšœ œ œ˜0Kšœ˜Kšœ˜Jšœ:˜:KšœŸ ˜—š ‘ œœœœ œ˜LKšœ Πekœ Οeœ’œ%’£œ£ œ£œ1™ΝKšœ œ˜Kšœœ˜'Kšœœ ˜Kšœœ ˜Mšœœœ ˜$Kšœœœ+œ˜NMšœœœ œ˜-Kšœœœ+œ ˜fMšœœœ œ˜-Kšœœœ+œ˜eKšœŸ ˜—š‘œœ˜K™EKšœ˜Kšœœœ˜KšœœŸ˜Kšœ6˜6šœ ˜KšœK˜K—šœ˜ Kšœ5˜5KšœJ˜JKš˜—KšœŸ˜ —LšœF˜FKšœO˜OKšœœ ˜Kšœ.˜.—Lšœ˜—…—―