<> <<-- Copyright (C) 1985, 1986 by Xerox Corporation. All rights reserved.>> <> <> <> 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.ROPE _ NIL] RETURNS [val: Rope.ROPE] = { RETURN[default]}; GetRopeListProp: PROCEDURE[from: Core.Properties, key: ATOM, default: LIST OF Rope.ROPE _ NIL] 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: BOOL _ FALSE] RETURNS [val: BOOL] = { RETURN[default]}; SetUpLayout: PUBLIC PROCEDURE[handle: SC.Handle, cellType: Core.CellType] RETURNS [canContinue: BOOL _ TRUE] = BEGIN <> 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; <> layoutParms.whichFom _ wlFom; <> layoutParms.useInteriorChanExits _ GetBoolProp[cellType.properties, $UseInteriorChanExits, TRUE]; <> 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]; <<>> <> 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; <> 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; <> 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.