<> <> <> <> DIRECTORY CD USING [Design, Instance, Layer, Object, Position], Core, CoreClasses USING [CreateIdentity], CoreCreate USING [PA], PWPins USING [Side], Sinix USING [Mode]; PWCore: CEDAR DEFINITIONS IMPORTS CoreClasses = BEGIN <> <> <> CellType: TYPE = Core.CellType; Object: TYPE = CD.Object; Wire: TYPE = Core.Wire; ROPE: TYPE = Core.ROPE; Properties: TYPE = Core.Properties; <> <> testLichen: BOOL; <> checkAbuts: BOOL; <> extractMode: Sinix.Mode; <> maskSuffix: ROPE; <> <> LayoutProc: TYPE = PROC [cellType: CellType] RETURNS [obj: Object]; <> <> <<>> DecorateProc: TYPE = PROC [cellType: CellType, obj: Object]; <> <<>> RegisterLayoutAtom: PROC [layoutAtom: ATOM, layoutProc: LayoutProc, decorateProc: DecorateProc] RETURNS [sameAtom: ATOM]; <> layoutAtomProp: ATOM; -- =$Layout. Property on cellTypes to specifies layoutAtoms SetLayout: PROC [cellType: CellType, layoutAtom: ATOM, userDataProp: ATOM _ NIL, userData: REF _ NIL]; <> <> <> <> <> <<>> Layout: PROC [cellType: CellType] RETURNS [obj: Object]; <> <<1) fetching the layoutAtom (property layoutAtomProp), >> <<2) finding the corresponding layoutProc and decorateProc, >> <<3) evaluating layoutProc, >> <<4) using the decorateProc to decorate the original cellType>> <<5) returning an indirect object of obj with a special property to extract it as cellType.>> <> <> FromLayout: PROC [public: Wire, obj: CD.Object] RETURNS [cellType: CellType]; <> FromLayoutWithoutPublic: PROC [obj: CD.Object] RETURNS [cellType: CellType]; <> <> <<$Get and $GetAndFlatten: expect a $PWCoreSourceDesign property [of type CD.Design] on the cellType. The cellType must be a recordCell. GetAndFlatten flattens the layout, so that corresponding transistors inter-cells are fused.>> <<$AbutX, $AbutY, $ReverseAbutX, $ReverseAbutY: the cellType must be a recordCell.>> <<$ArrayX, $ArrayY, $ReverseArrayX, $ReverseArrayY: the cellType must be a sequenceCell.>> <<$FlipX, $FlipY, $Rot90, $Rot180, $Rot270: the cellType must be an identityCell.>> <<$Recast: the cellType must have a Recast proc and the recasted cellType must have layout. This is the default for identity cellTypes.>> Get: LayoutProc; GetAndFlatten: LayoutProc; AbutX: LayoutProc; AbutY: LayoutProc; ReverseAbutX: LayoutProc; ReverseAbutY: LayoutProc; ArrayX: LayoutProc; ArrayY: LayoutProc; ReverseArrayX: LayoutProc; ReverseArrayY: LayoutProc; FlipX: LayoutProc; FlipY: LayoutProc; Rot90: LayoutProc; Rot180: LayoutProc; Rot270: LayoutProc; DecorateGet: DecorateProc; DecorateAbutX: DecorateProc; DecorateAbutY: DecorateProc; DecorateReverseAbutX: DecorateProc; DecorateReverseAbutY: DecorateProc; DecorateRotated: DecorateProc; <> DecorateRecasted: DecorateProc; <> OrderProc: TYPE = PROC [CD.Position, CD.Position] RETURNS [BOOL]; <> SortInX: OrderProc; SortInY: OrderProc; ReverseSortInX: OrderProc; ReverseSortInY: OrderProc; DecorateFlatten: PROC [cellType: CellType, obj: CD.Object, inOrder: OrderProc]; <> <> SortInstances: PROC [cellType: CellType, inOrder: OrderProc]; <> <> SetGet: PROC [cellType: CellType, source: CD.Design] = INLINE {SetLayout[cellType, $Get, $PWCoreSourceDesign, source]}; <> <<>> SetAbutX: PROC [cellType: CellType] = INLINE {SetLayout[cellType, $AbutX]}; SetAbutY: PROC [cellType: CellType] = INLINE {SetLayout[cellType, $AbutY]}; SetArrayX: PROC [cellType: CellType] = INLINE {SetLayout[cellType, $ArrayX]}; SetArrayY: PROC [cellType: CellType] = INLINE {SetLayout[cellType, $ArrayY]}; <> RotateCellType: PROC [cellType: CellType, orientation: ATOM] RETURNS [rotatedCellType: CellType] = INLINE { rotatedCellType _ CoreClasses.CreateIdentity[cellType]; SetLayout[rotatedCellType, orientation]; }; <> AbutInstance: TYPE = RECORD [object: CD.Object, pas: LIST OF CoreCreate.PA _ NIL]; <> <> AbutCell: PROC [public: Wire, abutInstances: LIST OF AbutInstance, inX: BOOL, shared: BOOL _ FALSE, name: ROPE _ NIL, props: Properties _ NIL] RETURNS [recordCell: CellType]; <> <> <> <> <> Side: TYPE = PWPins.Side; -- {bottom, right, top, left, none}; none side should not be given nor received as argument for all the following functions. EnumerateWirePins: PROC [cellType: CellType, eachWirePin: EachWirePinProc] RETURNS [quit: BOOL]; <> EachWirePinProc: TYPE = PROC [wire: Wire, instance: CD.Instance, min, max: INT, side: Side, layer: CD.Layer] RETURNS [quit: BOOL _ FALSE]; EnumerateNonOverlappingWirePins: PROC [cellType: CellType, eachWirePin: EachWirePinProc] RETURNS [quit: BOOL]; <> EnumeratePins: PROC [cellType: CellType, wire: Wire, eachPin: EachPinProc] RETURNS [quit: BOOL]; <> EachPinProc: TYPE = PROC [instance: CD.Instance, min, max: INT, side: Side, layer: CD.Layer] RETURNS [quit: BOOL _ FALSE]; EnumerateSortedPins: PROC [cellType: CellType, side: Side, eachSortedPin: EachSortedPinProc] RETURNS [quit: BOOL]; <> EachSortedPinProc: TYPE = PROC [wire: Wire, instance: CD.Instance, min, max: INT, layer: CD.Layer] RETURNS [quit: BOOL _ FALSE]; <> HasLayout: PRIVATE PROC [cellType: CellType] RETURNS [BOOL]; CancelLayout: PRIVATE PROC [cellType: CellType]; Signal: PRIVATE SIGNAL; END.