SetUpLayout:
PUBLIC
PROCEDURE[handle:
SC.Handle, cellType: Core.CellType]
RETURNS [canContinue:
BOOL ←
TRUE] =
BEGIN
get Power signals
ProcPower:
PROCEDURE [default: Rope.ROPE, lRSide: SCPrivate.LRSide]
RETURNS [powerSide: SCPrivate.PowerBus] =
BEGIN
powerSide ← NEW[SCPrivate.PowerBusRec];
powerSide.name ← default;
powerSide.onSide ← lRSide;
END;
layoutData: SCPrivate.LayoutData ← NARROW[NEW[SCPrivate.LayoutDataRec], SCPrivate.LayoutData];
layoutParms: SCPrivate.LayoutParms ← NEW[SCPrivate.LayoutParmsRec];
sideRules: Route.DesignRules ← handle.rules.sideRules;
rowRules: Route.DesignRules ← handle.rules.rowRules;
bottomRow: SCPrivate.BpRow ← NEW[SCPrivate.BpRowRec];
rightRow: SCPrivate.BpRow ← NEW[SCPrivate.BpRowRec];
topRow: SCPrivate.BpRow ← NEW[SCPrivate.BpRowRec];
leftRow: SCPrivate.BpRow ← NEW[SCPrivate.BpRowRec];
layoutData.bpRows ← NEW[SCPrivate.BpRowsRec];
layoutData.lgRows ← NEW[SCPrivate.LgRowsRec];
layoutData.sideChans[left] ← NEW[SCPrivate.SideChanRec];
layoutData.sideChans[right] ← NEW[SCPrivate.SideChanRec];
layoutData.rowChans ← NEW[SCPrivate.RowChansRec];
layoutData.layoutParms ← layoutParms;
handle.layoutData ← layoutData;
get fom type
layoutParms.whichFom ← wlFom;
get whether to use only maxRoute channels for exits
layoutParms.useInteriorChanExits ← GetBoolProp[cellType.properties, $UseInteriorChanExits, TRUE];
get number of rows
layoutParms.numRows ← GetIntProp[cellType.properties, SC.rowProp, 0];
layoutParms.rowDirection ← handle.rules.rowRules.trunkDirection;
-- do rest of power buses in GetStructure
layoutData.powerBuses[left] ← ProcPower["Vdd", left];
layoutData.powerBuses[right] ← ProcPower["Gnd", right];
initialize the channel widths
FOR chan: SCPrivate.MaxChanSr
IN SCPrivate.MaxChanSr
DO
channel: SCPrivate.RowChan ← NEW[SCPrivate.RowChanRec];
channel.exits ← NEW[SCPrivate.ExitArrayOb];
channel.chanNum ← chan;
layoutData.rowChans.chans[chan] ← channel;
channel.initChanWidth ← rowRules.trunkToTrunk*30;
ENDLOOP;
side data
FOR side: SCPrivate.LRSide
IN SCPrivate.LRSide
DO
channel: SCPrivate.SideChan ← NEW[SCPrivate.SideChanRec];
channel.side ← side;
layoutData.sideChans[side] ← channel;
channel.initSideChanWidth ← sideRules.trunkToTrunk*10;
ENDLOOP;
io and row data
FOR row:
NAT
IN SCPrivate.MaxRowSr
DO
layoutData.lgRows.rows[row] ← NEW[SCPrivate.LgRowRec];
layoutData.lgRows.rows[row].rowNum ← row;
ENDLOOP;
layoutData.bpRows[bottom] ← bottomRow;
bottomRow.bpSpacing ← GetIntProp[cellType.properties, SC.bottomExitSpacing, rowRules.branchToBranch];
bottomRow.initMaxBpsOnSide ← GetIntProp[cellType.properties, SC.bottomMaxExits, 0];
layoutData.bpRows[right] ← rightRow;
rightRow.bpSpacing ← GetIntProp[cellType.properties, SC.rightExitSpacing, sideRules.trunkToTrunk];
rightRow.initMaxBpsOnSide ← GetIntProp[cellType.properties, SC.rightMaxExits, 0];
layoutData.bpRows[top] ← topRow;
topRow.bpSpacing ← GetIntProp[cellType.properties, SC.topExitSpacing, rowRules.branchToBranch];
topRow.initMaxBpsOnSide ← GetIntProp[cellType.properties, SC.topMaxExits, 0];
layoutData.bpRows[left] ← leftRow;
leftRow.bpSpacing ← GetIntProp[cellType.properties, SC.leftExitSpacing, sideRules.trunkToTrunk];
leftRow.initMaxBpsOnSide ← GetIntProp[cellType.properties, SC.leftMaxExits, 0];
RETURN[canContinue];
END;
DestroyLayout:
PUBLIC
PROC [handle:
SC.Handle] ~ {
EachRow: SCRowUtil.EachRowProc ~ {
EachInst: SCRowUtil.EachInstProc ~ {
lgRow.lgsOnRow[pos] ← NIL};
[] ← SCRowUtil.EnumerateAllInstsOnRow[handle, row, EachInst];
layoutData.lgRows.rows[row] ← NIL};
EachSide: SCRowUtil.EachSideProc ~ {
EachInst: SCRowUtil.EachInstProc ~ {
bpRow.bpsOnSide[pos] ← NIL};
[] ← SCRowUtil.EnumerateAllInstsOnSide[handle, side, EachInst];
layoutData.bpRows[side] ← NIL};
EachRowChan: SCChanUtil.EachRowChanProc ~ {
EachExit: SCChanUtil.EachExitProc ~ {
exit.net ← NIL};
[] ← SCChanUtil.EnumerateExits[handle, rowChan, left, EachExit];
[] ← SCChanUtil.EnumerateExits[handle, rowChan, right, EachExit];
layoutData.rowChans.chans[chan] ← NIL};
EachSideChan: SCChanUtil.EachSideChanProc ~ {
layoutData.sideChans[lrSide] ← NIL};
layoutData: SCPrivate.LayoutData ← NARROW[handle.layoutData];
[] ← SCRowUtil.EnumerateRows[handle, EachRow];
[] ← SCRowUtil.EnumerateSides[handle, EachSide];
[] ← SCChanUtil.EnumerateRowChans[handle, EachRowChan];
layoutData.bpRows ← NIL;
layoutData.lgRows ← NIL;
layoutData.sideChans[left] ← layoutData.sideChans[right] ← NIL;
layoutData.rowChans ← NIL;
layoutData.powerBuses[left] ← layoutData.powerBuses[right] ← NIL;
layoutData.layoutParms ← NIL;
layoutData.placeDat ← NIL;
layoutData.globalRoute ← NIL;
handle.layoutData ← NIL};