file ///StdCell/SCChanUtilImpl.mesa
chan utility routines
DIRECTORY
RTSets,
SC,
SCChanUtil,
SCInstUtil,
SCNetUtil,
SCPrivate,
SCRowUtil;
SCChanUtilImpl: CEDAR PROGRAM
IMPORTS SCChanUtil, SCNetUtil, SCRowUtil
EXPORTS SCChanUtil
SHARES SC =
BEGIN
clear routing data
ClearRouteDat: PUBLIC PROCEDURE [handle: SC.Handle] = {
RowProc: SCRowUtil.EachRowProc = {
lgRow.nFtsOnRow ← 0;
lgRow.dimInvalid ← TRUE};
NetProc: SCNetUtil.EachNetProc = {
net.ftsOnRow ← RTSets.RTMdSetEmpty;
net.rowExits[left] ← net.rowExits[right] ← RTSets.RTMdSetEmpty};
[] ← SCRowUtil.EnumerateRows[handle, RowProc];
[] ← SCNetUtil.EnumerateNets[handle, NetProc];
};
initialize the channel widths
InitChanWidths: PUBLIC PROCEDURE [handle: SC.Handle] = {
RowChanProc: SCChanUtil.EachRowChanProc = {
rowChan.chanWidth ← rowChan.initChanWidth};
SideChanProc: SCChanUtil.EachSideChanProc = {
sideChan.sideChanWidth ← sideChan.initSideChanWidth};
[] ← SCChanUtil.EnumerateRowChans[handle, RowChanProc];
[] ← SCChanUtil.EnumerateSideChans[handle, SideChanProc];
};
EnumerateRowChans: PUBLIC PROC [handle: SC.Handle, eachRowChan: SCChanUtil.EachRowChanProc] RETURNS [quit: BOOL ← FALSE] = {
layoutData: SCPrivate.LayoutData ← NARROW[handle.layoutData];
rowChans: SCPrivate.RowChans ← layoutData.rowChans;
FOR chan: NAT IN [1 .. rowChans.count] WHILE ~quit DO
quit ← eachRowChan[chan, rowChans.chans[chan]];
ENDLOOP};
EnumerateSideChans: PUBLIC PROC [handle: SC.Handle, eachSideChan: SCChanUtil.EachSideChanProc] RETURNS [quit: BOOL ← FALSE] = {
layoutData: SCPrivate.LayoutData ← NARROW[handle.layoutData];
sideChans: SCPrivate.SideChans ← layoutData.sideChans;
FOR lrSide: SCPrivate.LRSide IN SCPrivate.LRSide WHILE ~quit DO
quit ← eachSideChan[lrSide, sideChans[lrSide]];
ENDLOOP};
EnumerateExits: PUBLIC PROC [handle: SC.Handle, rowChan: SCPrivate.RowChan, lrSide: SCPrivate.LRSide, eachExit: SCChanUtil.EachExitProc] RETURNS [quit: BOOL ← FALSE] = {
FOR exit: NAT IN [1 .. rowChan.numExits[lrSide]] WHILE ~quit DO
quit ← eachExit[exit, lrSide, rowChan, rowChan.exits[lrSide][exit]];
ENDLOOP};
END.