CDHierarchyMarks.mesa (part of ChipNDale)
Copyright © 1986 by Xerox Corporation. All rights reserved.
Christian Jacobi, July 16, 1986 8:09:57 pm PDT
last edited by Christian Jacobi, July 18, 1986 10:18:45 am PDT
DIRECTORY
CD USING [Design, Object, Instance];
CDHierarchyMarks: CEDAR DEFINITIONS =
BEGIN
This module allows the representation of one particular path down any hierachy of a design.
[It is only marginaly usefull for ChipNDale's own drawing hierarchy where a natural
path is given by the pushed in state, but really used for naming purposes in separate
icon-schematic hierachies; partly even defined outside the scope of ChipNDale].
Method of finding the path:
Use any object as root [NIL object for design].
Each object may denote its successor instance.
From the instance get object, depending on hierarchy model [not determined by this module].
Follow recursively until goal is found.
The particular hierarchy path might, might not, or might be partly saved on IO.
Client interfacing
GetHierarchyMark: PROC [design: CD.Design←NIL, ob: CD.Object←NIL] RETURNS [inst: CD.Instance];
Returns the hierachy mark from a particular point in hierachy.
This module tries hard to remember hierachy-marks, but it can still fail,
even if some other tool might still be able to find it.
The instance may part of the real object, do neither modify nor cache
it, except properties; the instance might just be a copy. For comparing
instances, compare location, orientation and object.
No message is made if a hierachy mark is not found; other errors might cause
a message on terminal.
SetHierarchyMark: PROC [design: CD.Design, ob: CD.Object←NIL, inst: CD.Instance];
Sets the hierachy-mark of a particular point in hierachy and implicitely
removes hierachy-mark from other instances of ob.
This module tries hard to remember the hierachy-mark, but it may fail.
This module might either use this instance or make a copy at its own peril.
Does not officially cause design, ob, or inst to be changed.
Propagates to all other tool implementors.
On errors might ERROR or message on terminal.
Implementor interfacing
RegisterHierarchyMarker: PROC [setHierarchyMark: SetHierarchyMarkProc];
Registers a procedure to be called whenever SetHierarchyMark is called.
This allows tool makers to keep track of hierachy mark positions in
parallel data structures (like Core, or, feedback in the interactive editor).
Clients procs are called in order of registration.
SetHierarchyMarkProc: TYPE = PROC [design: CD.Design, ob: CD.Object, inst: CD.Instance];
When called, the instance may be part of the real object; procedure must neither
modify nor cache it. Clients, except the interactive editor, must not use SIGNALS
or ERRORS, nor call SetHierarchyMark recursively.
Usage and performance hints
Do not excpect setting hierarchy marks to be extremely fast; it is thought
to be done mainly interactively.
Probably, the interactive editor will be the only client to set hierarchy marks;
it could do it with the following statements.
IF ~CDCells.IsPushedIn[design] THEN SetHierarchyMark[design, NIL, inst]
ELSE SetHierarchyMark[design, design.actual.first.dummyCell.ob, inst]
This module is not symmetric: Setting hierarchy marks proceeds to other tools,
while asking for a hierarchy mark does not proceed. It assumes that for asking
hierarchy marks, the master module will be on Core level, and maybe, that master
module might be the only one to call GetHierarchyMark.
Actually, some pieces of a hierarchy path might be through objects which are
not defined using ChipNDale; this module can not make any statements about those
parts of a hierarchy path.
END.