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: BOOL ← FALSE];
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: BOOL ← TRUE] 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: BOOL ← TRUE] 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: BOOL ← TRUE];
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.