LichenFromExtPrivate.Mesa
Last tweaked by Mike Spreitzer on April 12, 1989 3:11:49 pm PDT
DIRECTORY Basics, AbSets, IO, LichenDataStructure, SetBasics, ViewerClasses;
LichenFromExtPrivate:
CEDAR
DEFINITIONS
IMPORTS SetBasics
= {OPEN Sets:AbSets, LichenDataStructure;
REFTEXT: TYPE = REF TEXT;
Viewer: TYPE = ViewerClasses.Viewer;
Path:
TYPE ~
RECORD [
cells: LORA ← NIL,
wireName: SteppyName ← noName];
PathV:
PROC [p: Path]
RETURNS [Sets.Value]
~ INLINE {RETURN [[NEW [Path ← p]]]};
VPath:
PROC [v: Sets.Value]
RETURNS [Path]
~ INLINE {RETURN [NARROW[v.VA, REF Path]^]};
PTail:
PROC [p: Path]
RETURNS [Path]
~ INLINE {RETURN [[p.cells.rest, p.wireName]]};
paths: READONLY Sets.Space;
SourceList: TYPE = LIST OF Source;
Source: TYPE = RECORD [stream: IO.STREAM ← NIL, name: ROPE ← NIL];
Reader: TYPE = REF ReaderRep;
ReaderRep:
TYPE =
RECORD [
keyword: ROPE,
read:
PROC [s: Source, reader: Reader, cr: CellReading],
Consumes newline at end of line.
data: REF ANY];
DesignReading: TYPE = REF DesignReadingRep;
DesignReadingRep:
TYPE =
MONITORED
RECORD [
d: Design,
wDir: ROPE,
rg: Renaming,
fetTypes: Fn--FetType b cached FetType--,
unkosherArrays: Set,
clipINN: BiRel--clipped CellInstance's name (as ROPE) containing CellType's name (as ROPE)--,
clipINT: BiRel--clipped CellInstance's name (as ROPE) containing CellType--,
toMerge: Fn--array prefix b Set of Path--,
arraySpecs: Fn--array cell type b REF ArraySpec.array--,
mostRecentPathToMerge: Path ← [],
impossibleMerges: ImpossibleMergeList ← NIL,
buffer: REFTEXT,
pacifier, pie, label, pause: Viewer,
stop: BOOL ← FALSE,
stack: SourceList ← NIL,
index: INT ← 0,
curCellTypeName, prefix: ROPE ← NIL,
curArray: BOOL ← FALSE,
curCellFileLength: REAL ← 0,
change: CONDITION];
undefinedINT: INT = FIRST[INT];
Renaming: TYPE ~ Fn--cell type name b Fn(old wire name (ROPE) b new (SteppyName))--;
ImpossibleMergeList: TYPE = LIST OF ImpossibleMerge;
ImpossibleMerge:
TYPE =
RECORD [
arrayInstance: CellInstance, path1, path2: Path];
CellReading: TYPE = REF CellReadingRep;
CellReadingRep:
TYPE =
RECORD [
dr: DesignReading,
ct: CellType,
name: ROPE,
firstMerge: BOOL ← TRUE,
resistClasses: INT ← undefinedINT,
rScale: REAL--ohms-- ← 1.0E-3,
cScale: REAL--farads-- ← 1.0E-18,
lUnits: REAL--meters-- ← 1.0E-8,
scalingDefined: BOOL ← FALSE,
fetCount: INT ← 0,
newArrays: Set--of array cell types instantiated in ct--,
waitingMerges: PathPairList ← NIL
];
PathPairList: TYPE = LIST OF PathPair;
Use: TYPE = RECORD [childName: ROPE, as: ArraySpec];
ArraySpec:
TYPE =
RECORD [
variant:
SELECT kind: *
FROM
scalar => [],
array => [
range: Range2,
sep: Int2
]
ENDCASE];
FetTerminal:
TYPE =
RECORD [
name: ROPE,
length: INT];
IntBox: TYPE = RECORD [xmin, ymin, xmax, ymax: INT];
PathPair: TYPE = REF PathPairPrivate;
PathPairPrivate: TYPE = RECORD [p1, p2: Path];
FetType: TYPE = REF FetTypeRep;
FetTypeRep:
TYPE =
RECORD [
className: ROPE,
area, perim, twiceLength: INT,
ct: CellType ← NIL];
Register: PROC [keyword: ROPE, read: PROC [s: Source, reader: Reader, cr: CellReading], data: REF ANY ← NIL];
ReadCellType: PROC [d: Design, cellFileName: ROPE, dr: DesignReading] RETURNS [ct: CellType];
TryArrayFile: PROC [cr: CellReading];
FinishWaitingMerges: PROC [cr: CellReading];
MergeWork: PUBLIC PROC [cr: CellReading, path1, path2: Path] RETURNS [success: BOOL];
MergeFinal: PROC [dr: DesignReading, ct: CellType, path1, path2: Path];
ArrayMerge: PROC [cr: CellReading, arrayInstance: CellInstance, instanceName: ROPE, path1, path2: Path, may: BOOL] RETURNS [merged: BOOL];
DoMerges: PROC [s: Source, cr: CellReading];
ComparePaths: PROC [path1, path2: Path] RETURNS [c: SetBasics.TotalComparison];
CheckArrayUsage: PROC [d: Design, act: CellType];
ParsePath: PROC [s: Source, dr: DesignReading, from: CellType, asRope: ROPE, map: BOOL] RETURNS [Path];
FmtPath: PROC [path: Path] RETURNS [r: ROPE];
MapName: PROC [dr: DesignReading, ct: CellType, wn: ROPE] RETURNS [SteppyName];
MapFirst: PROC [dr: DesignReading, ct: CellType, sn: SteppyName] RETURNS [SteppyName];
PathGet: PROC [dr: DesignReading, from: CellType, path: Path, mayAdd: BOOL] RETURNS [w: Wire];
TokenBreak: IO.BreakProc;
R: PROC [r: ROPE] RETURNS [ROPE] ~ INLINE {RETURN [r]}--stupid goddam anachronism--;
}.