ExtendCells.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reversed.
Created by Bertrand Serlet, February 11, 1987 5:53:16 pm PST
Bertrand Serlet February 12, 1987 1:04:22 am PST
Old PW.TransferCell ( & others ?)
DIRECTORY CD, Core, CoreGeometry;
ExtendCells: CEDAR DEFINITIONS ~ BEGIN
Types and Defaults
ROPE: TYPE = Core.ROPE;
Wire: TYPE = Core.Wire;
CellType: TYPE = Core.CellType;
Properties: TYPE = Core.Properties;
Side: TYPE = CoreGeometry.Side;
Decoration: TYPE = CoreGeometry.Decoration;
Layer: TYPE = CD.Layer;
Object: TYPE = CD.Object;
ExtendSegmentProc: TYPE = PROC [wire: Wire, min, max: INT, layer: Layer, side: Side, extension: INT] RETURNS [Object ← NIL];
This function extends a segment by the amount extension.
If the returned object is NIL, it means no extension for this wirePinSide.
ExtendSegment: ExtendSegmentProc;
Returns a rectangle of layer layer, of length extension, and of width max-min.
If side=top or side=bottom, this rectangle is vertical, otherwise horizontal.
Extentions returning Objects
WirePin: TYPE = RECORD [wire: Wire, min, max: INT, layer: Layer];
wire is a public of the cellType being extended, and min and max are relative to its InterestRect.
ExtendObject: PROC [wirePins: LIST OF WirePin, size: CD.Position, side: Side, extendProc: ExtendSegmentProc ← ExtendSegment] RETURNS [extendedCell: Object];
Prepares an object to be abutted on the side side of an object having its side side made of wirePins.
For example if side=right, then extension=size.x, and [0 .. size.y] is the range in which all min and all max of wirePins should lie.
Extentions returning CellTypes
Extensions: TYPE = ARRAY Side OF INT;
Defines for each side, the amount of extension.
nullExtensions: Extensions = ALL [0];
WirePinSide: TYPE = RECORD [wire: Wire, min, max: INT, side: Side, layer: Layer];
wire is a public of the cellType being extended, and min and max are relative to its InterestRect.
ExtendCellType: PROC [decoration: Decoration, cellType: CellType, extensions: Extensions ← nullExtensions, extendProc: ExtendSegmentProc ← ExtendSegment, name: ROPENIL, props: Properties ← NIL] RETURNS [extendedCell: CellType];
Extends cellType by the given amounts (in every direction). The returned cellType contains the extended one, has a similar public, and is properly decorated.
END.