1 /* -*- tab-width: 4 -*-
2  *
3  * Electric(tm) VLSI Design System
4  *
5  * File: tech.h
6  * Technology header file
7  * Written by: Steven M. Rubin, Static Free Software
8  *
9  * Copyright (c) 2000 Static Free Software.
10  *
11  * Electric(tm) is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * Electric(tm) is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with Electric(tm); see the file COPYING.  If not, write to
23  * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
24  * Boston, Mass 02111-1307, USA.
25  *
26  * Static Free Software
27  * 4119 Alpine Road
28  * Portola Valley, California 94028
29  * info@staticfreesoft.com
30  */
31 
32 #if defined(__cplusplus) && !defined(ALLCPLUSPLUS)
33 extern "C"
34 {
35 #endif
36 
37 /******************** DIMENSIONS ********************/
38 
39 /* quarter unit fractions */
40 #define XX	  -WHOLE		/*  NULL */
41 #define K0	  0				/*  0.0  */
42 #define Q0    (WHOLE/4)		/*  0.25 */
43 #define H0    (WHOLE/2)		/*  0.5  */
44 #define T0    (H0+Q0)		/*  0.75 */
45 #define K1    (WHOLE)		/*  1.0  */
46 #define Q1    (K1+Q0)		/*  1.25 */
47 #define H1    (K1+H0)		/*  1.5  */
48 #define T1    (K1+T0)		/*  1.75 */
49 #define K2    (WHOLE*2)		/*  2.0  */
50 #define Q2    (K2+Q0)		/*  2.25 */
51 #define H2    (K2+H0)		/*  2.5  */
52 #define T2    (K2+T0)		/*  2.75 */
53 #define K3    (WHOLE*3)		/*  3.0  */
54 #define Q3    (K3+Q0)		/*  3.25 */
55 #define H3    (K3+H0)		/*  3.5  */
56 #define T3    (K3+T0)		/*  3.75 */
57 #define K4    (WHOLE*4)		/*  4.0  */
58 #define Q4    (K4+Q0)		/*  4.25 */
59 #define H4    (K4+H0)		/*  4.5  */
60 #define T4    (K4+T0)		/*  4.75 */
61 #define K5    (WHOLE*5)		/*  5.0  */
62 #define Q5    (K5+Q0)		/*  5.25 */
63 #define H5    (K5+H0)		/*  5.5  */
64 #define T5    (K5+T0)		/*  5.75 */
65 #define K6    (WHOLE*6)		/*  6.0  */
66 #define Q6    (K6+Q0)		/*  6.25 */
67 #define H6    (K6+H0)		/*  6.5  */
68 #define T6    (K6+T0)		/*  6.75 */
69 #define K7    (WHOLE*7)		/*  7.0  */
70 #define Q7    (K7+Q0)		/*  7.25 */
71 #define H7    (K7+H0)		/*  7.5  */
72 #define T7    (K7+T0)		/*  7.75 */
73 #define K8    (WHOLE*8)		/*  8.0  */
74 #define Q8    (K8+Q0)		/*  8.25 */
75 #define H8    (K8+H0)		/*  8.5  */
76 #define T8    (K8+T0)		/*  8.75 */
77 #define K9    (WHOLE*9)		/*  9.0  */
78 #define Q9    (K9+Q0)		/*  9.25 */
79 #define H9    (K9+H0)		/*  9.5  */
80 #define T9    (K9+T0)		/*  9.75 */
81 #define K10   (WHOLE*10)	/* 10.0  */
82 #define H10   (K10+H0)		/* 10.5  */
83 #define K11   (WHOLE*11)	/* 11.0  */
84 #define H11   (K11+H0)		/* 11.5  */
85 #define K12   (WHOLE*12)	/* 12.0  */
86 #define H12   (K12+H0)		/* 12.5  */
87 #define K13   (WHOLE*13)	/* 13.0  */
88 #define H13   (K13+H0)		/* 13.5  */
89 #define K14   (WHOLE*14)	/* 14.0  */
90 #define H14   (K14+H0)		/* 14.5  */
91 #define K15   (WHOLE*15)	/* 15.0  */
92 #define H15   (K15+H0)		/* 15.5  */
93 #define K16   (WHOLE*16)	/* 16.0  */
94 #define H16   (K16+H0)		/* 16.5  */
95 #define K17   (WHOLE*17)	/* 17.0  */
96 #define H17   (K17+H0)		/* 17.5  */
97 #define K18   (WHOLE*18)	/* 18.0  */
98 #define H18   (K18+H0)		/* 18.5  */
99 #define K19   (WHOLE*19)	/* 19.0  */
100 #define H19   (K19+H0)		/* 19.5  */
101 #define K20   (WHOLE*20)	/* 20.0  */
102 #define H20   (K20+H0)		/* 20.5  */
103 #define K21   (WHOLE*21)	/* 21.0  */
104 #define H21   (K21+H0)		/* 21.5  */
105 #define K22   (WHOLE*22)	/* 22.0  */
106 #define H22   (K22+H0)		/* 22.5  */
107 #define K23   (WHOLE*23)	/* 23.0  */
108 #define H23   (K23+H0)		/* 23.5  */
109 #define K24   (WHOLE*24)	/* 24.0  */
110 #define H24   (K24+H0)		/* 24.5  */
111 #define K25   (WHOLE*25)	/* 25.0  */
112 #define H25   (K25+H0)		/* 25.5  */
113 #define K26   (WHOLE*26)	/* 26.0  */
114 #define H26   (K26+H0)		/* 26.5  */
115 #define K27   (WHOLE*27)	/* 27.0  */
116 #define H27   (K27+H0)		/* 27.5  */
117 #define K28   (WHOLE*28)	/* 28.0  */
118 #define H28   (K28+H0)		/* 28.5  */
119 #define K29   (WHOLE*29)	/* 29.0  */
120 #define K30   (WHOLE*30)	/* 30.0  */
121 #define K31   (WHOLE*31)	/* 31.0  */
122 #define K32   (WHOLE*32)	/* 32.0  */
123 #define K35   (WHOLE*35)	/* 35.0  */
124 #define K37   (WHOLE*37)	/* 37.0  */
125 #define K38   (WHOLE*38)	/* 38.0  */
126 #define K39   (WHOLE*39)	/* 39.0  */
127 #define K44   (WHOLE*44)	/* 44.0  */
128 #define K55   (WHOLE*55)	/* 55.0  */
129 #define K57   (WHOLE*57)	/* 57.0  */
130 #define K135  (WHOLE*135)	/* 135.0 */
131 
132 /******************** DIMENSIONS CONVERTED TO EDGES ********************/
133 
134 #define CENTER      0,  0
135 
136 /* right of center by this amount */
137 #define CENTERR0H   0, H0	/* 0.5 */
138 #define CENTERR1    0, K1	/* 1.0 */
139 #define CENTERR1H   0, H1	/* 1.5 */
140 #define CENTERR2    0, K2	/* 2.0 */
141 #define CENTERR2H   0, H2	/* 2.5 */
142 #define CENTERR3    0, K3	/* 3.0 */
143 #define CENTERR3H   0, H3	/* 3.5 */
144 #define CENTERR4    0, K4	/* 4.0 */
145 #define CENTERR4H   0, H4	/* 4.5 */
146 #define CENTERR5    0, K5	/* 5.0 */
147 #define CENTERR5H   0, H5	/* 5.5 */
148 
149 /* up from center by this amount */
150 #define CENTERU0H   0, H0	/* 0.5 */
151 #define CENTERU1    0, K1	/* 1.0 */
152 #define CENTERU1H   0, H1	/* 1.5 */
153 #define CENTERU2    0, K2	/* 2.0 */
154 #define CENTERU2H   0, H2	/* 2.5 */
155 #define CENTERU3    0, K3	/* 3.0 */
156 #define CENTERU3H   0, H3	/* 3.5 */
157 #define CENTERU4    0, K4	/* 4.0 */
158 #define CENTERU4H   0, H4	/* 4.5 */
159 #define CENTERU5    0, K5	/* 5.0 */
160 #define CENTERU5H   0, H5	/* 5.5 */
161 
162 /* left of center by this amount */
163 #define CENTERL0H   0,-H0	/* 0.5 */
164 #define CENTERL1    0,-K1	/* 1.0 */
165 #define CENTERL1H   0,-H1	/* 1.5 */
166 #define CENTERL2    0,-K2	/* 2.0 */
167 #define CENTERL2H   0,-H2	/* 2.5 */
168 #define CENTERL3    0,-K3	/* 3.0 */
169 #define CENTERL3H   0,-H3	/* 3.5 */
170 #define CENTERL4    0,-K4	/* 4.0 */
171 #define CENTERL4H   0,-H4	/* 4.5 */
172 #define CENTERL5    0,-K5	/* 5.0 */
173 #define CENTERL5H   0,-H5	/* 5.5 */
174 
175 /* down from center by this amount */
176 #define CENTERD0H   0,-H0	/* 0.5 */
177 #define CENTERD1    0,-K1	/* 1.0 */
178 #define CENTERD1H   0,-H1	/* 1.5 */
179 #define CENTERD2    0,-K2	/* 2.0 */
180 #define CENTERD2H   0,-H2	/* 2.5 */
181 #define CENTERD3    0,-K3	/* 3.0 */
182 #define CENTERD3H   0,-H3	/* 3.5 */
183 #define CENTERD4    0,-K4	/* 4.0 */
184 #define CENTERD4H   0,-H4	/* 4.5 */
185 #define CENTERD5    0,-K5	/* 5.0 */
186 #define CENTERD5H   0,-H5	/* 5.5 */
187 
188 /* in from left edge by this amount */
189 #define LEFTEDGE  -H0,  0	/* 0.0 */
190 #define LEFTIN0Q  -H0, Q0	/* 0.25 */
191 #define LEFTIN0H  -H0, H0	/* 0.5  */
192 #define LEFTIN0T  -H0, T0	/* 0.75 */
193 #define LEFTIN1   -H0, K1	/* 1.0  */
194 #define LEFTIN1Q  -H0, Q1	/* 1.25 */
195 #define LEFTIN1H  -H0, H1	/* 1.5  */
196 #define LEFTIN1T  -H0, T1	/* 1.75 */
197 #define LEFTIN2   -H0, K2	/* 2.0  */
198 #define LEFTIN2Q  -H0, Q2	/* 2.25 */
199 #define LEFTIN2H  -H0, H2	/* 2.5  */
200 #define LEFTIN2T  -H0, T2	/* 2.75 */
201 #define LEFTIN3   -H0, K3	/* 3.0  */
202 #define LEFTIN3Q  -H0, Q3	/* 3.25 */
203 #define LEFTIN3H  -H0, H3	/* 3.5  */
204 #define LEFTIN3T  -H0, T3	/* 3.75 */
205 #define LEFTIN4   -H0, K4	/* 4.0  */
206 #define LEFTIN4Q  -H0, Q4	/* 4.25 */
207 #define LEFTIN4H  -H0, H4	/* 4.5  */
208 #define LEFTIN4T  -H0, T4	/* 4.75 */
209 #define LEFTIN5   -H0, K5	/* 5.0  */
210 #define LEFTIN5Q  -H0, Q5	/* 5.25 */
211 #define LEFTIN5H  -H0, H5	/* 5.5  */
212 #define LEFTIN5T  -H0, T5	/* 5.75 */
213 #define LEFTIN6   -H0, K6	/* 6.0  */
214 #define LEFTIN6Q  -H0, Q6	/* 6.25 */
215 #define LEFTIN6H  -H0, H6	/* 6.5  */
216 #define LEFTIN6T  -H0, T6	/* 6.75 */
217 #define LEFTIN7   -H0, K7	/* 7.0  */
218 #define LEFTIN7Q  -H0, Q7	/* 7.25 */
219 #define LEFTIN7H  -H0, H7	/* 7.5  */
220 #define LEFTIN7T  -H0, T7	/* 7.75 */
221 #define LEFTIN8   -H0, K8	/* 8.0  */
222 #define LEFTIN8Q  -H0, Q8	/* 8.25 */
223 #define LEFTIN8H  -H0, H8	/* 8.5  */
224 #define LEFTIN8T  -H0, T8	/* 8.75 */
225 #define LEFTIN9   -H0, K9	/* 9.0  */
226 #define LEFTIN9Q  -H0, Q9	/* 9.25 */
227 #define LEFTIN9H  -H0, H9	/* 9.5  */
228 #define LEFTIN9T  -H0, T9	/* 9.75 */
229 #define LEFTIN10  -H0, K10	/* 10.0 */
230 #define LEFTIN10H -H0, H10	/* 10.5 */
231 #define LEFTIN11  -H0, K11	/* 11.0 */
232 #define LEFTIN11H -H0, H11	/* 11.5 */
233 #define LEFTIN12  -H0, K12	/* 12.0 */
234 #define LEFTIN12H -H0, H12	/* 12.5 */
235 #define LEFTIN13  -H0, K13	/* 13.0 */
236 #define LEFTIN13H -H0, H13	/* 13.5 */
237 #define LEFTIN14  -H0, K14	/* 14.0 */
238 #define LEFTIN14H -H0, H14	/* 14.5 */
239 #define LEFTIN15  -H0, K15	/* 15.0 */
240 #define LEFTIN15H -H0, H15	/* 15.5 */
241 #define LEFTIN16  -H0, K16	/* 16.0 */
242 #define LEFTIN16H -H0, H16	/* 16.5 */
243 #define LEFTIN17  -H0, K17	/* 17.0 */
244 #define LEFTIN17H -H0, H17	/* 17.5 */
245 #define LEFTIN18  -H0, K18	/* 18.0 */
246 #define LEFTIN18H -H0, H18	/* 18.5 */
247 #define LEFTIN19  -H0, K19	/* 19.0 */
248 #define LEFTIN19H -H0, H19	/* 19.5 */
249 #define LEFTIN27H -H0, H27	/* 27.5 */
250 
251 /* in from bottom edge by this amount */
252 #define BOTEDGE   -H0,  0	/* 0.0  */
253 #define BOTIN0Q   -H0, Q0	/* 0.25 */
254 #define BOTIN0H   -H0, H0	/* 0.5  */
255 #define BOTIN0T   -H0, T0	/* 0.75 */
256 #define BOTIN1    -H0, K1	/* 1.0  */
257 #define BOTIN1Q   -H0, Q1	/* 1.25 */
258 #define BOTIN1H   -H0, H1	/* 1.5  */
259 #define BOTIN1T   -H0, T1	/* 1.75 */
260 #define BOTIN2    -H0, K2	/* 2.0  */
261 #define BOTIN2Q   -H0, Q2	/* 2.25 */
262 #define BOTIN2H   -H0, H2	/* 2.5  */
263 #define BOTIN2T   -H0, T2	/* 2.75 */
264 #define BOTIN3    -H0, K3	/* 3.0  */
265 #define BOTIN3Q   -H0, Q3	/* 3.25 */
266 #define BOTIN3H   -H0, H3	/* 3.5  */
267 #define BOTIN3T   -H0, T3	/* 3.75 */
268 #define BOTIN4    -H0, K4	/* 4.0  */
269 #define BOTIN4Q   -H0, Q4	/* 4.25 */
270 #define BOTIN4H   -H0, H4	/* 4.5  */
271 #define BOTIN4T   -H0, T4	/* 4.75 */
272 #define BOTIN5    -H0, K5	/* 5.0  */
273 #define BOTIN5Q   -H0, Q5	/* 5.25 */
274 #define BOTIN5H   -H0, H5	/* 5.5  */
275 #define BOTIN5T   -H0, T5	/* 5.75 */
276 #define BOTIN6    -H0, K6	/* 6.0  */
277 #define BOTIN6Q   -H0, Q6	/* 6.25 */
278 #define BOTIN6H   -H0, H6	/* 6.5  */
279 #define BOTIN6T   -H0, T6	/* 6.75 */
280 #define BOTIN7    -H0, K7	/* 7.0  */
281 #define BOTIN7Q   -H0, Q7	/* 7.25 */
282 #define BOTIN7H   -H0, H7	/* 7.5  */
283 #define BOTIN7T   -H0, T7	/* 7.75 */
284 #define BOTIN8    -H0, K8	/* 8.0  */
285 #define BOTIN8Q   -H0, Q8	/* 8.25 */
286 #define BOTIN8H   -H0, H8	/* 8.5  */
287 #define BOTIN8T   -H0, T8	/* 8.75 */
288 #define BOTIN9    -H0, K9	/* 9.0  */
289 #define BOTIN9Q   -H0, Q9	/* 9.25 */
290 #define BOTIN9H   -H0, H9	/* 9.5  */
291 #define BOTIN9T   -H0, T9	/* 9.75 */
292 #define BOTIN10   -H0, K10	/* 10.0 */
293 #define BOTIN10H  -H0, H10	/* 10.5 */
294 #define BOTIN11   -H0, K11	/* 11.0 */
295 #define BOTIN11H  -H0, H11	/* 11.5 */
296 #define BOTIN12   -H0, K12	/* 12.0 */
297 #define BOTIN12H  -H0, H12	/* 12.5 */
298 #define BOTIN13   -H0, K13	/* 13.0 */
299 #define BOTIN13H  -H0, H13	/* 13.5 */
300 #define BOTIN14   -H0, K14	/* 14.0 */
301 #define BOTIN14H  -H0, H14	/* 14.5 */
302 #define BOTIN15   -H0, K15	/* 15.0 */
303 #define BOTIN15H  -H0, H15	/* 15.5 */
304 #define BOTIN16   -H0, K16	/* 16.0 */
305 #define BOTIN16H  -H0, H16	/* 16.5 */
306 #define BOTIN17   -H0, K17	/* 17.0 */
307 #define BOTIN17H  -H0, H17	/* 17.5 */
308 #define BOTIN18   -H0, K18	/* 18.0 */
309 #define BOTIN18H  -H0, H18	/* 18.5 */
310 #define BOTIN19   -H0, K19	/* 19.0 */
311 #define BOTIN19H  -H0, H19	/* 19.5 */
312 #define BOTIN27H  -H0, H27	/* 27.5 */
313 
314 /* in from top edge by this amount */
315 #define TOPEDGE    H0,  0	/* 0.0  */
316 #define TOPIN0Q    H0,-Q0	/* 0.25 */
317 #define TOPIN0H    H0,-H0	/* 0.5  */
318 #define TOPIN0T    H0,-T0	/* 0.75 */
319 #define TOPIN1     H0,-K1	/* 1.0  */
320 #define TOPIN1Q    H0,-Q1	/* 1.25 */
321 #define TOPIN1H    H0,-H1	/* 1.5  */
322 #define TOPIN1T    H0,-T1	/* 1.75 */
323 #define TOPIN2     H0,-K2	/* 2.0  */
324 #define TOPIN2Q    H0,-Q2	/* 2.25 */
325 #define TOPIN2H    H0,-H2	/* 2.5  */
326 #define TOPIN2T    H0,-T2	/* 2.75 */
327 #define TOPIN3     H0,-K3	/* 3.0  */
328 #define TOPIN3Q    H0,-Q3	/* 3.25 */
329 #define TOPIN3H    H0,-H3	/* 3.5  */
330 #define TOPIN3T    H0,-T3	/* 3.75 */
331 #define TOPIN4     H0,-K4	/* 4.0  */
332 #define TOPIN4Q    H0,-Q4	/* 4.25 */
333 #define TOPIN4H    H0,-H4	/* 4.5  */
334 #define TOPIN4T    H0,-T4	/* 4.75 */
335 #define TOPIN5     H0,-K5	/* 5.0  */
336 #define TOPIN5Q    H0,-Q5	/* 5.25 */
337 #define TOPIN5H    H0,-H5	/* 5.5  */
338 #define TOPIN5T    H0,-T5	/* 5.75 */
339 #define TOPIN6     H0,-K6	/* 6.0  */
340 #define TOPIN6Q    H0,-Q6	/* 6.25 */
341 #define TOPIN6H    H0,-H6	/* 6.5  */
342 #define TOPIN6T    H0,-T6	/* 6.75 */
343 #define TOPIN7     H0,-K7	/* 7.0  */
344 #define TOPIN7Q    H0,-Q7	/* 7.25 */
345 #define TOPIN7H    H0,-H7	/* 7.5  */
346 #define TOPIN7T    H0,-T7	/* 7.75 */
347 #define TOPIN8     H0,-K8	/* 8.0  */
348 #define TOPIN8Q    H0,-Q8	/* 8.25 */
349 #define TOPIN8H    H0,-H8	/* 8.5  */
350 #define TOPIN8T    H0,-T8	/* 8.75 */
351 #define TOPIN9     H0,-K9	/* 9.0  */
352 #define TOPIN9Q    H0,-Q9	/* 9.25 */
353 #define TOPIN9H    H0,-H9	/* 9.5  */
354 #define TOPIN9T    H0,-T9	/* 9.75 */
355 #define TOPIN10    H0,-K10	/* 10.0 */
356 #define TOPIN10H   H0,-H10	/* 10.5 */
357 #define TOPIN11    H0,-K11	/* 11.0 */
358 #define TOPIN11H   H0,-H11	/* 11.5 */
359 #define TOPIN12    H0,-K12	/* 12.0 */
360 #define TOPIN12H   H0,-H12	/* 12.5 */
361 #define TOPIN13    H0,-K13	/* 13.0 */
362 #define TOPIN13H   H0,-H13	/* 13.5 */
363 #define TOPIN14    H0,-K14	/* 14.0 */
364 #define TOPIN14H   H0,-H14	/* 14.5 */
365 #define TOPIN15    H0,-K15	/* 15.0 */
366 #define TOPIN15H   H0,-H15	/* 15.5 */
367 #define TOPIN16    H0,-K16	/* 16.0 */
368 #define TOPIN16H   H0,-H16	/* 16.5 */
369 #define TOPIN17    H0,-K17	/* 17.0 */
370 #define TOPIN17H   H0,-H17	/* 17.5 */
371 #define TOPIN18    H0,-K18	/* 18.0 */
372 #define TOPIN18H   H0,-H18	/* 18.5 */
373 #define TOPIN19    H0,-K19	/* 19.0 */
374 #define TOPIN19H   H0,-H19	/* 19.5 */
375 #define TOPIN27H   H0,-H27	/* 27.5 */
376 
377 /* in from right edge by this amount */
378 #define RIGHTEDGE  H0,  0	/* 0.0  */
379 #define RIGHTIN0Q  H0,-Q0	/* 0.25 */
380 #define RIGHTIN0H  H0,-H0	/* 0.5  */
381 #define RIGHTIN0T  H0,-T0	/* 0.75 */
382 #define RIGHTIN1   H0,-K1	/* 1.0  */
383 #define RIGHTIN1Q  H0,-Q1	/* 1.25 */
384 #define RIGHTIN1H  H0,-H1	/* 1.5  */
385 #define RIGHTIN1T  H0,-T1	/* 1.75 */
386 #define RIGHTIN2   H0,-K2	/* 2.0  */
387 #define RIGHTIN2Q  H0,-Q2	/* 2.25 */
388 #define RIGHTIN2H  H0,-H2	/* 2.5  */
389 #define RIGHTIN2T  H0,-T2	/* 2.75 */
390 #define RIGHTIN3   H0,-K3	/* 3.0  */
391 #define RIGHTIN3Q  H0,-Q3	/* 3.25 */
392 #define RIGHTIN3H  H0,-H3	/* 3.5  */
393 #define RIGHTIN3T  H0,-T3	/* 3.75 */
394 #define RIGHTIN4   H0,-K4	/* 4.0  */
395 #define RIGHTIN4Q  H0,-Q4	/* 4.25 */
396 #define RIGHTIN4H  H0,-H4	/* 4.5  */
397 #define RIGHTIN4T  H0,-T4	/* 4.75 */
398 #define RIGHTIN5   H0,-K5	/* 5.0  */
399 #define RIGHTIN5Q  H0,-Q5	/* 5.25 */
400 #define RIGHTIN5H  H0,-H5	/* 5.5  */
401 #define RIGHTIN5T  H0,-T5	/* 5.75 */
402 #define RIGHTIN6   H0,-K6	/* 6.0  */
403 #define RIGHTIN6Q  H0,-Q6	/* 6.25 */
404 #define RIGHTIN6H  H0,-H6	/* 6.5  */
405 #define RIGHTIN6T  H0,-T6	/* 6.75 */
406 #define RIGHTIN7   H0,-K7	/* 7.0  */
407 #define RIGHTIN7Q  H0,-Q7	/* 7.25 */
408 #define RIGHTIN7H  H0,-H7	/* 7.5  */
409 #define RIGHTIN7T  H0,-T7	/* 7.75 */
410 #define RIGHTIN8   H0,-K8	/* 8.0  */
411 #define RIGHTIN8Q  H0,-Q8	/* 8.25 */
412 #define RIGHTIN8H  H0,-H8	/* 8.5  */
413 #define RIGHTIN8T  H0,-T8	/* 8.75 */
414 #define RIGHTIN9   H0,-K9	/* 9.0  */
415 #define RIGHTIN9Q  H0,-Q9	/* 9.25 */
416 #define RIGHTIN9H  H0,-H9	/* 9.5  */
417 #define RIGHTIN9T  H0,-T9	/* 9.75 */
418 #define RIGHTIN10  H0,-K10	/* 10.0 */
419 #define RIGHTIN10H H0,-H10	/* 10.5 */
420 #define RIGHTIN11  H0,-K11	/* 11.0 */
421 #define RIGHTIN11H H0,-H11	/* 11.5 */
422 #define RIGHTIN12  H0,-K12	/* 12.0 */
423 #define RIGHTIN12H H0,-H12	/* 12.5 */
424 #define RIGHTIN13  H0,-K13	/* 13.0 */
425 #define RIGHTIN13H H0,-H13	/* 13.5 */
426 #define RIGHTIN14  H0,-K14	/* 14.0 */
427 #define RIGHTIN14H H0,-H14	/* 14.5 */
428 #define RIGHTIN15  H0,-K15	/* 15.0 */
429 #define RIGHTIN15H H0,-H15	/* 15.5 */
430 #define RIGHTIN16  H0,-K16	/* 16.0 */
431 #define RIGHTIN16H H0,-H16	/* 16.5 */
432 #define RIGHTIN17  H0,-K17	/* 17.0 */
433 #define RIGHTIN17H H0,-H17	/* 17.5 */
434 #define RIGHTIN18  H0,-K18	/* 18.0 */
435 #define RIGHTIN18H H0,-H18	/* 18.5 */
436 #define RIGHTIN19  H0,-K19	/* 19.0 */
437 #define RIGHTIN19H H0,-H19	/* 19.5 */
438 #define RIGHTIN27H H0,-H27	/* 27.5 */
439 
440 /*********************** LOOPING THROUGH POLYGONS ON NODE/ARC ************************/
441 
442 typedef struct Ipolyloop
443 {
444 	INTBIG      realpolys;				/* polygon count without displayable variables */
445 	WINDOWPART *curwindowpart;			/* window used in getting polygons from node/arc */
446 
447 	/* for multi-cut contacts */
448 	INTBIG      moscutlx, moscuthx, moscutly, moscuthy;
449 	INTBIG      moscutbasex, moscutbasey, moscutsizex, moscutsizey;
450 	INTBIG      moscutsep, moscuttopedge, moscutleftedge, moscutrightedge;
451 	INTBIG      moscuttotal, moscutsx, moscutsy;
452 
453 	/* for serpentine transistors */
454 	VARIABLE   *serpentvar;
455 
456 	/* for circular arcs */
457 	INTBIG      arcpieces, anglebase, anglerange;
458 	INTBIG      centerx, centery, radius;
459 
460 	/* for displayable variables */
461 	INTBIG      numvar;
462 	VARIABLE   *firstvar;
463 	INTBIG      ndisplayindex;
464 	INTBIG      ndisplaysubindex;
465 } POLYLOOP;
466 
467 /******************** MISCELLANEOUS ********************/
468 
469 /* globally used arcprotos from the Generic technology */
470 #define AUNIV      (0|(1<<16))
471 #define AINVIS     (1|(1<<16))
472 #define AUNROUTED  (2|(1<<16))
473 #define ALLGEN     AUNIV,AINVIS,AUNROUTED
474 
475 extern POLYLOOP    tech_oneprocpolyloop;
476 
477 /* technology prototypes */
478 BOOLEAN   tech_doinitprocess(TECHNOLOGY*);
479 BOOLEAN   tech_doaddportsandvars(TECHNOLOGY*);
480 INTBIG    tech_initcurvedarc(ARCINST*, INTBIG, POLYLOOP*);
481 BOOLEAN   tech_curvedarcpiece(ARCINST*, INTBIG, POLYGON*, TECH_ARCS**, POLYLOOP*);
482 void      tech_addheadarrow(POLYGON*, INTBIG, INTBIG, INTBIG, INTBIG);
483 void      tech_adddoubleheadarrow(POLYGON*, INTBIG, INTBIG*, INTBIG*, INTBIG);
484 void      tech_add2linebody(POLYGON*, INTBIG, INTBIG, INTBIG, INTBIG, INTBIG, INTBIG);
485 INTBIG    tech_moscutcount(NODEINST*, INTBIG, INTBIG, INTBIG, INTBIG, INTBIG*, POLYLOOP*);
486 INTBIG    tech_inittrans(INTBIG, NODEINST*, POLYLOOP*);
487 BOOLEAN   tech_pinusecount(NODEINST*, WINDOWPART*);
488 INTBIG    tech_displayablenvars(NODEINST*, WINDOWPART*, POLYLOOP*);
489 VARIABLE *tech_filldisplayablenvar(NODEINST*, POLYGON*, WINDOWPART*, VARIABLE**, POLYLOOP*);
490 INTBIG    tech_displayablecellvars(NODEPROTO *np, WINDOWPART *win, POLYLOOP *pl);
491 VARIABLE *tech_filldisplayablecellvar(NODEPROTO *np, POLYGON *poly, WINDOWPART *win,
492 			VARIABLE **varnoeval, POLYLOOP *pl);
493 INTBIG    tech_displayableportvars(PORTPROTO *pp, WINDOWPART *win, POLYLOOP *pl);
494 VARIABLE *tech_filldisplayableportvar(PORTPROTO *pp, POLYGON *poly, WINDOWPART *win,
495 			VARIABLE **varnoeval, POLYLOOP *pl);
496 void      tech_filltrans(POLYGON*, TECH_POLYGON**, TECH_SERPENT*, NODEINST*, INTBIG,
497 			INTBIG, TECH_PORTS*, POLYLOOP*);
498 void      tech_moscutpoly(NODEINST*, INTBIG, INTBIG[], POLYLOOP*);
499 void      tech_fillpoly(POLYGON*, TECH_POLYGON*, NODEINST*, INTBIG, INTBIG);
500 void      tech_filltransport(NODEINST*, PORTPROTO*, POLYGON*, XARRAY, TECH_NODES*, INTBIG,
501 			INTBIG, INTBIG, INTBIG, INTBIG);
502 void      tech_fillportpoly(NODEINST*, PORTPROTO*, POLYGON*, XARRAY, TECH_NODES*, INTBIG, INTBIG);
503 void      tech_resetnegated(ARCINST*);
504 INTBIG    tech_displayableavars(ARCINST*, WINDOWPART*, POLYLOOP*);
505 VARIABLE *tech_filldisplayableavar(ARCINST*, POLYGON*, WINDOWPART*, VARIABLE**, POLYLOOP*);
506 void      tech_makearrow(ARCINST*, POLYGON*);
507 INTBIG    tech_getextendfactor(INTBIG, INTBIG);
508 void      tech_makeendpointpoly(INTBIG, INTBIG, INTBIG, INTBIG, INTBIG, INTBIG, INTBIG,
509 			INTBIG, INTBIG, POLYGON*);
510 void      tech_convertmocmoslib(LIBRARY*);
511 INTBIG    tech_nodepolys(NODEINST *ni, INTBIG *reasonable, WINDOWPART *win, POLYLOOP *pl);
512 void      tech_shapenodepoly(NODEINST *ni, INTBIG box, POLYGON *poly, POLYLOOP *pl);
513 INTBIG    tech_nodeEpolys(NODEINST *ni, INTBIG *reasonable, WINDOWPART *win, POLYLOOP *pl);
514 void      tech_shapeEnodepoly(NODEINST *ni, INTBIG box, POLYGON *poly, POLYLOOP *pl);
515 INTBIG    tech_arcpolys(ARCINST *ai, WINDOWPART *win, POLYLOOP *pl);
516 void      tech_shapearcpoly(ARCINST *ai, INTBIG box, POLYGON *poly, POLYLOOP *pl);
517 void      tech_nodeprotosizeoffset(NODEPROTO *np, INTBIG *lx, INTBIG *ly, INTBIG *hx, INTBIG *hy,
518 			INTBIG lambda);
519 
520 #if defined(__cplusplus) && !defined(ALLCPLUSPLUS)
521 }
522 #endif
523