DIRECTORY Core, Pipal, PipalCore, PipalInt, RefTab; PatchWork: CEDAR DEFINITIONS = BEGIN LayoutProc: TYPE = PROC [cellType: Core.CellType] RETURNS [obj: Pipal.Object]; DecorateProc: TYPE = PROC [cellType: Core.CellType, obj: Pipal.Object]; AttributesProc: TYPE = PROC [cellType: Core.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: Core.CellType] RETURNS [layoutAtom: ATOM _ NIL]; Layout: PROC [cellType: Core.CellType] RETURNS [obj: Pipal.Object]; maskSuffix: Core.ROPE; SetLayout: PROC [cellType: Core.CellType, layoutAtom: ATOM, userDataProp: ATOM _ NIL, userData: REF _ NIL]; SetGet: PROC [cellType: Core.CellType] = INLINE {SetLayout[cellType, $Get]}; SetLayoutAndDecoration: PROC [cellType: Core.CellType, layout: Pipal.Object] = INLINE {SetLayout[cellType, $ValueNoDecorate, $PWCoreValue, layout]}; SetAbutX: PROC [cellType: Core.CellType] = INLINE {SetLayout[cellType, $RawAbutX]}; SetAbutY: PROC [cellType: Core.CellType] = INLINE {SetLayout[cellType, $RawAbutY]}; SetArrayX: PROC [cellType: Core.CellType] = INLINE {SetLayout[cellType, $ArrayX]}; SetArrayY: PROC [cellType: Core.CellType] = INLINE {SetLayout[cellType, $ArrayY]}; RotateCellType: PROC [rotatedCellType: Core.CellType, orientation: ATOM] RETURNS [cellType: Core.CellType]; SortProc: TYPE = PROC [PipalInt.Position, PipalInt.Position] RETURNS [BOOL]; SortInX: SortProc; SortInY: SortProc; ReverseSortInX: SortProc; ReverseSortInY: SortProc; DecorateValue: DecorateProc; DecorateAbut: PROC [cellType: Core.CellType, obj: Pipal.Object, reverse: BOOL _ FALSE]; DecorateRecasted: DecorateProc; DecorateTransformed: DecorateProc; InstancesInXOrY: PROC [decoration: PipalCore.Decoration, record: Core.CellType, fudge: INT _ 0] RETURNS [ambiguous, inX: BOOL]; SortInstances: PROC [decoration: PipalCore.Decoration, cellType: Core.CellType, sort: SortProc]; Store: PROC [cellType: Core.CellType, withCuteFonts: BOOL _ FALSE]; Retrieve: PROC [name: Core.ROPE] RETURNS [cellType: Core.CellType]; LayoutInfo: PROC [sourceCT: Core.CellType] RETURNS [layout: Pipal.Object, extractedCT: Core.CellType, extractedToSource: RefTab.Ref, key: INT]; GetPWCoreExtractedCTKey: PROC [extractedCT: Core.CellType] RETURNS [key: INT _ 0]; IsPatchWorkGenerated: PROC [obj: Pipal.Object] RETURNS [BOOL]; Signal: SIGNAL [cellType: Core.CellType]; Error: ERROR [type: ATOM, message: Core.ROPE, cellType: Core.CellType]; PinsCorrespondingToSeveralPublics: SIGNAL [cellType: Core.CellType, obj: Pipal.Object, publics: Core.Wires, geometry: Pipal.Object]; NoPinsOnAtomicPublic: SIGNAL [cellType: Core.CellType, obj: Pipal.Object, public: Core.Wire, message: Core.ROPE _ NIL]; FromLayoutWithoutPublic: PROC [obj: Pipal.Object] RETURNS [cellType: Core.CellType]; END. nPatchWork.mesa Copyright Σ 1985, 1986, 1987, 1988 by Xerox Corporation. All rights reversed. Louis Monier February 14, 1986 11:00:35 am PST Bertrand Serlet, May 9, 1988 1:10:06 am PDT Theory This interface defines how to generate layout attached to Core. 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 the function Layout. 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, LayoutProcs must insert one level of indirection if the object they return can be returned by other calls with a different cell type. For example the Get Layout function always return an indirect object. Decorates cellType with the geometric information derived from obj. That is decorates the atomic publics with the pins. 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. Might load some program according to the ChipNDale-CD-PWCore.CDLoadList. Retrieves the layoutAtom (if any) on the CellType, then on the CellClass, then on the recasted cell type, etc... Usage should be limited to testing if the returned layoutAtom is NIL or not. 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 (if present), - evaluating layoutProc, - using the decorateProc (if present) to decorate the original cellType Calling twice Layout with the same (REF equal) cellType will produce the same (REF equal) obj. Predefined layoutAtoms Predefined layoutAtoms to be used in schematics $Get and $GetAndFlatten: the Object of name the name of the CellType concatenated with maskSuffix is fetched and 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. $Abut: the cellType must be a recordCell. Decides if it is an Abut in X or Y by looking at the Sisyph decorations. Then sorts the instances according to the Sisyph decoration. $ArrayX, $ArrayY, $ArrayFlipX, $ArrayFlipY, ReverseArrayX, $ReverseArrayY: the cellType must be a sequenceCell. $FlipX, $FlipY, $Rot90, $Rot180, $Rot270: the cellType must be a RecordCell with a unique instance. 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. No indirection is added, so that if different cell types (e.g. extracted by Sisyph in different contexts) need the same layout they must insert an indirection level in the Pipal hierarchy. $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. 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 Short cuts for the designer Attaches the atom as a property (layoutAtomProp) of the cell type. If the user wants to supply some data, this data is stored under the property userDataProp on the cellType. The implementation is the following: CoreProperties.PutCellTypeProp[cellType, layoutAtomProp, layoutAtom]; IF userDataProp#NIL THEN CoreProperties.PutCellTypeProp[cellType, userDataProp, userData]; Fetches layout from a source design. For cases when designer knows the layout of a cellType (without any lazyness), and has already decorated cellType with the interface decorations. Creates a new cellType which layout is the same as the rotatedCellType, but rotated by orientation. 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 of the N sub cell types has layout. Assumes that obj is a Pipal Cell is, after proper expansion, an abut with N children, corresponding to the layout of the N 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 transformation. Assuming that record is a decorated Record Cell, looks if the instances are spread in X or Y. Result inX is only valid when non ambiguous. The exact rule is to see if projections along one axis are all non overlapping, while projections along the other axis are overlapping. Overlapping takes into account the fudge quantity to allow instances that overlap by l/2 to be qualified "non-overlapping". In that case l/2 should be passed for the fudge argument. 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.core". Stores the layout on the file named "Layout.pipal". Stores a shell of the layout on the file named "Shell.pipal". This shell is only for documentation. Retrieves the decorated Core itself from the file named ".core". Backdoor for clients such as PWCoreLichen Makes the bridge between sourceCT and extractedCT. Returns 0 if obj has not been obtained by PatchWork.Layout. Otherwise returns a key suck that GetPWCoreExtractedCTKey[LayoutInfo[sourceCT].extractedCT]=LayoutInfo[sourceCT].key. Returns TRUE if obj has been obtained by PatchWork.Layout. Exceptions All the escapes from PatchWork 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. 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! Κ˜– "Cedar" stylešœ™JšœN™NIcodešœ+Οk™.Kšœ+™+—J˜š œ˜ Jšœ˜Jšœ˜Jšœ˜—J˜JšΠbn œœ œ˜$head™IbodyšœΔΟbœ™Λ—™šœ œœœ˜NKšœ!™!Kšœ œ&œK™‚Kšœθ™θK™—šœœœ.˜GKšœx™xK™—šœœœ˜6Kšœs™sK™—šΟnœœœ7œ#œœ œ˜₯K™NK™§Kšœœ*™FK˜—š œœœœœœ#œ˜’Kšœ)™)Kšœ3œ™HK™—šœœΟc=˜SK˜—š   œœœœœ˜OKšœp™pKšœAœ™LK™—š œœœ˜Cšœ5™5Kšœ™KšœA™AKšœ.™.Kšœ™KšœG™G—Kšœ$œ(œ ™^——šœ™šœ/™/Mšœ²™²Mšœ‰™‰Mšœ±™±Mšœo™oMšœe™eK˜—šœ)™)Mšœώ™ώMšœ‹™‹Mšœ[™[K˜—šœœ˜Kšœš™š——™š  œœ'œœœ œœ˜kKšœD™DKšœk™k™$KšœE™EKšœœœB™Z—K™—š œœ˜)Kšœ˜#K™$K™—š œœ3œ?˜”Kšœ‘™‘K™—Kš œœœ"˜Sš œœœ"˜SK˜—Kš  œœœ ˜RKš  œœœ ˜RK˜š œœ/œœ˜kKšœe™e——™š œ œœ(œœ˜LKšœœ-™9K™—Kš œ ˜Kš œ ˜Kš œ ˜š œ ˜K˜—š  œ˜Kšœy™yK™—š  œœ7œœ˜WKšœY™YJšœŠ™ŠJ™K™—š œ˜Kšœ;™;K™%Kšœ™K™—š œ˜"KšœW™WK™—š  œœBœœœ˜Kšœ]™]Kšœ,™,Kšœˆ™ˆKšœUΟgœ4’œ+™ΆK˜—š  œœM˜`Kšœ¦œ ™Ά——™™M™—š œœ*œœ˜CJ™3J™KJ™CJ™tJ™—š œœ œœ˜CJ™P——™)š  œœœXœ˜Jšœ2™2J˜—š œœœœ˜RJšœ;™;Jšœu™uJ™—š œœœœ˜>Jšœœ.™:——™ M™GM˜š œœ˜*šœœ0™;J™——š œœœœ˜HšœœG™QJ™ Jšœ™J™ J™ J™——š !œœ[˜„šœ™J™——š œœOœœ˜wJšœ‚™‚——™1š œœœ˜TKšœœq™zK™——Jšœ˜—…— <0Θ