1 /* -*- tab-width: 4 -*-
2  *
3  * Electric(tm) VLSI Design System
4  *
5  * File: tecrcmos.c
6  * Round MOSIS CMOS technology description
7  * Written by: Steven M. Rubin, Static Free Software
8  * Specified by: Dick Lyon, Carver Mead, and Erwin Liu
9  *
10  * Copyright (c) 2000 Static Free Software.
11  *
12  * Electric(tm) is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * Electric(tm) is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with Electric(tm); see the file COPYING.  If not, write to
24  * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
25  * Boston, Mass 02111-1307, USA.
26  *
27  * Static Free Software
28  * 4119 Alpine Road
29  * Portola Valley, California 94028
30  * info@staticfreesoft.com
31  */
32 
33 #include "config.h"
34 #include "global.h"
35 #include "egraphics.h"
36 #include "tech.h"
37 #include "tecrcmos.h"
38 #include "efunction.h"
39 
40 typedef struct
41 {
42 	INTBIG list0off, list1off, list2off;
43 } RCMPOLYLOOP;
44 
45 RCMPOLYLOOP rcmos_oneprocpolyloop;
46 
47 static TECHNOLOGY *rcmos_tech;
48 
49 static INTBIG rcmos_intarcpolys(ARCINST *ai, WINDOWPART *win, POLYLOOP *pl, RCMPOLYLOOP *rcmpl);
50 static void rcmos_intshapearcpoly(ARCINST *ai, INTBIG box, POLYGON *poly, POLYLOOP *pl, RCMPOLYLOOP *rcmpl);
51 
52 /******************** LAYERS ********************/
53 
54 #define MAXLAYERS 19		/* total layers below         */
55 #define LMETAL1    0		/* metal layer 1              */
56 #define LMETAL2    1		/* metal layer 2              */
57 #define LPOLY      2		/* polysilicon                */
58 #define LSACT      3		/* S active (diffusion)       */
59 #define LDACT      4		/* D active (diffusion)       */
60 #define LSELECT    5		/* Select                     */
61 #define LWELL      6		/* Well                       */
62 #define LCUT       7		/* contact cut                */
63 #define LVIA       8		/* metal-to-metal via         */
64 #define LPASS      9		/* passivation (overglass)    */
65 #define LPOLYCUT  10		/* poly contact cut           */
66 #define LACTCUT   11		/* active contact cut         */
67 #define LMET1P    12		/* pseudo metal 1             */
68 #define LMET2P    13		/* pseudo metal 2             */
69 #define LPOLYP    14		/* pseudo polysilicon         */
70 #define LSACTP    15		/* pseudo S active            */
71 #define LDACTP    16		/* pseudo D active            */
72 #define LSELECTP  17		/* pseudo Select              */
73 #define LWELLP    18		/* pseudo Well                */
74 
75 static GRAPHICS rcmos_m1_lay = {LAYERT1,COLORT1, SOLIDC, PATTERNED,
76 /* metal-1 layer */		{0x2222, /*   X   X   X   X  */
77 						0x0000,  /*                  */
78 						0x8888,  /* X   X   X   X    */
79 						0x0000,  /*                  */
80 						0x2222,  /*   X   X   X   X  */
81 						0x0000,  /*                  */
82 						0x8888,  /* X   X   X   X    */
83 						0x0000,  /*                  */
84 						0x2222,  /*   X   X   X   X  */
85 						0x0000,  /*                  */
86 						0x8888,  /* X   X   X   X    */
87 						0x0000,  /*                  */
88 						0x2222,  /*   X   X   X   X  */
89 						0x0000,  /*                  */
90 						0x8888,  /* X   X   X   X    */
91 						0x0000}, /*                  */
92 						NOVARIABLE, 0};
93 static GRAPHICS rcmos_m2_lay = {LAYERT5,COLORT5, SOLIDC, PATTERNED,
94 /* metal-2 layer */		{0x1010, /*    X       X     */
95 						0x2020,  /*   X       X      */
96 						0x4040,  /*  X       X       */
97 						0x8080,  /* X       X        */
98 						0x0101,  /*        X       X */
99 						0x0202,  /*       X       X  */
100 						0x0404,  /*      X       X   */
101 						0x0808,  /*     X       X    */
102 						0x1010,  /*    X       X     */
103 						0x2020,  /*   X       X      */
104 						0x4040,  /*  X       X       */
105 						0x8080,  /* X       X        */
106 						0x0101,  /*        X       X */
107 						0x0202,  /*       X       X  */
108 						0x0404,  /*      X       X   */
109 						0x0808}, /*     X       X    */
110 						NOVARIABLE, 0};
111 static GRAPHICS rcmos_p_lay = {LAYERT2,COLORT2, SOLIDC, PATTERNED,
112 /* poly layer */		{0x0808, /*     X       X    */
113 						0x0404,  /*      X       X   */
114 						0x0202,  /*       X       X  */
115 						0x0101,  /*        X       X */
116 						0x8080,  /* X       X        */
117 						0x4040,  /*  X       X       */
118 						0x2020,  /*   X       X      */
119 						0x1010,  /*    X       X     */
120 						0x0808,  /*     X       X    */
121 						0x0404,  /*      X       X   */
122 						0x0202,  /*       X       X  */
123 						0x0101,  /*        X       X */
124 						0x8080,  /* X       X        */
125 						0x4040,  /*  X       X       */
126 						0x2020,  /*   X       X      */
127 						0x1010}, /*    X       X     */
128 						NOVARIABLE, 0};
129 static GRAPHICS rcmos_sa_lay = {LAYERT3,COLORT3, SOLIDC, PATTERNED,
130 /* S active layer */	{0x0000, /*                  */
131 						0x0303,  /*       XX      XX */
132 						0x4848,  /*  X  X    X  X    */
133 						0x0303,  /*       XX      XX */
134 						0x0000,  /*                  */
135 						0x3030,  /*   XX      XX     */
136 						0x8484,  /* X    X  X    X   */
137 						0x3030,  /*   XX      XX     */
138 						0x0000,  /*                  */
139 						0x0303,  /*       XX      XX */
140 						0x4848,  /*  X  X    X  X    */
141 						0x0303,  /*       XX      XX */
142 						0x0000,  /*                  */
143 						0x3030,  /*   XX      XX     */
144 						0x8484,  /* X    X  X    X   */
145 						0x3030}, /*   XX      XX     */
146 						NOVARIABLE, 0};
147 static GRAPHICS rcmos_da_lay = {LAYERT3,COLORT3, SOLIDC, PATTERNED,
148 /* D active layer */	{0x0000, /*                  */
149 						0x0303,  /*       XX      XX */
150 						0x4848,  /*  X  X    X  X    */
151 						0x0303,  /*       XX      XX */
152 						0x0000,  /*                  */
153 						0x3030,  /*   XX      XX     */
154 						0x8484,  /* X    X  X    X   */
155 						0x3030,  /*   XX      XX     */
156 						0x0000,  /*                  */
157 						0x0303,  /*       XX      XX */
158 						0x4848,  /*  X  X    X  X    */
159 						0x0303,  /*       XX      XX */
160 						0x0000,  /*                  */
161 						0x3030,  /*   XX      XX     */
162 						0x8484,  /* X    X  X    X   */
163 						0x3030}, /*   XX      XX     */
164 						NOVARIABLE, 0};
165 static GRAPHICS rcmos_s_lay = {LAYERO,YELLOW, PATTERNED, PATTERNED,
166 /* Select layer */		{0x1010, /*    X       X     */
167 						0x2020,  /*   X       X      */
168 						0x4040,  /*  X       X       */
169 						0x8080,  /* X       X        */
170 						0x0101,  /*        X       X */
171 						0x0202,  /*       X       X  */
172 						0x0404,  /*      X       X   */
173 						0x0808,  /*     X       X    */
174 						0x1010,  /*    X       X     */
175 						0x2020,  /*   X       X      */
176 						0x4040,  /*  X       X       */
177 						0x8080,  /* X       X        */
178 						0x0101,  /*        X       X */
179 						0x0202,  /*       X       X  */
180 						0x0404,  /*      X       X   */
181 						0x0808}, /*     X       X    */
182 						NOVARIABLE, 0};
183 static GRAPHICS rcmos_w_lay = {LAYERT4,COLORT4, SOLIDC, PATTERNED,
184 /* Well implant */		{0x1000, /*    X             */
185 						0x0020,  /*           X      */
186 						0x0000,  /*                  */
187 						0x0000,  /*                  */
188 						0x0001,  /*                X */
189 						0x0200,  /*       X          */
190 						0x0000,  /*                  */
191 						0x0000,  /*                  */
192 						0x1000,  /*    X             */
193 						0x0020,  /*           X      */
194 						0x0000,  /*                  */
195 						0x0000,  /*                  */
196 						0x0001,  /*                X */
197 						0x0200,  /*       X          */
198 						0x0000,  /*                  */
199 						0x0000}, /*                  */
200 						NOVARIABLE, 0};
201 static GRAPHICS rcmos_c_lay = {LAYERO,BLACK, SOLIDC, SOLIDC,
202 /* cut layer */		{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, NOVARIABLE, 0};
203 static GRAPHICS rcmos_v_lay = {LAYERO,BLACK, SOLIDC, SOLIDC,
204 /* via layer */		{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, NOVARIABLE, 0};
205 static GRAPHICS rcmos_ov_lay = {LAYERO,DGRAY, PATTERNED, PATTERNED,
206 /* passivation layer */	{0x1C1C, /*    XXX     XXX   */
207 						0x3E3E,  /*   XXXXX   XXXXX  */
208 						0x3636,  /*   XX XX   XX XX  */
209 						0x3E3E,  /*   XXXXX   XXXXX  */
210 						0x1C1C,  /*    XXX     XXX   */
211 						0x0000,  /*                  */
212 						0x0000,  /*                  */
213 						0x0000,  /*                  */
214 						0x1C1C,  /*    XXX     XXX   */
215 						0x3E3E,  /*   XXXXX   XXXXX  */
216 						0x3636,  /*   XX XX   XX XX  */
217 						0x3E3E,  /*   XXXXX   XXXXX  */
218 						0x1C1C,  /*    XXX     XXX   */
219 						0x0000,  /*                  */
220 						0x0000,  /*                  */
221 						0x0000}, /*                  */
222 						NOVARIABLE, 0};
223 static GRAPHICS rcmos_pc_lay = {LAYERO,BLACK, SOLIDC, SOLIDC,
224 /* poly cut layer */	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, NOVARIABLE, 0};
225 static GRAPHICS rcmos_ac_lay = {LAYERO,BLACK, SOLIDC, SOLIDC,
226 /* active cut layer */	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, NOVARIABLE, 0};
227 static GRAPHICS rcmos_pm1_lay ={LAYERT1,COLORT1, SOLIDC, PATTERNED,
228 /* pseudo metal 1 */	{0x2222, /*   X   X   X   X  */
229 						0x0000,  /*                  */
230 						0x8888,  /* X   X   X   X    */
231 						0x0000,  /*                  */
232 						0x2222,  /*   X   X   X   X  */
233 						0x0000,  /*                  */
234 						0x8888,  /* X   X   X   X    */
235 						0x0000,  /*                  */
236 						0x2222,  /*   X   X   X   X  */
237 						0x0000,  /*                  */
238 						0x8888,  /* X   X   X   X    */
239 						0x0000,  /*                  */
240 						0x2222,  /*   X   X   X   X  */
241 						0x0000,  /*                  */
242 						0x8888,  /* X   X   X   X    */
243 						0x0000}, /*                  */
244 						NOVARIABLE, 0};
245 static GRAPHICS rcmos_pm2_lay = {LAYERT5,COLORT5, SOLIDC, PATTERNED,
246 /* pseudo metal-2 */	{0x1010, /*    X       X     */
247 						0x2020,  /*   X       X      */
248 						0x4040,  /*  X       X       */
249 						0x8080,  /* X       X        */
250 						0x0101,  /*        X       X */
251 						0x0202,  /*       X       X  */
252 						0x0404,  /*      X       X   */
253 						0x0808,  /*     X       X    */
254 						0x1010,  /*    X       X     */
255 						0x2020,  /*   X       X      */
256 						0x4040,  /*  X       X       */
257 						0x8080,  /* X       X        */
258 						0x0101,  /*        X       X */
259 						0x0202,  /*       X       X  */
260 						0x0404,  /*      X       X   */
261 						0x0808}, /*     X       X    */
262 						NOVARIABLE, 0};
263 static GRAPHICS rcmos_pp_lay = {LAYERT2,COLORT2, SOLIDC, PATTERNED,
264 /* pseudo poly layer */	{0x0808, /*     X       X    */
265 						0x0404,  /*      X       X   */
266 						0x0202,  /*       X       X  */
267 						0x0101,  /*        X       X */
268 						0x8080,  /* X       X        */
269 						0x4040,  /*  X       X       */
270 						0x2020,  /*   X       X      */
271 						0x1010,   /*    X       X     */
272 						0x0808,  /*     X       X    */
273 						0x0404,  /*      X       X   */
274 						0x0202,  /*       X       X  */
275 						0x0101,  /*        X       X */
276 						0x8080,  /* X       X        */
277 						0x4040,  /*  X       X       */
278 						0x2020,  /*   X       X      */
279 						0x1010},  /*    X       X     */
280 						NOVARIABLE, 0};
281 static GRAPHICS rcmos_psa_lay = {LAYERT3,COLORT3, SOLIDC, PATTERNED,
282 /* pseudo S active */	{0x0000, /*                  */
283 						0x0303,  /*       XX      XX */
284 						0x4848,  /*  X  X    X  X    */
285 						0x0303,  /*       XX      XX */
286 						0x0000,  /*                  */
287 						0x3030,  /*   XX      XX     */
288 						0x8484,  /* X    X  X    X   */
289 						0x3030,  /*   XX      XX     */
290 						0x0000,  /*                  */
291 						0x0303,  /*       XX      XX */
292 						0x4848,  /*  X  X    X  X    */
293 						0x0303,  /*       XX      XX */
294 						0x0000,  /*                  */
295 						0x3030,  /*   XX      XX     */
296 						0x8484,  /* X    X  X    X   */
297 						0x3030}, /*   XX      XX     */
298 						NOVARIABLE, 0};
299 static GRAPHICS rcmos_pda_lay = {LAYERT3,COLORT3, SOLIDC, PATTERNED,
300 /* pseudo D active */	{0x0000, /*                  */
301 						0x0303,  /*       XX      XX */
302 						0x4848,  /*  X  X    X  X    */
303 						0x0303,  /*       XX      XX */
304 						0x0000,  /*                  */
305 						0x3030,  /*   XX      XX     */
306 						0x8484,  /* X    X  X    X   */
307 						0x3030,  /*   XX      XX     */
308 						0x0000,  /*                  */
309 						0x0303,  /*       XX      XX */
310 						0x4848,  /*  X  X    X  X    */
311 						0x0303,  /*       XX      XX */
312 						0x0000,  /*                  */
313 						0x3030,  /*   XX      XX     */
314 						0x8484,  /* X    X  X    X   */
315 						0x3030}, /*   XX      XX     */
316 						NOVARIABLE, 0};
317 static GRAPHICS rcmos_ps_lay = {LAYERO,YELLOW, PATTERNED, PATTERNED,
318 /* pseudo Select */		{0x1010, /*    X       X     */
319 						0x2020,  /*   X       X      */
320 						0x4040,  /*  X       X       */
321 						0x8080,  /* X       X        */
322 						0x0101,  /*        X       X */
323 						0x0202,  /*       X       X  */
324 						0x0404,  /*      X       X   */
325 						0x0808,  /*     X       X    */
326 						0x1010,  /*    X       X     */
327 						0x2020,  /*   X       X      */
328 						0x4040,  /*  X       X       */
329 						0x8080,  /* X       X        */
330 						0x0101,  /*        X       X */
331 						0x0202,  /*       X       X  */
332 						0x0404,  /*      X       X   */
333 						0x0808}, /*     X       X    */
334 						NOVARIABLE, 0};
335 static GRAPHICS rcmos_pw_lay = {LAYERT4,COLORT4, SOLIDC, PATTERNED,
336 /* pseudo Well */		{0x1000, /*    X             */
337 						0x0020,  /*           X      */
338 						0x0000,  /*                  */
339 						0x0000,  /*                  */
340 						0x0001,  /*                X */
341 						0x0200,  /*       X          */
342 						0x0000,  /*                  */
343 						0x0000,  /*                  */
344 						0x1000,  /*    X             */
345 						0x0020,  /*           X      */
346 						0x0000,  /*                  */
347 						0x0000,  /*                  */
348 						0x0001,  /*                X */
349 						0x0200,  /*       X          */
350 						0x0000,  /*                  */
351 						0x0000}, /*                  */
352 						NOVARIABLE, 0};
353 
354 /* these tables must be updated together */
355 GRAPHICS *rcmos_layers[MAXLAYERS+1] = {&rcmos_m1_lay, &rcmos_m2_lay,
356 	&rcmos_p_lay, &rcmos_sa_lay, &rcmos_da_lay, &rcmos_s_lay,
357 	&rcmos_w_lay, &rcmos_c_lay, &rcmos_v_lay, &rcmos_ov_lay,
358 	&rcmos_pc_lay, &rcmos_ac_lay, &rcmos_pm1_lay, &rcmos_pm2_lay, &rcmos_pp_lay,
359 	&rcmos_psa_lay, &rcmos_pda_lay, &rcmos_ps_lay, &rcmos_pw_lay, NOGRAPHICS};
360 static CHAR *rcmos_layer_names[MAXLAYERS] = {x_("Metal-1"), x_("Metal-2"),
361 	x_("Polysilicon"), x_("S-Active"), x_("D-Active"), x_("Select"),
362 	x_("Well"), x_("Contact-Cut"), x_("Via"), x_("Passivation"), x_("Poly-Cut"),
363 	x_("Active-Cut"), x_("Pseudo-Metal-1"), x_("Pseudo-Metal-2"), x_("Pseudo-Polysilicon"),
364 	x_("Pseudo-S-Active"), x_("Pseudo-D-Active"), x_("Pseudo-Select"), x_("Pseudo-Well")};
365 static INTBIG rcmos_layer_function[MAXLAYERS] = {LFMETAL1|LFTRANS1,
366 	LFMETAL2|LFTRANS5, LFPOLY1|LFTRANS2, LFDIFF|LFPTYPE|LFTRANS3,
367 	LFDIFF|LFNTYPE|LFTRANS3, LFIMPLANT|LFPTYPE, LFWELL|LFTRANS4, LFCONTACT1,
368 	LFCONTACT2|LFCONMETAL, LFOVERGLASS, LFCONTACT1|LFCONPOLY, LFCONTACT1|LFCONDIFF,
369 	LFMETAL1|LFPSEUDO|LFTRANS1, LFMETAL2|LFPSEUDO|LFTRANS5, LFPOLY1|LFPSEUDO|LFTRANS2,
370 	LFDIFF|LFPTYPE|LFPSEUDO|LFTRANS3, LFDIFF|LFNTYPE|LFPSEUDO|LFTRANS3,
371 	LFIMPLANT|LFPTYPE|LFPSEUDO, LFWELL|LFPSEUDO|LFTRANS4};
372 static CHAR *rcmos_cif_layers[MAXLAYERS] = {x_("CMF"), x_("CMS"), x_("CPG"), x_("CAA"),
373 	x_("CAA"), x_("CSG"), x_("CWG"), x_("CC"), x_("CVA"), x_("COG"), x_("CCP"), x_("CCA"),
374 	x_(""), x_(""), x_(""), x_(""), x_(""), x_(""), x_("")};
375 static CHAR *rcmos_layer_letters[MAXLAYERS] = {x_("m"), x_("h"), x_("p"), x_("s"), x_("d"),
376 	x_("e"), x_("w"), x_("c"), x_("v"), x_("o"), x_("a"), x_("A"), x_("M"), x_("H"), x_("P"), x_("S"), x_("D"), x_("E"), x_("W")};
377 
378 /* The low 5 bits map Metal-1, Poly, Active, Well, and Metal-2 */
379 static TECH_COLORMAP rcmos_colmap[32] =
380 {                  /*     metal2 select active poly metal1 */
381 	{200,200,200}, /* 0:                                 */
382 	{ 96,209,255}, /* 1:                          metal1 */
383 	{255,155,192}, /* 2:                     poly        */
384 	{ 96,127,192}, /* 3:                     poly+metal1 */
385 	{107,226, 96}, /* 4:              active             */
386 	{ 40,186, 96}, /* 5:              active+     metal1 */
387 	{107,137, 72}, /* 6:              active+poly        */
388 	{ 40,113, 72}, /* 7:              active+poly+metal1 */
389 	{240,221,181}, /* 8:         well                    */
390 	{ 91,182,181}, /* 9:         well+            metal1 */
391 	{240,134,136}, /* 10:        well+       poly        */
392 	{ 91,111,136}, /* 11:        well+       poly+metal1 */
393 	{101,196, 68}, /* 12:        well+active             */
394 	{ 38,161, 68}, /* 13:        well+active+     metal1 */
395 	{101,119, 51}, /* 14:        well+active+poly        */
396 	{ 38, 98, 51}, /* 15:        well+active+poly+metal1 */
397 	{224, 95,255}, /* 16: metal2+                        */
398 	{ 85, 78,255}, /* 17: metal2+                 metal1 */
399 	{224, 57,192}, /* 18: metal2+            poly        */
400 	{ 85, 47,192}, /* 19: metal2+            poly+metal1 */
401 	{ 94, 84, 96}, /* 20: metal2+     active             */
402 	{ 36, 69, 96}, /* 21: metal2+     active+     metal1 */
403 	{ 94, 51, 72}, /* 22: metal2+     active+poly        */
404 	{ 36, 42, 72}, /* 23: metal2+     active+poly+metal1 */
405 	{211, 82,181}, /* 24: metal2+well                    */
406 	{ 80, 68,181}, /* 25: metal2+well+            metal1 */
407 	{211, 50,136}, /* 26: metal2+well+       poly        */
408 	{ 80, 41,136}, /* 27: metal2+well+       poly+metal1 */
409 	{ 89, 73, 68}, /* 28: metal2+well+active             */
410 	{ 33, 60, 68}, /* 29: metal2+well+active+     metal1 */
411 	{ 89, 44, 51}, /* 30: metal2+well+active+poly        */
412 	{ 33, 36, 51}  /* 31: metal2+well+active+poly+metal1 */
413 };
414 
415 /******************** ARCS ********************/
416 
417 #define ARCPROTOCOUNT  9
418 #define AMETAL1        0	/* metal-1                   */
419 #define AMETAL2        1	/* metal-2                   */
420 #define APOLY          2	/* polysilicon               */
421 #define ASACT          3	/* S-active                  */
422 #define ADACT          4	/* D-active                  */
423 #define ASUACT         5	/* Substrate active          */
424 #define AWEACT         6	/* Well active               */
425 #define ASTRANS        7	/* S-transistor              */
426 #define ADTRANS        8	/* D-transistor              */
427 
428 /* metal 1 arc */
429 static TECH_ARCLAY rcmos_al_m1[] = {{LMETAL1,0,FILLED }};
430 static TECH_ARCS rcmos_a_m1 = {
431 	x_("Metal-1"),K3,AMETAL1,NOARCPROTO,								/* name */
432 	1,rcmos_al_m1,														/* layers */
433 	(APMETAL1<<AFUNCTIONSH)|WANTNOEXTEND|CANCURVE|(0<<AANGLEINCSH)};	/* userbits */
434 
435 /* metal 2 arc */
436 static TECH_ARCLAY rcmos_al_m2[] = {{LMETAL2,0,FILLED }};
437 static TECH_ARCS rcmos_a_m2 = {
438 	x_("Metal-2"),K3,AMETAL2,NOARCPROTO,								/* name */
439 	1,rcmos_al_m2,														/* layers */
440 	(APMETAL2<<AFUNCTIONSH)|WANTNOEXTEND|CANCURVE|(0<<AANGLEINCSH)};	/* userbits */
441 
442 /* polysilicon arc */
443 static TECH_ARCLAY rcmos_al_p[] = {{LPOLY,0,FILLED }};
444 static TECH_ARCS rcmos_a_po = {
445 	x_("Polysilicon"),K2,APOLY,NOARCPROTO,								/* name */
446 	1,rcmos_al_p,														/* layers */
447 	(APPOLY1<<AFUNCTIONSH)|WANTNOEXTEND|CANCURVE|(0<<AANGLEINCSH)};		/* userbits */
448 
449 /* S-active arc */
450 static TECH_ARCLAY rcmos_al_sa[] = {{LSACT,K4,FILLED}, {LSELECT,0,FILLED}};
451 static TECH_ARCS rcmos_a_sa = {
452 	x_("S-Active"),K6,ASACT,NOARCPROTO,									/* name */
453 	2,rcmos_al_sa,														/* layers */
454 	(APDIFFN<<AFUNCTIONSH)|WANTNOEXTEND|CANCURVE|(0<<AANGLEINCSH)};		/* userbits */
455 
456 /* D-active arc */
457 static TECH_ARCLAY rcmos_al_da[] = {{LDACT,K8,FILLED}, {LWELL,0,FILLED}};
458 static TECH_ARCS rcmos_a_da = {
459 	x_("D-Active"),K10,ADACT,NOARCPROTO,								/* name */
460 	2,rcmos_al_da,														/* layers */
461 	(APDIFFP<<AFUNCTIONSH)|WANTNOEXTEND|CANCURVE|(0<<AANGLEINCSH)};		/* userbits */
462 
463 /* Substrate active arc */
464 static TECH_ARCLAY rcmos_al_sua[] = {{LDACT,0,FILLED}, {LSACT,0,FILLED}};
465 static TECH_ARCS rcmos_a_sua = {
466 	x_("Substrate-Active"),K2,ASUACT,NOARCPROTO,						/* name */
467 	2,rcmos_al_sua,														/* layers */
468 	(APDIFFS<<AFUNCTIONSH)|WANTNOEXTEND|CANCURVE|(0<<AANGLEINCSH)};		/* userbits */
469 
470 /* Well active arc */
471 static TECH_ARCLAY rcmos_al_wea[] = {{LDACT,K4,FILLED}, {LSACT,K4,FILLED},
472 	{LWELL,0,FILLED}, {LSELECT,K2,FILLED}};
473 static TECH_ARCS rcmos_a_wea = {
474 	x_("Well-Active"),K6,AWEACT,NOARCPROTO,								/* name */
475 	4,rcmos_al_wea,														/* layers */
476 	(APDIFFW<<AFUNCTIONSH)|WANTNOEXTEND|CANCURVE|(0<<AANGLEINCSH)};		/* userbits */
477 
478 /* S-transistor arc */
479 static TECH_ARCLAY rcmos_al_st[] = {{LDACT,K4,FILLED}, {LPOLY,K4,FILLED},
480 	{LSELECT,0,FILLED}};
481 static TECH_ARCS rcmos_a_st = {
482 	x_("S-Transistor"),K6,ASTRANS,NOARCPROTO,							/* name */
483 	3,rcmos_al_st,														/* layers */
484 	(APDIFFN<<AFUNCTIONSH)|WANTNOEXTEND|CANCURVE|(0<<AANGLEINCSH)};		/* userbits */
485 
486 /* D-transistor arc */
487 static TECH_ARCLAY rcmos_al_dt[] = {{LDACT,K8,FILLED}, {LPOLY,K8,FILLED},
488 	{LWELL,0,FILLED}};
489 static TECH_ARCS rcmos_a_dt = {
490 	x_("D-Transistor"),K10,ADTRANS,NOARCPROTO,							/* name */
491 	3,rcmos_al_dt,														/* layers */
492 	(APDIFFP<<AFUNCTIONSH)|WANTNOEXTEND|CANCURVE|(0<<AANGLEINCSH)};		/* userbits */
493 
494 TECH_ARCS *rcmos_arcprotos[ARCPROTOCOUNT+1] = {
495 	&rcmos_a_m1, &rcmos_a_m2, &rcmos_a_po, &rcmos_a_sa, &rcmos_a_da,
496 	&rcmos_a_sua, &rcmos_a_wea, &rcmos_a_st, &rcmos_a_dt, ((TECH_ARCS *)-1)};
497 
498 static INTBIG rcmos_arc_widoff[ARCPROTOCOUNT] = {0,0,0,K4,K8,0,K4,K4,K8};
499 
500 /******************** PORTINST CONNECTIONS ********************/
501 
502 /* these values are replaced with actual arcproto addresses */
503 static INTBIG rcmos_pc_m1[]   = {-1, AMETAL1, ALLGEN, -1};
504 static INTBIG rcmos_pc_m2[]   = {-1, AMETAL2, ALLGEN, -1};
505 static INTBIG rcmos_pc_p[]    = {-1, APOLY, ALLGEN, -1};
506 static INTBIG rcmos_pc_st[]   = {-1, ASTRANS, ASACT, APOLY, ALLGEN, -1};
507 static INTBIG rcmos_pc_dt[]   = {-1, ADTRANS, ADACT, APOLY, ALLGEN, -1};
508 static INTBIG rcmos_pc_sa[]   = {-1, ASACT, ALLGEN, -1};
509 static INTBIG rcmos_pc_da[]   = {-1, ADACT, ALLGEN, -1};
510 static INTBIG rcmos_pc_sua[]  = {-1, ASUACT, ALLGEN, -1};
511 static INTBIG rcmos_pc_wea[]  = {-1, AWEACT, ALLGEN, -1};
512 static INTBIG rcmos_pc_suam1[]= {-1, AMETAL1, ASUACT, ALLGEN, -1};
513 static INTBIG rcmos_pc_weam1[]= {-1, AMETAL1, AWEACT, ALLGEN, -1};
514 static INTBIG rcmos_pc_sam1[] = {-1, ASACT, AMETAL1, ALLGEN, -1};
515 static INTBIG rcmos_pc_dam1[] = {-1, ADACT, AMETAL1, ALLGEN, -1};
516 static INTBIG rcmos_pc_pm1[]  = {-1, APOLY, AMETAL1, ALLGEN, -1};
517 static INTBIG rcmos_pc_mm[]   = {-1, AMETAL1, AMETAL2, ALLGEN, -1};
518 static INTBIG rcmos_pc_null[] = {-1, ALLGEN, -1};
519 
520 /******************** NODES ********************/
521 
522 #define NODEPROTOCOUNT 26
523 #define NMETAL1P        1	/* metal-1 pin */
524 #define NMETAL2P        2	/* metal-2 pin */
525 #define NPOLYP          3	/* polysilicon pin */
526 #define NSACTP          4	/* S-active pin */
527 #define NDACTP          5	/* D-active pin */
528 #define NSUACTP         6	/* Substrate active pin */
529 #define NWEACTP         7	/* Well active pin */
530 #define NSTRANSP        8	/* S-transistor pin */
531 #define NDTRANSP        9	/* D-transistor pin */
532 #define NMETSACTC      10	/* metal-1-S-active contact */
533 #define NMETDACTC      11	/* metal-1-D-active contact */
534 #define NMETPOLYC      12	/* metal-1-polysilicon contact */
535 #define NVIA           13	/* metal-1-metal-2 contact */
536 #define NWBUT          14	/* metal-1-Well contact */
537 #define NSBUT          15	/* metal-1-Substrate contact */
538 #define NMETAL1N       16	/* metal-1 node */
539 #define NMETAL2N       17	/* metal-2 node */
540 #define NPOLYN         18	/* polysilicon node */
541 #define NACTIVEN       19	/* active node */
542 #define NSELECTN       20	/* select node */
543 #define NCUTN          21	/* cut node */
544 #define NPCUTN         22	/* poly cut node */
545 #define NACUTN         23	/* active cut node */
546 #define NVIAN          24	/* via node */
547 #define NWELLN         25	/* well node */
548 #define NPASSN         26	/* passivation node */
549 
550 /* for geometry */
551 static INTBIG rcmos_fullbox[8] = {LEFTEDGE, BOTEDGE, RIGHTEDGE, TOPEDGE};
552 static INTBIG rcmos_2round[8]  = {CENTER,   CENTER,  CENTERR1,  CENTER};
553 static INTBIG rcmos_4round[8]  = {CENTER,   CENTER,  CENTERR2,  CENTER};
554 static INTBIG rcmos_fullround[8]={CENTER,   CENTER,  RIGHTEDGE, CENTER};
555 static INTBIG rcmos_in1round[8]= {CENTER,   CENTER,  RIGHTIN1,  CENTER};
556 static INTBIG rcmos_in2round[8]= {CENTER,   CENTER,  RIGHTIN2,  CENTER};
557 static INTBIG rcmos_in4round[8]= {CENTER,   CENTER,  RIGHTIN4,  CENTER};
558 static INTBIG rcmos_tras1[8]   = {CENTER,   CENTER,  CENTER,    TOPIN2};
559 static INTBIG rcmos_tras2[8]   = {CENTER,   CENTER,  RIGHTIN2,  CENTER};
560 static INTBIG rcmos_tras3[8]   = {CENTER,   CENTER,  CENTER,    TOPEDGE};
561 static INTBIG rcmos_tras4[8]   = {CENTER,   CENTER,  CENTER,    TOPIN4};
562 static INTBIG rcmos_tras5[8]   = {CENTER,   CENTER,  RIGHTIN4,  CENTER};
563 
564 /* metal-1-pin */
565 static TECH_PORTS rcmos_pm1_p[] = {				/* ports */
566 	{rcmos_pc_m1, x_("metal-1"), NOPORTPROTO, (180<<PORTARANGESH),
567 		CENTER, CENTER, CENTER, CENTER}};
568 static TECH_POLYGON rcmos_pm1_l[] = {			/* layers */
569 	{LMETAL1, 0, 2, DISC, POINTS, rcmos_fullround}};
570 static TECH_NODES rcmos_pm1 = {
571 	x_("Metal-1-Pin"),NMETAL1P,NONODEPROTO,		/* name */
572 	K3,K3,										/* size */
573 	1,rcmos_pm1_p,								/* ports */
574 	1,rcmos_pm1_l,								/* layers */
575 	(NPPIN<<NFUNCTIONSH)|NSQUARE,				/* userbits */
576 	0,0,0,0,0,0,0,0,0};							/* characteristics */
577 
578 /* metal-2-pin */
579 static TECH_PORTS rcmos_pm2_p[] = {				/* ports */
580 	{rcmos_pc_m2, x_("metal-2"), NOPORTPROTO, (180<<PORTARANGESH),
581 		CENTER, CENTER, CENTER, CENTER}};
582 static TECH_POLYGON rcmos_pm2_l[] = {			/* layers */
583 	{LMETAL2, 0, 2, DISC, POINTS, rcmos_fullround}};
584 static TECH_NODES rcmos_pm2 = {
585 	x_("Metal-2-Pin"),NMETAL2P,NONODEPROTO,		/* name */
586 	K3,K3,										/* size */
587 	1,rcmos_pm2_p,								/* ports */
588 	1,rcmos_pm2_l,								/* layers */
589 	(NPPIN<<NFUNCTIONSH)|NSQUARE,				/* userbits */
590 	0,0,0,0,0,0,0,0,0};							/* characteristics */
591 
592 /* polysilicon-pin */
593 static TECH_PORTS rcmos_pp_p[] = {				/* ports */
594 	{rcmos_pc_p, x_("polysilicon"), NOPORTPROTO, (180<<PORTARANGESH),
595 		CENTER, CENTER, CENTER, CENTER}};
596 static TECH_POLYGON rcmos_pp_l[] = {			/* layers */
597 	{LPOLY,  0, 2, DISC, POINTS, rcmos_fullround}};
598 static TECH_NODES rcmos_pp = {
599 	x_("Polysilicon-Pin"),NPOLYP,NONODEPROTO,	/* name */
600 	K2,K2,										/* size */
601 	1,rcmos_pp_p,								/* ports */
602 	1,rcmos_pp_l,								/* layers */
603 	(NPPIN<<NFUNCTIONSH)|NSQUARE,				/* userbits */
604 	0,0,0,0,0,0,0,0,0};							/* characteristics */
605 
606 /* S-active-pin */
607 static TECH_PORTS rcmos_psa_p[] = {				/* ports */
608 	{rcmos_pc_sa, x_("s-active"), NOPORTPROTO, (180<<PORTARANGESH),
609 		CENTER, CENTER, CENTER, CENTER}};
610 static TECH_POLYGON rcmos_psa_l[] = {			/* layers */
611 	{LSACT,    0, 2, DISC, POINTS, rcmos_in2round},
612 	{LSELECT, -1, 2, DISC, POINTS, rcmos_fullround}};
613 static TECH_NODES rcmos_psa = {
614 	x_("S-Active-Pin"),NSACTP,NONODEPROTO,		/* name */
615 	K6,K6,										/* size */
616 	1,rcmos_psa_p,								/* ports */
617 	2,rcmos_psa_l,								/* layers */
618 	(NPPIN<<NFUNCTIONSH)|NSQUARE,				/* userbits */
619 	0,0,0,0,0,0,0,0,0};							/* characteristics */
620 
621 /* D-active-pin */
622 static TECH_PORTS rcmos_pda_p[] = {				/* ports */
623 	{rcmos_pc_da, x_("d-active"), NOPORTPROTO, (180<<PORTARANGESH),
624 		CENTER, CENTER, CENTER, CENTER}};
625 static TECH_POLYGON rcmos_pda_l[] = {			/* layers */
626 	{LDACT,  0, 2, DISC, POINTS, rcmos_in4round},
627 	{LWELL, -1, 2, DISC, POINTS, rcmos_fullround}};
628 static TECH_NODES rcmos_pda = {
629 	x_("D-Active-Pin"),NDACTP,NONODEPROTO,		/* name */
630 	K10,K10,									/* size */
631 	1,rcmos_pda_p,								/* ports */
632 	2,rcmos_pda_l,								/* layers */
633 	(NPPIN<<NFUNCTIONSH)|NSQUARE,				/* userbits */
634 	0,0,0,0,0,0,0,0,0};							/* characteristics */
635 
636 /* Substrate active-pin */
637 static TECH_PORTS rcmos_psu_p[] = {				/* ports */
638 	{rcmos_pc_sua, x_("active"), NOPORTPROTO, (180<<PORTARANGESH),
639 		CENTER, CENTER, CENTER, CENTER}};
640 static TECH_POLYGON rcmos_psu_l[] = {			/* layers */
641 	{LDACT,  0, 2, DISC, POINTS, rcmos_fullround},
642 	{LSACT,  0, 2, DISC, POINTS, rcmos_fullround}};
643 static TECH_NODES rcmos_psu = {
644 	x_("Substrate-Active-Pin"),NSUACTP,NONODEPROTO,	/* name */
645 	K2,K2,										/* size */
646 	1,rcmos_psu_p,								/* ports */
647 	2,rcmos_psu_l,								/* layers */
648 	(NPPIN<<NFUNCTIONSH)|NSQUARE,				/* userbits */
649 	0,0,0,0,0,0,0,0,0};							/* characteristics */
650 
651 /* Well active-pin */
652 static TECH_PORTS rcmos_pwe_p[] = {				/* ports */
653 	{rcmos_pc_wea, x_("active"), NOPORTPROTO, (180<<PORTARANGESH),
654 		CENTER, CENTER, CENTER, CENTER}};
655 static TECH_POLYGON rcmos_pwe_l[] = {			/* layers */
656 	{LDACT,  0, 2, DISC, POINTS, rcmos_in2round},
657 	{LSACT,  0, 2, DISC, POINTS, rcmos_in2round},
658 	{LWELL,  0, 2, DISC, POINTS, rcmos_fullround},
659 	{LSELECT,0, 2, DISC, POINTS, rcmos_in1round}};
660 static TECH_NODES rcmos_pwe = {
661 	x_("Well-Active-Pin"),NWEACTP,NONODEPROTO,	/* name */
662 	K6,K6,										/* size */
663 	1,rcmos_pwe_p,								/* ports */
664 	4,rcmos_pwe_l,								/* layers */
665 	(NPPIN<<NFUNCTIONSH)|NSQUARE,				/* userbits */
666 	0,0,0,0,0,0,0,0,0};							/* characteristics */
667 
668 /* S-transistor pin */
669 static TECH_PORTS rcmos_tsa_p[] = {				/* ports */
670 	{rcmos_pc_st,  x_("s-trans"),  NOPORTPROTO, (180<<PORTARANGESH)|PORTISOLATED,
671 		CENTER, CENTER, CENTER, CENTER}};
672 static TECH_POLYGON rcmos_tsa_l[] = {			/* layers */
673 	{LSACT,   0, 2, DISC,   POINTS, rcmos_tras1},
674 	{LPOLY,   0, 2, DISC,   POINTS, rcmos_tras2},
675 	{LSELECT,-1, 2, DISC,   POINTS, rcmos_tras3}};
676 static TECH_NODES rcmos_tsa = {
677 	x_("S-Transistor"),NSTRANSP,NONODEPROTO,	/* name */
678 	K6,K6,										/* size */
679 	1,rcmos_tsa_p,								/* ports */
680 	3,rcmos_tsa_l,								/* layers */
681 	(NPPIN<<NFUNCTIONSH),						/* userbits */
682 	0,0,0,0,0,0,0,0,0};							/* characteristics */
683 
684 /* D-transistor */
685 static TECH_PORTS rcmos_tda_p[] = {				/* ports */
686 	{rcmos_pc_dt,  x_("d-trans"),  NOPORTPROTO, (180<<PORTARANGESH)|PORTISOLATED,
687 		CENTER, CENTER, CENTER, CENTER}};
688 static TECH_POLYGON rcmos_tda_l[] = {			/* layers */
689 	{LDACT,   0, 2, DISC,   POINTS, rcmos_tras4},
690 	{LPOLY,   0, 2, DISC,   POINTS, rcmos_tras5},
691 	{LWELL,  -1, 2, DISC,   POINTS, rcmos_tras3}};
692 static TECH_NODES rcmos_tda = {
693 	x_("D-Transistor"),NDTRANSP,NONODEPROTO,	/* name */
694 	K10,K10,									/* size */
695 	1,rcmos_tda_p,								/* ports */
696 	3,rcmos_tda_l,								/* layers */
697 	(NPPIN<<NFUNCTIONSH),						/* userbits */
698 	0,0,0,0,0,0,0,0,0};							/* characteristics */
699 
700 /* metal-1-S-active-contact */
701 static TECH_PORTS rcmos_msa_p[] = {				/* ports */
702 	{rcmos_pc_sam1, x_("metal-1-s-act"), NOPORTPROTO, (180<<PORTARANGESH),
703 		CENTER, CENTER, CENTER, CENTER}};
704 static TECH_POLYGON rcmos_msa_l[] = {			/* layers */
705 	{LMETAL1, 0, 2, DISC, POINTS, rcmos_4round},
706 	{LSACT,   0, 2, DISC, POINTS, rcmos_in2round},
707 	{LSELECT, 0, 2, DISC, POINTS, rcmos_fullround},
708 	{LACTCUT, 0, 2, DISC, POINTS, rcmos_2round}};
709 static TECH_NODES rcmos_msa = {
710 	x_("Metal-1-S-Active-Con"),NMETSACTC,NONODEPROTO,/* name */
711 	K10,K10,									/* size */
712 	1,rcmos_msa_p,								/* ports */
713 	4,rcmos_msa_l,								/* layers */
714 	(NPCONTACT<<NFUNCTIONSH)|NSQUARE,			/* userbits */
715 	0,0,0,0,0,0,0,0,0};							/* characteristics */
716 
717 /* metal-1-D-active-contact */
718 static TECH_PORTS rcmos_mda_p[] = {				/* ports */
719 	{rcmos_pc_dam1, x_("metal-1-d-act"), NOPORTPROTO, (180<<PORTARANGESH),
720 		CENTER, CENTER, CENTER, CENTER}};
721 static TECH_POLYGON rcmos_mda_l[] = {			/* layers */
722 	{LMETAL1, 0, 2, DISC, POINTS, rcmos_4round},
723 	{LDACT,   0, 2, DISC, POINTS, rcmos_in4round},
724 	{LWELL,  -1, 2, DISC, POINTS, rcmos_fullround},
725 	{LACTCUT, 0, 2, DISC, POINTS, rcmos_2round}};
726 static TECH_NODES rcmos_mda = {
727 	x_("Metal-1-D-Active-Con"),NMETDACTC,NONODEPROTO,/* name */
728 	K14,K14,									/* size */
729 	1,rcmos_mda_p,								/* ports */
730 	4,rcmos_mda_l,								/* layers */
731 	(NPCONTACT<<NFUNCTIONSH)|NSQUARE,			/* userbits */
732 	0,0,0,0,0,0,0,0,0};							/* characteristics */
733 
734 /* metal-1-polysilicon-contact */
735 static TECH_PORTS rcmos_mp_p[] = {				/* ports */
736 	{rcmos_pc_pm1, x_("metal-1-polysilicon"), NOPORTPROTO, (180<<PORTARANGESH),
737 		CENTER, CENTER, CENTER, CENTER}};
738 static TECH_POLYGON rcmos_mp_l[] = {			/* layers */
739 	{LMETAL1,  0, 2, DISC, POINTS, rcmos_4round},
740 	{LPOLY,    0, 2, DISC, POINTS, rcmos_fullround},
741 	{LPOLYCUT, 0, 2, DISC, POINTS, rcmos_2round}};
742 static TECH_NODES rcmos_mp = {
743 	x_("Metal-1-Polysilicon-Con"),NMETPOLYC,NONODEPROTO,/* name */
744 	K6,K6,										/* size */
745 	1,rcmos_mp_p,								/* ports */
746 	3,rcmos_mp_l,								/* layers */
747 	(NPCONTACT<<NFUNCTIONSH)|NSQUARE,			/* userbits */
748 	0,0,0,0,0,0,0,0,0};							/* characteristics */
749 
750 /* metal-1-metal-2-contact */
751 static TECH_PORTS rcmos_mm_p[] = {				/* ports */
752 	{rcmos_pc_mm, x_("metal-1-metal-2"), NOPORTPROTO, (180<<PORTARANGESH),
753 		CENTER, CENTER, CENTER, CENTER}};
754 static TECH_POLYGON rcmos_mm_l[] = {			/* layers */
755 	{LMETAL1, 0, 2, DISC,   POINTS, rcmos_fullround},
756 	{LMETAL2, 0, 2, DISC,   POINTS, rcmos_fullround},
757 	{LVIA,    0, 2, CIRCLE, POINTS, rcmos_2round}};
758 static TECH_NODES rcmos_mm = {
759 	x_("Metal-1-Metal-2-Con"),NVIA,NONODEPROTO,	/* name */
760 	K4,K4,										/* size */
761 	1,rcmos_mm_p,								/* ports */
762 	3,rcmos_mm_l,								/* layers */
763 	(NPCONTACT<<NFUNCTIONSH)|NSQUARE,			/* userbits */
764 	0,0,0,0,0,0,0,0,0};							/* characteristics */
765 
766 /* Metal-1-Well Contact */
767 static TECH_PORTS rcmos_psub_p[] = {			/* ports */
768 	{rcmos_pc_weam1, x_("metal-1-well"), NOPORTPROTO, (180<<PORTARANGESH),
769 		CENTER, CENTER, CENTER, CENTER}};
770 static TECH_POLYGON rcmos_psub_l[] = {			/* layers */
771 	{LMETAL1, 0, 2, DISC, POINTS, rcmos_4round},
772 	{LSACT,   0, 2, DISC, POINTS, rcmos_in2round},
773 	{LWELL,  -1, 2, DISC, POINTS, rcmos_fullround},
774 	{LSELECT,-1, 2, DISC, POINTS, rcmos_in2round},
775 	{LACTCUT, 0, 2, DISC, POINTS, rcmos_2round}};
776 static TECH_NODES rcmos_psub = {
777 	x_("Metal-1-Well-Con"),NWBUT,NONODEPROTO,	/* name */
778 	K10,K10,									/* size */
779 	1,rcmos_psub_p,								/* ports */
780 	5,rcmos_psub_l,								/* layers */
781 	(NPWELL<<NFUNCTIONSH)|NSQUARE,				/* userbits */
782 	0,0,0,0,0,0,0,0,0};							/* characteristics */
783 
784 /* Metal-1-Substrate Contact */
785 static TECH_PORTS rcmos_nsub_p[] = {			/* ports */
786 	{rcmos_pc_suam1, x_("metal-1-substrate"), NOPORTPROTO, (180<<PORTARANGESH),
787 		CENTER, CENTER, CENTER, CENTER}};
788 static TECH_POLYGON rcmos_nsub_l[] = {			/* layers */
789 	{LMETAL1, 0, 2, DISC, POINTS, rcmos_4round},
790 	{LDACT,   0, 2, DISC, POINTS, rcmos_fullround},
791 	{LACTCUT, 0, 2, DISC, POINTS, rcmos_2round}};
792 static TECH_NODES rcmos_nsub = {
793 	x_("Metal-1-Substrate-Con"),NSBUT,NONODEPROTO,	/* name */
794 	K6,K6,										/* size */
795 	1,rcmos_nsub_p,								/* ports */
796 	3,rcmos_nsub_l,								/* layers */
797 	(NPSUBSTRATE<<NFUNCTIONSH)|NSQUARE,			/* userbits */
798 	0,0,0,0,0,0,0,0,0};							/* characteristics */
799 
800 /* Metal-1-Node */
801 static TECH_PORTS rcmos_m1_p[] = {				/* ports */
802 	{rcmos_pc_m1, x_("metal-1"), NOPORTPROTO, (180<<PORTARANGESH),
803 		LEFTIN1H, BOTIN1H, RIGHTIN1H, TOPIN1H}};
804 static TECH_POLYGON rcmos_m1_l[] = {			/* layers */
805 	{LMETAL1, 0, 4, FILLEDRECT, BOX, rcmos_fullbox}};
806 static TECH_NODES rcmos_m1 = {
807 	x_("Metal-1-Node"),NMETAL1N,NONODEPROTO,	/* name */
808 	K4,K4,										/* size */
809 	1,rcmos_m1_p,								/* ports */
810 	1,rcmos_m1_l,								/* layers */
811 	(NPNODE<<NFUNCTIONSH)|HOLDSTRACE,			/* userbits */
812 	POLYGONAL,0,0,0,0,0,0,0,0};					/* characteristics */
813 
814 /* Metal-2-Node */
815 static TECH_PORTS rcmos_m2_p[] = {				/* ports */
816 	{rcmos_pc_m2, x_("metal-2"), NOPORTPROTO, (180<<PORTARANGESH),
817 		LEFTIN1H, BOTIN1H, RIGHTIN1H, TOPIN1H}};
818 static TECH_POLYGON rcmos_m2_l[] = {			/* layers */
819 	{LMETAL2, 0, 4, FILLEDRECT, BOX, rcmos_fullbox}};
820 static TECH_NODES rcmos_m2 = {
821 	x_("Metal-2-Node"),NMETAL2N,NONODEPROTO,	/* name */
822 	K4,K4,										/* size */
823 	1,rcmos_m2_p,								/* ports */
824 	1,rcmos_m2_l,								/* layers */
825 	(NPNODE<<NFUNCTIONSH)|HOLDSTRACE,			/* userbits */
826 	POLYGONAL,0,0,0,0,0,0,0,0};					/* characteristics */
827 
828 /* Polysilicon-Node */
829 static TECH_PORTS rcmos_p_p[] = {				/* ports */
830 	{rcmos_pc_p, x_("polysilicon"), NOPORTPROTO, (180<<PORTARANGESH),
831 		LEFTIN1, BOTIN1, RIGHTIN1, TOPIN1}};
832 static TECH_POLYGON rcmos_p_l[] = {				/* layers */
833 	{LPOLY, 0, 4, FILLEDRECT, BOX, rcmos_fullbox}};
834 static TECH_NODES rcmos_p = {
835 	x_("Polysilicon-Node"),NPOLYN,NONODEPROTO,	/* name */
836 	K4,K4,										/* size */
837 	1,rcmos_p_p,								/* ports */
838 	1,rcmos_p_l,								/* layers */
839 	(NPNODE<<NFUNCTIONSH)|HOLDSTRACE,			/* userbits */
840 	POLYGONAL,0,0,0,0,0,0,0,0};					/* characteristics */
841 
842 /* Active-Node */
843 static TECH_PORTS rcmos_a_p[] = {				/* ports */
844 	{rcmos_pc_null, x_("active"), NOPORTPROTO, (180<<PORTARANGESH),
845 		LEFTIN1, BOTIN1, RIGHTIN1, TOPIN1}};
846 static TECH_POLYGON rcmos_a_l[] = {				/* layers */
847 	{LSACT, 0, 4, FILLEDRECT, BOX, rcmos_fullbox}};
848 static TECH_NODES rcmos_a = {
849 	x_("Active-Node"),NACTIVEN,NONODEPROTO,		/* name */
850 	K4,K4,										/* size */
851 	1,rcmos_a_p,								/* ports */
852 	1,rcmos_a_l,								/* layers */
853 	(NPNODE<<NFUNCTIONSH)|HOLDSTRACE,			/* userbits */
854 	POLYGONAL,0,0,0,0,0,0,0,0};					/* characteristics */
855 
856 /* Select-Node */
857 static TECH_PORTS rcmos_s_p[] = {				/* ports */
858 	{rcmos_pc_null, x_("select"), NOPORTPROTO, (180<<PORTARANGESH),
859 		LEFTEDGE, BOTEDGE, RIGHTEDGE, TOPEDGE}};
860 static TECH_POLYGON rcmos_s_l[] = {				/* layers */
861 	{LSELECT, 0, 4, FILLEDRECT, BOX, rcmos_fullbox}};
862 static TECH_NODES rcmos_s = {
863 	x_("Select-Node"),NSELECTN,NONODEPROTO,		/* name */
864 	K6,K6,										/* size */
865 	1,rcmos_s_p,								/* ports */
866 	1,rcmos_s_l,								/* layers */
867 	(NPNODE<<NFUNCTIONSH)|HOLDSTRACE,			/* userbits */
868 	POLYGONAL,0,0,0,0,0,0,0,0};					/* characteristics */
869 
870 /* Cut-Node */
871 static TECH_PORTS rcmos_c_p[] = {				/* ports */
872 	{rcmos_pc_null, x_("cut"), NOPORTPROTO, (180<<PORTARANGESH),
873 		LEFTEDGE, BOTEDGE, RIGHTEDGE, TOPEDGE}};
874 static TECH_POLYGON rcmos_c_l[] = {				/* layers */
875 	{LCUT, 0, 4, FILLEDRECT, BOX, rcmos_fullbox}};
876 static TECH_NODES rcmos_c = {
877 	x_("Cut-Node"),NCUTN,NONODEPROTO,			/* name */
878 	K2,K2,										/* size */
879 	1,rcmos_c_p,								/* ports */
880 	1,rcmos_c_l,								/* layers */
881 	(NPNODE<<NFUNCTIONSH)|HOLDSTRACE,			/* userbits */
882 	POLYGONAL,0,0,0,0,0,0,0,0};					/* characteristics */
883 
884 /* PolyCut-Node */
885 static TECH_PORTS rcmos_gc_p[] = {				/* ports */
886 	{rcmos_pc_null, x_("polycut"), NOPORTPROTO, (180<<PORTARANGESH),
887 		LEFTEDGE, BOTEDGE, RIGHTEDGE, TOPEDGE}};
888 static TECH_POLYGON rcmos_gc_l[] = {			/* layers */
889 	{LPOLYCUT, 0, 4, FILLEDRECT, BOX, rcmos_fullbox}};
890 static TECH_NODES rcmos_gc = {
891 	x_("Poly-Cut-Node"),NPCUTN,NONODEPROTO,		/* name */
892 	K2,K2,										/* size */
893 	1,rcmos_gc_p,								/* ports */
894 	1,rcmos_gc_l,								/* layers */
895 	(NPNODE<<NFUNCTIONSH)|HOLDSTRACE,			/* userbits */
896 	POLYGONAL,0,0,0,0,0,0,0,0};					/* characteristics */
897 
898 /* ActiveCut-Node */
899 static TECH_PORTS rcmos_ac_p[] = {				/* ports */
900 	{rcmos_pc_null, x_("activecut"), NOPORTPROTO, (180<<PORTARANGESH),
901 		LEFTEDGE, BOTEDGE, RIGHTEDGE, TOPEDGE}};
902 static TECH_POLYGON rcmos_ac_l[] = {			/* layers */
903 	{LACTCUT, 0, 4, FILLEDRECT, BOX, rcmos_fullbox}};
904 static TECH_NODES rcmos_ac = {
905 	x_("Active-Cut-Node"),NACUTN,NONODEPROTO,	/* name */
906 	K2,K2,										/* size */
907 	1,rcmos_ac_p,								/* ports */
908 	1,rcmos_ac_l,								/* layers */
909 	(NPNODE<<NFUNCTIONSH)|HOLDSTRACE,			/* userbits */
910 	POLYGONAL,0,0,0,0,0,0,0,0};					/* characteristics */
911 
912 /* Via-Node */
913 static TECH_PORTS rcmos_v_p[] = {				/* ports */
914 	{rcmos_pc_null, x_("via"), NOPORTPROTO, (180<<PORTARANGESH),
915 		LEFTEDGE, BOTEDGE, RIGHTEDGE, TOPEDGE}};
916 static TECH_POLYGON rcmos_v_l[] = {				/* layers */
917 	{LVIA, 0, 4, CLOSEDRECT, BOX, rcmos_fullbox}};
918 static TECH_NODES rcmos_v = {
919 	x_("Via-Node"),NVIAN,NONODEPROTO,			/* name */
920 	K2,K2,										/* size */
921 	1,rcmos_v_p,								/* ports */
922 	1,rcmos_v_l,								/* layers */
923 	(NPNODE<<NFUNCTIONSH)|HOLDSTRACE,			/* userbits */
924 	POLYGONAL,0,0,0,0,0,0,0,0};					/* characteristics */
925 
926 /* Well-Node */
927 static TECH_PORTS rcmos_w_p[] = {				/* ports */
928 	{rcmos_pc_sa, x_("well"), NOPORTPROTO, (180<<PORTARANGESH),
929 		LEFTIN3, BOTIN3, RIGHTIN3, TOPIN3}};
930 static TECH_POLYGON rcmos_w_l[] = {				/* layers */
931 	{LWELL, 0, 4, FILLEDRECT, BOX, rcmos_fullbox}};
932 static TECH_NODES rcmos_w = {
933 	x_("Well-Node"),NWELLN,NONODEPROTO,			/* name */
934 	K6,K6,										/* size */
935 	1,rcmos_w_p,								/* ports */
936 	1,rcmos_w_l,								/* layers */
937 	(NPNODE<<NFUNCTIONSH)|HOLDSTRACE,			/* userbits */
938 	POLYGONAL,0,0,0,0,0,0,0,0};					/* characteristics */
939 
940 /* Passivation-node */
941 static TECH_PORTS rcmos_o_p[] = {				/* ports */
942 	{rcmos_pc_null, x_("passivation"), NOPORTPROTO, (180<<PORTARANGESH),
943 		LEFTEDGE, BOTEDGE, RIGHTEDGE, TOPEDGE}};
944 static TECH_POLYGON rcmos_o_l[] = {				/* layers */
945 	{LPASS, 0, 4, FILLEDRECT, BOX, rcmos_fullbox}};
946 static TECH_NODES rcmos_o = {
947 	x_("Passivation-Node"),NPASSN,NONODEPROTO,	/* name */
948 	K8,K8,										/* size */
949 	1,rcmos_o_p,								/* ports */
950 	1,rcmos_o_l,								/* layers */
951 	(NPNODE<<NFUNCTIONSH)|HOLDSTRACE,			/* userbits */
952 	POLYGONAL,0,0,0,0,0,0,0,0};					/* characteristics */
953 
954 TECH_NODES *rcmos_nodeprotos[NODEPROTOCOUNT+1] = {
955 	&rcmos_pm1, &rcmos_pm2, &rcmos_pp, &rcmos_psa, &rcmos_pda,
956 	&rcmos_psu, &rcmos_pwe,
957 	&rcmos_tsa, &rcmos_tda,
958 	&rcmos_msa, &rcmos_mda, &rcmos_mp,
959 	&rcmos_mm,
960 	&rcmos_psub, &rcmos_nsub,
961 	&rcmos_m1, &rcmos_m2, &rcmos_p, &rcmos_a, &rcmos_s,
962 	&rcmos_c, &rcmos_gc, &rcmos_ac, &rcmos_v, &rcmos_w, &rcmos_o, ((TECH_NODES *)-1)};
963 
964 /* this table must correspond with the above table */
965 static INTBIG rcmos_node_widoff[NODEPROTOCOUNT*4] = {
966 	0,0,0,0, 0,0,0,0, 0,0,0,0, K2,K2,K2,K2, K4,K4,K4,K4,	/* pins */
967 	0,0,0,0, K2,K2,K2,K2,
968 	K2,K2,K2,K2, K4,K4,K4,K4,								/* tran pin */
969 	K2,K2,K2,K2, K4,K4,K4,K4, 0,0,0,0,						/* contacts */
970 	0,0,0,0,												/* vias */
971 	K2,K2,K2,K2, 0,0,0,0,									/* buttons */
972 	0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,			/* nodes */
973 	0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};
974 
975 
976 /******************** SIMULATION VARIABLES ********************/
977 
978 /* for SPICE simulation */
979 #define RCMOS_MIN_RESIST	50.0f	/* minimum resistance consider */
980 #define RCMOS_MIN_CAPAC	     0.04f	/* minimum capacitance consider */
981 static float rcmos_sim_spice_resistance[MAXLAYERS] = {  /* per square micron */
982 	0.03f /* METAL1 */,    0.03f /* METAL2 */,    50.0f /* POLY */,
983 	10.0f /* SACT */,      10.0f /* DACT */,
984 	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};
985 static float rcmos_sim_spice_capacitance[MAXLAYERS] = { /* per square micron */
986 	0.03f /* METAL1 */,    0.03f /* METAL2 */,    0.04f /* POLY */,
987 	0.1f /* SACT */,       0.1f /* DACT */,
988 	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};
989 static CHAR *rcmos_sim_spice_header_level1[] = {
990 	x_("*CMOS/BULK-NWELL (PRELIMINARY PARAMETERS)"),
991 	x_(".OPTIONS NOMOD DEFL=3UM DEFW=3UM DEFAD=70P DEFAS=70P LIMPTS=1000"),
992 	x_("+ITL4=1000 ITL5=0 RELTOL=0.01 ABSTOL=500PA VNTOL=500UV LVLTIM=2"),
993 	x_("+LVLCOD=1"),
994 	x_(".MODEL N NMOS LEVEL=1"),
995 	x_("+KP=60E-6 VTO=0.7 GAMMA=0.3 LAMBDA=0.05 PHI=0.6"),
996 	x_("+LD=0.4E-6 TOX=40E-9 CGSO=2.0E-10 CGDO=2.0E-10 CJ=.2MF/M^2"),
997 	x_(".MODEL P PMOS LEVEL=1"),
998 	x_("+KP=20E-6 VTO=0.7 GAMMA=0.4 LAMBDA=0.05 PHI=0.6"),
999 	x_("+LD=0.6E-6 TOX=40E-9 CGSO=3.0E-10 CGDO=3.0E-10 CJ=.2MF/M^2"),
1000 	x_(".MODEL DIFFCAP D CJO=.2MF/M^2"),
1001 	NOSTRING};
1002 static CHAR *rcmos_sim_spice_header_level2[] = {
1003 	x_("* CMOS 3um process parameters from MOSIS run M46M"),
1004 	x_("* CBPEM2 Telmos/Sierracin"),
1005 	x_(".OPTIONS NOMOD DEFL=3UM DEFW=3UM DEFAD=70P DEFAS=70P LIMPTS=1000"),
1006 	x_("+ITL4=1000 ITL5=0 RELTOL=0.01 ABSTOL=500PA VNTOL=500UV LVLTIM=2"),
1007 	x_("+LVLCOD=1"),
1008 	x_(".MODEL P PMOS LEVEL=2 LD=0.51286U TOX=500E-10"),
1009 	x_("+NSUB=2.971614E+14 VTO=-0.844293 KP=1.048805E-5 GAMMA=0.723071"),
1010 	x_("+PHI=0.6 UO=100.0 UEXP=0.145531 UCRIT=18543.6"),
1011 	x_("+DELTA=2.19030 VMAX=100000. XJ=2.583588E-2U LAMBDA=5.274834E-2"),
1012 	x_("+NFS=1.615644E+12 NEFF=1.001E-2 NSS=0. TPG=-1."),
1013 	x_("+RSH=95 CGSO=4E-10 CGDO=4E-10 CJ=2E-4 MJ=0.5 CJSW=4.5E-10 MJSW=0.33"),
1014 	x_(".MODEL N NMOS LEVEL=2 LD=0.245423U TOX=500E-10"),
1015 	x_("+NSUB=1E+16 VTO=0.932797 KP=2.696667E-5 GAMMA=1.28047"),
1016 	x_("+PHI=0.6 UO=381.905 UEXP=1.001E-3 UCRIT=999000"),
1017 	x_("+DELTA=1.47242 VMAX=55346.3 XJ=0.145596U LAMBDA=2.491255E-2"),
1018 	x_("+NFS=3.727796E+11 NEFF=1.001E-2 NSS=0 TPG=1"),
1019 	x_("+RSH=25 CGSO=5.2E-10 CGDO=5.2E-10 CJ=3.2E-4 MJ=0.5 CJSW=9E-10"),
1020 	x_("+MJSW=0.33"),
1021 	NOSTRING};
1022 
1023 /******************** VARIABLE AGGREGATION ********************/
1024 
1025 TECH_VARIABLES rcmos_variables[] =
1026 {
1027 	/* set general information about the technology */
1028 	{x_("TECH_layer_names"), (CHAR *)rcmos_layer_names, 0.0,
1029 		VSTRING|VDONTSAVE|VISARRAY|(MAXLAYERS<<VLENGTHSH)},
1030 	{x_("TECH_layer_function"), (CHAR *)rcmos_layer_function, 0.0,
1031 		VINTEGER|VDONTSAVE|VISARRAY|(MAXLAYERS<<VLENGTHSH)},
1032 	{x_("TECH_arc_width_offset"), (CHAR *)rcmos_arc_widoff, 0.0,
1033 		VFRACT|VDONTSAVE|VISARRAY|(ARCPROTOCOUNT<<VLENGTHSH)},
1034 	{x_("TECH_node_width_offset"), (CHAR *)rcmos_node_widoff, 0.0,
1035 		VFRACT|VDONTSAVE|VISARRAY|((NODEPROTOCOUNT*4)<<VLENGTHSH)},
1036 
1037 	/* set information for the USER tool */
1038 	{x_("USER_color_map"), (CHAR *)rcmos_colmap, 0.0,
1039 		VCHAR|VDONTSAVE|VISARRAY|((sizeof rcmos_colmap)<<VLENGTHSH)},
1040 	{x_("USER_layer_letters"), (CHAR *)rcmos_layer_letters, 0.0,
1041 		VSTRING|VDONTSAVE|VISARRAY|(MAXLAYERS<<VLENGTHSH)},
1042 
1043 			/* set information for the I/O tool */
1044 	{x_("IO_cif_layer_names"), (CHAR *)rcmos_cif_layers, 0.0,
1045 		VSTRING|VDONTSAVE|VISARRAY|(MAXLAYERS<<VLENGTHSH)},
1046 
1047 	/* set information for the SIM tool (SPICE) */
1048 	{x_("SIM_spice_min_resistance"), 0, RCMOS_MIN_RESIST, VFLOAT|VDONTSAVE},
1049 	{x_("SIM_spice_min_capacitance"), 0, RCMOS_MIN_CAPAC, VFLOAT|VDONTSAVE},
1050 	{x_("SIM_spice_resistance"), (CHAR *)rcmos_sim_spice_resistance, 0.0,
1051 		VFLOAT|VISARRAY|(MAXLAYERS<<VLENGTHSH)|VDONTSAVE},
1052 	{x_("SIM_spice_capacitance"), (CHAR *)rcmos_sim_spice_capacitance, 0.0,
1053 		VFLOAT|VISARRAY|(MAXLAYERS<<VLENGTHSH)|VDONTSAVE},
1054 	{x_("SIM_spice_header_level1"), (CHAR *)rcmos_sim_spice_header_level1, 0.0,
1055 		VSTRING|VDONTSAVE|VISARRAY},
1056 	{x_("SIM_spice_header_level2"), (CHAR *)rcmos_sim_spice_header_level2, 0.0,
1057 		VSTRING|VDONTSAVE|VISARRAY},
1058 	{NULL, NULL, 0.0, 0}
1059 };
1060 
1061 /******************** ROUTINES ********************/
1062 
rcmos_initprocess(TECHNOLOGY * tech,INTBIG pass)1063 BOOLEAN rcmos_initprocess(TECHNOLOGY *tech, INTBIG pass)
1064 {
1065 	if (pass == 0) rcmos_tech = tech;
1066 	return(FALSE);
1067 }
1068 
rcmos_arcpolys(ARCINST * ai,WINDOWPART * win)1069 INTBIG rcmos_arcpolys(ARCINST *ai, WINDOWPART *win)
1070 {
1071 	return(rcmos_intarcpolys(ai, win, &tech_oneprocpolyloop, &rcmos_oneprocpolyloop));
1072 }
1073 
rcmos_intarcpolys(ARCINST * ai,WINDOWPART * win,POLYLOOP * pl,RCMPOLYLOOP * rcmpl)1074 INTBIG rcmos_intarcpolys(ARCINST *ai, WINDOWPART *win, POLYLOOP *pl, RCMPOLYLOOP *rcmpl)
1075 {
1076 	REGISTER INTBIG widestp, widestd, i, lambda, pwid, dwid, orip, orid, amt;
1077 	REGISTER INTBIG total, aindex;
1078 	INTBIG lx, ly, hx, hy;
1079 	REGISTER NODEINST *ni;
1080 
1081 	if ((ai->userbits&ISNEGATED) != 0) tech_resetnegated(ai);
1082 	aindex = ai->proto->arcindex;
1083 	total = rcmos_arcprotos[aindex]->laycount;
1084 	if (aindex == ASTRANS || aindex == ADTRANS)
1085 	{
1086 		lambda = lambdaofarc(ai);
1087 
1088 		/* set defaults for the arc */
1089 		if (aindex == ASTRANS) amt = K4; else amt = K8;
1090 		rcmpl->list0off = amt;	/* diffusion */
1091 		rcmpl->list1off = amt;	/* polysilicon */
1092 		rcmpl->list2off = 0;	/* well/select */
1093 
1094 		/* determine the maximum and initial size of the arc */
1095 		widestp = widestd = ai->width - amt * lambda / WHOLE;
1096 		orip = widestp;   orid = widestd;
1097 
1098 		/* include the size of the nodes on the ends of the arc */
1099 		for(i=0; i<2; i++)
1100 		{
1101 			ni = ai->end[i].nodeinst;
1102 			if (ni->proto->tech != rcmos_tech) continue;
1103 			nodesizeoffset(ni, &lx, &ly, &hx, &hy);
1104 			lx = ni->lowx+lx;   hx = ni->highx-hx;
1105 			ly = ni->lowy+ly;   hy = ni->highy-hy;
1106 			pwid = hx - lx;
1107 			dwid = hy - ly;
1108 			if (pwid > orip || dwid > orid)
1109 				ttyputmsg(_("Warning: arc %s is too narrow for its %s node"),
1110 					describearcinst(ai), (i==0 ? _("tail") : _("head")));
1111 			if (pwid < widestp) widestp = pwid;
1112 			if (dwid < widestd) widestd = dwid;
1113 		}
1114 
1115 		/* set the true size of the arc */
1116 		rcmpl->list0off = (ai->width - widestd) * WHOLE / lambda;
1117 		rcmpl->list1off = (ai->width - widestp) * WHOLE / lambda;
1118 		rcmpl->list2off = rcmos_arcprotos[aindex]->list[0].off - amt;
1119 	}
1120 	total = tech_initcurvedarc(ai, total, pl);
1121 
1122 	/* add in displayable variables */
1123 	pl->realpolys = total;
1124 	total += tech_displayableavars(ai, win, pl);
1125 	return(total);
1126 }
1127 
rcmos_shapearcpoly(ARCINST * ai,INTBIG box,POLYGON * poly)1128 void rcmos_shapearcpoly(ARCINST *ai, INTBIG box, POLYGON *poly)
1129 {
1130 	rcmos_intshapearcpoly(ai, box, poly, &tech_oneprocpolyloop, &rcmos_oneprocpolyloop);
1131 }
1132 
rcmos_intshapearcpoly(ARCINST * ai,INTBIG box,POLYGON * poly,POLYLOOP * pl,RCMPOLYLOOP * rcmpl)1133 void rcmos_intshapearcpoly(ARCINST *ai, INTBIG box, POLYGON *poly, POLYLOOP *pl, RCMPOLYLOOP *rcmpl)
1134 {
1135 	REGISTER INTBIG aindex;
1136 	REGISTER TECH_ARCLAY *thista;
1137 
1138 	/* handle displayable variables */
1139 	if (box >= pl->realpolys)
1140 	{
1141 		(void)tech_filldisplayableavar(ai, poly, pl->curwindowpart, 0, pl);
1142 		return;
1143 	}
1144 
1145 	/* now handle curved arcs */
1146 	if (!tech_curvedarcpiece(ai, box, poly, rcmos_arcprotos, pl))
1147 	{
1148 		poly->desc = rcmos_layers[poly->layer];
1149 		return;
1150 	}
1151 
1152 	/* finally handle straight arcs */
1153 	aindex = ai->proto->arcindex;
1154 	thista = &rcmos_arcprotos[aindex]->list[box];
1155 	if (aindex == ASTRANS || aindex == ADTRANS)
1156 	{
1157 		rcmos_arcprotos[aindex]->list[0].off = rcmpl->list0off;	/* diffusion */
1158 		rcmos_arcprotos[aindex]->list[1].off = rcmpl->list1off;	/* polysilicon */
1159 		rcmos_arcprotos[aindex]->list[2].off = rcmpl->list2off;	/* well/select */
1160 	}
1161 	makearcpoly(ai->length, ai->width-thista->off*lambdaofarc(ai)/WHOLE, ai, poly, thista->style);
1162 	poly->layer = thista->lay;
1163 	poly->desc = rcmos_layers[poly->layer];
1164 }
1165 
rcmos_allarcpolys(ARCINST * ai,POLYLIST * plist,WINDOWPART * win)1166 INTBIG rcmos_allarcpolys(ARCINST *ai, POLYLIST *plist, WINDOWPART *win)
1167 {
1168 	REGISTER INTBIG tot, j;
1169 	POLYLOOP mypl;
1170 	RCMPOLYLOOP myrcmpl;
1171 
1172 	mypl.curwindowpart = win;
1173 	tot = rcmos_intarcpolys(ai, win, &mypl, &myrcmpl);
1174 	tot = mypl.realpolys;
1175 	if (ensurepolylist(plist, tot, db_cluster)) return(-1);
1176 	for(j = 0; j < tot; j++)
1177 	{
1178 		rcmos_intshapearcpoly(ai, j, plist->polygons[j], &mypl, &myrcmpl);
1179 	}
1180 	return(tot);
1181 }
1182