!14/05
!
! global declarations and initialisations for all components
!
%endoflist


%externalstring(63)%fnspec ITOS(%integer n,m)
%externalroutinespec CIF VIEW(%string(255) parm)

%own %integer id= 0,j

%const %integer xdir=0 , ydir= 1
%const %integer not set= 55000
%const %integer ignore= 50000

! constraint graph edges
%const %integer edges= 5000
%const %integer short edge= edges-10
%const %integer left side= -edges
%const %integer bottom side= -edges
%const %integer right side= edges
%const %integer top side= edges

! notional circuit nodes
%const %integer port= 4000
%const %integer join= 3000
! layers
%const %integer metal= blue
%const %integer poly = red
%const %integer diff = green

! components
%const %integer device= 240
%const %integer horiz wire=241
%const %integer vert wire= 242
%const %integer cell= 243
%const %integer notional= 200

!   device constants
%const %integer contact= 0
%const %integer pull down= 1
%const %integer pull up= 2
%const %integer pass tran= 4
%const %integer CPM= 5,
                CDM= 6,
                PUE= 7,
                PUN= 8,
               CPDE= 9,
               CPDW= 10,
               CPDN= 11,
               CPDS= 12

!menu display
%constinteger mouse display x= 450
%constinteger mouse display y= 15

%const %integer fclear=    1,
                fstop=     2,
                fcell=     3,
                fcompile=  4,
                fflesh=    5,
                freset=    6,
                fzoom=     7,
                flayout=   8,
                fcompact=  9,
                fsize=    10,
                fname=    11,
                finput=   12,
                foutput=  13

%constinteger topp=    20,
              right=   21,
              left=    22,
              bottom=  23
             
%constinteger fileload= 2

%owninteger %array port side(topp:bottom)
%owninteger %array ports(1:20,xdir:ydir)



!_________________________  HEAPS ______________________________________
%record %format %spec ARCC

%record %format NODE ( %record(ARCC)%namearray arccs(xdir:ydir), %c
                       %record(ARCC)%namearray cons(xdir:ydir), %c
                       %integerarray path length(xdir:ydir),
                       %integer idd,
                       %byte checked, %c
                       %byte concheck,
                       %byte %array in arc count(xdir:ydir), %c
                       %byte %array cc  (xdir:ydir), %C
                       %record (NODE) %name next x, %c
                       %record (NODE) %name next y, %c
                       %integer x,y, %c
                       %integer class, %c
                       (%byte width %or %c
                           %byte ratio), 
                       %integer type, %c
                       %record(NODE)%name backtrack, %c
                       %record(ARCC)%name on lp, %c
                       (%integer coord3  %or %c
                           %integer rot  %or %c
                              %integer side))
                       
%record %format ARCC   (%record(NODE)%name next node,  %c
                       %byte include,LProute,dec,  %c
                       %integer length, %c
                       %byte cc,
                       %record(ARCC)%name another ARCC)

%record %format NODE LIST  (%integer rx,lx,
                            %byte id,
                            %record(NODE)%name node,
                            %record(NODE LIST)%name list,
                            %record(NODE LIST)%name next)

%recordformat SETS (%integer wire,
                             cell,
                             size,
                             ratio,
                             start,
                    %record(NODE)%name node)


%recordformat EXT (%record(NODE)%name ptr)
%list
%endoffile
