-- definitions module for random logic layout subroutine
-- written by Petit, September 26, 1981  6:35 PM

DIRECTORY
  SegmentDefs,
  ppdefs;
rldefs: DEFINITIONS IMPORTS SegmentDefs, ppdefs =
  BEGIN OPEN ppdefs, SegmentDefs;


-- gate stuff:

gateCharac:TYPE = RECORD[inCnt,norCnt:INTEGER,-- norCnt is maxCnt for Sequence
	ands:SEQUENCE COMPUTED CARDINAL OF [0..255] ];

gate:TYPE = RECORD [nxt:LONG POINTER TO gate,
	charac:LONG POINTER TO gateCharac,
	firstInTopAvail:BOOLEAN,
	lSpac,rSpac:[0..7],
	parmNum:[0..255],
	cell:LONG POINTER TO cList,
	inCnt:INTEGER,-- this is the maxCount for the Sequence
	gnd:Point,
	firstInTop:Point,
	out:Point,
	ins:SEQUENCE COMPUTED CARDINAL OF Point ];

GateList:TYPE = RECORD[nxt:LONG POINTER TO GateList,
	gat:LONG POINTER TO gate,
	x,y:locNum,
	outNode:INTEGER,
	nodes:SEQUENCE nodeCnt:CARDINAL OF [0..255] ];

mContProcd:TYPE = PROCEDURE[lCnt,rCnt,x,y,maxy:INTEGER,
	lp:LONG POINTER TO list,totIns:INTEGER]
	RETURNS[dx,wid:INTEGER,nl:LONG POINTER TO list];

mAndProcd:TYPE = PROCEDURE[aCnt,x,y:INTEGER,lp:LONG POINTER TO list,
	inputs:INTEGER,gat:LONG POINTER TO gate,totIns:INTEGER]
	RETURNS[dx,wid:INTEGER,nl:LONG POINTER TO list];

mTWProcd:TYPE = PROCEDURE[x:INTEGER,lp:LONG POINTER TO list,totIns:INTEGER]
	RETURNS[dx:INTEGER,nl:LONG POINTER TO list];

mPuProcd:TYPE = PROCEDURE[x1,x2,mx:INTEGER,
	lp:LONG POINTER TO list,gat:LONG POINTER TO gate,totIns:INTEGER]
	RETURNS[dx:INTEGER,nl:LONG POINTER TO list];

calcMyProcd:TYPE = PROCEDURE[gc:LONG POINTER TO gateCharac]
	RETURNS[my:INTEGER];

parmaCnt:TYPE = [1..5];

gateTypeRecord:TYPE = RECORD[
	wWid,mwWid:INTEGER,
	norWireOff:INTEGER,
	standWidth:INTEGER,
	strtY,invOff:INTEGER,
	putWid,putLen:INTEGER,
	makAnd:mAndProcd,
	makPu:mPuProcd,
	makConts:mContProcd,
	makTopWire:mTWProcd,
	calcMaxy:calcMyProcd ];

downWireRec:TYPE = RECORD [
	node,x,y,tx,ty:INTEGER,
	fixed:BOOLEAN,leftEnd,rightEnd,andCnt:[0..31],
	wiredLeft,topWireable:BOOLEAN,dwLeft:[0..37777B],
	wiredRight:BOOLEAN,dwRight:[0..37777B] ];

blockageType:TYPE = {none,met,poly,cell};

hLineRec:TYPE = RECORD [
	btyp:blockageType,distance:[-20..5000] ];


-- ****** Stuff From  rlgate.mesa:

getGate:PROCEDURE[gc:LONG POINTER TO gateCharac,parms:INTEGER]
	RETURNS[gat:LONG POINTER TO gate] ;


-- ****** Stuff From  rlin.mesa:

myZone: UNCOUNTED ZONE ;
fileErr: SIGNAL;
abbrt: SIGNAL;

inputCircuit:PROCEDURE RETURNS[pnt:LONG POINTER TO GateList,
	dwCnt,maxNN:INTEGER];


  END.