!******************************************************************************* %routine %spec crest (%integer xsize, ysize) %routine %spec text %alias "ILAPTEXT" (%string (31) name, %string (255) text, %integer xsize, ysize) %routine %spec TEXT LAYER (%string (7) LAYER) !******************************************************************************* ! Declarations for using ILAP included. %constant %string (2) blue ="M", metal ="M", nm="M" %constant %string (2) green ="D", diffusion="D", nd="D" %constant %string (2) red ="P", poly ="P", np="P" %constant %string (2) implant ="I", ni="I" %constant %string (2) glass ="G", ng="G" %constant %string (2) contact ="C", nc="C" %constant %string (2) buried ="B", nb="B" %constant %integer true = 0, false = 1 %external %routine %spec first cell number (%integer num) %external %routine %spec set lambda (%integer l) %external %string (2) %fn %spec contacts %external %integer %map %spec ILAP control %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 %constant %integer circuit analysis = 32 %constant %integer give node list = 64 %constant %integer give tran list = 128 %constant %integer give node plot = 256 %external %routine %spec merge on %external %routine %spec merge off %external %routine %spec drc on %external %routine %spec drc off %external %routine %spec initialise %alias "INITIALISENMOS" (%string (255) s) %external %routine %spec finish %external %routine %spec give statistics %external %routine %spec end symbol %external %routine %spec symbol (%string (31) name) %external %routine %spec symbol spec (%string (31) name, %integer xl, yl, xu, yu) %external %routine %spec external symbol spec (%string (31) name, %integer number, %integer xl, yl, xu, yu) %external %routine %spec box %alias "ILAPBOX" (%integer xl, yl, xu, yu) %external %routine %spec polygon %alias "ILAPPOLYGON" (%real x, y) %external %routine %spec line %alias "ILAPLINE" (%real x, y) %external %routine %spec wirex (%integer x, y, l) %external %routine %spec wirey (%integer x, y, l) %external %routine %spec ETPX (%string (31) name, %integer x, y, l) %external %routine %spec ETPY (%string (31) name, %integer x, y, l) %external %routine %spec ETDX (%string (31) name, %integer x, y, l) %external %routine %spec ETDY (%string (31) name, %integer x, y, l) %external %routine %spec DTPX (%string (31) name, %integer x, y, l) %external %routine %spec DTPY (%string (31) name, %integer x, y, l) %external %routine %spec DTDX (%string (31) name, %integer x, y, l) %external %routine %spec DTDY (%string (31) name, %integer x, y, l) %external %routine %spec DTDBX (%string (31) name, %integer x, y, l) %external %routine %spec DTDBY (%string (31) name, %integer x, y, l) %external %routine %spec ax (%integer u) %external %routine %spec ay (%integer v) %external %routine %spec axy (%real x, y) %external %routine %spec dx (%integer u) %external %routine %spec dy (%integer v) %external %routine %spec dxy (%real x, y) %external %routine %spec layer (%string (4) colour) %external %string (4) %function %spec clayer %external %routine %spec width (%integer size) %external %integer %function %spec cwidth %external %routine %spec cifcomment (%string (255) s) %external %routine %spec user extension (%integer no, %string (255) s) %external %routine %spec draw (%string (31) name, %integer x, y) %external %routine %spec drawmx (%string (31) name, %integer x, y) %external %routine %spec drawmy (%string (31) name, %integer x, y) %external %routine %spec drawrot (%string (31) name, %integer x, y, rot) %external %routine %spec draw mx rot (%string (31) name, %integer x, y, rot) %external %routine %spec draw my rot (%string (31) name, %integer x, y, rot) %external %integer %function %spec SX (%string (31) name) %external %integer %function %spec SY (%string (31) name) %external %integer %function %spec LX (%string (31) name) %external %integer %function %spec LY (%string (31) name) %external %integer %function %spec symbol exists (%string (31) name) %external %routine %spec dm (%integer x, y) %external %routine %spec pm (%integer x, y) %external %routine %spec pdms (%integer x, y) %external %routine %spec pdmn (%integer x, y) %external %routine %spec pdmw (%integer x, y) %external %routine %spec pdme (%integer x, y) %external %routine %spec pdbn (%integer x, y) %external %routine %spec pdbs (%integer x, y) %external %routine %spec pdbe (%integer x, y) %external %routine %spec pdbw (%integer x, y) %external %routine %spec pdcn (%integer x, y) %external %routine %spec pdcs (%integer x, y) %external %routine %spec pdce (%integer x, y) %external %routine %spec pdcw (%integer x, y) %external %routine %spec pdbns (%integer x, y) %external %routine %spec pdbew (%integer x, y) %external %routine %spec tpla (%string (31) name, %string (127) file, %integer %name phi1y, phi2y, %integer %array %name inx, outx) %external %routine %spec epla (%string (31) name, %string (127) file, %integer %name phi1y, phi2y, %integer %array %name inx, outx) %external %routine %spec equate (%string (255) parm) %external %routine %spec table (%string (255) parm) %external %routine %spec rom (%string (31) name, %string (127) file, %integer %name phi1y, phi2y, %integer %array %name inx, outx) %external %routine %spec stack (%string (31) name, %integer bits, words, %integer %name controlx, controly, pushcony, popcony, phi1x, phi2x, phi3x, phi4x, %integer %array %name pushy, popy) %record %format port (%integer x, w) %external %integer %function %spec route (%string (31) name, %record (port) %array %name a, b, %integer n, %string (4) layer, %integer twid, tsep, sepn) %external %routine %spec croute (%string(31) name, %record(port)%arrayname a,b, %integer n,ya,xb,%string(4) lay,%integer twid,tsep) %external %routine %spec padvdd %external %routine %spec padgnd %external %routine %spec padin (%integername padinx) %external %routine %spec padout (%integername padoutx) %external %routine %spec padclout (%integername padcloutx, padcloutclx) %external %routine %spec padinout (%integername padinoutinx, padinoutoutx, padinoutenx) %record %format connf (%integer type, side, C, W, %string (4) LAYER) %external %routine %spec placepads (%string (31) chipname, cellname, %record (connf) %array %name P, %integer N) !******************************************************************************* %externalstring(63)%fnspec itos(%integer i,n) %external %routine %spec warn %alias "ILAPWARNING" (%string(225) ST) %external %routine %spec update bb %alias "ILAPUPDATEMBB" (%integer xl, yb, xr, yt) %const %integer no drc = 7 %own %string (7) layer for text = "M" !******************************************************************************* %external %routine crest (%integer bwidth, bheight) %const %integer swidth = 34 %const %integer sheight = 43 %const %integer cy = 24 {extent of crest in -ve y direction} %integer widthscale, heightscale, s, a, b %integer x, y {origin of crest in box) %integer i, old control %constshortintegerarray c(1:360)= -4, -24, -3, -21, -3, -24, -2, -21, -2, -24, 2, -23, -2, -23, 2, -22, -6, -23, -5, -20, -5, -23, -4, -21, 4, -23, 5, -21, 5, -23, 6, -20, -8, -22, -7, -19, -7, -22, -6, -20, 2, -24, 3, -21, 3, -24, 4, -21, 6, -22, 7, -20, 7, -22, 8, -19, -9, -21, -8, -18, 8, -21, 9, -18, -10, -20, -9, -17, 9, -20, 10, -17, -11, -19, -10, -16, 10, -19, 11, -16, -12, -18, -11, -14, -6, -18, -1, -11, 1, -18, 6, -11, 11, -18, 12, -14, -13, -17, -12, -5, 12, -17, 13, -5, -14, -16, -13, -6, 13, -16, 14, -6, -1, -15, 1, -8, -15, -14, -14, -7, 14, -14, 15, -7, -16, -12, -15, 19, 15, -12, 16, 19, -12, -11, -11, -4, -6, -11, -5, -9, -5, -11, -4, -9, -2, -11, -1, -7, 1, -11, 2, -7, 4, -11, 5, -9, 11, -11, 12, -4, -11, -10, -10, -3, 5, -11, 6, -9, 10, -10, 11, -3, -17, -9, -16, 19, -10, -9, -9, -2, 9, -9, 10, -2, 16, -9, 17, 19, -9, -8, -8, -1, 8, -8, 9, -1, -8, -7, -7, 0, 7, -7, 8, 0, -7, -6, -6, 7, 6, -6, 7, 7, -5, -5, 5, -4, -5, -4, 5, -3, -6, -5, -5, 6, -1, -3, 1, -2, 5, -5, 6, 6, -8, 1, -7, 8, 7, 1, 8, 8, -9, 2, -8, 9, -1, 2, 1, 3, 8, 2, 9, 9, -10, 3, -9, 10, -5, 3, 5, 4, -5, 4, 5, 5, 9, 3, 10, 10, -11, 4, -10, 11, 10, 4, 11, 11, -12, 5, -11, 12, 11, 5, 12, 12, -13, 6, -12, 13, 12, 6, 13, 13, -14, 7, -13, 19, -3, 7, -2, 9, -2, 7, 3, 8, 13, 7, 14, 19, -15, 8, -14, 19, -4, 8, -3, 11, -1, 8, 1, 12, 2, 8, 4, 9, 14, 8, 15, 19, 3, 9, 4, 11, -6, 10, -4, 13, 4, 10, 6, 13, -2, 12, 2, 15, -8, 12, -6, 15, 6, 12, 8, 15, -13, 17, 13, 18, -13, 18, 13, 19 ! First check bounding box %if bwidth >= swidth %and bheight >= sheight %start ! Multiples of swidth widthscale = bwidth // swidth ! Multiples of sheight heightscale = bheight // sheight ! Scale of crest %if width scale < height scale %then s = widthscale %else s = heightscale ! Find coordinates of crest origin in box x = bwidth // 2 y = s * cy + (bheight - s * sheight) // 2 ! Define symbol Old control = ILAP control ILAP control = ILAP control & no drc symbol("crest") layer(metal) %for i=1,4,357 %cycle box(s*c(i)+x,s*c(i+1)+y,s*c(i+2)+x,s*c(i+3)+y) %repeat update bb (0, 0, bwidth, bheight) endsymbol ILAP control = old control %finish %else %start ! Here bounding box too small a = swidth b = sheight warn("Crest is too large for area supplied Minimum dimensions X = ".itos(a,1)." Y = ".itos(b,1)." Symbol not generated") %finish %end %const %integer spacing = 10 %const %integer space width = 20 %own %byte starts initialised = false %own %integerarray starts(0:127) = 0(128) %const %integer points = 2634 %const %byte %array coords (1:points) = 33, 4, { ! } 0, 0, 0, 8, 8, 8, 8, 0, 33, 4, { ! } 0, 14, 0, 40, 8, 40, 8, 14, 34, 4, { " } 0, 30, 0, 40, 6, 40, 6, 30, 34, 4, { " } 12, 30, 12, 40, 18, 40, 18, 30, 35, 20, { # } 4, 0, 4, 16, 0, 16, 0, 24, 4, 24, 4, 34, 10, 40, 24, 40, 30, 34, 30, 28, 22, 28, 22, 32, 12, 32, 12, 24, 18, 24, 18, 16, 12, 16, 12, 8, 30, 8, 30, 0, 36, 38, { $ } 0, 6, 0, 12, 6, 12, 6, 8, 10, 8, 10, 16, 16, 16, 16, 8, 20, 8, 20, 16, 4, 16, 0, 20, 0, 32, 4, 36, 10, 36, 10, 40, 16, 40, 16, 36, 22, 36, 26, 32, 26, 26, 20, 26, 20, 30, 16, 30, 16, 22, 10, 22, 10, 30, 6, 30, 6, 22, 22, 22, 26, 18, 26, 6, 22, 2, 16, 2, 16, 0, 10, 0, 10, 2, 4, 2, 37, 4, { % } 0, 0, 0, 10, 30, 40, 30, 30, 37, 13, { % } 0, 32, 0, 36, 4, 40, 8, 40, 12, 36, 12, 32, 8, 28, 4, 28, 4, 36, 8, 36, 8, 32, 4, 32, 4, 28, 37, 13, { % } 18, 4, 18, 8, 22, 12, 26, 12, 30, 8, 30, 4, 26, 0, 22, 0, 22, 8, 26, 8, 26, 4, 22, 4, 22, 0, 38, 30, { & } 0, 4, 0, 16, 16, 32, 16, 34, 6, 34, 6, 28, 9, 25, 5, 21, 0, 26, 0, 34, 6, 40, 18, 40, 22, 36, 22, 28, 6, 12, 6, 8, 8, 6, 10, 6, 15, 11, 10, 16, 14, 20, 19, 15, 22, 18, 26, 14, 23, 11, 26, 8, 26, 0, 19, 7, 12, 0, 4, 0, 39, 6, { ' } 0, 28, 4, 32, 4, 40, 10, 40, 10, 32, 6, 28, 40, 10, { ( } 0, 6, 0, 34, 6, 40, 14, 40, 14, 32, 8, 32, 8, 8, 14, 8, 14, 0, 6, 0, 41, 10, { ) } 0, 0, 0, 8, 6, 8, 6, 32, 0, 32, 0, 40, 8, 40, 14, 34, 14, 6, 8, 0, 42, 18, { * } 0, 16, 0, 22, 8, 22, 2, 28, 6, 32, 12, 26, 18, 32, 22, 28, 16, 22, 24, 22, 24, 16, 16, 16, 22, 10, 18, 6, 12, 12, 6, 6, 2, 10, 8, 16, 43, 12, { + } 0, 16, 0, 22, 9, 22, 9, 31, 15, 31, 15, 22, 24, 22, 24, 16, 15, 16, 15, 7, 9, 7, 9, 16, 44, 6, { , } 0, 0, 0, 8, 8, 8, 8, 64+2, 2, 64+8, 2, 0, 45, 4, { - } 0, 16, 0, 22, 20, 22, 20, 16, 46, 4, { . } 0, 0, 0, 8, 8, 8, 8, 0, 47, 4, { / } 0, 0, 0, 10, 30, 40, 30, 30, 48, 14, { 0 } 0, 6, 0, 34, 6, 40, 18, 40, 24, 34, 24, 6, 18, 0, 8, 0, 8, 8, 16, 8, 16, 32, 8, 32, 8, 0, 6, 0, 49, 6, { 1 } 4, 0, 4, 32, 0, 32, 0, 40, 12, 40, 12, 0, 50, 15, { 2 } 0, 0, 0, 8, 18, 26, 18, 32, 8, 32, 8, 28, 0, 28, 0, 34, 6, 40, 20, 40, 26, 34, 26, 22, 12, 8, 26, 8, 26, 0, 51, 23, { 3 } 0, 6, 0, 12, 8, 12, 8, 8, 18, 8, 18, 16, 10, 16, 10, 24, 18, 24, 18, 32, 8, 32, 8, 28, 0, 28, 0, 34, 6, 40, 20, 40, 26, 34, 26, 24, 22, 20, 26, 16, 26, 6, 20, 0, 6, 0, 52, 17, { 4 } 0, 10, 0, 20, 20, 40, 28, 40, 28, 18, 32, 18, 32, 10, 28, 10, 28, 0, 20, 0, 20, 10, 8, 10, 8, 18, 20, 18, 20, 30, 8, 18, 8, 10, 53, 17, { 5 } 0, 6, 0, 12, 8, 12, 8, 8, 18, 8, 18, 18, 0, 18, 0, 40, 26, 40, 26, 32, 8, 32, 8, 26, 20, 26, 26, 20, 26, 6, 20, 0, 6, 0, 54, 21, { 6 } 0, 6, 0, 34, 6, 40, 20, 40, 26, 34, 26, 28, 18, 28, 18, 32, 8, 32, 8, 24, 20, 24, 26, 18, 26, 6, 20, 0, 8, 0, 8, 8, 18, 8, 18, 16, 8, 16, 8, 0, 6, 0, 55, 9, { 7 } 0, 0, 0, 14, 18, 32, 0, 32, 0, 40, 26, 40, 26, 28, 8, 10, 8, 0, 56, 24, { 8 } 0, 6, 0, 16, 4, 20, 0, 24, 0, 34, 6, 40, 20, 40, 26, 34, 26, 24, 22, 20, 26, 16, 26, 6, 20, 0, 8, 0, 8, 8, 18, 8, 18, 16, 8, 16, 8, 24, 18, 24, 18, 32, 8, 32, 8, 0, 6, 0, 57, 21, { 9 } 0, 6, 0, 12, 8, 12, 8, 8, 18, 8, 18, 16, 8, 16, 8, 24, 18, 24, 18, 32, 8, 32, 8, 16, 6, 16, 0, 22, 0, 34, 6, 40, 20, 40, 26, 34, 26, 6, 20, 0, 6, 0, 58, 4, { : } 0, 0, 0, 8, 8, 8, 8, 0, 58, 4, { : } 0, 14, 0, 22, 8, 22, 8, 14, 59, 6, { ; } 0, 0, 0, 8, 8, 8, 8, 64+2, 2, 64+8, 2, 0, 59, 4, { ; } 0, 14, 0, 22, 8, 22, 8, 14, 60, 8, { < } 0, 16, 16, 32, 20, 32, 20, 26, 10, 16, 20, 6, 20, 0, 16, 0, 61, 4, { = } 0, 8, 0, 14, 20, 14, 20, 8, 61, 4, { = } 0, 20, 0, 26, 20, 26, 20, 20, 62, 8, { > } 0, 0, 0, 6, 10, 16, 0, 26, 0, 32, 4, 32, 20, 16, 4, 0, 63, 14, { ? } 0, 28, 0, 34, 6, 40, 20, 40, 26, 34, 26, 26, 18, 18, 18, 12, 10, 12, 10, 22, 18, 30, 18, 32, 8, 32, 8, 28, 63, 4, { ? } 10, 0, 10, 6, 18, 6, 18, 0, 64, 19, { @ } 0, 6, 0, 14, 6, 20, 18, 20, 18, 14, 8, 14, 8, 8, 18, 8, 18, 26, 6, 26, 6, 24, 0, 24, 0, 28, 6, 34, 20, 34, 26, 28, 26, 6, 20, 0, 6, 0, 65, 14, { A } 0, 0, 0, 34, 6, 40, 20, 40, 26, 34, 26, 0, 18, 0, 18, 10, 8, 10, 8, 18, 18, 18, 18, 32, 8, 32, 8, 0, 66, 19, { B } 0, 0, 0, 40, 20, 40, 26, 34, 26, 24, 22, 20, 26, 16, 26, 6, 20, 0, 8, 0, 8, 8, 18, 8, 18, 16, 8, 16, 8, 24, 18, 24, 18, 32, 8, 32, 8, 0, 67, 16, { C } 0, 6, 0, 34, 6, 40, 20, 40, 26, 34, 26, 26, 18, 26, 18, 32, 8, 32, 8, 8, 18, 8, 18, 14, 26, 14, 26, 6, 20, 0, 6, 0, 68, 12, { D } 0, 0, 0, 40, 20, 40, 26, 34, 26, 6, 20, 0, 8, 0, 8, 8, 18, 8, 18, 32, 8, 32, 8, 0, 69, 12, { E } 0, 0, 0, 40, 26, 40, 26, 32, 8, 32, 8, 24, 24, 24, 24, 16, 8, 16, 8, 8, 26, 8, 26, 0, 70, 10, { F } 0, 0, 0, 40, 26, 40, 26, 32, 8, 32, 8, 24, 24, 24, 24, 16, 8, 16, 8, 0, 71, 18, { G } 0, 6, 0, 34, 6, 40, 20, 40, 26, 34, 26, 28, 18, 28, 18, 32, 8, 32, 8, 8, 18, 8, 18, 12, 14, 12, 14, 20, 26, 20, 26, 6, 20, 0, 6, 0, 72, 12, { H } 0, 0, 0, 40, 8, 40, 8, 24, 18, 24, 18, 40, 26, 40, 26, 0, 18, 0, 18, 16, 8, 16, 8, 0, 73, 4, { I } 0, 0, 0, 40, 8, 40, 8, 0, 74, 10, { J } 0, 6, 0, 14, 8, 14, 8, 8, 18, 8, 18, 40, 26, 40, 26, 6, 20, 0, 6, 0, 75, 16, { K } 0, 0, 0, 40, 8, 40, 8, 24, 18, 34, 18, 40, 26, 40, 26, 30, 18, 22, 26, 14, 26, 0, 18, 0, 18, 10, 12, 16, 8, 16, 8, 0, 76, 6, { L } 0, 0, 0, 40, 8, 40, 8, 8, 26, 8, 26, 0, 77, 12, { M } 0, 0, 0, 40, 6, 40, 16, 30, 26, 40, 32, 40, 32, 0, 24, 0, 24, 28, 16, 20, 8, 28, 8, 0, 78, 11, { N } 0, 0, 0, 40, 4, 40, 18, 26, 18, 40, 26, 40, 26, 0, 18, 0, 18, 14, 8, 24, 8, 0, 79, 14, { O } 0, 6, 0, 34, 6, 40, 20, 40, 26, 34, 26, 6, 20, 0, 8, 0, 8, 8, 18, 8, 18, 32, 8, 32, 8, 0, 6, 0, 80, 12, { P } 0, 0, 0, 40, 20, 40, 26, 34, 26, 22, 20, 16, 8, 16, 8, 24, 18, 24, 18, 32, 8, 32, 8, 0, 81, 15, { Q } 0, 6, 0, 34, 6, 40, 18, 40, 24, 34, 24, 8, 26, 8, 26, 0, 8, 0, 8, 8, 16, 8, 16, 32, 8, 32, 8, 0, 6, 0, 82, 16, { R } 0, 0, 0, 40, 20, 40, 26, 34, 26, 24, 22, 20, 26, 16, 26, 0, 18, 0, 18, 16, 8, 16, 8, 24, 18, 24, 18, 32, 8, 32, 8, 0, 83, 22, { S } 0, 6, 0, 12, 8, 12, 8, 8, 18, 8, 18, 16, 6, 16, 0, 22, 0, 34, 6, 40, 20, 40, 26, 34, 26, 28, 18, 28, 18, 32, 8, 32, 8, 24, 20, 24, 26, 18, 26, 6, 20, 0, 6, 0, 84, 8, { T } 8, 0, 8, 32, 0, 32, 0, 40, 24, 40, 24, 32, 16, 32, 16, 0, 85, 10, { U } 0, 6, 0, 40, 8, 40, 8, 8, 18, 8, 18, 40, 26, 40, 26, 6, 20, 0, 6, 0, 86, 10, { V } 0, 14, 0, 40, 8, 40, 8, 18, 14, 12, 20, 18, 20, 40, 28, 40, 28, 14, 14, 0, 87, 14, { W } 0, 4, 0, 40, 8, 40, 8, 12, 16, 20, 24, 12, 24, 40, 32, 40, 32, 4, 28, 0, 24, 0, 16, 8, 8, 0, 4, 0, 88, 20, { X } 0, 0, 0, 14, 6, 20, 0, 26, 0, 40, 8, 40, 8, 30, 13, 25, 18, 30, 18, 40, 26, 40, 26, 26, 20, 20, 26, 14, 26, 0, 18, 0, 18, 10, 13, 15, 8, 10, 8, 0, 89, 14, { Y } 9, 0, 9, 16, 0, 25, 0, 40, 8, 40, 8, 28, 12, 24, 14, 24, 18, 28, 18, 40, 26, 40, 26, 25, 17, 16, 17, 0, 90, 10, { Z } 0, 0, 0, 13, 19, 32, 0, 32, 0, 40, 26, 40, 26, 27, 7, 8, 26, 8, 26, 0, 91, 8, { [ } 0, 0, 0, 40, 14, 40, 14, 32, 8, 32, 8, 8, 14, 8, 14, 0, 92, 4, { \ } 0, 30, 0, 40, 30, 10, 30, 0, 93, 8, { ] } 0, 0, 0, 8, 6, 8, 6, 32, 0, 32, 0, 40, 14, 40, 14, 0, 94, 9, { ^ } 0, 18, 0, 28, 12, 40, 24, 28, 24, 18, 16, 26, 16, 0, 8, 0, 8, 26, 95, 7, { _ } 0, 20, 12, 32, 12, 24, 26, 24, 26, 16, 12, 16, 12, 8, 96, 6, { ` } 0, 32, 0, 40, 6, 40, 6, 32, 10, 28, 4, 28, 97, 12, { a } 0, 6, 0, 18, 6, 24, 26, 24, 26, 0, 8, 0, 8, 8, 18, 8, 18, 16, 8, 16, 8, 0, 6, 0, 98, 14, { b } 0, 0, 0, 36, 8, 36, 8, 24, 20, 24, 26, 18, 26, 6, 20, 0, 8, 0, 8, 8, 18, 8, 18, 16, 8, 16, 8, 0, 99, 10, { c } 0, 6, 0, 18, 6, 24, 22, 24, 22, 16, 8, 16, 8, 8, 22, 8, 22, 0, 6, 0, 100, 14, { d } 0, 6, 0, 18, 6, 24, 18, 24, 18, 36, 26, 36, 26, 0, 8, 0, 8, 8, 18, 8, 18, 16, 8, 16, 8, 0, 6, 0, 101, 16, { e } 0, 4, 0, 20, 4, 24, 18, 24, 22, 20, 22, 14, 18, 10, 6, 10, 6, 14, 16, 14, 16, 20, 6, 20, 6, 6, 22, 6, 22, 0, 4, 0, 102, 15, { f } 4, 0, 4, 12, 0, 12, 0, 20, 4, 20, 4, 30, 10, 36, 18, 36, 18, 28, 12, 28, 12, 20, 16, 20, 16, 12, 12, 12, 12, 0, 103, 17, { g } 0, 6, 0, 18, 6, 24, 26, 24, 26, 64+8, 20, 64+14, 0, 64+14, 0, 64+6, 18, 64+6, 18, 0, 8, 0, 8, 8, 18, 8, 18, 16, 8, 16, 8, 0, 6, 0, 104, 11, { h } 0, 0, 0, 36, 8, 36, 8, 24, 20, 24, 26, 18, 26, 0, 18, 0, 18, 16, 8, 16, 8, 0, 105, 4, { i } 0, 0, 0, 22, 8, 22, 8, 0, 105, 4, { i } 0, 28, 0, 36, 8, 36, 8, 28, 106, 7, { j } 0, 0, 8, 0, 8, 22, 16, 22, 16, 64+2, 10, 64+8, 0, 64+8, 106, 4, { j } 8, 28, 8, 36, 16, 36, 16, 28, 107, 17, { k } 0, 0, 0, 36, 8, 36, 8, 22, 12, 22, 18, 28, 18, 32, 26, 32, 26, 24, 21, 19, 26, 14, 26, 0, 18, 0, 18, 10, 14, 14, 8, 14, 8, 0, 108, 4, { l } 0, 0, 0, 36, 8, 36, 8, 0, 109, 16, { m } 0, 0, 0, 24, 14, 24, 18, 20, 22, 24, 32, 24, 36, 20, 36, 0, 28, 0, 28, 16, 22, 16, 22, 0, 14, 0, 14, 16, 8, 16, 8, 0, 110, 9, { n } 0, 0, 0, 24, 20, 24, 26, 18, 26, 0, 18, 0, 18, 16, 8, 16, 8, 0, 111, 14, { o } 0, 6, 0, 18, 6, 24, 20, 24, 26, 18, 26, 6, 20, 0, 8, 0, 8, 8, 18, 8, 18, 16, 8, 16, 8, 0, 6, 0, 112, 12, { p } 0, 64+14, 0, 24, 20, 24, 26, 18, 26, 6, 20, 0, 8, 0, 8, 8, 18, 8, 18, 16, 8, 16, 8, 64+14, 113, 14, { q } 0, 6, 0, 18, 6, 24, 26, 24, 26, 64+14, 18, 64+14, 18, 0, 8, 0, 8, 8, 18, 8, 18, 16, 8, 16, 8, 0, 6, 0, 114, 7, { r } 0, 0, 0, 18, 6, 24, 22, 24, 22, 16, 8, 16, 8, 0, 115, 16, { s } 0, 0, 0, 6, 16, 6, 16, 10, 4, 10, 0, 14, 0, 20, 4, 24, 24, 24, 24, 18, 8, 18, 8, 14, 20, 14, 24, 10, 24, 4, 20, 0, 116, 11, { t } 0, 6, 0, 36, 8, 36, 8, 28, 16, 28, 16, 20, 8, 20, 8, 8, 16, 8, 16, 0, 6, 0, 117, 9, { u } 0, 6, 0, 24, 8, 24, 8, 8, 18, 8, 18, 24, 26, 24, 26, 0, 6, 0, 118, 12, { v } 0, 12, 0, 24, 8, 24, 8, 14, 12, 10, 14, 10, 18, 14, 18, 24, 26, 24, 26, 12, 14, 0, 12, 0, 119, 17, { w } 0, 4, 0, 24, 8, 24, 8, 8, 14, 8, 14, 24, 22, 24, 22, 8, 28, 8, 28, 24, 36, 24, 36, 4, 32, 0, 22, 0, 18, 4, 14, 0, 4, 0, 120, 20, { x } 0, 0, 0, 6, 6, 12, 0, 18, 0, 24, 8, 24, 8, 20, 13, 15, 18, 20, 18, 24, 26, 24, 26, 18, 20, 12, 26, 6, 26, 0, 18, 0, 18, 4, 13, 9, 8, 4, 8, 0, 121, 14, { y } 0, 6, 0, 24, 8, 24, 8, 8, 18, 8, 18, 24, 26, 24, 26, 64+8, 20, 64+14, 0, 64+14, 0, 64+6, 18, 64+6, 18, 0, 6, 0, 122, 10, { z } 0, 0, 0, 4, 12, 16, 0, 16, 0, 24, 24, 24, 24, 20, 12, 8, 24, 8, 24, 0, 123, 16, { left curly bracket } 4, 4, 4, 16, 0, 20, 4, 24, 4, 36, 8, 40, 16, 40, 16, 32, 12, 32, 12, 24, 8, 20, 12, 16, 12, 8, 16, 8, 16, 0, 8, 0, 124, 4, { | } 0, 0, 0, 40, 8, 40, 8, 0, 125, 16, { right curly bracket } 0, 0, 0, 8, 4, 8, 4, 16, 8, 20, 4, 24, 4, 32, 0, 32, 0, 40, 8, 40, 12, 36, 12, 24, 16, 20, 12, 16, 12, 4, 8, 0, 126, 14, { ~ } 0, 12, 0, 20, 6, 26, 10, 26, 14, 22, 16, 22, 22, 28, 24, 28, 24, 20, 18, 14, 14, 14, 10, 18, 8, 18, 2, 12 %real %fn draw sym (%integer s, %real x, y, scale) %real xx, yy, l, ox, oy %integer i, j, old stream %if starts initialised # true %start starts initialised = true i = 1 %while i = 64; !deal with descenders yy = yy * scale ox = x + xx; oy = y + yy polygon (ox, oy) l = MOD(xx) %if MOD(xx)> l i = i+2 j = j-1 %while j>0 %cycle xx=coords(i); yy=coords(i+1) yy= 64-yy %if yy>= 64; !deal with descenders xx=xx*scale; yy=yy*scale axy (x+xx, y+yy) l = MOD(xx) %if MOD(xx) >l i = i+2 j = j-1 %repeat axy (ox, oy) %repeat %finish %else %result = MOD(space width*scale) %result = l + MOD(spacing*scale) %end %routine draw syms (%string (255) s, %real x, y, scale) %integer i %real l l = 0 l = l + draw sym(charno(s,i),x+l,y,scale) %for i = 1,1,length(s) %end %external %routine text %alias "ILAPTEXT" (%string(31) cell name, %string(255) contents, %integer bwidth, bheight) %const %byte %array width(32:126) = 20, 9,14,20,18,20,18,10,12,12,17,17, 9,15, 9,20,17,11,18,18,21,18,18,18,18,18, 9, 9,15,15,15,18,18,18,18,18,18,18,18,18,18, 9,18,18,18,21,18,18,18,18,18,18, 17,18,19,21,18,18,18,12,20,12,17,18,10,18,18,16,18,16,14,18,18, 9,13,18,9,23, 18,18,18,18,16,17,13,18,18,23,18,18,17,13, 9,13,17 %const %byte %array above(32:126) = 0,20,20,20,20,20,20,20,20,20,16,16,4 ,11,4 ,20,20,20,20,20,20,20,20,20,20,20, 11,11,16,13,16,20,17,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, 20,20,20,20,20,20,20,20,20,20,20,16,20,12,18,12,18,12,18,12,18,18,18,18,18,12, 12,12,12,12,12,12,18,12,12,12,12,12,12,20,20,20,14 %const %byte %array below(32:126) = 0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,4,0,0,0, 0,0,7,7,0,0,0,0,0,0,0,7,0,0,0,0,0 %const %integer line space = 12, edge space = 10 %record %format data(%string(255) text, %integer width, chars, above, below) %const %integer max lines = 31 %record (data) %array line(1:max lines) %integer lines, i, j, twidth, theight, worth starting, cc %integer old control, a, b %real height scale, width scale, s, xstart, ystart, xnext, ynext %real spacing, line spacing lines = 1 line (lines) = 0 %for i = 1, 1, length(contents) %cycle %if charno (contents, i) = nl %start lines = lines + 1 line(lines) = 0 %finish %else %start charno (contents, i) = ' ' %unless 32 <= charno (contents, i) <= 126 line(lines)_text = line(lines)_text.to string(charno(contents, i)) %finish %repeat ! Check that there is text to draw worth starting = false ! Scan each line of text to discover lengths,heights etc. twidth = 0 theight = 0 %cycle i = 1,1,lines { Note that LINE has already been zeroed } line(i)_chars = length(line(i)_text) {no of chars} %if line(i)_chars = 0 %start line(i)_above = 20 {blank line !!!!} line(i)_width = 1 {avoids errors} %finish %else %start worth starting = true %cycle j = 1,1,line(i)_chars cc = charno (line(i)_text,j) line(i)_width = line(i)_width + width(cc) line(i)_above = above(cc) %if above(cc) > line(i)_above line(i)_below = below(cc) %if below(cc) > line(i)_below %repeat %finish twidth = line(i)_width %if line(i)_width > twidth theight = theight + line(i)_above + line(i)_below %repeat %if worth starting = true %start twidth = twidth - 5 {adjusts for space on last char} ! Determine largest possible scale factor widthscale = bwidth / (twidth + edge space + edge space) heightscale = bheight / (theight + edge space + edge space) %if heightscale>width scale %then s=widthscale %else s=heightscale ! Calculate line spacing and positioning line spacing = 0 spacing = bheight - s * theight %if lines # 1 %then line spacing = spacing / (lines-1) line spacing = s * line space %if line spacing > s * line space ystart = (spacing - (lines - 1) * line spacing) / 2 xstart = (bwidth - s * twidth) / 2 old control = ILAP control ILAP control = 0 {NO merge + NO DRC } symbol(cell name) layer(layer for text) ynext = line(lines)_below * s + ystart xnext =(twidth-line(lines)_width+edge space)*s/2 + xstart draw syms (line(lines)_text,xnext,ynext,s/2) %for i = lines - 1,-1,1 %cycle ynext=ynext+linespacing+(line(i+1)_above+line(i)_below)*s xnext=(twidth-line(i)_width+edge space)*s/2 + xstart draw syms (line(i)_text,xnext,ynext,s/2) %repeat ! update bb (0, 0, bwidth, bheight) endsymbol ILAP control = old control %finish %else warn("No printable text supplied, Symbol ".cell name." not generated") %end %external %routine TEXT LAYER (%string (7) LAYER) layer for text <- layer %end %end %of %file