--CellsDefs.mesa

CellsDefs:DEFINITIONS=BEGIN

Space:CHARACTER=' ;
Ret:CHARACTER='
;

zone:UNCOUNTED ZONE;
signalMax:INTEGER=500;
sigType:TYPE=ARRAY [0..signalMax) OF SignalEntry;
sig:LONG POINTER TO sigType;
SignalEntry:TYPE=RECORD[columnNum:INTEGER,fixed:Fixed,con:ConstraintCode,invisible:BOOLEAN,def:TList,printString:STRING,up:INTEGER];
NilSig:SignalEntry=[0,none,none,FALSE,NIL,NIL,0];
ConstraintCode:TYPE={none,thru,top,bottom,any};
Fixed:TYPE={none,hi,lo,mid};

Transistor:TYPE=RECORD[type:Type,cutG,cutD:BOOLEAN,g,d,e:INTEGER];
Type:TYPE={pass,pass1,pass2,aoiPullUp,norPullUp,aoiPullDown,norPullDown,wire};
--pass is one transistor.
-- Nor is pullup followed by some pulldowns
--aoi is pullup followed by pulldown pairs, the first member of the pair being closer to the pullup if it matters
TP:TYPE=LONG POINTER TO Transistor;
TListBody:TYPE=RECORD[s:TP,next:TList];
TList:TYPE=LONG POINTER TO TListBody;

columnType:TYPE=ARRAY[0..columnMax) OF INTEGER;
column:LONG POINTER TO columnType;
columnMax:INTEGER=signalMax;

trackMax:INTEGER=100;
Track:TYPE=[0..trackMax);
trackType:TYPE=ARRAY [0..signalMax) OF PACKED ARRAY [0..trackMax)
                   OF CHARACTER;
track:LONG POINTER TO trackType;

ParseInput:PROCEDURE;
AssignColumns:PROCEDURE;
ClusterColumns:PROCEDURE;
Showtrack:PROCEDURE;
MakeTracks:PROCEDURE;
PrintTracks:PROCEDURE;
EnumerateColumns:PROCEDURE[PROCEDURE[c,s,z:INTEGER]];
Lookup2:PROCEDURE[INTEGER] RETURNS[STRING];
ReturnStorage:PROCEDURE;

print:BOOLEAN=TRUE AND ~chip;
printPlot:BOOLEAN=TRUE AND ~chip;
stop:BOOLEAN=TRUE AND ~chip;
chip:BOOLEAN=TRUE;

END...