SCExprRoutePinsUtil.mesa
Copyright Ó 1986, 1987 by Xerox Corporation. All rights reserved.
Bryan Preas, August 4, 1987 12:14:52 pm PDT
Cong, August 24, 1987 7:41:49 pm PDT
DIRECTORY
CD, DABasics, RTBasic, SC, SCPrivate;
SCExprRoutePinsUtil: CEDAR DEFINITIONS = {
ConnectionType: TYPE = {left, interior, right, unconnected};
PinClass: TYPE = {isPin, isExit};
PinList: TYPE = LIST OF PinInChan;
PinInChan: TYPE = REF PinInChanRec;
PinInChanRec: TYPE = RECORD[
layer: SC.Layer,
net: SCPrivate.Net ← NIL,
chanNet: ChanNetDat ← NIL,
min, max, depth: SC.Number,
pinClass: PinClass ← isPin,
chanSide: RTBasic.Side ← bottom,
nextPinInChan, prevPinInChan: PinInChan ← NIL,
pinConn: ConnectionType ← unconnected,
nextPinInNet, prevPinInNet: PinInChan ← NIL,
localDensity: INT ← 0 ,
alwaysUse: BOOLEANFALSE,
chanNum: NAT ← 0,
component: NAT ← 0,    -- for union-find operation
adjList: REF ANYNIL,
dfsLabel: NAT ← 0];
NetDat: TYPE = REF NetDatRec;
NetDatRec: TYPE = ARRAY SCPrivate.MaxChanSr OF ChanNetDat ← ALL[NIL];
ChanNetDat: TYPE = REF ChanNetDatRec;
ChanNetDatRec: TYPE = RECORD[
net: SCPrivate.Net,
firstPin, lastPin: PinInChan ← NIL,  -- for all the pins in the net
leftmost, rightmost: PinInChan ←NIL,  -- for net segmet
exits: ARRAY SCPrivate.LRSide OF PinInChan ← ALL[NIL],
pinCount: INT ← 0];
Logically, we treat exits as pins. So 'firstPin' may point to an exit.
ChanNetList: TYPE = LIST OF ChanNetDat;
ChanDat: TYPE = REF ChanDatRec;
ChanDatRec: TYPE = RECORD [
head, tail: PinInChan];
initialize for determining the width of a channel
InitGetChanPins: PROCEDURE [handle: SC.Handle, rowChan: SCPrivate.RowChan];
terminate determining the width of a channel
TermGetChanPins: PROCEDURE [handle: SC.Handle, rowChan: SCPrivate.RowChan];
enter a net on a channel into data structure
EnterPin: PROCEDURE[rowChan: SCPrivate.RowChan, min, max, depth: SC.Number, layer: SC.Layer, net: SCPrivate.Net, side: SCPrivate.TBSide, alwaysUse: BOOLEAN] RETURNS[pinInChan: PinInChan];
enter exit data for a channel into routing data base
EnterExit: PROCEDURE[rowChan: SCPrivate.RowChan, pos: SC.Number, layer: SC.Layer, net: SCPrivate.Net, side: SCPrivate.LRSide] RETURNS[pinInChan: PinInChan];
Sort pins in the channel and link them by nets, and create corresponding net data records.
Minmium route channels need special processing to include the minimun number of wire segments of minimum length
CreateNetDat: PROCEDURE [handle: SC.Handle, rowChan: SCPrivate.RowChan];
enter a net segment into netDat, and enter pin connection info thru callback procs.
call back with segProc at the end (right) of each segment.
GetANetSegInChan: PROCEDURE[handle: SC.Handle, rowChan: SCPrivate.RowChan, net: SCPrivate.Net, segProc: SegProc, pinProc: PinProc, exitProc: ExitProc];
PinProc: TYPE = PROC [min, max, depth: SC.Number, side: SC.Side, layer: SC.Layer, net: SCPrivate.Net];
ExitProc: TYPE = PROC [side: SCPrivate.LRSide, layer: SC.Layer, net: SCPrivate.Net];
SegProc: TYPE = PROC [segNum: SC.Number, net: SCPrivate.Net];
enter all net segments in the channel.
GetAllNetSegInChan: PROCEDURE[handle: SC.Handle, rowChan: SCPrivate.RowChan, segProc: SegProc, pinProc: PinProc, exitProc: ExitProc];
move a pin by specified distance.
MoveAPinInChan: PROCEDURE[rowChan: SCPrivate.RowChan, pin: PinInChan, deltaX: SC.Number] RETURNS [scan: BOOLEAN];
enumerate pins in channel on net
EnumPinsInNetChan: PROCEDURE[chanNetDat: ChanNetDat, side: DABasics.Side, doEachNetPin: EachNetPinProc];
enumerate all pins in channel on net
EnumAllPinsInNetChan: PROCEDURE[chanNetDat: ChanNetDat, doEachNetPin: EachNetPinProc];
EachNetPinProc: TYPE = PROC[chanNetDat: ChanNetDat, pin: PinInChan];
enumerate all pins in channel
EnumPinsInChan: PROCEDURE[rowChan: SCPrivate.RowChan, doEachPin: EachPinProc];
EachPinProc: TYPE = PROC[rowChan: SCPrivate.RowChan, pin: PinInChan];
}.