file: ///stdcell/SCSetUpLayoutImpl.mesa
-- Copyright (C) 1985, 1986 by Xerox Corporation. All rights reserved.
last modified by Preas, May 8, 1986 3:07:45 pm PDT
Frank Bowers February 6, 1986 9:55:23 am PST
the high level Sloop initialization:
DIRECTORY
Core,
Rope,
Route,
SC,
SCChanUtil,
SCPrivate,
SCRowUtil,
TerminalIO;
SCSetUpLayoutImpl: CEDAR PROGRAM
IMPORTS SC, SCChanUtil, SCRowUtil
EXPORTS SCPrivate
SHARES SC =
BEGIN
GetRopeProp: PROCEDURE[from: Core.Properties, key: ATOM, default: Rope.ROPENIL]
RETURNS [val: Rope.ROPE] = {
RETURN[default]};
GetRopeListProp: PROCEDURE[from: Core.Properties, key: ATOM, default: LIST OF Rope.ROPENIL]
RETURNS [val: LIST OF Rope.ROPE] = {
RETURN[default]};
GetIntProp: PROCEDURE[from: Core.Properties, key: ATOM, default: INT ← 0] RETURNS [val: INT] = {
RETURN[default]};
GetBoolProp: PROCEDURE[from: Core.Properties, key: ATOM, default: BOOLFALSE]
RETURNS [val: BOOL] = {
RETURN[default]};
SetUpLayout: PUBLIC PROCEDURE[handle: SC.Handle, cellType: Core.CellType] RETURNS [canContinue: BOOLTRUE] =
BEGIN
get Power signals
ProcPower: PROCEDURE [default: Rope.ROPE, lRSide: SCPrivate.LRSide]
RETURNS [powerSide: SCPrivate.PowerBus] = {
powerSide ← NEW[SCPrivate.PowerBusRec];
powerSide.name ← default};
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 and CD units
layoutParms.whichFom ← wlFom;
get whether to use only maxRoute channels for exits
layoutParms.useInteriorChanExits ← GetBoolProp[cellType.properties, $UseInteriorChanExits, TRUE];
get number of rows
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};
END.