CabbageImpl:
CEDAR
PROGRAM
IMPORTS CabbagePrivate
Error: PUBLIC ERROR[errorType: Cabbage.ErrorType ← callingError, explanation: Rope.ROPE ← NIL] = CODE;
Signal:
PUBLIC
SIGNAL[errorType: Cabbage.ErrorType ← callingError, explanation: Rope.
ROPE ←
NIL] =
CODE;
defaultPadRingParams:
PUBLIC Cabbage.PadRingParams ←
NEW[Cabbage.PadRingParamsRec ← ["metal", "metal2"]];
Returns the innerPos needed for centering the inner in the pad frame. This is usually what is desired. However the position of the inner cell can be positioned other than in the center.
Center:
PUBLIC
PROC [inner, bottomLeft, bottom, bottomRight, right, topRight, top, topLeft, left: Cabbage.Object, parms: Cabbage.PadRingParams]
RETURNS [innerPos:
CD.Position] = {
handle: CabbagePrivate.Handle ← CabbagePrivate.CreateHandle[inner, bottomLeft, bottom, bottomRight, right, topRight, top, topLeft, left, NIL, parms, NIL, normal];
lowerY: INT ← handle.bottom.origin.y + handle.bottom.size.y;
upperY: INT ← handle.top.origin.y - handle.inner.size.y;
lowerX: INT ← handle.left.origin.x + handle.left.size.x;
upperX: INT ← handle.right.origin.x - handle.inner.size.x;
innerPos ← [(lowerX + upperX)/2, (lowerY + upperY)/2]};
Extends the wires of oldInner to make an proper inner. The extension takes into account the routing layer.
MakeInner:
PUBLIC
PROC [oldInner: Cabbage.Object, connections: Connections.Table, parms: Cabbage.PadRingParams]
RETURNS [inner: Cabbage.Object] = {
};
Extends the wires of oldPadSides to make an proper PadSides. The extension takes into account the routing layer.
MakeOuter: PUBLIC PROC [oldOuter: Cabbage.Object, side: Cabbage.Side, connections: Connections.Table, parms: Cabbage.PadRingParams] RETURNS [outer: Cabbage.Object] = {
Route the chip
PadRoute:
PUBLIC
PROC [inner, bottomLeft, bottom, bottomRight, right, topRight, top, topLeft, left: Cabbage.Object, innerPos:
CD.Position, connections: Connections.Table, parms: Cabbage.PadRingParams ← defaultPadRingParams, name: Rope.
ROPE]
RETURNS [chip: Cabbage.Object] = {
handle: CabbagePrivate.Handle ← CabbagePrivate.CreateHandle[inner, bottomLeft, bottom, bottomRight, right, topRight, top, topLeft, left, connections, parms, name, normal];
CabbagePrivate.CheckInnerPos[handle, innerPos];
CabbagePrivate.DistributePower[handle];
CabbagePrivate.GlobalRoute[handle];
CabbagePrivate.DetailedRoute[handle];
chip ← CabbagePrivate.MakeChip[handle]};
Route a pad limited chip
PadLimitedRoute:
PUBLIC
PROC [inner, bottomLeft, bottom, bottomRight, right, topRight, top, topLeft, left: Cabbage.Object, innerPos:
CD.Position, connections: Connections.Table, parms: Cabbage.PadRingParams ← defaultPadRingParams, name: Rope.
ROPE]
RETURNS [chip: Cabbage.Object] = {
handle: CabbagePrivate.Handle ← CabbagePrivate.CreateHandle[inner, bottomLeft, bottom, bottomRight, right, topRight, top, topLeft, left, connections, parms, name, padLimited];
CabbagePrivate.CheckInnerPos[handle, innerPos];
CabbagePrivate.DistributePower[handle];
CabbagePrivate.GlobalRoute[handle];
CabbagePrivate.DetailedRoute[handle];
chip ← CabbagePrivate.MakeChip[handle]};
END.