<> <> <> <> DIRECTORY CD USING [Design, InterestRect, Object, Position, Rect], Core, CoreCreate USING [PA], CoreGeometry, HashTable USING [Table], Sinix USING [Mode]; PWCore: CEDAR DEFINITIONS IMPORTS CD = BEGIN <> <> <> CellType: TYPE = Core.CellType; Object: TYPE = CD.Object; Wire: TYPE = Core.Wire; WireSeq: TYPE = Core.WireSeq; ROPE: TYPE = Core.ROPE; Properties: TYPE = Core.Properties; Wires: TYPE = Core.Wires; <> LayoutProc: TYPE = PROC [cellType: CellType] RETURNS [obj: Object]; <> <> <<>> DecorateProc: TYPE = PROC [cellType: CellType, obj: Object]; <> <<>> AttributesProc: TYPE = PROC [cellType: CellType]; <> <<>> RegisterLayoutAtom: PROC [layoutAtom: ATOM, layoutProc: LayoutProc, decorateProc: DecorateProc _ NIL, attributesProc: AttributesProc _ NIL] RETURNS [sameAtom: ATOM]; <> <> <> GetLayoutAtomRegistration: PROC [layoutAtom: ATOM] RETURNS [layoutProc: LayoutProc _ NIL, decorateProc: DecorateProc _ NIL, attributesProc: AttributesProc _ NIL]; <> <> <<>> layoutAtomProp: ATOM; -- = $Layout. Property on cellTypes to specifies layoutAtoms GetLayoutAtom: PROC [cellType: CellType] RETURNS [layoutAtom: ATOM _ NIL]; <> <<>> Layout: PROC [cellType: CellType] RETURNS [obj: Object]; <> <<- fetching the layoutAtom with the function GetLayoutAtom (property layoutAtomProp), and finding the corresponding layoutProc and decorateProc, >> <<- if that fails start all over again with the recast of cellType.>> <<- evaluating the attributesProc, >> <<- evaluating layoutProc, >> <<- using the decorateProc to decorate the original cellType>> <<- returning an indirect object of obj with a funny ExtractProc.>> <> <> <> <<>> InterestRect: PROC [cellType: CellType] RETURNS [ir: CD.Rect] = INLINE {ir _ CD.InterestRect[Layout[cellType]]}; <> <> <> <<$Get and $GetAndFlatten: expect a $PWCoreSourceDesign property [of type CD.Design] on the cellType. The Object of name the name of the CellType concatenated with maskSuffix is fetched in the attribute Design, and is Extracted. Publics of the extracted CellType must correspond [by full name] to the original public. GetAndFlatten flattens the layout, so that corresponding transistors inter-cells are fused.>> <<$AbutX, $AbutY, $ReverseAbutX, $ReverseAbutY: the cellType must be a recordCell. Sorts the instances according to the Sisyph decoration.>> <<$ArrayX, $ArrayY, $ReverseArrayX, $ReverseArrayY: the cellType must be a sequenceCell.>> <<$FlipX, $FlipY, $Rot90, $Rot180, $Rot270: the cellType must be a RecordCell with a unique instance. >> <> <<$Value: expects a $PWCoreValue property [of type Object] on the cellType. The Object is extracted, and publics of the extracted CellType must correspond [by full name] to the original public.>> <<$RawAbutX, $RawAbutY, $RawReverseAbutX, $RawReverseAbutY: the cellType must be a recordCell. The order of the cell instances is important.>> <<$Recast: the cellType must have a Recast proc and the recasted cellType must have layout. >> maskSuffix: ROPE; <> <> <> extractMode: Sinix.Mode; <> <> <> SetLayout: PROC [cellType: CellType, layoutAtom: ATOM, userDataProp: ATOM _ NIL, userData: REF _ NIL]; <> <> <> <> <> <<>> SetGet: PROC [cellType: CellType, source: CD.Design] = INLINE {SetLayout[cellType, $Get, $PWCoreSourceDesign, source]}; <> <<>> SetLayoutAndDecoration: PROC [cellType: CellType, layout: Object] = INLINE {SetLayout[cellType, $ValueNoDecorate, $PWCoreValue, layout]}; <> <<>> SetAbutX: PROC [cellType: CellType] = INLINE {SetLayout[cellType, $RawAbutX]}; SetAbutY: PROC [cellType: CellType] = INLINE {SetLayout[cellType, $RawAbutY]}; SetArrayX: PROC [cellType: CellType] = INLINE {SetLayout[cellType, $ArrayX]}; SetArrayY: PROC [cellType: CellType] = INLINE {SetLayout[cellType, $ArrayY]}; RotateCellType: PROC [rotatedCellType: CellType, orientation: ATOM] RETURNS [cellType: CellType]; <> <> SortProc: TYPE = PROC [CD.Position, CD.Position] RETURNS [BOOL]; <> <<>> SortInX: SortProc; SortInY: SortProc; ReverseSortInX: SortProc; ReverseSortInY: SortProc; DecorateValue: DecorateProc; <> <<>> DecorateAbut: PROC [cellType: CellType, obj: Object, sort: SortProc]; <> <> <> <<>> DecorateAbutX: DecorateProc; DecorateAbutY: DecorateProc; DecorateReverseAbutX: DecorateProc; DecorateReverseAbutY: DecorateProc; <<>> DecorateRecasted: DecorateProc; <> <> <> <<>> DecorateRotated: DecorateProc; <> <<>> DecorateFlatten: PROC [cellType: CellType, obj: Object, sort: SortProc]; <> <> <<>> SortInstances: PROC [decoration: CoreGeometry.Decoration, cellType: CellType, sort: SortProc]; <> <> <> AbutInstance: TYPE = RECORD [object: Object, pas: LIST OF CoreCreate.PA _ NIL]; <> <> <<>> AbutCell: PROC [public: Wire, abutInstances: LIST OF AbutInstance, inX: BOOL, name: ROPE _ NIL, props: Properties _ NIL] RETURNS [recordCell: CellType]; <> <> <> <> <<>> Store: PROC [cellType: CellType, withCuteFonts: BOOL _ FALSE]; <> <.core".>> <Layout.dale".>> <Shell.dale".>> <<>> Retrieve: PROC [name: ROPE] RETURNS [cellType: CellType]; <.core".>> <> layoutClass: Core.CellClass; -- data field of such objects is of type LayoutData LayoutData: PRIVATE TYPE = REF LayoutDataRec; <> LayoutDataRec: PRIVATE TYPE = RECORD [ obj: Object, -- obj as returned by the layoutProc cellType: CellType, -- source as passed by the user mode: Sinix.Mode -- extractMode, at layout creation time ]; <> LayoutCellTypeInfo: PROC [layoutCellType: CellType] RETURNS [obj: Object, sourceCellType, extractedCellType: CellType, extractedToSource: HashTable.Table]; <> CorrespondingCellType: PROC [obj: Object] RETURNS [layoutCellType: CellType _ NIL]; <> < layoutCellType=NIL.>> <> <> <> Signal: SIGNAL [cellType: CellType]; <> <<>> Error: ERROR [type: ATOM, message: ROPE, cellType: CellType]; <> <<$NoLayoutAtom>> <<$NoRegistration>> <<$InternalBug>> <<$CallerBug>> <<>> PinsCorrespondingToSeveralPublics: SIGNAL [cellType: CellType, obj: Object, publics: Wires, geometry: CoreGeometry.Instances]; <> <<>> NoPinsOnAtomicPublic: SIGNAL [cellType: CellType, obj: Object, public: Wire, message: ROPE _ NIL]; <> <> FromLayoutWithoutPublic: PROC [obj: Object] RETURNS [cellType: CellType]; <> <<>> END.