DIRECTORY CD, CDInstances, CDRects, Core, CoreClasses, CoreGeometry, CoreOps, ExtendCells, PWObjects; ExtendCellsImpl: CEDAR PROGRAM IMPORTS CD, CDInstances, CDRects, CoreClasses, CoreGeometry, CoreOps, PWObjects EXPORTS ExtendCells ~ BEGIN OPEN ExtendCells; ExtendSegment: PUBLIC ExtendSegmentProc = { IF extension=0 THEN RETURN; RETURN [CDRects.CreateRect[ IF side=top OR side=bottom THEN [max-min, extension] ELSE [extension, max-min], layer]]; }; ExtendObject: PUBLIC PROC [wirePins: LIST OF WirePin, size: CD.Position, side: Side, extendProc: ExtendSegmentProc _ ExtendSegment] RETURNS [extendedCell: Object] = { instances: CD.InstanceList _ NIL; extension: INT _ IF side=top OR side=bottom THEN size.y ELSE size.x; WHILE wirePins#NIL DO wirePin: WirePin = wirePins.first; object: Object _ extendProc[wirePin.wire, wirePin.min, wirePin.max, wirePin.layer, side, extension]; IF object#NIL THEN instances _ CONS [ CDInstances.NewInst[ ob: object, trans: [IF side=top OR side=bottom THEN [wirePin.min, 0] ELSE [0, wirePin.min]] ], instances]; wirePins _ wirePins.rest; ENDLOOP; extendedCell _ PWObjects.CreateCell[instances: instances, ir: [0, 0, size.x, size.y], name: "ExtendObject"]; }; ExtendCellType: PUBLIC PROC [decoration: Decoration, cellType: CellType, extensions: Extensions _ nullExtensions, extendProc: ExtendSegmentProc _ ExtendSegment, name: ROPE _ NIL, props: Properties _ NIL] RETURNS [extendedCell: CellType] = { cdInstances: CD.InstanceList _ NIL; instance: CoreClasses.CellInstance _ NIL; public: Wire _ CoreOps.CopyWire[cellType.public]; subObject: Object = CoreGeometry.GetObject[decoration, cellType]; isize: CD.Position = CD.InterestSize[subObject]; ir: CD.Rect = [-extensions[left], -extensions[bottom], isize.x+extensions[right], isize.y+extensions[top]]; EachBinding: CoreOps.EachWirePairProc = { EachPin: CoreGeometry.EachPinProc = { object: Object; extension: INT = extensions[side]; IF extension=0 THEN RETURN; object _ extendProc[publicWire, min, max, layer, side, extension]; IF object#NIL THEN { trans: CD.Transformation = [SELECT side FROM top => [min, isize.y], bottom => [min, -extension], right => [isize.x, min], left => [-extension, min], ENDCASE => ERROR]; cdInstances _ CONS [CDInstances.NewInst[ob: object, trans: trans], cdInstances]; CoreGeometry.AddGeometry[decoration, actualWire, LIST [[object, trans]]]; CoreGeometry.AddPins[decoration, actualWire, LIST [[object, trans]]]; }; }; CoreGeometry.PutTransWireIRLazyPins[decoration, actualWire, publicWire, [], ir]; [] _ CoreGeometry.EnumerateSides[decoration, cellType, publicWire, EachPin]; }; [] _ CoreOps.VisitBindingSeq[public, cellType.public, EachBinding]; cdInstances _ CONS [CDInstances.NewInst[ob: subObject, trans: []], cdInstances]; instance _ CoreClasses.CreateInstance[public, cellType]; CoreGeometry.PutTrans[decoration, instance, []]; extendedCell _ CoreClasses.CreateRecordCell[public, public, LIST [instance], name, props]; CoreGeometry.PutObject[decoration, extendedCell, PWObjects.CreateCell[instances: cdInstances, ir: ir, name: name]]; }; END. ExtendCellsImpl.mesa Copyright Σ 1987 by Xerox Corporation. All rights reversed. Created by Bertrand Serlet, February 11, 1987 5:53:16 pm PST Bertrand Serlet March 15, 1987 11:11:45 pm PST Types and Defaults Extentions returning Objects Extentions returning CellTypes Κ!˜codešœ™Kšœ<™˜PKšœ1œ˜IKšœ-œ˜EK˜—K˜—KšœP˜PKšœL˜LK˜—KšœC˜CKšœœ>˜PKšœ8˜8Kšœ0˜0Kšœ<œ˜ZKšœs˜sK˜——K˜Kšœ˜—…— ό1