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]];
};