{ Declarations for using CMOS ILAP included}
%end %of %list
{02/04/87 RJG  Added declarations for Corner routers and new Padplace}
{updated for Padplace spec. by DJR 1/12/86}
{updated for glass layer by DJR 4/12/86}
{updated for annotation layer by DJR 19/12/86}

%constant %string (3) pwell = "PW"
%constant %string (3) nwell = "NW"
%constant %string (3) diff = "AA"
%constant %string (3) poly = "PY"
%constant %string (3) ndiff = "ND"
%constant %string (3) pdiff = "PD"
%constant %string (3) nplus = "NI"
%constant %string (3) pplus = "PI"
%constant %string (3) contact = "CC"
%constant %string (3) metal1 = "M1"
%constant %string (3) via = "VI"
%constant %string (3) metal2 = "M2"
%constant %string (3) glass = "GZ"

%constant %integer true = 1,   false = 0
!%constant %integer       no warnings = 1
!%constant %integer    monitor endsym = 2
!%constant %integer        give times = 4
!%constant %integer         merge cif = 8
!%constant %integer design rule check = 16

%external %routine %spec first cell number %alias "ILAP_FIRST_CELL_NUMBER" %c
  (%integer num)
%external %routine %spec set lambda %alias "ILAP_SET_LAMBDA" %c
  (%integer lambda)
%external %routine %spec get lambda %alias "ILAP_GET_LAMBDA" %c
  (%integer %name lambda)
%external %routine %spec set error stream %alias "ILAP_SET_ERROR_STREAM" %c
  (%integer ST)
%external %routine %spec set cif stream %alias "ILAP_SET_ERROR_STREAM" %c
  (%integer ST)
%external %routine %spec warning %alias "ILAP_WARNING" %c
  (%string (255) message)
%external %routine %spec disaster %alias "ILAP_DISASTER" %c
  (%string (255) message)
%external %routine %spec update mbb %alias "ILAP_UPDATE_MBB" %c
  (%integer XL, YB, XR, YT)
%external %routine %spec fix mbb %alias "ILAP_FIX_MBB" %c
  (%integer XL, YB, XR, YT)
%external %integer %fn %spec ILAP warnings %alias "ILAP_WARNINGS"
%external %integer %map %spec ILAP control %alias "ILAP_CONTROL"

%external %routine %spec plus on %alias "ILAP_PLUS_ON"
%external %routine %spec plus off %alias "ILAP_PLUS_ON"
%external %routine %spec merge on %alias "ILAP_MERGE_ON"
%external %routine %spec merge off %alias "ILAP_MERGE_OFF"

%external %routine %spec initialise %alias "ILAP_INIT_CMOS" (%string (255) s)
%external %routine %spec finish %alias "ILAP_FINISH"
%external %routine %spec give statistics %alias "ILAP_GIVE_STATISTICS"

%external %routine %spec end symbol %alias "ILAP_END_SYMBOL"
%external %routine %spec symbol %alias "ILAP_SYMBOL" (%string (31) name)
%external %routine %spec symbol spec %alias "ILAP_SYMBOL_SPEC" %c
  (%string (31) name, %integer xl, yl, xu, yu)
%external %routine %spec external symbol %alias "ILAP_EXTERNAL_SYMBOL" %c
  (%string (31) name, %integer number)
%external %routine %spec externalsymbolspec %alias "ILAP_EXTERNAL_SYMBOL_SPEC"%c
  (%string (31) name, %integer number, %integer xl, yl, xu, yu)

%external %routine %spec box %alias "ILAP_BOX" (%integer xl, yl, xu, yu)
%external %routine %spec polygon %alias "ILAP_POLYGON" (%integer x, y)
%external %routine %spec line %alias "ILAP_LINE" (%integer x, y)
%external %routine %spec wirex %alias "ILAP_WIREX" (%integer x, y, l)
%external %routine %spec wirey %alias "ILAP_WIREY" (%integer x, y, l)
%external %routine %spec vsswirex %alias "ILAP_VSSWIREX" (%integer x, y, l)
%external %routine %spec vsswirey %alias "ILAP_VSSWIREY" (%integer x, y, l)
%external %routine %spec vddwirex %alias "ILAP_VDDWIREX" (%integer x, y, l)
%external %routine %spec vddwirey %alias "ILAP_VDDWIREY" (%integer x, y, l)

%external %routine %spec NTPX %alias "ILAP_NTPX" %c
  (%string (31) name, %integer x, y, l)
%external %routine %spec NTPY %alias "ILAP_NTPY" %c
  (%string (31) name, %integer x, y, l)
%external %routine %spec PTPX %alias "ILAP_PTPX" %c
  (%string (31) name, %integer x, y, l)
%external %routine %spec PTPY %alias "ILAP_PTPY" %c
  (%string (31) name, %integer x, y, l)
%external %routine %spec NTDX %alias "ILAP_NTDX" %c
  (%string (31) name, %integer x, y, l)
%external %routine %spec NTDY %alias "ILAP_NTDY" %c
  (%string (31) name, %integer x, y, l)
%external %routine %spec PTDX %alias "ILAP_PTDX" %c
  (%string (31) name, %integer x, y, l)
%external %routine %spec PTDY %alias "ILAP_PTDY" %c
  (%string (31) name, %integer x, y, l)

%external %routine %spec ax %alias "ILAP_AX" (%integer x)
%external %routine %spec ay %alias "ILAP_AY" (%integer y)
%external %routine %spec axy %alias "ILAP_AXY" (%integer x, y)
%external %routine %spec dx %alias "ILAP_DX" (%integer x)
%external %routine %spec dy %alias "ILAP_DY" (%integer y)
%external %routine %spec dxy %alias "ILAP_DXY" (%integer x, y)

%external %routine %spec layer %alias "ILAP_LAYER" (%string (3) colour)
%external %string (3) %function %spec clayer %alias "ILAP_CLAYER"
%external %routine %spec width %alias "ILAP_WIDTH" (%integer size)
%external %integer %function %spec cwidth %alias "ILAP_CWIDTH"

%external %routine %spec cif comment %alias "ILAP_CIF_COMMENT" %c
  (%string (255) s)
%external %routine %spec cif statement %alias "ILAP_CIF_STATEMENT" %c
  (%string (255) s)
%external %routine %spec user extension %alias "ILAP_USER_EXTENSION" %c
  (%integer no, %string (255) s)
%external %routine %spec node label %alias "ILAP_NODE_LABEL" %c
  (%string (31) label, %integer x, y, %string (3) layer)

%external %routine %spec draw %alias "ILAP_DRAW" %c
  (%string (31) name, %integer x, y)
%external %routine %spec drawmx %alias "ILAP_DRAW_MX" %c
  (%string (31) name, %integer x, y)
%external %routine %spec drawmy %alias "ILAP_DRAW_MY" %c
  (%string (31) name, %integer x, y)
%external %routine %spec drawrot %alias "ILAP_DRAW_ROT" %c
  (%string (31) name, %integer x, y, rot)
%external %routine %spec draw mx rot %alias "ILAP_DRAW_MX_ROT" %c
  (%string (31) name, %integer x, y, rot)
%external %routine %spec draw my rot %alias "ILAP_DRAW_MY_ROT" %c
  (%string (31) name, %integer x, y, rot)

%external %integer %function %spec SX %alias "ILAP_SX" (%string (31) name)
%external %integer %function %spec SY %alias "ILAP_SY" (%string (31) name)
%external %integer %function %spec LX %alias "ILAP_LX" (%string (31) name)
%external %integer %function %spec LY %alias "ILAP_LY" (%string (31) name)
%external %predicate %spec symbol exists %alias "ILAP_SYMBOL_EXISTS" %c
  (%string (31) name)

%external %routine %spec nsub %alias "ILAP_NSUB" (%integer x, y)
%external %routine %spec psub %alias "ILAP_ PSUB" (%integer x, y)
%external %routine %spec nsubn %alias "ILAP_NSUBN" (%integer x, y)
%external %routine %spec nsubs %alias "ILAP_NSUBS" (%integer x, y)
%external %routine %spec nsube %alias "ILAP_NSUBE" (%integer x, y)
%external %routine %spec nsubw %alias "ILAP_NSUBW" (%integer x, y)
%external %routine %spec psubn %alias "ILAP_PSUBN" (%integer x, y)
%external %routine %spec psubs %alias "ILAP_PSUBS" (%integer x, y)
%external %routine %spec psube %alias "ILAP_PSUBE" (%integer x, y)
%external %routine %spec psubw %alias "ILAP_PSUBW" (%integer x, y)
%external %routine %spec ndm %alias "ILAP_NDM" (%integer x, y)
%external %routine %spec pdm %alias "ILAP_PDM" (%integer x, y)
%external %routine %spec pm %alias "ILAP_PM" (%integer x, y)
%external %routine %spec mm %alias "ILAP_MM" (%integer x, y)

%external %routine %spec tpla %alias "ILAP_TPLA" %c
  (%string (31) name, %string (255) file)
%external %routine %spec epla %alias "ILAP_EPLA" %c
  (%string (31) name, %string (255) file)
%external %routine %spec rom %alias "ILAP_ROM" %c
  (%string (31) name, %string (255) file)
%external %routine %spec tplap %alias "ILAP_TPLAP" %c
  (%string (31) name, %string (255) file, %integer %name ins, feeds, outs)
%external %routine %spec eplap %alias "ILAP_EPLAP" %c
  (%string (31) name, %string (255) file, %integer %name ins, feeds, outs)
%external %routine %spec romp %alias "ILAP_ROMP" %c
  (%string (31) name, %string (255) file, %integer %name ins, outs)

%external %routine %spec equate %alias "ILAP_EQUATE" (%string (255) parm)
%external %routine %spec table %alias "ILAP_TABLE" (%string (255) parm)

%external %routine %spec crest %alias "ILAP_CREST" %c
  (%string (31) name, %integer xsize, ysize)
%external %routine %spec text %alias "ILAP_TEXT" %c
  (%string (31) name, %string (255) text, %integer xsize, ysize)
%external %routine %spec copyright %alias "ILAP_COPYRIGHT" %c
  (%string (31) name, %integer xsize, ysize)
%external %routine %spec setannotationlayer %alias "ILAP_SET_ANNOTATION_LAYER"%c
  (%string (3) layer)

! ILAP New Universal Ports Stuff
! %Internal to Ilap code :
%record %format Port form(%string(31) name,
                          %integer xl, yb, xr, yt,
                          %string(3) layer,
                          %integer Kind)

%external %record(port form)%fn %spec Port(%string(31) port name,
                                         %integer xl, yb, xr, yt,
                                         %string(3) layer, %integer Kind)

%external %routine %spec Preset Port(%string(31) symbol, %record(port form) p)
%external %routine %spec Set Port(%record(Port Form) p)
%external %routine %spec Change port(%string(31) sym name, %record(Port form) p)
%external %record(Port Form)%fn %spec Get Port(%string(31) sym name, port name)
%external %routine %spec Reset to first Port(%string(31) sym name, %integer side)
%external %record(Port Form)%fn %spec Get next Port(%string(31) sym name,
                                                  %integer side)

%external %string(31) %fn %spec Make Port Name(%string(31) first, second,
                                               %integer index)
%external %routine %spec Break Port name(%string(31) port name, { -> }
                                         %string(31)%name first, second,
                                         %integer %name index)

%const %integer North = 1, East = 2, South = 3, West = 4, All ports = 5

%const %record(Port Form) Nil Port = 0

{ ROUTING declarations }

%external %routine %spec Rroute %alias "ILAP_RROUTE" (%string (31) name)
%external %routine %spec RrouteDir %alias "ILAP_RROUTEDIR" (%string(31) name,%c
                                                    %integer side from,side to)
%external %routine %spec River route %alias "ILAP_RIVERROUTE" (%string(31) name,
                          %integer Side From, Side To,
                          %string (4) lay,
                          %integer n,
			  %integer tsep,   
			           twid)
%constinteger optimum sepn   = 1 {if this sepn specified, route optimally}
      {for routing directions}
%conststring(3) NUL=""
%external %routine %spec corner route %alias "ILAP_CORNER_ROUTE" %c
    (%string(31) name,
    %integer from, to,
    %string (3) lay,
    %integer n,
    %integer tsep,twid)
%external %routine %spec CROUTEdir %alias "ILAP_CROUTEDIR" (%string(31) name,
                                                            %integer from,to)
%external %routine %spec CROUTE %alias "ILAP_CROUTE" (%string(31) name)

%external%routinespec Padplace %alias "ILAP_PADPLACE" %c
                      (%string(31)%name core,newsym)


{Port KINDS for padplace}
%constinteger VDD PORT=1
%constinteger VSS PORT=2
%constinteger IN PORT=3
%constinteger OUT PORT=4
%constinteger CLOUTOUT PORT=5
%constinteger CLOUTCL PORT=6
%constinteger INOUTIN PORT=7
%constinteger INOUTOUT PORT=8
%constinteger INOUTEN PORT=9
%constinteger VDD X PORT=10

%end %of %file
