DIRECTORY CD USING [Design, Instance, Object, Position, Rect], Core, CoreCreate USING [PA], CoreGeometry, HashTable USING [Table], Sinix USING [Mode]; PWCore: CEDAR DEFINITIONS = BEGIN CellType: TYPE = Core.CellType; Object: TYPE = CD.Object; Wire: TYPE = Core.Wire; 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]; InterestRect: PROC [cellType: CellType] RETURNS [ir: CD.Rect]; maskSuffix: ROPE; extractMode: Sinix.Mode; 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]; 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]; 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]; 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]; AbutList: PROC [cellTypes: LIST OF CellType, inX: BOOL] RETURNS [recordCell: CellType]; 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]; Signal: SIGNAL [cellType: CellType]; Error: ERROR [type: ATOM, message: ROPE, cellType: CellType]; PinsCorrespondingToSeveralPublics: SIGNAL [cellType: CellType, obj: Object, publics: Wires, geometry: LIST OF CD.Instance]; NoPinsOnAtomicPublic: SIGNAL [cellType: CellType, obj: Object, public: Wire, message: ROPE _ NIL]; NoInterestRectDecoration: SIGNAL [cellType: CellType, obj: Object]; FromLayoutWithoutPublic: PROC [obj: Object] RETURNS [cellType: CellType]; END. "HPWCore.mesa Copyright c 1985, 1986 by Xerox Corporation. All rights reversed. Louis Monier February 14, 1986 11:00:35 am PST Bertrand Serlet, October 13, 1986 6:26:40 pm PDT Theory This interface defines how to generate layout attached to Core, using PatchWork (PW). Layout done by hand can also be attached. When layout is attached to Core, it is also specified how to decorate the original Core source with the interface geometry. The only way for clients to retrieve the Layout hanging on a Core CellType is Layout. Basics Primitive operations obj is the layout for cellType. Identical (REF equal) cellTypes must have the same (REF equal) layout, and the same layout must correspond to the same cellType. To follow this restriction, the Layout function automatically insert one level of indirection (Indirect object). Decorates cellType with the geometric information derived from obj. That is decorates the atomic publics with the pins, and the cellType with the InterestRect. This function allows the computation of arbitrary attributes that can be stored on the cellType for the LayoutProc. LayoutProcs are not directly accessible and must be associated with an atom. This delayed generation allows description or simulation of the Core structure before any geometry is present, and lazy evaluation of the geometry improves efficiency. decorateProc can only be NIL if layoutProc is decorating its argument. Retrieves the registration of layoutAtom Retrieves the layoutAtom (if any) on the CellType, then on the CellClass. Retrieves the layout corresponding to a cell type by: - 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. The result is cached, so that means that called twice with the same (REF equal) cellType, Layout will produce the same (REF equal) obj. To follow the restriction that the same layout can not correspond to two different cellTypes, Layout automatically inserts one level of indirection (indirect object). The extraction of the indirect object returns a CellType of class layoutClass that contains the source layout and the source CellType, and that recasts in a recordCell with only one sub cellType being the result of the extraction of the source layout. Returns the InterestRect of a cellType (might call Layout, if the property is not present) Predefined layoutAtoms Predefined layoutAtoms to be used in schematics $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. Predefined layoutAtoms to be used by code $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. $FlipX, $FlipY, $Rot90, $Rot180, $Rot270: the cellType must be a RecordCell with a unique instance. Contains the rope that is to be concatenated to the name of a cellType to find the name of the corresponding layout cell. Used by the LayoutProc for $Get Global Variable A global variable is used for calling Sinix. This is going to change soon, but for now that is fine enough. Better rollback between changes, if you don't know what you are doing. Contains the mode that is to be passed to Sinix when doing extraction. Its default is SinixCMos.extractBMode and it can be changed to SinixCMos.checkBMode. Help for writing DecorateProcs Returns TRUE if the first position is "before" the second Provokes an extraction. Assumes the the full names of the publics cellType and the extracted CellType are corresponding. Assumes that cellType is a record Cell for which each sub cell type has layout. Assumes that obj (when expanded the appropriate number of times) is a CD Cell that contains translations of the layouts of the sub cell types. Does not provoke an extraction. Assumes that cellType and its recast have similar public. Copies the decorations of the recast. Does not provoke an extraction. Assumes that cellType is a RecordCell with a unique instance, and obj a CD Cell with a unique instance. Conceptually flattens obj (stopping for the cellTypes which have an associated layout), extracts it, sorts its instances, assumes they match the instances of cellType, and finally decorates cellType in accord to this sort. Wires that have their own geometry (not part of an instance) are matched by name. This function modifies physically the instances of cellType, by permuting the ith and the jth instance when sort (called with the positions of the instances) returns FALSE (for i layoutCellType=NIL. This function is used for checking the isomorphism between the source Core and the extracted Core. Exceptions All the escapes from PWCore functions are described in this section. This SIGNAL is called when implementor should be called ... This ERROR is called when attachment of layout is impossible. Current types are: $NoLayoutAtom $NoRegistration $InternalBug $CallerBug This Signal is called during or after decoration of cellType, when some interface geometry corresponds to two several atomic wires of cellType. The variable publics holds the list of atomic publics corresponding; geometry holds all the geometry in error. This Signal is called during or after decoration of cellType. The variable public holds the atomic public which has no geometry. This Signal is called during or after decoration of cellType. For those who really want to live dangerously ... This PROC is used to bypass all checks and get the Core description directly from the Layout using Sinix. Avoid using it! Κt˜– "Cedar" stylešœ ™ Jšœ Οmœ7™BIcode™.K™0—J˜šΟk œ˜ Jšžœžœ,˜4Jšœ˜Jšœ žœžœ˜J˜ Jšœ žœ ˜Jšœžœ˜—J˜JšΠbnœžœž œž˜!head™IbodyšœQžœ™Τ—™Kšœ žœ˜Kšœžœžœ˜Kšœžœ ˜Kšžœžœžœ˜Kšœ žœ˜#Kšœžœ˜—™šœ žœžœžœ˜CKšœ!™!Kšœς™ςK™—šœžœžœ#˜JšœZ™Z——šœ™šœ/™/MšœHžœΠ™šMšœ‰™‰MšœV™VK˜—šœ)™)Mšœ1žœžœk™ΐMšœ‹™‹Mšœ[™[Mšœc™cK˜—šœ žœ˜Kš‘š™š——™MšœΆ™ΆK˜šœ˜Kš‘œ™œ——™š œ žœžœžœ žœ žœžœ˜@K™9K™—Kš œ ˜Kš œ ˜Kš œ ˜š œ ˜K˜—š  œ˜Kšœy™yK™—š  œžœ3˜EKšœO™OJšœ™J™K™—Kš  œ˜Kš  œ˜Kš œ˜#š œ˜#K™—š œ˜Kšœ;™;K™%Kšœ™K™—š œ˜Kšœg™gK™—š œžœ3˜HKšœί™ίK™QK™—š  œžœK˜^KšœΆ™Ά——™š  œžœ"žœžœžœ žœžœ˜fKšœD™DKšœk™k™$KšœE™EKšžœžœžœB™Z—K™—š œžœžœ ˜7Kšžœ:˜@K™$K™—š œžœ&˜BKšœ‘™‘K™—Kš œžœžœ"˜Nš œžœžœ"˜NK˜—Kš  œžœžœ ˜MKš  œžœžœ ˜MK˜š œžœ*žœžœ˜aKšœk™k——™M™‹K˜š œžœžœžœžœ žœžœ˜OKšœ™Kšž œn™wK™—š œžœžœžœžœžœžœžœžœ˜˜Kšœη™ηKšœF™FK™SK™—š  œžœ žœžœžœžœ˜WKšœd™dKšœF™F——™)Jšœ‘3˜PJ˜šœ žœžœžœ˜-J™—šœžœžœžœ˜&Jšœ‘$˜3Jšœ‘˜3Jšœ‘'˜8J˜J™J˜—š œžœžœ`˜›J™FJ˜—š œžœžœžœ˜SJšœpžœ ™~Jšœ4žœ™8Jšœb™b——™ M™DM˜š œžœ˜%šœžœ0™;J™——š œžœžœ žœ˜>šœžœG™QJ™ Jšœ™J™ J™ J™——š  !œžœ=žœžœžœ ˜{šœ™J™——š œžœ:žœžœ˜bJšœ‚™‚J™—š œžœ#˜CJšœ?™?——™1š œžœžœ˜IKšœžœq™zK™——Jšžœ˜—…—(8δ