ConstructRow:
PROC [handle:
SC.Handle, lgRow: SCPrivate.LgRow]
RETURNS [row:
CD.Object ← CDCells.CreateEmptyCell[]] ~ {
LeftEnumerateSegments:
PROC [eachSegment:
PROC [CoreRoute.Segment]] ~ {
enumerate public wires for left side of row
EachWirePin: CoreGeometry.EachWirePinProc = {
PROC [wire: Wire, min, max: INT, side: Side, layer: CD.Layer] RETURNS [quit: BOOL ← FALSE];
IF side=left THEN eachSegment[[label: CoreOps.GetShortWireName[wire], min: min, max: max, layer: layer]]};
[] ← CoreGeometry.EnumerateWireSides[mode.decoration, lgRow.lgsOnRow[1].object.cellType, EachWirePin]};
RightEnumerateSegments:
PROC [eachSegment:
PROC [CoreRoute.Segment]] ~ {
enumerate public wires for right side of row
EachWirePin: CoreGeometry.EachWirePinProc = {
PROC [wire: Wire, min, max: INT, side: Side, layer: CD.Layer] RETURNS [quit: BOOL ← FALSE];
IF side=right THEN eachSegment[[label: CoreOps.GetShortWireName[wire], min: min, max: max, layer: layer]]};
[] ← CoreGeometry.EnumerateWireSides[mode.decoration, lgRow.lgsOnRow[lgRow.nLgsOnRow].object.cellType, EachWirePin]};
ForEachInstance: SCRowUtil.EachInstProc = {
[pos: NAT, instance: SCPrivate.Instance] RETURNS [quit: BOOL ← FALSE]
LabelProc:
PROC [pinName: Rope.
ROPE]
RETURNS [label: Route.Label ←
NIL] ~ {
find label for this pin
EachPin: SCInstUtil.EachPinProc ~ {
PROC [instance: SCPrivate.Instance, pin: NAT, netPin: SCPrivate.PinNet] RETURNS [quit: BOOL ← FALSE];
IF netPin.pin.name = pinName THEN {label ← netPin.net.name; quit ← TRUE}};
IF SCUtil.IsPowerName[handle, pinName] THEN label ← pinName
ELSE
IF ~SCInstUtil.EnumeratePinsOnInst[instance: instance, eachPin: EachPin]
THEN
SC.Signal[callingError, "FeedThrough definition in library does not have all rectangles marked."]};
instOrientation: CD.Orientation ← SCInstUtil.CDOrien[instance];
object:
CD.Object ←
IF instance.whichClass = ft
THEN CoreRoute.MakeRoutingCell[instance.object.cdOb, LabelProc]
ELSE instance.object.cdOb;
instPosition: CD.Position ← CDOps.FitObjectI[ob: object, location: [offset, 0], orientation: instOrientation].off;
cdInst: CD.Instance ← RouteUtil.Include[cell: row, ob: object, position: instPosition, orientation: instOrientation];
CDProperties.PutInstanceProp[cdInst, $InstanceName, instance.name];
offset ← offset + RTBasic.IRSize[object].x};
mode: Sinix.Mode = SinixOps.GetExtractMode[handle.rules.rowParms.technology];
layoutData: SCPrivate.LayoutData ← NARROW[handle.layoutData];
maxRowWidth: CD.Number ← layoutData.lgRows.maxRowWidth;
rowLength: SC.Number ← lgRow.size.p;
rowOffset: SC.Number ← lgRow.rowOrg.p - layoutData.lgRows.horzRowOrg;
offset: SC.Number ← 0;
IF rowOffset > 0
THEN {
leftObject: CD.Object ← CoreRoute.ExtendObject[enumerateSegments: LeftEnumerateSegments, size: [rowOffset, lgRow.size.q], side: left, extendProc: CoreRoute.ExtendSegment];
[] ← RouteUtil.Include[cell: row, ob: leftObject, position: [offset, 0]];
offset ← offset + RTBasic.IRSize[leftObject].x};
[] ← SCRowUtil.EnumerateAllInstsOnRow[handle, lgRow.rowNum, ForEachInstance];
IF rowOffset + rowLength < maxRowWidth
THEN {
rightObject: CD.Object ← CoreRoute.ExtendObject[enumerateSegments: RightEnumerateSegments, size: [maxRowWidth - (rowOffset + rowLength), lgRow.size.q], side: right, extendProc: CoreRoute.ExtendSegment];
[] ← RouteUtil.Include[cell: row, ob: rightObject, position: [offset, 0]];
offset ← offset + RTBasic.IRSize[rightObject].x};
RTBasic.RepositionCell[row]};