SXCommands.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Written by Shand, September 12, 1983 11:40 pm
Last Edited by: Shand, March 11, 1985 2:51:32 am PST
Last Edited by: Jacobi, April 8, 1985 12:14:48 pm PST
Last edited by: gbb November 24, 1985 4:08:32 pm PST
DIRECTORY
CD USING [Design, Instance, InstanceList, Object, Position],
CDCommandOps USING [CallWithResource],
CDInstances USING [OnlySelected],
CDMenus USING [CreateEntry],
CDOps USING [InstList, Info],
CDOrient USING [MapPoint],
CDSequencer USING [Command, ImplementCommand],
IO USING [EndOfStream, Error, GetInt, RIS, STREAM],
Process USING [priorityBackground, SetPriority],
Rope USING [Cat, ROPE],
SXAccess USING [Analyze],
SXAtoms USING [analyzeAndRoseSelected, analyzeAndThymeSelected, analyzeSelected, highlightKeyboardCoordsNode, highlightPointedNode, rosePrint, thymePrint],
SXHighlightNode USING [HighlightNode],
TerminalIO USING [RequestRope, WriteRope];
SXCommands: CEDAR PROGRAM
IMPORTS CDCommandOps, CDInstances, CDMenus, CDOps, CDOrient, CDSequencer, IO, Process, Rope, SXAccess, SXAtoms, SXHighlightNode, TerminalIO =
BEGIN
AnalyzeComm: PROCEDURE [comm: CDSequencer.Command] =
BEGIN
stopFlag: REF BOOLNEW[BOOLFALSE];
ProtectedAnalyzeComm: PROCEDURE [comm: CDSequencer.Command] =
BEGIN
selected: CD.InstanceList ← CDInstances.OnlySelected[CDOps.InstList[comm.design]];
IF selected=NIL THEN TerminalIO.WriteRope[ "no selection\n"]
ELSE {
skipped: BOOL;
format: REF ANY;
SELECT comm.a FROM
SXAtoms.analyzeAndThymeSelected => {
TerminalIO.WriteRope["Analysis and Thyme format extraction of\n"];
format ← SXAtoms.thymePrint;
};
SXAtoms.analyzeAndRoseSelected => {
TerminalIO.WriteRope["Analysis and Rosemary format extraction of\n"];
format ← SXAtoms.rosePrint;
};
ENDCASE => {
TerminalIO.WriteRope["Analysis of\n"];
format ← NIL;
};
FOR list: CD.InstanceList ← selected, list.rest WHILE list#NIL DO
TerminalIO.WriteRope[Rope.Cat[" ", CDOps.Info[list.first.ob], "\n"]];
ENDLOOP;
TRUSTED { Process.SetPriority[Process.priorityBackground] };
skipped ← SXAccess.Analyze[design: comm.design, hierarchyRoots: selected, formatKey: format, stopFlag: stopFlag];
IF skipped THEN TerminalIO.WriteRope["Analysis skipped\n"]
ELSE TerminalIO.WriteRope["Analysis complete\n"]
}
END;
TerminalIO.WriteRope["Spinifex\n"];
[] ← CDCommandOps.CallWithResource[ProtectedAnalyzeComm, comm, $Spinifex, stopFlag];
END;
HighLightNode: PROCEDURE [comm: CDSequencer.Command] =
BEGIN
TerminalIO.WriteRope["Highlight Node (cur layer, pointed)\n"];
TRUSTED { Process.SetPriority[Process.priorityBackground] };
SXHighlightNode.HighlightNode[comm.design, comm.pos, comm.l];
END;
HighLightNodeFromKeyboard: PROCEDURE [comm: CDSequencer.Command] =
BEGIN
ENABLE {
IO.Error => {
TerminalIO.WriteRope[" Invalid Coords (Format is: x y )\n"];
ERROR ABORTED
};
IO.EndOfStream => {
TerminalIO.WriteRope[" Invalid Coords (Format is: x y )\n"];
ERROR ABORTED
};
};
coords: CD.Position ← [0,0];
inLine: IO.STREAM ~ IO.RIS[ TerminalIO.RequestRope["Highlight Node (cur layer)\n Enter coords of node relative to currently pushed cell>"]];
coords.x ← IO.GetInt[inLine] * comm.design.technology.lambda;
coords.y ← IO.GetInt[inLine] * comm.design.technology.lambda;
TRUSTED { Process.SetPriority[Process.priorityBackground] };
-- Transform coords from those of currently pushed appliaction to those of screen.
{
a: CD.Instance ~ comm.design.actual.first.mightReplace;
IF a # NIL THEN
coords ← CDOrient.MapPoint[ coords, a.ob.size, a.orientation, a.location];
};
SXHighlightNode.HighlightNode[comm.design, coords, comm.l];
END;
-- SpinifexCommands
CDSequencer.ImplementCommand[a: SXAtoms.analyzeSelected, p: AnalyzeComm, queue: doQueue];
CDSequencer.ImplementCommand[a: SXAtoms.analyzeAndThymeSelected, p: AnalyzeComm, queue: doQueue];
CDSequencer.ImplementCommand[a: SXAtoms.analyzeAndRoseSelected, p: AnalyzeComm, queue: doQueue];
CDSequencer.ImplementCommand[a: SXAtoms.highlightPointedNode, p: HighLightNode, queue: doQueue];
CDSequencer.ImplementCommand[a: SXAtoms.highlightKeyboardCoordsNode, p: HighLightNodeFromKeyboard, queue: doQueue];
CDMenus.CreateEntry[menu: $ProgramMenu, entry: "DRC", key: SXAtoms.analyzeSelected];
CDMenus.CreateEntry[menu: $ProgramMenu, entry: "DRC & extract Thyme", key: SXAtoms.analyzeAndThymeSelected];
CDMenus.CreateEntry[menu: $ProgramMenu, entry: "DRC & extract Rose", key: SXAtoms.analyzeAndRoseSelected];
CDMenus.CreateEntry[menu: $RectProgramMenu, entry: "Highlight node", key: SXAtoms.highlightPointedNode];
CDMenus.CreateEntry[menu: $ProgramMenu, entry: "Highlight node (at coords)", key: SXAtoms.highlightKeyboardCoordsNode];
TerminalIO.WriteRope["Spinifex layout analysis package loaded\n"]
END.
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.