SCStats.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Last Edited by: Preas, September 5, 1985 10:39:21 am PDT
Massoud Pedram March 23, 1989 10:09:06 am PST
To print stats from SC placement and routing;
set SCNewRouteImpl.keepStats ← TRUE to gather statistics
DIRECTORY
Rope, SC, RefTab;
SCStats:
CEDAR
DEFINITIONS =
BEGIN
Table: TYPE = RefTab.Ref;
Key: TYPE = REF;
NetStat: TYPE = REF NetStatRec;
Int0: TYPE = INT ← 0;
Real0: TYPE = REAL ← 0.0;
VecSeqN: TYPE = RECORD[SEQUENCE ncols: INTEGER OF Int0];
RowN: TYPE = REF VecSeqN;
VecSeqR: TYPE = RECORD[SEQUENCE ncols: INTEGER OF Real0];
RowR: TYPE = REF VecSeqR;
Span:
TYPE =
RECORD [
min, max: INT
];
NetStatRec:
TYPE =
RECORD [
name: Rope.ROPE ← NIL,
numPins: INT ← 0,
xSpan: Span ← [0, 0],
ySpan: Span ← [0, 0],
trackLength: INT ← 0,
ftHeight: INT ← 0,
netStatDat: REF ANY ← NIL
];
CreateForRopes:
PROC [mod:
NAT ← 17]
RETURNS [Table];
creates new table, whose length is mod. Does the right thing for Rope tables.
Fetch:
PROC [table: Table, key: Key]
RETURNS [found:
BOOL, netStat: NetStat];
looks up key in table, returns associated net (if any)
if found is TRUE, net is value associated with given key
if found is FALSE, net is NIL
Store:
PROC [table: Table, key: Key, netStat: NetStat]
RETURNS [
BOOL];
returns TRUE after inserting new pair
returns FALSE after overwriting old net for existing key-net pair
EnumerateNetStats:
PROC [table: Table, action: EachNetStatAction]
RETURNS [quit:
BOOL];
enumerates pairs currently in symbol table in unspecified order
pairs inserted/deleted during enumeration may or may not be seen
applies action to each pair until action returns TRUE or no more pairs
returns TRUE if some action returns TRUE
EachNetStatAction: TYPE = PROC [key: Key, netStat: NetStat] RETURNS [quit: BOOL ← FALSE];
WriteSummaryStats: PROC [result: SC.Result];
WriteDetailStats: PROC [result: SC.Result];
CreateNetStats: PROC [result: SC.Result] RETURNS [table: Table];
WriteDetailNetStats: PROC [table: Table];
WriteSummaryNetStats: PROC [result: SC.Result, table: Table];
ReadStats: PROC [fileName: Rope.ROPE] RETURNS [stats: LIST OF SC.ChannelStats];
END.