DIRECTORY Cabbage, CD, CDBasics, CDSimpleRules, Connections, Core, CoreClasses, CoreCreate, CoreOps, CoreProperties, CoreGeometry, CoreRoute, PWCore, Rope, RTBasic, Sisyph; BicPadFrameImpl: CEDAR PROGRAM IMPORTS Cabbage, CD, CDBasics, CDSimpleRules, Connections, CoreOps, CoreProperties, CoreGeometry, CoreRoute, PWCore, Sisyph = BEGIN ROPE: TYPE = Core.ROPE; Wire: TYPE = Core.Wire; WireSeq: TYPE = Core.WireSeq; CellType: TYPE = Core.CellType; CellInstance: TYPE = CoreCreate.CellInstance; GetCTPropBool: PROC [ct: CellType, prop: ATOM, default: BOOL] RETURNS [val: BOOL] ~ { ref: REF _ CoreProperties.GetCellTypeProp[ct, prop]; val _ IF ref=NIL THEN default ELSE NARROW[ref, REF BOOL]^; }; GetCTPropInt: PROC [ct: CellType, prop: ATOM, default: INT] RETURNS [val: INT] ~ { ref: REF _ CoreProperties.GetCellTypeProp[ct, prop]; val _ IF ref=NIL THEN default ELSE NARROW[ref, REF INT]^; }; GetCTPropRope: PROC [ct: CellType, prop: ATOM, default: ROPE] RETURNS [val: ROPE] ~ { ref: REF _ CoreProperties.GetCellTypeProp[ct, prop]; val _ IF ref=NIL THEN default ELSE NARROW[ref, ROPE]; }; SideToSide: PROC [side: CoreGeometry.Side] RETURNS [RTBasic.Side] = { RETURN [SELECT side FROM top => top, bottom => bottom, left => left, right => right, ENDCASE => ERROR ]; }; AddConnection: PROC [nets: Connections.Table, internal: WireSeq, actual: Wire, object: CD.Object, min, max: INT, side: CoreGeometry.Side, layer: CD.Layer] = { name: ROPE _ CoreRoute.LabelInternal[internal, actual]; net: Connections.Net _ Connections.Fetch[nets, name].net; widthVal: REF ANY _ CoreProperties.GetWireProp[actual, wireWidthProp]; width: INT _ IF widthVal = NIL THEN 0 ELSE NARROW[widthVal, REF INT]^; IF net=NIL THEN { net _ NEW [Connections.NetRec _ [name: name, width: width]]; [] _ Connections.Store[nets, name, net]; }; net.segments _ CONS [ NEW [Connections.SegmentRec _ [object: object, range: [min, max], side: SideToSide[side], layer: layer]], net.segments]; }; BBox: PROC [inst: CellInstance] RETURNS [CD.Rect] ~ { RETURN[CDBasics.MapRect[CD.InterestRect[CoreGeometry.GetObject[Sisyph.mode.decoration, inst.type]], CoreGeometry.GetTrans[Sisyph.mode.decoration, inst]]] }; AttributePadFrame: PWCore.AttributesProc = { data: CoreClasses.RecordCellType _ NARROW [cellType.data]; minX, minY: INT _ LAST[INT]; maxX, maxY: INT _ FIRST[INT]; left, right, top, bottom: CellInstance _ NIL; IF data.size#5 THEN ERROR; -- 4 sides and inner FOR i: NAT IN [0..data.size) DO IF BBox[data[i]].x1maxX THEN {right _ data[i]; maxX _ BBox[data[i]].x2}; IF BBox[data[i]].y1maxY THEN {top _ data[i]; maxY _ BBox[data[i]].y2}; ENDLOOP; CoreProperties.PutCellInstanceProp[left, $PadFrameSide, $Left]; CoreProperties.PutCellInstanceProp[bottom, $PadFrameSide, $Bottom]; CoreProperties.PutCellInstanceProp[right, $PadFrameSide, $Right]; CoreProperties.PutCellInstanceProp[top, $PadFrameSide, $Top]; }; technologyKey: ATOM = $cmosB; wireWidthProp: ATOM = $w; lambda: INT _ CDSimpleRules.GetTechnology[technologyKey].lambda; LayoutPadFrame: PWCore.LayoutProc = { data: CoreClasses.RecordCellType _ NARROW [cellType.data]; leftInst, rightInst, topInst, bottomInst, innerInst: CellInstance _ NIL; leftOb, rightOb, topOb, bottomOb, innerOb: CD.Object _ NIL; prop: REF _ CoreProperties.GetCellTypeProp[cellType, $VerticalMetal]; innerDX: INT _ GetCTPropInt[cellType, $innerDX, 0]; innerDY: INT _ GetCTPropInt[cellType, $innerDY, 0]; vertLayer: ROPE _ IF prop=NIL OR prop=$Metal2 THEN "metal2" ELSE "metal"; -- default: metal2 horizLayer: ROPE _ IF prop=NIL OR prop=$Metal2 THEN "metal" ELSE "metal2"; outerChanWidth: INT _ GetCTPropInt[cellType, $outerWidth, 90]; powerCellWidth: INT _ GetCTPropInt[cellType, $powerWidth, 200]; hLayer: CD.Layer _ CDSimpleRules.GetLayer[technologyKey, horizLayer]; vLayer: CD.Layer _ CDSimpleRules.GetLayer[technologyKey, vertLayer]; params: Cabbage.PadRingParams _ NEW [Cabbage.PadRingParamsRec _ [ horizLayer: horizLayer, vertLayer: vertLayer, technologyKey: technologyKey, -- $cmosB outerBTChanWidth: outerChanWidth, -- enough for xxx tracks outerLRChanWidth: outerChanWidth, -- enough for xxx tracks powerBTCellWidth : powerCellWidth, -- xxx lambda power busses powerLRCellWidth : powerCellWidth, -- xxx lambda power busses opt: noIncompletes, signalSinglePinNets: TRUE]]; nets: Connections.Table _ Connections.CreateForRopes[]; innerPos: CD.Position; leftSize, rightSize, topSize, bottomSize: CD.Position; ConnectionsFromList: PROC [nets: Connections.Table, inst: CellInstance, side: CoreGeometry.Side, layer: CD.Layer] ~ { FOR l: CoreRoute.WirePins _ CoreRoute.FilteredInstanceLayoutPins[inst, side], l.rest WHILE l#NIL DO actual: Wire _ l.first.wire; name: ROPE _ CoreRoute.LabelInternal[data.internal, actual]; net: Connections.Net _ Connections.Fetch[nets, name].net; widthVal: REF ANY _ CoreProperties.GetWireProp[actual, wireWidthProp]; width: INT _ IF widthVal = NIL THEN 0 ELSE NARROW[widthVal, REF INT]^; IF layer#l.first.layer THEN LOOP; IF l.first.min>l.first.max THEN ERROR; IF net=NIL THEN net _ NEW [Connections.NetRec _ [name: name, width: width]]; [] _ Connections.Store[nets, name, net]; net.segments _ CONS [ NEW [Connections.SegmentRec _ [object: PWCore.Layout[inst.type], range: [l.first.min, l.first.max], side: SideToSide[side], layer: l.first.layer]], net.segments]; ENDLOOP; }; IF data.size#5 THEN ERROR; -- 4 sides and inner FOR i: NAT IN [0..data.size) DO SELECT CoreProperties.GetCellInstanceProp[data[i], $PadFrameSide] FROM $Left => leftInst _ data[i]; $Right => rightInst _ data[i]; $Top => topInst _ data[i]; $Bottom => bottomInst _ data[i]; NIL => innerInst _ data[i]; ENDCASE => ERROR; ENDLOOP; IF leftInst=NIL OR rightInst=NIL OR topInst=NIL OR bottomInst=NIL OR innerInst=NIL THEN ERROR; leftOb _ PWCore.Layout[leftInst.type]; rightOb _ PWCore.Layout[rightInst.type]; topOb _ PWCore.Layout[topInst.type]; bottomOb _ PWCore.Layout[bottomInst.type]; innerOb _ PWCore.Layout[innerInst.type]; leftSize _ CD.InterestSize[leftOb]; rightSize _ CD.InterestSize[rightOb]; topSize _ CD.InterestSize[topOb]; bottomSize _ CD.InterestSize[bottomOb]; IF NOT(bottomSize.x=topSize.x AND leftSize.y=rightSize.y) THEN ERROR; ConnectionsFromList[nets, leftInst, right, vLayer]; ConnectionsFromList[nets, rightInst, left, vLayer]; ConnectionsFromList[nets, topInst, bottom, hLayer]; ConnectionsFromList[nets, bottomInst, top, hLayer]; ConnectionsFromList[nets, innerInst, right, hLayer]; ConnectionsFromList[nets, innerInst, left, hLayer]; ConnectionsFromList[nets, innerInst, bottom, vLayer]; ConnectionsFromList[nets, innerInst, top, vLayer]; innerPos _ CDBasics.AddPoints[ [innerDX*lambda, innerDY*lambda], Cabbage.Center[innerOb, NIL, bottomOb, NIL, rightOb, NIL, topOb, NIL, leftOb, params] ]; CoreGeometry.PutTrans[PWCore.extractMode.decoration, innerInst, [innerPos]]; CoreGeometry.PutTrans[PWCore.extractMode.decoration, bottomInst, [[leftSize.x, 0]]]; CoreGeometry.PutTrans[PWCore.extractMode.decoration, rightInst, [[leftSize.x+bottomSize.x, bottomSize.y]]]; CoreGeometry.PutTrans[PWCore.extractMode.decoration, topInst, [[leftSize.x, bottomSize.y+leftSize.y]]]; CoreGeometry.PutTrans[PWCore.extractMode.decoration, leftInst, [[0, bottomSize.y]]]; obj _ Cabbage.PadLimitedRoute[ inner: innerOb, bottom: bottomOb, right: rightOb, top: topOb, left: leftOb, bottomLeft: NIL, bottomRight: NIL, topRight: NIL, topLeft: NIL, innerPos: innerPos, connections: nets, parms: params, name: CoreOps.GetCellTypeName[cellType] ]; }; DecoratePadframe: PWCore.DecorateProc = { CoreGeometry.PutRecordLazyPins[PWCore.extractMode.decoration, cellType, CD.InterestRect[obj]]; }; [] _ PWCore.RegisterLayoutAtom[$PadFrame, LayoutPadFrame, DecoratePadframe, AttributePadFrame]; END. ”BicPadFrameImpl.mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Bertrand Serlet September 10, 1987 11:17:02 pm PDT Louis Monier October 7, 1987 12:52:31 pm PDT Common types Utilities Layout Proc -- default: metal1 -- warning: the new Cabbage changes layer from inner to pads, so pads on the left will use their pins in vertLayer!!! -- Call Cabbage Decorate Proc Initialization Κk˜– "Cedar" stylešœ™Jšœ<™Kšœœ,˜?Kšœœ;˜EKšœœ:˜Dšœ œ˜AKšœ˜Kšœ˜Kšœ  ˜'Kšœ" ˜:Kšœ" ˜:Kšœ# ˜=Kšœ# ˜=Kšœ˜Kšœœ˜—Jšœ7˜7Jšœ œ ˜Jšœ*œ ˜6K˜šŸœœOœ ˜ušœRœœ˜cKšœ˜Kšœœ2˜