SpinifexCommands.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Written by Shand, September 12, 1983 11:40 pm
Last Edited by: Shand, August 24, 1984 1:46:27 am PDT
Last Edited by: BERETTA, November 5, 1984 3:59:41 pm PST
DIRECTORY
TerminalIO USING [WriteRope],
CD USING [Design, ObPtr, ApplicationPtr],
CDDirectory USING [Name],
CDSequencer USING [Command, ImplementCommand],
CDMenus USING [CreateEntry],
CDEvents USING [EventProc, RegisterEventProc],
CDOps USING [AppList],
CDProperties USING [GetPropFromObject, PutPropOnObject],
Process USING [SetPriority, priorityBackground],
Rope USING [Cat, ROPE],
SpinifexAtoms USING [ spinifex, errorClient, analyzeSelected, analyzeAndThymeSelected, thymePrint, analyzeAndRoseSelected, rosePrint, highlightPointedNode],
SpinifexCircuit USING [ Circuit],
SpinifexAccess USING [AnalyzeCell],
SpinifexHighlightNode USING [HighlightNode]
;
SpinifexCommands: CEDAR PROGRAM
IMPORTS TerminalIO, CDDirectory, CDSequencer, CDMenus, CDEvents, CDOps, CDProperties, Process, Rope, SpinifexAtoms, SpinifexAccess, SpinifexHighlightNode
~ BEGIN
Analyze: PROCEDURE [comm: CDSequencer.Command] ~ {
selectedAppls: LIST OF CD.ApplicationPtr ← NIL;
mesg: Rope.ROPE ← "";
-- Set priority to background for Spinifex
TRUSTED { Process.SetPriority[Process.priorityBackground] };
FOR appls: LIST OF CD.ApplicationPtr ← CDOps.AppList[comm.design], appls.rest WHILE appls # NIL DO
IF appls.first.selected THEN
selectedAppls ← CONS[ appls.first, selectedAppls];
ENDLOOP;
IF selectedAppls # NIL THEN {
format: REF ANY;
SELECT comm.a FROM
SpinifexAtoms.analyzeAndThymeSelected => {
mesg ← mesg.Cat[ "Comencing analysis and Thyme format extraction of "];
format ← SpinifexAtoms.thymePrint
};
SpinifexAtoms.analyzeAndRoseSelected => {
mesg ← mesg.Cat[ "Comencing analysis and Rosemary format extraction of "];
format ← SpinifexAtoms.rosePrint
};
ENDCASE => {
mesg ← mesg.Cat[ "Comencing analysis of "];
format ← NIL
};
IF selectedAppls.rest = NIL THEN
TerminalIO.WriteRope[ mesg.Cat[ "hierarchy rooted at \"", CDDirectory.Name[selectedAppls.first.ob], "\"\n"]]
ELSE {
mesg ← mesg.Cat[ "hierarchies rooted at "];
FOR hrl: LIST OF CD.ApplicationPtr ← selectedAppls, hrl.rest WHILE hrl # NIL DO
mesg ← mesg.Cat[ "\"", CDDirectory.Name[hrl.first.ob], "\""];
IF hrl.rest # NIL THEN
mesg ← mesg.Cat[ ", "];
ENDLOOP;
TerminalIO.WriteRope[ mesg.Cat[ "\n"]]
};
IF SpinifexAccess.AnalyzeCell[design ~ comm.design, hierarchyRoots ~ selectedAppls, formatKey ~ format] THEN
TerminalIO.WriteRope["Analysis of hierarchy complete\n"]
}
ELSE TerminalIO.WriteRope[ "Select a single cell to analyze\n"];
};
ClearSpinifexProperty: CDEvents.EventProc -- PROC [event: REF, design: CD.Design, x: REF] RETURNS [dont: BOOL�LSE] -- ~ {
IF event # $AfterCellReplacement THEN ERROR
ELSE {
cellObject: CD.ObPtr ~ NARROW[x, CD.ObPtr];
cir: REF SpinifexCircuit.Circuit ~ NARROW[ CDProperties.GetPropFromObject[from~ cellObject, prop~ SpinifexAtoms.spinifex]];
IF cir # NIL THEN
CDProperties.PutPropOnObject[onto~ cellObject, prop~ SpinifexAtoms.spinifex, val~ NIL];
FOR errorRectClients: LIST OF CD.ObPtr ← NARROW[ CDProperties.GetPropFromObject[from~ cellObject, prop~ SpinifexAtoms.errorClient]], errorRectClients.rest
WHILE errorRectClients # NIL DO
Delete SpinifexAtoms.spinifex ATOM from client Subcells
CDProperties.PutPropOnObject[onto~ errorRectClients.first, prop~ SpinifexAtoms.spinifex, val~ NIL]
ENDLOOP;
}
};
HighLightNode: PROCEDURE [comm: CDSequencer.Command] ~ {
TerminalIO.WriteRope["Highlight Node (pointed)\n"];
TRUSTED { Process.SetPriority[Process.priorityBackground] };
SpinifexHighlightNode.HighlightNode[ comm.design, comm.pos, comm.l];
};
-- Module Initialization of SpinifexCommands
CDSequencer.ImplementCommand[a: SpinifexAtoms.analyzeSelected, p: Analyze, queue: doQueue];
CDSequencer.ImplementCommand[a: SpinifexAtoms.analyzeAndThymeSelected, p: Analyze, queue: doQueue];
CDSequencer.ImplementCommand[a: SpinifexAtoms.analyzeAndRoseSelected, p: Analyze, queue: doQueue];
CDSequencer.ImplementCommand[a: SpinifexAtoms.highlightPointedNode, p: HighLightNode, queue: doQueue];
CDMenus.CreateEntry [menu: $ProgramMenu, entry: "DRC", key: SpinifexAtoms.analyzeSelected];
CDMenus.CreateEntry [menu: $ProgramMenu, entry: "DRC & Extract Thyme", key: SpinifexAtoms.analyzeAndThymeSelected];
CDMenus.CreateEntry [menu: $ProgramMenu, entry: "DRC & Extract Rose", key: SpinifexAtoms.analyzeAndRoseSelected];
CDMenus.CreateEntry [menu: $RectProgramMenu, entry: "Hilight pointed node", key: SpinifexAtoms.highlightPointedNode];
CDEvents.RegisterEventProc[ proc~ClearSpinifexProperty, event~$AfterCellReplacement];
TerminalIO.WriteRope["Spinifex layout analysis package loaded\n"]
END.
Edited on October 22, 1984 11:57:12 am PDT, by BERETTA
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.
Edited on November 5, 1984 3:59:42 pm PST, by Beretta
changes to: CDMenus: "Hilight pointed node" now in RectProgramMenu