-- File: IPNetTab.mesa
Last Edited by: CSChow, January 26, 1985 11:57:36 pm PST
DIRECTORY
IO,
Graphics,
SymTab,
Rope,
IP,
IPParams,
IPConstants,
IPChipRose;
IPNetTab: CEDAR DEFINITIONS
IMPORTS IPParams= BEGIN
Ref: TYPE = REF Rep;
Rep: TYPE = RECORD[nets: SymTab.Ref];
Net: TYPE = REF NetRep;
NetRep: TYPE = IP.NetRep; --name, pinNets, length
PinNets: TYPE = LIST OF REF IP.PinNetRep;
PhysicalPins: TYPE = LIST OF REF IP.PhysicalPinRep;
Rect: TYPE = IP.Rect;
EachNetAction: TYPE = PROC[net: Net] RETURNS [quit: BOOLFALSE];
ChNetFactorEstimator: TYPE = PROC[netBRect: Rect, activePins, nonActivePins: INT ← 0] RETURNS [horFactor, verFactor: REAL];
--A Simple Example of ChNetFactorEstimator
SimpleChNetFactorEstimator: ChNetFactorEstimator;
-- = {
-- horFactor ← (netBRect.x2 - netBRect.x1);
-- verFactor ← (netBRect.y2 - netBRect.y1)};
Create: PROC[chipRose: IPChipRose.Ref] RETURNS [Ref];
FetchNet: PROC[netTab: Ref, name: Rope.ROPE, raiseError: BOOLTRUE] RETURNS [Net];
Size: PROC[netTab: Ref] RETURNS [INT];
Nets: PROC[netTab: Ref, action: EachNetAction];
TotalNetLength: PROC[netTab: Ref, netFactorProc: ChNetFactorEstimator ← SimpleChNetFactorEstimator] RETURNS [INT];
CountNets: PROC[netTab: Ref] RETURNS [active, nonActive: INT];
CountAllPins: PROC[netTab: Ref, activeNetsOnly: BOOLTRUE] RETURNS [active, nonActive: INT];
CheckSelf: PROC[netTab: Ref];
DescribeSelf: PROC[netTab: Ref, stream: IO.STREAM, debug: BOOL ← IPParams.DebugSystem];
--IF debug THEN print extra info not used to ReconstructSelf
ReconstructSelf: PROC[stream: IO.STREAM] RETURNS [Ref];
--Operation on individual net
NetLength: PROC[net: Net, netFactorProc: ChNetFactorEstimator ← NIL] RETURNS [INT];
--After calling this proc the state of pinNets in net will be uptodate
CountPins: PROC[net: Net] RETURNS [active, nonActive: INT];
--Assumed NetLength has been called so that activePins and nonActivePins are updated
PaintNet: PROC [net: Net, context: Graphics.Context, xOffset, yOffset: REAL ← 0.0, scaleFactor: REAL ← 1.0, stipple: CARDINAL ← IPConstants.White, showNetName: BOOLTRUE];
NetActive: PROC[net: Net] RETURNS [BOOL] = INLINE {
RETURN [NOT (net.pinNets = NIL OR net.pinNets.rest = NIL)]
}; --NetActive
NetName: PROC [net: Net] RETURNS [Rope.ROPE] = INLINE{
RETURN [net.name]
}; --NetName
END.