SXAccessImpl.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Written by Jacobi, April 2, 1985 5:11:35 pm PST
Last Edited by: Jacobi, April 2, 1985 5:11:39 pm PST
DIRECTORY
CD,
CDCommandOps,
CDProperties,
CDSequencer,
SX,
SXAccess,
SXAtoms,
SXAccessInternal,
TerminalIO;
SXAccessImpl:
CEDAR
PROGRAM
IMPORTS CDCommandOps, CDProperties, SXAtoms, SXAccessInternal, TerminalIO
EXPORTS SXAccess =
BEGIN
--variables only valid inside an analysis invocation
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.ApplicationList,
formatKey: REF,
stopFlag: REF BOOL
];
Analyze:
PUBLIC
PROC [design:
CD.Design, hierarchyRoots:
CD.ApplicationList, formatKey:
REF, stopFlag:
REF
BOOL←
NIL]
RETURNS [skipped:
BOOL←
FALSE] =
--if stopFlag^ gets true, analysis might be aborted
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 ←[
a: $SX,
design: design,
ref: ik
]];
skipped ← CDCommandOps.CallWithResource[PseudoCommand, comm, $SX, stopFlag];
IF skipped THEN TerminalIO.WriteRope["**analyze skipped\n"]
END;
PseudoCommand:
PROC [comm: CDSequencer.Command] =
BEGIN
GetSXTech:
PROC [technology:
CD.Technology]
RETURNS [th:
REF
SX.TechHandle] =
BEGIN
WITH CDProperties.GetProp[technology, SXAtoms.spinifex]
SELECT
FROM
x: REF SX.TechHandle => th ← x;
ENDCASE => th ← NIL;
IF th=
NIL
THEN
TerminalIO.WriteRope["technology not implemented for Spinifex\n"];
END;
callParameters: REF CallingRec = NARROW[comm.ref];
design ← callParameters.design;
formatKey ← callParameters.formatKey;
invocation ← callParameters;
stopFlag ← callParameters.stopFlag;
stopFlag^ ← FALSE;
sxTech ← GetSXTech[design.technology];
IF sxTech#
NIL
THEN
ProtectedAnalyze[callParameters.hierarchyRoots];
design ← NIL;
invocation ← NIL;
formatKey ← NIL;
sxTech ← NIL;
END;
ProtectedAnalyze:
PROC [hierarchyRoots:
CD.ApplicationList] =
BEGIN
SXAccessInternal.Analyze[hierarchyRoots];
--OldSpinifexAccess.Analyze[design, hierarchyRoots, formatKey, stopFlag];-
END;
END.