PipalCoreCDUser.mesa
Copyright Ó 1987, 1988 by Xerox Corporation. All rights reserved.
Barth, October 15, 1987 1:25:41 pm PDT
Last tweaked by Mike Spreitzer on February 17, 1988 8:55:57 am PST
Bertrand Serlet April 24, 1988 11:55:32 pm PDT
Theory
This interface allows Core tools to interact with users through ChipNDale. It presumes a model in which a single root Core cell type is associated with a design at any one instant. The context section allows client programs to establish and make use of this association. The procedures which map Core to CD allow marking CoreFlat cell types and wire with either of the two CD interaction mechanisms, highlight and the push stack with selection. The CD to Core procedures translate the CD push stack and selections into CoreFlat cell types and wires within the current root cell type context.
Context
Client commands which take a single cell type as argument should normally get this argument via GetDesignRootCellType. Commands which need to enumerate a set of Core cell types should do so via EnumerateSelectedCellTypes.
EachRootCellTypeProc:
TYPE =
PROC [root: Core.CellType]
RETURNS [quit:
BOOL ←
FALSE];
EnumerateSelectedCellTypes:
PROC [design:
CD.Design, eachRootCellType: EachRootCellTypeProc, mode: PipalSinix.Mode ←
NIL]
RETURNS [quit:
BOOL ←
FALSE];
Extracts the object of each selected instance, calls SetDesignRootCellType, calls SetRootCellTypeDecoration, and calls eachRootCellType with each resulting root. If mode is NIL then GetExtractMode is used.
There is a many to one relation from applications to root cell types and from root cell types to designs. In order for interactions which start with a design to refer to a root cell a single root cell is placed on a design. Application handles should be placed on the root cell property list. Thus tool handles can be reached from a design by accessing the root cell and then fetching the tool handle. This also means that only a single application instance can be associated with a root cell type. The root cell type associated with a design is changed by CoreCDUser interactive commands which call the following procedures.
SetDesignRootCellType:
PROC [design:
CD.Design, root: Core.CellType];
Calls SetImporterDesign for each imported design.
GetDesignRootCellType:
PROC [design:
CD.Design]
RETURNS [root: Core.CellType];
GetRootCellTypeDesign:
PROC [root: Core.CellType]
RETURNS [design:
CD.Design];
There is also a many to one relationship between importer and importee designs. To allow CD push stacks in imported designs to refer to root cell types it is necessary to set to which importer the importee is currently referring.
SetImporterDesign:
PROC [importee:
CD.Design, importer:
CD.Design];
Performs operation on transitive closure of all designs reachable from importee.
GetImporterDesign:
PROC [importee:
CD.Design]
RETURNS [importer:
CD.Design];
In addition to the cell type some procedures in this interface require the decoration used to associate CD objects with Core cell types and wires.
SetRootCellTypeDecoration:
PROC [root: Core.CellType, decoration: PipalCore.Decoration];
GetRootCellTypeDecoration:
PROC [root: Core.CellType]
RETURNS [decoration: PipalCore.Decoration];
GetDesignLabel:
PROC [design:
CD.Design]
RETURNS [label: Rope.
ROPE ←
NIL];
Core To CD
In the following procedures the design and decoration are fetched from the root cell type property list if they are NIL. If these procedures are invoked from a CD command then the design should be the command's design. All of these procedures may raise CoreCDUserError.
Highlight generates a set of rectangles at the top level of a ChipNDale design. It is useful when the feedback must cross multiple ChipNDale cells. Select uses the standard ChipNDale selection mechanism. It is only useful within a single cell.
HighlightFlatCellType:
PROC [root: Core.CellType, flatCell: CoreFlat.FlatCellTypeRec, design:
CD.Design ←
NIL, decoration: PipalCore.Decoration ←
NIL, viewer: ViewerClasses.Viewer ←
NIL, clearFirst:
BOOL ←
TRUE];
Constructs a highlight rectangle the same size as the associated object. If viewer is NIL then ExtractOps.FindViewer is invoked. If clearFirst, all other highlight in the design is removed first.
HighlightFlatWire:
PROC [root: Core.CellType, flatWire: CoreFlat.FlatWireRec, design:
CD.Design ←
NIL, decoration: PipalCore.Decoration ←
NIL, viewer: ViewerClasses.Viewer ←
NIL, clearFirst:
BOOL ←
TRUE];
Highlights all parents and sons of this wire and all wires bound to this wire or its parents or sons. If viewer is NIL then ExtractOps.FindViewer is invoked.
SelectFlatCellType:
PROC [root: Core.CellType, flatCell: CoreFlat.FlatCellTypeRec, design:
CD.Design ←
NIL, decoration: PipalCore.Decoration ←
NIL];
This procedure potentially changes the CD stack. If it does then any previous selections are lost.
SelectFlatWire:
PROC [root: Core.CellType, flatWire: CoreFlat.FlatWireRec, design:
CD.Design ←
NIL, decoration: PipalCore.Decoration ←
NIL];
Adds only the flatWire indicated to the selection, not its parents or sons. This procedure potentially changes the CD stack. If it does then any previous selections are lost.
CD To Core
The procedures in this section use the CD stack to disambiguate the flat cell type corresponding to the most deeply pushed CD cell. The wire or cell types enumerated are those which are selected within this disambiguated cell type. Imported design push stacks are disambiguated ignoring all other design push stacks, utilizing only the selection viewer in addition to the single push stack.
Basic Operations
ignoreMeProp:
ATOM;
This is a cell type property. When it is present the disambiguation mechanism ignores the cell type when constructing the selection viewer. Effectively the user is promising never to push into such a cell type in an ambiguous manner and then invoke one of the functions in this section.
EachSelectedFlatWireProc:
TYPE =
PROC [selectedFlatWire: CoreFlat.FlatWireRec]
RETURNS [quit:
BOOL ←
FALSE];
selectedFlatWire is not in canonical form.
EnumerateSelectedFlatWires:
PROC [root: Core.CellType, eachSelectedFlatWire: EachSelectedFlatWireProc, cutSet: CoreFlat.CutSet ←
NIL, design:
CD.Design ←
NIL, decoration: PipalCore.Decoration ←
NIL]
RETURNS [quit:
BOOL ←
FALSE];
Raises CoreCDUserError if some selected object does not correspond to a wire rectangle.
EachSelectedFlatCellProc:
TYPE =
PROC [selectedFlatCell: CoreFlat.FlatCellTypeRec]
RETURNS [quit:
BOOL ←
FALSE];
EnumerateSelectedFlatCells:
PROC [root: Core.CellType, eachSelectedFlatCell: EachSelectedFlatCellProc, cutSet: CoreFlat.CutSet ←
NIL, design:
CD.Design ←
NIL, decoration: PipalCore.Decoration ←
NIL]
RETURNS [quit:
BOOL ←
FALSE];
Raises CoreCDUserError if some selected object does not correspond to a Core cell type.
Command Utilities
These procedures deal with printing error messages. They are otherwise similiar to EnumerateSelectedFlatWires and EnumerateSelectedFlatCells. They print messages if nothing is selected or the selected rectangles are not matched to any wire, or if the action procedure returns with a non NIL error message. They catch CoreFlat.PathError and CoreCDUserError and print the associated error message.
SelectedFlatWireActionProc:
TYPE =
PROC [selectedFlatWire: CoreFlat.FlatWire];
DoForSelectedFlatWires:
PROC [root: Core.CellType, action: SelectedFlatWireActionProc, cutSet: CoreFlat.CutSet ←
NIL, design:
CD.Design ←
NIL, decoration: PipalCore.Decoration ←
NIL];
Calls action once per wire even if the wire is reachable through multiple paths of a wire DAG.
SelectedFlatCellActionProc:
TYPE =
PROC [selectedFlatCell: CoreFlat.FlatCellType];
DoForSelectedFlatCells:
PROC [root: Core.CellType, action: SelectedFlatCellActionProc, cutSet: CoreFlat.CutSet ←
NIL, design:
CD.Design ←
NIL, decoration: PipalCore.Decoration ←
NIL];