DIRECTORY BasicTime USING [GMT, Now, Period], CD USING [Design, Instance, InstanceList, Layer, Position, Technology], CDBasics, CDCommandOps USING [DoWithResource], CDEnvironment USING [ExecFileEntry], CDInstances USING [OnlySelected], CDLayers USING [CurrentLayer], CDOps USING [InstList, LayerRope, ObjectRope], CDProperties USING [GetTechnologyProp, PutTechnologyProp], CDSequencer USING [Command, CommandRec, ImplementCommand, UseAbortFlag], IO USING [EndOfStream, Error, GetInt, int, PutFR1, RIS, STREAM], PrincOpsUtils USING [], Process USING [priorityBackground, SetPriority], Rope USING [Cat, ROPE], SX USING [TechHandle], SXAccess USING [], SXAccessInternal USING [Analyze], SXAtoms USING [analyzeAndRoseSelected, analyzeAndThymeSelected, analyzeSelected, highlightKeyboardCoordsNode, highlightPointedNode, rosePrint, spinifex, thymePrint], SXHighlightNode USING [HighlightNode], TerminalIO USING [RequestRope, PutRope, PutRopes]; SXAccessImpl: CEDAR PROGRAM IMPORTS BasicTime, CDBasics, CDCommandOps, CDEnvironment, CDInstances, CDLayers, CDOps, CDProperties, CDSequencer, IO, Process, Rope, SXAccessInternal, SXAtoms, SXHighlightNode, TerminalIO EXPORTS SXAccess = BEGIN timing: BOOL _ FALSE; design: PUBLIC CD.Design _ NIL; formatKey: PUBLIC REF _ NIL; invocation: PUBLIC REF _ NIL; stopFlag: PUBLIC REF BOOL _ NIL; sxTech: PUBLIC REF SX.TechHandle _ NIL; CallingRec: TYPE = RECORD [ design: CD.Design, hierarchyRoots: CD.InstanceList, formatKey: REF, stopFlag: REF BOOL]; Analyze: PUBLIC PROC [design: CD.Design, hierarchyRoots: CD.InstanceList, formatKey: REF, stopFlag: REF BOOL _ NIL] RETURNS [skipped: BOOL _ FALSE] = BEGIN ik: REF CallingRec; comm: CDSequencer.Command; IF (stopFlag = NIL) THEN stopFlag _ NEW [BOOL _ FALSE]; ik _ NEW [CallingRec _ [design: design, hierarchyRoots: hierarchyRoots, formatKey: formatKey, stopFlag: stopFlag]]; comm _ NEW [CDSequencer.CommandRec _ [key: $SX, design: design, ref: ik]]; skipped _ CDCommandOps.DoWithResource [PseudoCommand, comm, $SX]; IF skipped THEN TerminalIO.PutRope ["** analysis skipped\n"] END; -- Analyze PseudoCommand: PROC [comm: CDSequencer.Command] = BEGIN GetSXTech: PROC [technology: CD.Technology] RETURNS [th: REF SX.TechHandle] = BEGIN WITH CDProperties.GetTechnologyProp [technology, SXAtoms.spinifex] SELECT FROM x: REF SX.TechHandle => th _ x; ENDCASE => th _ NIL; IF th = NIL THEN TerminalIO.PutRope ["Technology not implemented for Spinifex\n"] END; callParameters: REF CallingRec = NARROW [comm.ref]; design _ callParameters.design; formatKey _ callParameters.formatKey; invocation _ NEW [INT]; stopFlag _ callParameters.stopFlag; stopFlag^ _ FALSE; CDSequencer.UseAbortFlag[design, stopFlag]; sxTech _ GetSXTech [design.technology]; IF (sxTech # NIL) THEN ProtectedAnalyze [callParameters.hierarchyRoots]; design _ NIL; invocation _ NIL; formatKey _ NIL; sxTech _ NIL END; -- PseudoCommand ProtectedAnalyze: PROC [hierarchyRoots: CD.InstanceList] = BEGIN SXAccessInternal.Analyze[hierarchyRoots] END; LoadTechnology: PROC [t: CD.Technology] = { IF CDProperties.GetTechnologyProp[t, $SpinifexLoaded]#$TRUE THEN { key: Rope.ROPE _ Rope.Cat["Spinifex-", t.name]; CDProperties.PutTechnologyProp[t, $SpinifexLoaded, $TRUE]; TerminalIO.PutRope ["load technology dependent part of spinifex\n"]; CDEnvironment.ExecFileEntry[key: key, technology: t] }; }; AnalyzeComm: PROCEDURE [comm: CDSequencer.Command] = BEGIN stopFlag: REF BOOL _ NEW [BOOL_FALSE]; ProtectedAnalyzeComm: PROCEDURE [comm: CDSequencer.Command] = BEGIN startTime, stopTime: BasicTime.GMT; -- for internal use selected: CD.InstanceList _ CDInstances.OnlySelected [CDOps.InstList[comm.design]]; IF selected=NIL THEN TerminalIO.PutRope [ "No selection.\n"] ELSE { skipped: BOOL; format: REF ANY; CDSequencer.UseAbortFlag[comm.design, stopFlag]; LoadTechnology[comm.design.technology]; SELECT comm.key FROM SXAtoms.analyzeAndThymeSelected => { TerminalIO.PutRope ["Analysis and Thyme format extraction of\n"]; format _ SXAtoms.thymePrint; }; SXAtoms.analyzeAndRoseSelected => { TerminalIO.PutRope ["Analysis and Rosemary format extraction of\n"]; format _ SXAtoms.rosePrint; }; ENDCASE => { TerminalIO.PutRope ["Analysis of\n"]; format _ NIL; }; FOR list: CD.InstanceList _ selected, list.rest WHILE list#NIL DO TerminalIO.PutRopes[" ", CDOps.ObjectRope[list.first.ob], "\n"]; ENDLOOP; TRUSTED {Process.SetPriority [Process.priorityBackground]}; startTime _ BasicTime.Now []; skipped _ Analyze [design: comm.design, hierarchyRoots: selected, formatKey: format, stopFlag: stopFlag]; stopTime _ BasicTime.Now []; IF skipped THEN TerminalIO.PutRope ["Analysis skipped.\n"] ELSE TerminalIO.PutRope ["Analysis complete.\n"]; IF timing THEN TerminalIO.PutRope [Rope.Cat ["Total elapsed time: ", TimeToRope [startTime, stopTime], "\n"]] } END; -- ProtectedAnalyzeComm TerminalIO.PutRope ["Spinifex.\n"]; [] _ CDCommandOps.DoWithResource [ProtectedAnalyzeComm, comm, $Spinifex] END; -- AnalyzeComm 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 HighLightNode: PROCEDURE [comm: CDSequencer.Command] = BEGIN layer: CD.Layer = CDLayers.CurrentLayer [comm.design]; layerName: Rope.ROPE = CDOps.LayerRope [layer]; TerminalIO.PutRope [Rope.Cat ["Highlight Node (", layerName, ", pointed)\n"]]; LoadTechnology[comm.design.technology]; TRUSTED {Process.SetPriority[Process.priorityBackground]}; SXHighlightNode.HighlightNode [comm.design, comm.pos, layer] END; HighLightNodeFromKeyboard: PROCEDURE [comm: CDSequencer.Command] = BEGIN ENABLE { IO.Error => { TerminalIO.PutRope [" Invalid Coords (Format is: x y )\n"]; ERROR ABORTED }; IO.EndOfStream => { TerminalIO.PutRope [" Invalid Coords (Format is: x y )\n"]; ERROR ABORTED }; }; coords: CD.Position _ [0,0]; layer: CD.Layer = CDLayers.CurrentLayer [comm.design]; layerName: Rope.ROPE = CDOps.LayerRope [layer]; prompt: Rope.ROPE = Rope.Cat ["Highlight node on layer ", layerName, " as selected on control panel.\n Enter coords of node relative to currently pushed cell > "]; inLine: IO.STREAM ~ IO.RIS [TerminalIO.RequestRope [prompt]]; coords.x _ IO.GetInt[inLine] * comm.design.technology.lambda; coords.y _ IO.GetInt[inLine] * comm.design.technology.lambda; TRUSTED {Process.SetPriority [Process.priorityBackground]}; BEGIN a: CD.Instance ~ comm.design.actual.first.mightReplace; IF a # NIL THEN coords _ CDBasics.MapPoint [coords, a.trans] END; LoadTechnology[comm.design.technology]; SXHighlightNode.HighlightNode [comm.design, coords, layer] END; -- HighLightNodeFromKeyboard CDSequencer.ImplementCommand [key: SXAtoms.analyzeSelected, proc: AnalyzeComm, queue: doQueue]; CDSequencer.ImplementCommand [key: SXAtoms.analyzeAndThymeSelected, proc: AnalyzeComm, queue: doQueue]; CDSequencer.ImplementCommand [key: SXAtoms.analyzeAndRoseSelected, proc: AnalyzeComm, queue: doQueue]; CDSequencer.ImplementCommand [key: SXAtoms.highlightPointedNode, proc: HighLightNode, queue: doQueue]; CDSequencer.ImplementCommand [key: SXAtoms.highlightKeyboardCoordsNode, proc: HighLightNodeFromKeyboard, queue: doQueue]; TerminalIO.PutRope ["Spinifex layout analysis package loaded.\n"] END. ŒSXAccessImpl.mesa Copyright c 1984, 1985 by Xerox Corporation. All rights reserved. Written by Christian Jacobi, April 2, 1985 5:11:35 pm PST Written by Shand, September 12, 1983 11:40 pm Last Edited by: Christian Jacobi, November 7, 1986 4:15:01 pm PST Last edited by: gbb March 26, 1986 2:53:33 pm PST Exported stuff Variables only valid inside an analysis invocation If stopFlag^ gets true, analysis might be aborted Interactive Command 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. Transform coords from those of currently pushed appliaction to those of screen. SpinifexCommands Edited on October 22, 1984 11:57:12 am PDT, by gbb Implementation of dynamic menu entries (new feature of Chipndale). changes to: DIRECTORY: added CDMenus, IMPORTS: added CDMenus, CDSequencer: parameters specified using keyword notation, CDMenus: new, create a dynamic menu entry. CDMenus: "Hilight pointed node" now in RectProgramMenu Edited on December 6, 1984 3:14:29 pm PST, by Jacobi changed the formatting, simplified, use of CDInstances.OnlySelected, Edited on December 18, 1984 6:22:50 pm PST, by Jacobi AnaysisAccess changed Edited on January 30, 1985 7:49:17 pm PST, by Jacobi Clear of SpinifexProperties removed and put in proper module Edited on March 11, 1985 2:51:32 am PST, by Shand New Command HighLightNodeFromKeyboard changes to: DIRECTORY, HighLightNodeFromKeyboard, AnalyzeComm, HighLightNodeFromKeyboard, HighLightNodeFromKeyboard gbb July 31, 1985 6:53:46 pm PDT Added command for Core output. changes to: DIRECTORY, AnalyzeComm, CDSequencer, CDMenus gbb November 5, 1985 5:41:29 pm PST Converted to ChipNDale 2.2 gbb November 24, 1985 4:08:16 pm PST Removed command for Core output. gbb February 13, 1986 5:26:08 pm PST Merged in SXCommands. changes to: DIRECTORY, SXAccessImpl, design, formatKey, invocation, stopFlag, sxTech, CallingRec, Analyze, PseudoCommand, GetSXTech (local of PseudoCommand), ProtectedAnalyze, AnalyzeComm, ProtectedAnalyzeComm (local of AnalyzeComm), HighLightNode, HighLightNodeFromKeyboard, CDSequencer, CDSequencer, CDSequencer, CDSequencer, CDSequencer, CDMenus, CDMenus, CDMenus, CDMenus, CDMenus, TerminalIO, END gbb March 14, 1986 11:40:47 am PST Improved user interface. changes to: DIRECTORY, SXAccessImpl, HighLightNode, HighLightNodeFromKeyboard gbb March 16, 1986 3:42:55 pm PST Fixed a synchronisation problem in getting the current layer. changes to: DIRECTORY, SXAccessImpl, HighLightNode, HighLightNodeFromKeyboard gbb March 25, 1986 10:33:18 am PST Changed labels of menu entries. Κΰ˜code™Kšœ Οmœ7™BK™9K™-K™AK™1—code2šΟk ˜ Kšœ žœžœ˜#Kšžœžœ?˜GKšœ ˜ Kšœ žœ˜$Kšœžœ˜$Kšœ žœ˜!Kšœ žœ˜Kšœžœ#˜.Kšœ žœ(˜:Kšœ žœ7˜HKšžœžœ+žœžœ˜@Kšœžœ˜Kšœžœ#˜0Kšœžœžœ˜Kšžœžœ˜Kšœ žœ˜Kšœžœ ˜!Kšœžœ˜˜₯Kšœžœ˜&Kšœ žœ"˜2—šΠbl œžœž˜LšžœlžœG˜ΌLšžœ ž˜Lšœžœžœ˜—head™Lšœ2™2Kšœžœžœ žœ˜Kšœ žœžœžœ˜Kšœ žœžœžœ˜Kš œ žœžœžœžœ˜ Kš œžœžœžœ žœžœ˜'Lšœ žœžœ žœžœžœ žœžœ˜tšΟnœžœžœ žœžœžœ žœžœžœžœ žœžœž˜›Kšœ1™1Kšœžœ ˜Kšœ˜Kš žœ žœžœ žœžœžœ˜7Kšœžœk˜sKšœžœ@˜JKšœA˜AKšžœ žœ-˜