2 * This file is part of the Alliance CAD System
3 * Copyright (C) Laboratoire LIP6 - D\8epartement ASIM
4 * Universite Pierre et Marie Curie
6 * Home page : http://www-asim.lip6.fr/alliance/
7 * E-mail support : mailto:alliance-support@asim.lip6.fr
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Library General Public License as published
11 * by the Free Software Foundation; either version 2 of the License, or (at
12 * your option) any later version.
14 * Alliance VLSI CAD System is distributed in the hope that it will be
15 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17 * Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with the GNU C Library; see the file COPYING. If not, write to the Free
21 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 /* 10/23/97 Cone Netlist Structure functions: savecnsfig.c */
28 /*============================================================================*
29 | function savecnsfig(); |
30 | Cone Netlist Structure driver |
31 *============================================================================*/
33 savecnsfig(ptcnsfig
, ptlofig
)
34 cnsfig_list
*ptcnsfig
;
37 if (V_BOOL_TAB
[__CNS_DRIVE_VERBOSE
].VALUE
) savecnvfig(ptcnsfig
);
38 if (V_BOOL_TAB
[__CNS_DRIVE_NORMAL
].VALUE
) savecnslofig(ptcnsfig
, ptlofig
, 1);
41 /*============================================================================*
42 | function savecnslofig(); |
43 | Cone Netlist Structure with embedded lofig driver |
44 *============================================================================*/
46 savecnslofig(ptcnsfig
, ptlofig
, complete
)
47 cnsfig_list
*ptcnsfig
;
58 lorcnet_list
*ptrcnet
;
72 char cone_tectype
[16];
75 branch_list
*ptbranch
;
85 if (CNS_TRACE_MODE
>= CNS_TRACE
)
86 (void) printf("TRA_cns savecnsfig in\n");
88 if (ptcnsfig
== NULL
|| ptlofig
== NULL
) {
89 (void) fflush(stdout
);
90 (void) fprintf(stderr
, "*** cns error ***");
91 (void) fprintf(stderr
, " savecnsfig() impossible for %s.cns : both logical and CNS figures are required\n", ptcnsfig
->NAME
);
92 if (CNS_TRACE_MODE
>= CNS_TRACE
)
93 (void) printf("TRA_cns savecnsfig out\n");
97 /* ---------------------------------------------------------------------------
99 --------------------------------------------------------------------------- */
101 if ((ptfile
= mbkfopen(ptcnsfig
->NAME
, "cns", WRITE_TEXT
)) == NULL
) {
102 (void) fflush(stdout
);
103 (void) fprintf(stderr
, "*** cns error ***");
104 (void) fprintf(stderr
, " savecnsfig() impossible: can't open file %s.cns\n", ptcnsfig
->NAME
);
105 if (CNS_TRACE_MODE
>= CNS_TRACE
)
106 (void) printf("TRA_cns savecnsfig out\n");
110 /* ---------------------------------------------------------------------------
112 --------------------------------------------------------------------------- */
114 fprintf(ptfile
, "(CNS V%s %s %s %s %s %s", CNS_VERSION
, CNS_TECHNO
, IN_LO
, ptcnsfig
->NAME
, getenv("USER"), ctime(&counter
));
116 /* ---------------------------------------------------------------------------
118 --------------------------------------------------------------------------- */
119 fprintf(ptfile
, "\n(SCALE\n(X %ld))\n", SCALE_X
);
121 /* ---------------------------------------------------------------------------
123 --------------------------------------------------------------------------- */
124 if (ptlofig
!= NULL
) {
126 for (ptlosig
= ptlofig
->LOSIG
; ptlosig
; ptlosig
= ptlosig
->NEXT
) {
128 if ((ptptype
= getptype(ptlosig
->USER
, (long) CNS_INDEX
)) != NULL
) {
129 ptptype
->DATA
= (void *) counter
;
132 ptlosig
->USER
= addptype(ptlosig
->USER
, (long) CNS_INDEX
, (void *) counter
);
136 /* ---------------------------------------------------------------------------
137 Cone Netlist Structure external connector list
138 --------------------------------------------------------------------------- */
140 fprintf(ptfile
, "\n(CONNECTORS");
141 for (ptlocon
= ptcnsfig
->LOCON
; ptlocon
!= NULL
; ptlocon
= ptlocon
->NEXT
) {
143 if ((ptptype
= getptype(ptlocon
->USER
, (long) CNS_INDEX
)) != NULL
) {
144 ptptype
->DATA
= (void *) counter
;
147 ptlocon
->USER
= addptype(ptlocon
->USER
, (long) CNS_INDEX
, (void *) counter
);
149 if (strchr(ptlocon
->NAME
, ' ') != NULL
) {
150 fprintf(ptfile
, "\n(%ld \"%s\"", counter
, ptlocon
->NAME
);
152 else fprintf(ptfile
, "\n(%ld %s", counter
, ptlocon
->NAME
);
153 if (ptlocon
->DIRECTION
== CNS_I
)
154 fprintf(ptfile
, " I");
155 else if (ptlocon
->DIRECTION
== CNS_O
)
156 fprintf(ptfile
, " O");
157 else if (ptlocon
->DIRECTION
== CNS_B
)
158 fprintf(ptfile
, " B");
159 else if (ptlocon
->DIRECTION
== CNS_Z
)
160 fprintf(ptfile
, " Z");
161 else if (ptlocon
->DIRECTION
== CNS_T
)
162 fprintf(ptfile
, " T");
163 else if (ptlocon
->DIRECTION
== CNS_X
)
164 fprintf(ptfile
, " X");
165 else if (ptlocon
->DIRECTION
== CNS_VDDC
)
166 fprintf(ptfile
, " Vdd");
167 else if (ptlocon
->DIRECTION
== CNS_GNDC
)
168 fprintf(ptfile
, " Gnd");
169 else if (ptlocon
->DIRECTION
== CNS_VSSC
)
170 fprintf(ptfile
, " Vss");
172 fprintf(ptfile
, " ?");
175 if (ptlocon
->TYPE
== 'I')
176 fprintf(ptfile
, " I");
177 else if (ptlocon
->TYPE
== 'E')
178 fprintf(ptfile
, " E");
179 else if (ptlocon
->TYPE
== 'X')
180 fprintf(ptfile
, " X");
182 fprintf(ptfile
, " ?");
185 if (ptlofig
!= NULL
&& (ptptype
= getptype(ptlocon
->SIG
->USER
, (long) CNS_INDEX
)) != NULL
) {
186 fprintf(ptfile
, " %ld", (long) ptptype
->DATA
);
187 if (ptlocon
->PNODE
!= NULL
&& complete
) {
188 fprintf(ptfile
, " (#");
189 for (ptnum
= ptlocon
->PNODE
; ptnum
; ptnum
= ptnum
->NEXT
) {
190 fprintf(ptfile
, " %ld", ptnum
->DATA
);
192 fprintf(ptfile
, ")");
195 ptptype
= getptype(ptlocon
->USER
, CNS_TYPELOCON
);
196 if (ptptype
!= NULL
) {
197 if (((long)ptptype
->DATA
& CNS_ONE
) == CNS_ONE
) fprintf(ptfile
, " - 1");
198 else if (((long)ptptype
->DATA
& CNS_ZERO
) == CNS_ZERO
) fprintf(ptfile
, " - 0");
200 fprintf(ptfile
, ")");
202 fprintf(ptfile
, ")\n");
204 /* ---------------------------------------------------------------------------
205 Cone Netlist Structure internal connector list
206 --------------------------------------------------------------------------- */
207 if (ptcnsfig
->INTCON
!= NULL
) {
208 fprintf(ptfile
, "\n(INTERNAL");
209 for (ptlocon
= ptcnsfig
->INTCON
; ptlocon
!= NULL
; ptlocon
= ptlocon
->NEXT
) {
211 if ((ptptype
= getptype(ptlocon
->USER
, (long) CNS_INDEX
)) != NULL
) {
212 ptptype
->DATA
= (void *) counter
;
215 ptlocon
->USER
= addptype(ptlocon
->USER
, (long) CNS_INDEX
, (void *) counter
);
217 if (strchr(ptlocon
->NAME
, ' ') != NULL
) {
218 fprintf(ptfile
, "\n(%ld \"%s\"", counter
, ptlocon
->NAME
);
220 else fprintf(ptfile
, "\n(%ld %s", counter
, ptlocon
->NAME
);
221 if (ptlocon
->DIRECTION
== CNS_I
)
222 fprintf(ptfile
, " I");
223 else if (ptlocon
->DIRECTION
== CNS_O
)
224 fprintf(ptfile
, " O");
225 else if (ptlocon
->DIRECTION
== CNS_B
)
226 fprintf(ptfile
, " B");
227 else if (ptlocon
->DIRECTION
== CNS_Z
)
228 fprintf(ptfile
, " Z");
229 else if (ptlocon
->DIRECTION
== CNS_T
)
230 fprintf(ptfile
, " T");
231 else if (ptlocon
->DIRECTION
== CNS_X
)
232 fprintf(ptfile
, " X");
233 else if (ptlocon
->DIRECTION
== CNS_VDDC
)
234 fprintf(ptfile
, " Vdd");
235 else if (ptlocon
->DIRECTION
== CNS_GNDC
)
236 fprintf(ptfile
, " Gnd");
237 else if (ptlocon
->DIRECTION
== CNS_VSSC
)
238 fprintf(ptfile
, " Vss");
240 fprintf(ptfile
, " ?");
243 if (ptlofig
!= NULL
&& (ptptype
= getptype(ptlocon
->SIG
->USER
, (long) CNS_INDEX
)) != NULL
) {
244 fprintf(ptfile
, " %ld", (long) ptptype
->DATA
);
245 if (ptlocon
->PNODE
!= NULL
) {
246 fprintf(ptfile
, " (#");
247 for (ptnum
= ptlocon
->PNODE
; ptnum
; ptnum
= ptnum
->NEXT
) {
248 fprintf(ptfile
, " %ld", ptnum
->DATA
);
250 fprintf(ptfile
, ")");
253 fprintf(ptfile
, ")");
255 fprintf(ptfile
, ")\n");
258 /* ---------------------------------------------------------------------------
259 Lofig Structure signal list
260 --------------------------------------------------------------------------- */
261 if (ptlofig
!= NULL
) {
262 cachemode
=rcn_hascache(ptlofig
);
263 fprintf(ptfile
, "\n(SIGNALS");
264 for (ptlosig
= ptlofig
->LOSIG
; ptlosig
; ptlosig
= ptlosig
->NEXT
) {
265 ptptype
= getptype(ptlosig
->USER
, CNS_INDEX
);
266 counter
= (long) ptptype
->DATA
;
267 if (complete
) fprintf(ptfile
, "\n");
268 fprintf(ptfile
, "\n(%ld (", counter
);
269 if ((ptchain
= ptlosig
->NAMECHAIN
) != NULL
) {
270 ptname
= (char *)ptchain
->DATA
;
271 if (strchr(ptname
, ' ') != NULL
) {
272 fprintf(ptfile
, "\"%s\"", ptname
);
274 else fprintf(ptfile
, "%s", ptname
);
275 while ((ptchain
= ptchain
->NEXT
) != NULL
) {
276 ptname
= (char *)ptchain
->DATA
;
277 if (strchr(ptname
, ' ') != NULL
) {
278 fprintf(ptfile
, " \"%s\"", ptname
);
280 else fprintf(ptfile
, " %s", ptname
);
284 fprintf(ptfile
, "cns_sig%ld", counter
);
285 strcpy(losig_type
, "");
286 switch (ptlosig
->TYPE
) {
288 strcat(losig_type
, "I");
291 strcat(losig_type
, "E");
294 strcat(losig_type
, "D");
297 strcat(losig_type
, "S");
300 strcat(losig_type
, "T");
303 strcat(losig_type
, "?");
305 fprintf(ptfile
, ") %s", losig_type
);
306 if ((ptptype
= getptype(ptlosig
->USER
, LOSIGALIM
)) != NULL
) {
307 fprintf(ptfile
, " (%ld)", (long)ptptype
->DATA
);
309 if ((ptrcnet
= ptlosig
->PRCN
) != NULL
&& complete
) {
310 if (!(cachemode
&& (mbk_LosigIsVDD(ptlosig
) || mbk_LosigIsVSS(ptlosig
))))
312 rcn_lock_signal(ptlofig
, ptlosig
);
313 fprintf(ptfile
, " %3.2f", rcn_getcapa( ptlofig
, ptlosig
) * 1000);
314 if (ptrcnet
->PWIRE
!= NULL
) {
315 fprintf(ptfile
, "\n(WIRES");
316 for (ptwire
= ptrcnet
->PWIRE
; ptwire
; ptwire
= ptwire
->NEXT
) {
317 fprintf(ptfile
, "\n(X");
318 fprintf(ptfile
, " %ld %ld %g %g)", ptwire
->NODE1
, ptwire
->NODE2
, ptwire
->RESI
, ptwire
->CAPA
* 1000);
320 fprintf(ptfile
, ")");
322 rcn_unlock_signal(ptlofig
, ptlosig
);
325 else if (ptrcnet
!= NULL
) {
326 fprintf(ptfile
, " %3.2f", rcn_getcapa( ptlofig
, ptlosig
) * 1000);
329 fprintf(ptfile
, " 0");
330 fprintf(ptfile
, ")");
332 fprintf(ptfile
, ")\n");
335 /* ---------------------------------------------------------------------------
336 Crosstalk Capacitances list
337 --------------------------------------------------------------------------- */
338 if (ptlofig
!= NULL
&& complete
) {
339 fprintf(ptfile
, "\n(CROSSTALKS");
340 for (ptlosig
= ptlofig
->LOSIG
; ptlosig
; ptlosig
= ptlosig
->NEXT
) {
341 if (ptlosig
->PRCN
== NULL
) continue;
342 if (cachemode
&& (mbk_LosigIsVDD(ptlosig
) || mbk_LosigIsVSS(ptlosig
))) continue;
343 rcn_lock_signal(ptlofig
, ptlosig
);
344 for (ptchain
= ptlosig
->PRCN
->PCTC
; ptchain
; ptchain
= ptchain
->NEXT
) {
345 ptctc
= (loctc_list
*)ptchain
->DATA
;
346 if (rcn_capacitancetooutput(cachemode
, ptlosig
, ptctc
)) {
347 fprintf(ptfile
, "\n(K %g", ptctc
->CAPA
* 1000);
348 ptptype
= getptype(ptctc
->SIG1
->USER
, CNS_INDEX
);
349 counter
= (long) ptptype
->DATA
;
350 fprintf(ptfile
, " %ld", counter
);
351 fprintf(ptfile
, " %ld", ptctc
->NODE1
);
352 ptptype
= getptype(ptctc
->SIG2
->USER
, CNS_INDEX
);
353 counter
= (long) ptptype
->DATA
;
354 fprintf(ptfile
, " %ld", counter
);
355 fprintf(ptfile
, " %ld)", ptctc
->NODE2
);
358 rcn_unlock_signal(ptlofig
, ptlosig
);
360 fprintf(ptfile
, ")\n");
363 /* ---------------------------------------------------------------------------
364 Cone Netlist Structure transistor list
365 --------------------------------------------------------------------------- */
367 fprintf(ptfile
, "\n(TRANSISTORS");
368 for (ptlotrs
= ptcnsfig
->LOTRS
; ptlotrs
!= NULL
; ptlotrs
= ptlotrs
->NEXT
) {
370 if ((ptptype
= getptype(ptlotrs
->USER
, (long) CNS_INDEX
)) != NULL
) {
371 ptptype
->DATA
= (void *) counter
;
374 ptlotrs
->USER
= addptype(ptlotrs
->USER
, (long) CNS_INDEX
, (void *) counter
);
376 fprintf(ptfile
, "\n(%ld", counter
);
377 if (ptlotrs
->TRNAME
!= NULL
) {
378 if (isdigit((int)*(ptlotrs
->TRNAME
))) fprintf(ptfile
, " cns_%s", ptlotrs
->TRNAME
);
379 else fprintf(ptfile
, " %s", ptlotrs
->TRNAME
);
382 fprintf(ptfile
, " noname");
384 if ((ptptype
= getptype(ptlotrs
->USER
, (long) CNS_DRIVINGCONE
)) != NULL
) {
385 fprintf(ptfile
, " %ld", ((cone_list
*) ptptype
->DATA
)->INDEX
);
387 else if ((ptptype
= getptype(ptlotrs
->USER
, (long) CNS_LINKTYPE
)) != NULL
) {
388 if (((long) ptptype
->DATA
& CNS_ACTIVE
) == CNS_ACTIVE
) {
389 if ((ptcone
= (cone_list
*) ptlotrs
->GRID
) != NULL
) {
390 fprintf(ptfile
, " %ld", ptcone
->INDEX
);
393 fprintf(ptfile
, " ?");
397 else if (((long) ptptype
->DATA
& CNS_PULL
) == CNS_PULL
)
398 fprintf(ptfile
, " puller");
399 else if (((long) ptptype
->DATA
& (CNS_DIODE_UP
& CNS_DIODE_DOWN
)) == (CNS_DIODE_UP
& CNS_DIODE_DOWN
))
400 fprintf(ptfile
, " diode");
401 else if (((long) ptptype
->DATA
& CNS_RESIST
) == CNS_RESIST
)
402 fprintf(ptfile
, " resistance");
403 else if (((long) ptptype
->DATA
& CNS_CAPA
) == CNS_CAPA
)
404 fprintf(ptfile
, " capacity");
406 fprintf(ptfile
, " ?");
410 /*else if ((ptcone = (cone_list *) ptlotrs->GRID) != NULL) {
411 fprintf(ptfile, " %ld", ptcone->INDEX);
414 fprintf(ptfile
, " 0");
416 if (ptlotrs
->X
!= LONG_MIN
) fprintf(ptfile
, " %ld", ptlotrs
->X
);
417 else fprintf(ptfile
, " 0");
418 if (ptlotrs
->X
!= LONG_MIN
) fprintf(ptfile
, " %ld", ptlotrs
->Y
);
419 else fprintf(ptfile
, " 0");
420 fprintf(ptfile
, " %ld %ld", ptlotrs
->WIDTH
, ptlotrs
->LENGTH
);
421 fprintf(ptfile
, " %ld %ld", ptlotrs
->PS
, ptlotrs
->PD
);
422 fprintf(ptfile
, " %ld %ld", ptlotrs
->XS
, ptlotrs
->XD
);
423 if (ptlofig
!= NULL
) {
424 ptlosig
= ptlotrs
->DRAIN
->SIG
;
425 ptptype
= getptype(ptlosig
->USER
, CNS_INDEX
);
426 fprintf(ptfile
, " %ld", (long) ptptype
->DATA
);
427 if (ptlotrs
->DRAIN
->PNODE
!= NULL
&& complete
) {
428 fprintf(ptfile
, " (#");
429 for (ptnum
= ptlotrs
->DRAIN
->PNODE
; ptnum
; ptnum
= ptnum
->NEXT
) {
430 fprintf(ptfile
, " %ld", (long) ptnum
->DATA
);
432 fprintf(ptfile
, ")");
434 ptlosig
= ptlotrs
->GRID
->SIG
;
435 ptptype
= getptype(ptlosig
->USER
, CNS_INDEX
);
436 fprintf(ptfile
, " %ld", (long) ptptype
->DATA
);
437 if (ptlotrs
->GRID
->PNODE
!= NULL
&& complete
) {
438 fprintf(ptfile
, " (#");
439 for (ptnum
= ptlotrs
->GRID
->PNODE
; ptnum
; ptnum
= ptnum
->NEXT
) {
440 fprintf(ptfile
, " %ld", (long) ptnum
->DATA
);
442 fprintf(ptfile
, ")");
444 ptlosig
= ptlotrs
->SOURCE
->SIG
;
445 ptptype
= getptype(ptlosig
->USER
, CNS_INDEX
);
446 fprintf(ptfile
, " %ld", (long) ptptype
->DATA
);
447 if (ptlotrs
->SOURCE
->PNODE
!= NULL
&& complete
) {
448 fprintf(ptfile
, " (#");
449 for (ptnum
= ptlotrs
->SOURCE
->PNODE
; ptnum
; ptnum
= ptnum
->NEXT
) {
450 fprintf(ptfile
, " %ld", (long) ptnum
->DATA
);
452 fprintf(ptfile
, ")");
454 if (ptlotrs
->BULK
==NULL
) ptlosig
=NULL
;
455 else ptlosig
= ptlotrs
->BULK
->SIG
;
456 if (ptlosig
!= NULL
) {
457 ptptype
= getptype(ptlosig
->USER
, CNS_INDEX
);
458 fprintf(ptfile
, " %ld", (long) ptptype
->DATA
);
459 if (ptlotrs
->BULK
->PNODE
!= NULL
&& complete
) {
460 fprintf(ptfile
, " (#");
461 for (ptnum
= ptlotrs
->BULK
->PNODE
; ptnum
; ptnum
= ptnum
->NEXT
) {
462 fprintf(ptfile
, " %ld", (long) ptnum
->DATA
);
464 fprintf(ptfile
, ")");
467 else fprintf(ptfile
, " 0");
469 strcpy(lotrs_type
, "");
470 if (strcmp(CNS_TECHNO
, "edmesfet") == 0) {
471 if (MLO_IS_TRANSN(ptlotrs
->TYPE
))
472 strcat(lotrs_type
, "E");
473 else if (MLO_IS_TRANSP(ptlotrs
->TYPE
))
474 strcat(lotrs_type
, "D");
476 else if (strcmp(CNS_TECHNO
, "npmosfet") == 0) {
477 if (MLO_IS_TRANSN(ptlotrs
->TYPE
))
478 strcat(lotrs_type
, "N");
479 else if (MLO_IS_TRANSP(ptlotrs
->TYPE
))
480 strcat(lotrs_type
, "P");
482 if (strlen(lotrs_type
) == 0) {
483 strcat(lotrs_type
, "?");
486 if (ptlotrs
->MODINDEX
== EMPTYHT
) fprintf(ptfile
, " %s", lotrs_type
);
487 else fprintf(ptfile
, " %s %s", lotrs_type
, getlotrsmodel(ptlotrs
));
488 fprintf(ptfile
, " (");
489 if ((ptptype
= getptype(ptlotrs
->USER
, OPT_PARAMS
)) != NULL
) {
491 for (ptopt
= (optparam_list
*)ptptype
->DATA
; ptopt
; ptopt
= ptopt
->NEXT
) {
492 if (isknowntrsparam(ptopt
->UNAME
.STANDARD
)) {
493 if (**(ptopt
->UNAME
.STANDARD
) != '$') {
497 else fprintf(ptfile
, " ");
498 fprintf(ptfile
, "%s=%g", *(ptopt
->UNAME
.STANDARD
), ptopt
->UDATA
.VALUE
);
503 fprintf(ptfile
, ")");
504 fprintf(ptfile
, " (");
505 if ((ptptype
= getptype(ptlotrs
->USER
, PARAM_CONTEXT
)) != NULL
) {
507 eqt_param
*from
=(eqt_param
*)ptptype
->DATA
;
509 subcktname
=mbk_get_subckt_name(ptlotrs
);
510 fprintf(ptfile
, " %s", subcktname
!=NULL
?subcktname
:"");
511 for (i
= 0; i
< from
->NUMBER
; i
++)
512 fprintf(ptfile
, " %s=%g", from
->EBI
[i
].NAME
, from
->EBI
[i
].VAL
);
514 fprintf(ptfile
, ")");
515 fprintf(ptfile
, ")");
517 fprintf(ptfile
, ")\n");
519 /* ---------------------------------------------------------------------------
520 Cone Netlist Structure instance list
521 --------------------------------------------------------------------------- */
523 fprintf(ptfile
, "\n(INSTANCES");
524 for (ptloins
= ptcnsfig
->LOINS
; ptloins
!= NULL
; ptloins
= ptloins
->NEXT
) {
526 if ((ptptype
= getptype(ptloins
->USER
, (long) CNS_INDEX
)) != NULL
) {
527 ptptype
->DATA
= (void *) counter
;
530 ptloins
->USER
= addptype(ptloins
->USER
, (long) CNS_INDEX
, (void *) counter
);
532 fprintf(ptfile
, "\n\n(%ld", counter
);
533 if (strchr(ptloins
->INSNAME
, ' ') != NULL
) {
534 fprintf(ptfile
, " \"%s\" %s", ptloins
->INSNAME
, ptloins
->FIGNAME
);
536 else fprintf(ptfile
, " %s %s", ptloins
->INSNAME
, ptloins
->FIGNAME
);
538 fprintf(ptfile
, "\n(CONNECTORS");
539 ptloins
->LOCON
= (locon_list
*)reverse((chain_list
*)ptloins
->LOCON
);
540 for (ptlocon
= ptloins
->LOCON
; ptlocon
!= NULL
; ptlocon
= ptlocon
->NEXT
) {
542 if ((ptptype
= getptype(ptlocon
->USER
, (long) CNS_INDEX
)) != NULL
) {
543 ptptype
->DATA
= (void *) counter1
;
546 ptlocon
->USER
= addptype(ptlocon
->USER
, (long) CNS_INDEX
, (void *) counter1
);
548 if (strchr(ptlocon
->NAME
, ' ') != NULL
) {
549 fprintf(ptfile
, "\n(%ld \"%s\"", counter1
, ptlocon
->NAME
);
551 else fprintf(ptfile
, "\n(%ld %s", counter1
, ptlocon
->NAME
);
552 if (ptlocon
->DIRECTION
== CNS_I
)
553 fprintf(ptfile
, " I");
554 else if (ptlocon
->DIRECTION
== CNS_O
)
555 fprintf(ptfile
, " O");
556 else if (ptlocon
->DIRECTION
== CNS_B
)
557 fprintf(ptfile
, " B");
558 else if (ptlocon
->DIRECTION
== CNS_Z
)
559 fprintf(ptfile
, " Z");
560 else if (ptlocon
->DIRECTION
== CNS_T
)
561 fprintf(ptfile
, " T");
562 else if (ptlocon
->DIRECTION
== CNS_X
)
563 fprintf(ptfile
, " X");
564 else if (ptlocon
->DIRECTION
== CNS_VDDC
)
565 fprintf(ptfile
, " Vdd");
566 else if (ptlocon
->DIRECTION
== CNS_GNDC
)
567 fprintf(ptfile
, " Gnd");
568 else if (ptlocon
->DIRECTION
== CNS_VSSC
)
569 fprintf(ptfile
, " Vss");
571 fprintf(ptfile
, " ?");
574 if (ptlofig
!= NULL
&& (ptptype
= getptype(ptlocon
->SIG
->USER
, (long) CNS_INDEX
)) != NULL
) {
575 fprintf(ptfile
, " %ld", (long) ptptype
->DATA
);
576 if (ptlocon
->PNODE
!= NULL
&& complete
) {
577 fprintf(ptfile
, " (#");
578 for (ptnum
= ptlocon
->PNODE
; ptnum
; ptnum
= ptnum
->NEXT
) {
579 fprintf(ptfile
, " %ld", ptnum
->DATA
);
581 fprintf(ptfile
, ")");
584 fprintf(ptfile
, ")");
586 ptloins
->LOCON
= (locon_list
*)reverse((chain_list
*)ptloins
->LOCON
);
587 fprintf(ptfile
, "))");
589 fprintf(ptfile
, ")\n");
591 /* ---------------------------------------------------------------------------
592 Cone Netlist Structure cell list
593 --------------------------------------------------------------------------- */
594 if (ptcnsfig
->CELL
!= NULL
) {
595 fprintf(ptfile
, "\n(CELLS");
597 for (ptcell
= ptcnsfig
->CELL
; ptcell
!= NULL
; ptcell
= ptcell
->NEXT
) {
598 if (ptcell
->CONES
== NULL
) continue;
600 if ((ptptype
= getptype(ptcell
->USER
, (long) CNS_INDEX
)) != NULL
) {
601 ptptype
->DATA
= (void *) counter
;
604 ptcell
->USER
= addptype(ptcell
->USER
, (long) CNS_INDEX
, (void *) counter
);
606 fprintf(ptfile
, "\n\n(%ld", counter
);
607 strcpy(cell_type
, "");
608 if ((ptcell
->TYPE
& CNS_UNKNOWN
) == CNS_UNKNOWN
) {
609 if (ptcell
->TYPE
!= 0) {
610 fprintf(ptfile
, " %ld", (ptcell
->TYPE
& ~CNS_UNKNOWN
));
613 strcat(cell_type
, "?");
618 if ((ptcell
->TYPE
& CNS_SUPER_BUFFER
) == CNS_SUPER_BUFFER
)
619 strcat(cell_type
, "Super_Buffer");
620 else if ((ptcell
->TYPE
& CNS_TRISTATE_E
) == CNS_TRISTATE_E
)
621 strcat(cell_type
, "Tristate");
622 else if ((ptcell
->TYPE
& CNS_SQUIRT_BUFFER
) == CNS_SQUIRT_BUFFER
)
623 strcat(cell_type
, "Squirt_Buffer");
624 else if ((ptcell
->TYPE
& CNS_LATCH_E
) == CNS_LATCH_E
)
625 strcat(cell_type
, "Latch");
626 else if ((ptcell
->TYPE
& CNS_READ
) == CNS_READ
)
627 strcat(cell_type
, "Read");
628 else if ((ptcell
->TYPE
& CNS_MS_FF
) == CNS_MS_FF
)
629 strcat(cell_type
, "Ms_Ff");
630 if (strlen(cell_type
) == 0) {
631 strcat(cell_type
, "?");
634 fprintf(ptfile
, " %s", cell_type
);
636 if ((ptchain
= ptcell
->CONES
) != NULL
) {
637 fprintf(ptfile
, "\n(%ld", ((cone_list
*) ptchain
->DATA
)->INDEX
);
639 for (ptchain
= ptchain
->NEXT
; ptchain
!= NULL
; ptchain
= ptchain
->NEXT
) {
640 if (counter1
++ == 9) {
641 fprintf(ptfile
, "\n");
644 if (ptchain
->DATA
!= NULL
) {
645 fprintf(ptfile
, " %ld", ((cone_list
*) ptchain
->DATA
)->INDEX
);
648 fprintf(ptfile
, " ?");
654 fprintf(ptfile
, "\n(?");
657 fprintf(ptfile
, "))");
659 fprintf(ptfile
, ")\n");
662 /* ---------------------------------------------------------------------------
663 Cone Netlist Structure cone list
664 --------------------------------------------------------------------------- */
665 fprintf(ptfile
, "\n(CONES");
666 for (ptcone0
= ptcnsfig
->CONE
; ptcone0
!= NULL
; ptcone0
= ptcone0
->NEXT
) {
667 if (strchr(ptcone0
->NAME
, ' ') != NULL
) {
668 fprintf(ptfile
, "\n\n(%ld \"%s\"", ptcone0
->INDEX
, ptcone0
->NAME
);
670 else fprintf(ptfile
, "\n\n(%ld %s", ptcone0
->INDEX
, ptcone0
->NAME
);
671 strcpy(cone_type
, "");
672 if ((ptcone0
->TYPE
& CNS_MEMSYM
) == CNS_MEMSYM
)
673 strcat(cone_type
, "M");
674 if ((ptcone0
->TYPE
& CNS_LATCH
) == CNS_LATCH
)
675 strcat(cone_type
, "L");
676 if ((ptcone0
->TYPE
& CNS_RS
) == CNS_RS
)
677 strcat(cone_type
, "S");
678 if ((ptcone0
->TYPE
& CNS_FLIP_FLOP
) == CNS_FLIP_FLOP
)
679 strcat(cone_type
, "F");
680 if ((ptcone0
->TYPE
& CNS_MASTER
) == CNS_MASTER
)
681 strcat(cone_type
, "m");
682 if ((ptcone0
->TYPE
& CNS_SLAVE
) == CNS_SLAVE
)
683 strcat(cone_type
, "e");
684 if ((ptcone0
->TYPE
& CNS_PRECHARGE
) == CNS_PRECHARGE
)
685 strcat(cone_type
, "P");
686 if ((ptcone0
->TYPE
& CNS_TRI
) == CNS_TRI
)
687 strcat(cone_type
, "T");
688 if ((ptcone0
->TYPE
& CNS_CONFLICT
) == CNS_CONFLICT
)
689 strcat(cone_type
, "C");
690 if ((ptcone0
->TYPE
& CNS_EXT
) == CNS_EXT
)
691 strcat(cone_type
, "Ext");
692 if ((ptcone0
->TYPE
& CNS_VDD
) == CNS_VDD
)
693 strcat(cone_type
, "Vdd");
694 if ((ptcone0
->TYPE
& CNS_GND
) == CNS_GND
)
695 strcat(cone_type
, "Gnd");
696 if ((ptcone0
->TYPE
& CNS_VSS
) == CNS_VSS
)
697 strcat(cone_type
, "Vss");
698 /* if (strlen(cone_type) == 0) {
699 strcat(cone_type, "?");
702 fprintf(ptfile
, " %s -", cone_type
);
704 strcpy(cone_tectype
, "");
705 if ((ptcone0
->TECTYPE
& CNS_DUAL_CMOS
) == CNS_DUAL_CMOS
)
706 strcat(cone_tectype
, "dC");
707 else if ((ptcone0
->TECTYPE
& CNS_CMOS
) == CNS_CMOS
)
708 strcat(cone_tectype
, "Cm");
709 if ((ptcone0
->TECTYPE
& CNS_VDD_DEGRADED
) == CNS_VDD_DEGRADED
)
710 strcat(cone_tectype
, "VddD");
711 if ((ptcone0
->TECTYPE
& CNS_GND_DEGRADED
) == CNS_GND_DEGRADED
)
712 strcat(cone_tectype
, "GndD");
713 if ((ptcone0
->TECTYPE
& CNS_VSS_DEGRADED
) == CNS_VSS_DEGRADED
)
714 strcat(cone_tectype
, "VssD");
715 if ((ptcone0
->TECTYPE
& CNS_NOR
) == CNS_NOR
)
716 strcat(cone_tectype
, "Nor");
717 if ((ptcone0
->TECTYPE
& CNS_OR
) == CNS_OR
)
718 strcat(cone_tectype
, "Or");
719 if ((ptcone0
->TECTYPE
& CNS_PR_NOR
) == CNS_PR_NOR
)
720 strcat(cone_tectype
, "Pr_Nor");
721 if ((ptcone0
->TECTYPE
& CNS_NAND
) == CNS_NAND
)
722 strcat(cone_tectype
, "Nand");
723 if ((ptcone0
->TECTYPE
& CNS_SBE
) == CNS_SBE
)
724 strcat(cone_tectype
, "Sbe");
725 if ((ptcone0
->TECTYPE
& CNS_SBD
) == CNS_SBD
)
726 strcat(cone_tectype
, "Sbd");
727 if ((ptcone0
->TECTYPE
& CNS_TRISTATE_O
) == CNS_TRISTATE_O
)
728 strcat(cone_tectype
, "Tristate_o");
729 if ((ptcone0
->TECTYPE
& CNS_SQUIRT_O
) == CNS_SQUIRT_O
)
730 strcat(cone_tectype
, "Squirt_o");
731 if ((ptcone0
->TECTYPE
& CNS_LATCH_O
) == CNS_LATCH_O
)
732 strcat(cone_tectype
, "Latch_o");
733 if ((ptcone0
->TECTYPE
& CNS_PR_BUS
) == CNS_PR_BUS
)
734 strcat(cone_tectype
, "Pr_Bus");
735 if ((ptcone0
->TECTYPE
& CNS_ZERO
) == CNS_ZERO
)
736 strcat(cone_tectype
, "Zero");
737 if ((ptcone0
->TECTYPE
& CNS_ONE
) == CNS_ONE
)
738 strcat(cone_tectype
, "One");
739 if (strlen(cone_tectype
) == 0) {
740 strcat(cone_tectype
, "X");
742 fprintf(ptfile
, " %s", cone_tectype
);
745 fprintf(ptfile
, " %ld %ld %ld %ld", ptcone0
->XM
, ptcone0
->Xm
, ptcone0
->YM
, ptcone0
->Ym
);
747 fprintf(ptfile
, " %d %d %d %d", 0, 0, 0, 0);
749 /* ------------------------------------------------------------------------
751 ------------------------------------------------------------------------ */
752 fprintf(ptfile
, "\n(INPUT");
753 if (ptcone0
->INCONE
!= NULL
) {
754 for (ptedge
= ptcone0
->INCONE
; ptedge
!= NULL
; ptedge
= ptedge
->NEXT
) {
755 if ((ptedge
->TYPE
& CNS_CONE
) == CNS_CONE
) {
756 fprintf(ptfile
, "\n(Cone");
757 ptcone1
= ptedge
->UEDGE
.CONE
;
758 if (ptcone1
!= NULL
) {
759 if ((ptedge
->TYPE
& CNS_BLEEDER
) == CNS_BLEEDER
) {
760 fprintf(ptfile
, " bleeder");
762 if ((ptedge
->TYPE
& CNS_COMMAND
) == CNS_COMMAND
) {
763 fprintf(ptfile
, " command");
765 if ((ptedge
->TYPE
& CNS_ASYNC
) == CNS_ASYNC
) {
766 fprintf(ptfile
, " async");
768 if ((ptedge
->TYPE
& CNS_LOOP
) == CNS_LOOP
) {
769 fprintf(ptfile
, " loop");
771 if ((ptedge
->TYPE
& CNS_FEEDBACK
) == CNS_FEEDBACK
) {
772 fprintf(ptfile
, " feedback");
774 if ((ptedge
->TYPE
& CNS_MEMSYM
) == CNS_MEMSYM
) {
775 fprintf(ptfile
, " memsym");
777 if ((ptedge
->TYPE
& CNS_HZCOM
) == CNS_HZCOM
) {
778 fprintf(ptfile
, " hz_command");
780 fprintf(ptfile
, " %ld)", ptcone1
->INDEX
);
783 fprintf(ptfile
, " ?)");
787 else if ((ptedge
->TYPE
& CNS_VDD
) == CNS_VDD
) {
788 fprintf(ptfile
, "\n(Vdd");
789 ptcone1
= ptedge
->UEDGE
.CONE
;
790 if (ptcone1
!= NULL
) {
791 fprintf(ptfile
, " %ld)", ptcone1
->INDEX
);
794 fprintf(ptfile
, " ?)");
798 else if ((ptedge
->TYPE
& CNS_GND
) == CNS_GND
) {
799 fprintf(ptfile
, "\n(Gnd");
800 ptcone1
= ptedge
->UEDGE
.CONE
;
801 if (ptcone1
!= NULL
) {
802 fprintf(ptfile
, " %ld)", ptcone1
->INDEX
);
805 fprintf(ptfile
, " ?)");
809 else if ((ptedge
->TYPE
& CNS_VSS
) == CNS_VSS
) {
810 fprintf(ptfile
, "\n(Vss");
811 ptcone1
= ptedge
->UEDGE
.CONE
;
812 if (ptcone1
!= NULL
) {
813 fprintf(ptfile
, " %ld)", ptcone1
->INDEX
);
816 fprintf(ptfile
, " ?)");
820 else if ((ptedge
->TYPE
& CNS_EXT
) == CNS_EXT
) {
821 fprintf(ptfile
, "\n(Ext");
822 ptlocon
= ptedge
->UEDGE
.LOCON
;
823 if ((ptlocon
!= NULL
) && ((ptptype
= getptype(ptlocon
->USER
, (long) CNS_INDEX
)) != NULL
)) {
824 fprintf(ptfile
, " %ld)", (long) ptptype
->DATA
);
827 fprintf(ptfile
, " ?)");
832 fprintf(ptfile
, "\n(? ?)");
837 fprintf(ptfile
, ")");
839 /* ------------------------------------------------------------------------
841 ------------------------------------------------------------------------ */
842 fprintf(ptfile
, "\n(OUTPUT");
843 if (ptcone0
->OUTCONE
!= NULL
) {
844 for (ptedge
= ptcone0
->OUTCONE
; ptedge
!= NULL
; ptedge
= ptedge
->NEXT
) {
845 if ((ptedge
->TYPE
& CNS_CONE
) == CNS_CONE
) {
846 fprintf(ptfile
, "\n(Cone");
847 ptcone1
= ptedge
->UEDGE
.CONE
;
848 if (ptcone1
!= NULL
) {
849 if ((ptedge
->TYPE
& CNS_BLEEDER
) == CNS_BLEEDER
) {
850 fprintf(ptfile
, " bleeder");
852 if ((ptedge
->TYPE
& CNS_COMMAND
) == CNS_COMMAND
) {
853 fprintf(ptfile
, " command");
855 if ((ptedge
->TYPE
& CNS_ASYNC
) == CNS_ASYNC
) {
856 fprintf(ptfile
, " async");
858 if ((ptedge
->TYPE
& CNS_LOOP
) == CNS_LOOP
) {
859 fprintf(ptfile
, " loop");
861 if ((ptedge
->TYPE
& CNS_FEEDBACK
) == CNS_FEEDBACK
) {
862 fprintf(ptfile
, " feedback");
864 if ((ptedge
->TYPE
& CNS_MEMSYM
) == CNS_MEMSYM
) {
865 fprintf(ptfile
, " memsym");
867 fprintf(ptfile
, " %ld)", ptcone1
->INDEX
);
870 fprintf(ptfile
, " ?)");
874 else if ((ptedge
->TYPE
& CNS_EXT
) == CNS_EXT
) {
875 fprintf(ptfile
, "\n(Ext");
876 ptlocon
= ptedge
->UEDGE
.LOCON
;
877 if ((ptlocon
!= NULL
) && ((ptptype
= getptype(ptlocon
->USER
, (long) CNS_INDEX
)) != NULL
)) {
878 fprintf(ptfile
, " %ld)", (long) ptptype
->DATA
);
881 fprintf(ptfile
, " ?)");
886 fprintf(ptfile
, "\n(? ?)");
891 fprintf(ptfile
, ")");
893 /* ------------------------------------------------------------------------
895 ------------------------------------------------------------------------ */
896 fprintf(ptfile
, "\n(BRANCHES");
898 for (ptbranch
= ptcone0
->BRVDD
; ptbranch
!= NULL
; ptbranch
= ptbranch
->NEXT
) {
899 if (treatbr(ptfile
, ptbranch
, ++counter
)) {
904 for (ptbranch
= ptcone0
->BRGND
; ptbranch
!= NULL
; ptbranch
= ptbranch
->NEXT
) {
905 if (treatbr(ptfile
, ptbranch
, ++counter
)) {
910 for (ptbranch
= ptcone0
->BRVSS
; ptbranch
!= NULL
; ptbranch
= ptbranch
->NEXT
) {
911 if (treatbr(ptfile
, ptbranch
, ++counter
)) {
916 for (ptbranch
= ptcone0
->BREXT
; ptbranch
!= NULL
; ptbranch
= ptbranch
->NEXT
) {
917 if (treatbr(ptfile
, ptbranch
, ++counter
)) {
922 fprintf(ptfile
, ")");
925 /* ------------------------------------------------------------------------
926 cells containg the cone
927 ------------------------------------------------------------------------ */
928 if ((ptchain
= ptcone0
->CELLS
) != NULL
) {
929 fprintf(ptfile
, "\n(CELLS");
930 if ((ptptype
= getptype(((cell_list
*) ptchain
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
931 fprintf(ptfile
, "\n(%ld", (long) ptptype
->DATA
);
934 fprintf(ptfile
, "\n(?");
937 for (ptchain
= ptchain
->NEXT
; ptchain
!= NULL
; ptchain
= ptchain
->NEXT
) {
938 if (counter1
++ == 9) {
939 fprintf(ptfile
, "\n");
942 if (ptchain
->DATA
!= NULL
) {
943 if ((ptptype
= getptype(((cell_list
*) ptchain
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
944 fprintf(ptfile
, " %ld", (long) ptptype
->DATA
);
947 fprintf(ptfile
, " ?");
951 fprintf(ptfile
, " ?");
955 fprintf(ptfile
, "))");
958 /* ------------------------------------------------------------------------
960 ------------------------------------------------------------------------ */
961 if (((getptype(ptcone0
->USER
, (long) CNS_PARALLEL
)) != NULL
)
962 || ((getptype(ptcone0
->USER
, (long) CNS_BLEEDER
)) != NULL
)
963 || ((getptype(ptcone0
->USER
, (long) CNS_SIGNATURE
)) != NULL
)
964 || ((getptype(ptcone0
->USER
, (long) CNS_SWITCH
)) != NULL
)
965 || getptype(ptcone0
->USER
, (long) CNS_SIGNAL
) != NULL
) {
966 fprintf(ptfile
, "\n(USER");
968 /* ---------------------------------------------------------------------
969 cone parallel branches
970 --------------------------------------------------------------------- */
971 if ((ptptype
= getptype(ptcone0
->USER
, (long) CNS_PARALLEL
)) != NULL
) {
972 if ((ptchain0
= (chain_list
*) ptptype
->DATA
) != NULL
) {
973 fprintf(ptfile
, "\n(PARALLEL");
974 for (ptchain0
= ptchain0
; ptchain0
!= NULL
; ptchain0
= ptchain0
->NEXT
) {
975 if (ptchain0
->DATA
!= NULL
) {
976 ptchain1
= (chain_list
*) ptchain0
->DATA
;
977 if ((ptptype1
= getptype(((branch_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
978 fprintf(ptfile
, "\n(%ld", (long) ptptype1
->DATA
);
981 fprintf(ptfile
, "\n(?");
984 for (ptchain1
= ptchain1
->NEXT
; ptchain1
!= NULL
; ptchain1
= ptchain1
->NEXT
) {
985 if (counter1
++ == 9) {
986 fprintf(ptfile
, "\n");
989 if ((ptptype1
= getptype(((branch_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
990 fprintf(ptfile
, " %ld", (long) ptptype1
->DATA
);
993 fprintf(ptfile
, " ?");
996 fprintf(ptfile
, ")");
999 fprintf(ptfile
, ")");
1003 /* ---------------------------------------------------------------------
1005 --------------------------------------------------------------------- */
1006 if ((ptptype
= getptype(ptcone0
->USER
, (long) CNS_BLEEDER
)) != NULL
) {
1007 if ((ptchain0
= (chain_list
*) ptptype
->DATA
) != NULL
) {
1008 fprintf(ptfile
, "\n(BLEEDER");
1009 if ((ptptype0
= getptype(((branch_list
*) ptchain0
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1010 fprintf(ptfile
, "\n(%ld", (long) ptptype0
->DATA
);
1013 fprintf(ptfile
, "\n(?");
1016 for (ptchain1
= ptchain0
->NEXT
; ptchain1
!= NULL
; ptchain1
= ptchain1
->NEXT
) {
1017 if (counter1
++ == 9) {
1018 fprintf(ptfile
, "\n");
1021 if ((ptptype1
= getptype(((branch_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1022 fprintf(ptfile
, " %ld", (long) ptptype1
->DATA
);
1025 fprintf(ptfile
, " ?");
1028 fprintf(ptfile
, "))");
1032 /* ---------------------------------------------------------------------
1034 --------------------------------------------------------------------- */
1035 if ((ptptype
= getptype(ptcone0
->USER
, (long) CNS_SIGNATURE
)) != NULL
) {
1036 if (ptptype
->DATA
!= NULL
) {
1037 fprintf(ptfile
, "\n(SIGNATURE");
1038 fprintf(ptfile
, "\n(%s", ((char *) ptptype
->DATA
));
1039 fprintf(ptfile
, "))");
1042 /* ---------------------------------------------------------------------
1044 --------------------------------------------------------------------- */
1045 if ((ptptype
= getptype(ptcone0
->USER
, (long) CNS_SIGNAL
)) != NULL
&& ptlofig
!= NULL
) {
1046 if (ptptype
->DATA
!= NULL
) {
1047 ptlosig
= (losig_list
*)ptptype
->DATA
;
1048 ptptype1
= getptype(ptlosig
->USER
, CNS_INDEX
);
1049 fprintf(ptfile
, "\n(SIGIDX");
1050 fprintf(ptfile
, "\n(%ld", (long)ptptype1
->DATA
);
1051 fprintf(ptfile
, "))");
1054 /* ---------------------------------------------------------------------
1056 --------------------------------------------------------------------- */
1057 if ((ptptype
= getptype(ptcone0
->USER
, (long) CNS_SWITCH
)) != NULL
) {
1058 if ((ptchain0
= (chain_list
*) ptptype
->DATA
) != NULL
) {
1059 fprintf(ptfile
, "\n(SWITCH\n");
1061 for (ptchain0
= ptchain0
; ptchain0
!= NULL
; ptchain0
= ptchain0
->NEXT
) {
1062 if (counter1
++ == 5) {
1063 fprintf(ptfile
, "\n");
1066 if ((ptchain1
= (chain_list
*) ptchain0
->DATA
) != NULL
) {
1067 if ((ptptype1
= getptype(((lotrs_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1068 fprintf(ptfile
, " (%ld", (long) ptptype1
->DATA
);
1071 fprintf(ptfile
, " (?");
1073 if ((ptchain1
= ptchain1
->NEXT
) != NULL
) {
1074 if ((ptptype1
= getptype(((lotrs_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1075 fprintf(ptfile
, " %ld)", (long) ptptype1
->DATA
);
1078 fprintf(ptfile
, " ?)");
1082 fprintf(ptfile
, " ?)");
1086 fprintf(ptfile
, " (? ?)");
1089 fprintf(ptfile
, ")");
1092 /* ---------------------------------------------------------------------
1093 cone parallel transistors
1094 --------------------------------------------------------------------- */
1095 if ((ptptype
= getptype(ptcone0
->USER
, (long) CNS_PARATRANS
)) != NULL
) {
1096 if ((ptchain0
= (chain_list
*) ptptype
->DATA
) != NULL
) {
1097 fprintf(ptfile
, "\n(PARATRANS");
1098 for (ptchain0
= ptchain0
; ptchain0
!= NULL
; ptchain0
= ptchain0
->NEXT
) {
1099 if (ptchain0
->DATA
!= NULL
) {
1100 ptchain1
= (chain_list
*)getptype(((lotrs_list
*)ptchain0
->DATA
)->USER
, MBK_TRANS_PARALLEL
)->DATA
;
1101 if ((ptptype1
= getptype(((lotrs_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1102 fprintf(ptfile
, "\n(%ld", (long) ptptype1
->DATA
);
1105 fprintf(ptfile
, "\n(?");
1108 for (ptchain1
= ptchain1
->NEXT
; ptchain1
!= NULL
; ptchain1
= ptchain1
->NEXT
) {
1109 if (counter1
++ == 9) {
1110 fprintf(ptfile
, "\n");
1113 if ((ptptype1
= getptype(((lotrs_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1114 fprintf(ptfile
, " %ld", (long) ptptype1
->DATA
);
1117 fprintf(ptfile
, " ?");
1120 fprintf(ptfile
, ")");
1123 fprintf(ptfile
, ")");
1127 /* ---------------------------------------------------------------------
1128 end of cone user fields
1129 --------------------------------------------------------------------- */
1130 fprintf(ptfile
, ")");
1133 /* ------------------------------------------------------------------------
1135 ------------------------------------------------------------------------ */
1136 fprintf(ptfile
, ")");
1139 /* ---------------------------------------------------------------------------
1141 --------------------------------------------------------------------------- */
1142 fprintf(ptfile
, ")");
1144 /* ---------------------------------------------------------------------------
1146 --------------------------------------------------------------------------- */
1147 fprintf(ptfile
, ")\n");
1149 for (ptcell
= ptcnsfig
->CELL
; ptcell
!= NULL
; ptcell
= ptcell
->NEXT
) {
1150 if (ptcell
->CONES
== NULL
) continue;
1151 ptcell
->USER
= testanddelptype(ptcell
->USER
, (long) CNS_INDEX
);
1153 /* ---------------------------------------------------------------------------
1155 --------------------------------------------------------------------------- */
1157 (void) fflush(stdout
);
1158 (void) fprintf(stderr
, "*** cns warning ***");
1159 (void) fprintf(stderr
, " savecnsfig(): unknown fields found (marked by '?')\n");
1162 if (fclose(ptfile
) != 0) {
1163 (void) fflush(stdout
);
1164 (void) fprintf(stderr
, "*** cns error ***");
1165 (void) fprintf(stderr
, " savecnsfig() impossible: can't close file %s.cns\n", ptcnsfig
->NAME
);
1166 if (CNS_TRACE_MODE
>= CNS_TRACE
)
1167 (void) printf("TRA_cns savecnsfig out\n");
1171 if (CNS_TRACE_MODE
>= CNS_TRACE
)
1172 (void) printf("TRA_cns savecnsfig out\n");
1175 /*============================================================================*
1176 | function treatbr(); |
1177 *============================================================================*/
1179 treatbr(ptfile
, ptbranch
, counter
)
1181 branch_list
*ptbranch
;
1185 char branch_type
[10];
1188 link_list
*ptlink
= NULL
;
1189 lotrs_list
*ptlotrs
= NULL
;
1190 ptype_list
*ptptype
= NULL
;
1191 locon_list
*ptlocon
= NULL
;
1193 if (CNS_TRACE_MODE
>= CNS_TRACE
)
1194 (void) printf("TRA_cns treatbr\n");
1196 if (ptbranch
->LINK
!= NULL
) {
1197 strcpy(branch_type
, "");
1198 if ((ptbranch
->TYPE
& CNS_NOT_FUNCTIONAL
) == CNS_NOT_FUNCTIONAL
)
1199 strcat(branch_type
, "Nf");
1200 if ((ptbranch
->TYPE
& CNS_NOT_UP
) == CNS_NOT_UP
)
1201 strcat(branch_type
, "Nu");
1202 if ((ptbranch
->TYPE
& CNS_NOT_DOWN
) == CNS_NOT_DOWN
)
1203 strcat(branch_type
, "Nd");
1204 if ((ptbranch
->TYPE
& CNS_BLEEDER
) == CNS_BLEEDER
)
1205 strcat(branch_type
, "B");
1206 if ((ptbranch
->TYPE
& CNS_VDD_DEGRADED
) == CNS_VDD_DEGRADED
)
1207 strcat(branch_type
, "Dd");
1208 if ((ptbranch
->TYPE
& CNS_VSS_DEGRADED
) == CNS_VSS_DEGRADED
)
1209 strcat(branch_type
, "Ds");
1210 if ((ptbranch
->TYPE
& CNS_FEEDBACK
) == CNS_FEEDBACK
)
1211 strcat(branch_type
, "F");
1212 if ((ptbranch
->TYPE
& CNS_NOTCONFLICTUAL
) == CNS_NOTCONFLICTUAL
)
1213 strcat(branch_type
, "Nx");
1214 if ((ptbranch
->TYPE
& CNS_RESBRANCH
) == CNS_RESBRANCH
)
1215 strcat(branch_type
, "R");
1216 if ((ptbranch
->TYPE
& CNS_IGNORE
) == CNS_IGNORE
)
1217 strcat(branch_type
, "I");
1218 if ((ptbranch
->TYPE
& CNS_PARALLEL_INS
) == CNS_PARALLEL_INS
)
1219 strcat(branch_type
, "p");
1220 else if ((ptbranch
->TYPE
& CNS_PARALLEL
) == CNS_PARALLEL
)
1221 strcat(branch_type
, "P");
1222 if ((ptbranch
->TYPE
& CNS_VDD
) == CNS_VDD
)
1223 strcat(branch_type
, "Vdd");
1224 if ((ptbranch
->TYPE
& CNS_GND
) == CNS_GND
)
1225 strcat(branch_type
, "Gnd");
1226 if ((ptbranch
->TYPE
& CNS_VSS
) == CNS_VSS
)
1227 strcat(branch_type
, "Vss");
1228 if ((ptbranch
->TYPE
& CNS_EXT
) == CNS_EXT
)
1229 strcat(branch_type
, "Ext");
1230 if (strlen(branch_type
) == 0) {
1231 strcat(branch_type
, "?");
1234 if ((ptptype
= getptype(ptbranch
->USER
, (long) CNS_INDEX
)) != NULL
) {
1235 ptptype
->DATA
= (void *) counter
;
1238 ptbranch
->USER
= addptype(ptbranch
->USER
, (long) CNS_INDEX
, (void *) counter
);
1240 fprintf(ptfile
, "\n(%ld %s", counter
, branch_type
);
1241 for (ptlink
= ptbranch
->LINK
; ptlink
!= NULL
; ptlink
= ptlink
->NEXT
) {
1242 if ((ptlink
->TYPE
& CNS_EXT
) != CNS_EXT
) {
1243 strcpy(lotrs_type
, "");
1244 if ((ptlink
->TYPE
& CNS_SW
) == CNS_SW
)
1245 strcat(lotrs_type
, "S");
1246 if ((ptlink
->TYPE
& CNS_PULL
) == CNS_PULL
)
1247 strcat(lotrs_type
, "P");
1248 if ((ptlink
->TYPE
& CNS_DRIV_PULL
) == CNS_DRIV_PULL
)
1249 strcat(lotrs_type
, "p");
1250 if ((ptlink
->TYPE
& CNS_DIODE_UP
) == CNS_DIODE_UP
)
1251 strcat(lotrs_type
, "DU");
1252 if ((ptlink
->TYPE
& CNS_DIODE_DOWN
) == CNS_DIODE_DOWN
)
1253 strcat(lotrs_type
, "DD");
1254 if ((ptlink
->TYPE
& CNS_SHORT
) == CNS_SHORT
)
1255 strcat(lotrs_type
, "X");
1256 if ((ptlink
->TYPE
& CNS_RESIST
) == CNS_RESIST
)
1257 strcat(lotrs_type
, "R");
1258 if ((ptlink
->TYPE
& CNS_CAPA
) == CNS_CAPA
)
1259 strcat(lotrs_type
, "C");
1260 if ((ptlink
->TYPE
& CNS_DIPOLE
) == CNS_DIPOLE
)
1261 strcat(lotrs_type
, "d");
1262 if ((ptlink
->TYPE
& CNS_SWITCH
) == CNS_SWITCH
)
1263 strcat(lotrs_type
, "_s");
1264 if ((ptlink
->TYPE
& CNS_COMMAND
) == CNS_COMMAND
)
1265 strcat(lotrs_type
, "_c");
1266 if ((ptlink
->TYPE
& CNS_ASYNCLINK
) == CNS_ASYNCLINK
)
1267 strcat(lotrs_type
, "_a");
1268 if (strlen(lotrs_type
) == 0) {
1269 strcat(lotrs_type
, "?");
1272 fprintf(ptfile
, "\n(%s", lotrs_type
);
1273 ptlotrs
= ptlink
->ULINK
.LOTRS
;
1274 if (ptlotrs
!= NULL
) {
1275 if (strcmp(CNS_TECHNO
, "edmesfet") == 0) {
1276 if (MLO_IS_TRANSN(ptlotrs
->TYPE
))
1277 fprintf(ptfile
, " E");
1278 else if (MLO_IS_TRANSP(ptlotrs
->TYPE
))
1279 fprintf(ptfile
, " D");
1281 fprintf(ptfile
, " ?");
1285 else if (strcmp(CNS_TECHNO
, "npmosfet") == 0) {
1286 if (MLO_IS_TRANSN(ptlotrs
->TYPE
))
1287 fprintf(ptfile
, " N");
1288 else if (MLO_IS_TRANSP(ptlotrs
->TYPE
))
1289 fprintf(ptfile
, " P");
1291 fprintf(ptfile
, " ?");
1296 fprintf(ptfile
, " ?");
1299 if ((ptptype
= getptype(ptlotrs
->USER
, (long) CNS_INDEX
)) != NULL
) {
1300 fprintf(ptfile
, " %ld", (long) ptptype
->DATA
);
1303 fprintf(ptfile
, " ?");
1309 if ((ptlink
->TYPE
& CNS_IN
) == CNS_IN
) {
1310 fprintf(ptfile
, "\n(In");
1312 else if ((ptlink
->TYPE
& CNS_INOUT
) == CNS_INOUT
) {
1313 fprintf(ptfile
, "\n(InOut");
1316 fprintf(ptfile
, "\n(?");
1319 ptlocon
= ptlink
->ULINK
.LOCON
;
1320 if ((ptlocon
!= NULL
) && ((ptptype
= getptype(ptlocon
->USER
, (long) CNS_INDEX
)) != NULL
)) {
1321 fprintf(ptfile
, " %ld", (long) ptptype
->DATA
);
1324 fprintf(ptfile
, " ?");
1328 ptptype
= getptype(ptlink
->SIG
->USER
, CNS_INDEX
);
1329 fprintf(ptfile
, " %ld", (long) ptptype
->DATA
);
1330 fprintf(ptfile
, ")");
1332 fprintf(ptfile
, ")");
1338 /*============================================================================*
1339 | function savecnvfig(); |
1340 | Verbose Cone Netlist driver |
1341 *============================================================================*/
1343 savecnvfig(ptcnsfig
)
1344 cnsfig_list
*ptcnsfig
;
1348 locon_list
*ptlocon
;
1350 lotrs_list
*ptlotrs
;
1351 ptype_list
*ptptype
;
1357 chain_list
*ptchain
;
1359 char cone_type
[256];
1360 char cone_tectype
[256];
1363 branch_list
*ptbranch
;
1364 chain_list
*ptchain0
;
1365 ptype_list
*ptptype0
;
1366 chain_list
*ptchain1
;
1367 ptype_list
*ptptype1
;
1370 if (CNS_TRACE_MODE
>= CNS_TRACE
)
1371 (void) printf("TRA_cns savecnsfig in\n");
1373 /* ---------------------------------------------------------------------------
1375 --------------------------------------------------------------------------- */
1377 if ((ptfile
= mbkfopen(ptcnsfig
->NAME
, "cnv", WRITE_TEXT
)) == NULL
) {
1378 (void) fflush(stdout
);
1379 (void) fprintf(stderr
, "*** cns error ***");
1380 (void) fprintf(stderr
, " savecnvfig() impossible: can't open file %s.cnv\n", ptcnsfig
->NAME
);
1381 if (CNS_TRACE_MODE
>= CNS_TRACE
)
1382 (void) printf("TRA_cns savecnvfig out\n");
1386 /* ---------------------------------------------------------------------------
1388 --------------------------------------------------------------------------- */
1391 sprintf(buffer
, "CNS V%s %s\n"
1393 "Netlist format: %s\n",
1394 CNS_VERSION
, CNS_TECHNO
, ptcnsfig
->NAME
, IN_LO
);
1396 avt_printExecInfo(ptfile
, "*", buffer
, "");
1398 /* ---------------------------------------------------------------------------
1400 --------------------------------------------------------------------------- */
1401 fprintf(ptfile
, "\nCapacitance Scale: %ld\n", SCALE_X
);
1403 /* ---------------------------------------------------------------------------
1404 Cone Netlist Structure external connector list
1405 --------------------------------------------------------------------------- */
1407 fprintf(ptfile
, "\nEXTERNAL CONNECTORS\n");
1408 for (ptlocon
= ptcnsfig
->LOCON
; ptlocon
!= NULL
; ptlocon
= ptlocon
->NEXT
) {
1410 if ((ptptype
= getptype(ptlocon
->USER
, (long) CNS_INDEX
)) != NULL
) {
1411 ptptype
->DATA
= (void *) counter
;
1414 ptlocon
->USER
= addptype(ptlocon
->USER
, (long) CNS_INDEX
, (void *) counter
);
1416 if (strchr(ptlocon
->NAME
, ' ') != NULL
) {
1417 fprintf(ptfile
, "\n %ld) %s[%d]", counter
, vectorradical(ptlocon
->NAME
), vectorindex(ptlocon
->NAME
));
1419 else fprintf(ptfile
, "\n %ld) %s", counter
, ptlocon
->NAME
);
1420 if (ptlocon
->DIRECTION
== CNS_I
)
1421 fprintf(ptfile
, " (Input)");
1422 else if (ptlocon
->DIRECTION
== CNS_O
)
1423 fprintf(ptfile
, " (Output)");
1424 else if (ptlocon
->DIRECTION
== CNS_B
)
1425 fprintf(ptfile
, " (Bidirectional)");
1426 else if (ptlocon
->DIRECTION
== CNS_Z
)
1427 fprintf(ptfile
, " (Tristate output)");
1428 else if (ptlocon
->DIRECTION
== CNS_T
)
1429 fprintf(ptfile
, " (Bidirectional tristate)");
1430 else if (ptlocon
->DIRECTION
== CNS_X
)
1431 fprintf(ptfile
, " (Unknown)");
1432 else if (ptlocon
->DIRECTION
== CNS_VDDC
)
1433 fprintf(ptfile
, " (Vdd)");
1434 else if (ptlocon
->DIRECTION
== CNS_GNDC
)
1435 fprintf(ptfile
, " (Gnd)");
1436 else if (ptlocon
->DIRECTION
== CNS_VSSC
)
1437 fprintf(ptfile
, " (Vss)");
1439 fprintf(ptfile
, " (?)");
1442 ptptype
= getptype(ptlocon
->USER
, CNS_TYPELOCON
);
1443 if (ptptype
!= NULL
) {
1444 if (((long)ptptype
->DATA
& CNS_ONE
) == CNS_ONE
) fprintf(ptfile
, " Stuck One");
1445 else if (((long)ptptype
->DATA
& CNS_ZERO
) == CNS_ZERO
) fprintf(ptfile
, " Stuck Zero");
1448 fprintf(ptfile
, "\n");
1450 /* ---------------------------------------------------------------------------
1451 Cone Netlist Structure internal connector list
1452 --------------------------------------------------------------------------- */
1453 if (ptcnsfig
->INTCON
!= NULL
) {
1454 fprintf(ptfile
, "\nCONNECTORS TO INSTANCES\n");
1455 for (ptlocon
= ptcnsfig
->INTCON
; ptlocon
!= NULL
; ptlocon
= ptlocon
->NEXT
) {
1457 if ((ptptype
= getptype(ptlocon
->USER
, (long) CNS_INDEX
)) != NULL
) {
1458 ptptype
->DATA
= (void *) counter
;
1461 ptlocon
->USER
= addptype(ptlocon
->USER
, (long) CNS_INDEX
, (void *) counter
);
1463 if (strchr(ptlocon
->NAME
, ' ') != NULL
) {
1464 fprintf(ptfile
, "\n %ld) %s[%d]", counter
, vectorradical(ptlocon
->NAME
), vectorindex(ptlocon
->NAME
));
1466 else fprintf(ptfile
, "\n %ld) %s", counter
, ptlocon
->NAME
);
1467 if (ptlocon
->DIRECTION
== CNS_I
)
1468 fprintf(ptfile
, " (Input)");
1469 else if (ptlocon
->DIRECTION
== CNS_O
)
1470 fprintf(ptfile
, " (Output)");
1471 else if (ptlocon
->DIRECTION
== CNS_B
)
1472 fprintf(ptfile
, " (Bidirectional)");
1473 else if (ptlocon
->DIRECTION
== CNS_Z
)
1474 fprintf(ptfile
, " (Tristate output)");
1475 else if (ptlocon
->DIRECTION
== CNS_T
)
1476 fprintf(ptfile
, " (Bidirectional tristate)");
1477 else if (ptlocon
->DIRECTION
== CNS_X
)
1478 fprintf(ptfile
, " (Unknown)");
1479 else if (ptlocon
->DIRECTION
== CNS_VDDC
)
1480 fprintf(ptfile
, " (Vdd)");
1481 else if (ptlocon
->DIRECTION
== CNS_GNDC
)
1482 fprintf(ptfile
, " (Gnd)");
1483 else if (ptlocon
->DIRECTION
== CNS_VSSC
)
1484 fprintf(ptfile
, " (Vss)");
1486 fprintf(ptfile
, " (?)");
1490 fprintf(ptfile
, "\n");
1493 /* ---------------------------------------------------------------------------
1494 Cone Netlist Structure transistor list
1495 --------------------------------------------------------------------------- */
1497 fprintf(ptfile
, "\nTRANSISTORS\n");
1498 for (ptlotrs
= ptcnsfig
->LOTRS
; ptlotrs
!= NULL
; ptlotrs
= ptlotrs
->NEXT
) {
1500 if ((ptptype
= getptype(ptlotrs
->USER
, (long) CNS_INDEX
)) != NULL
) {
1501 ptptype
->DATA
= (void *) counter
;
1504 ptlotrs
->USER
= addptype(ptlotrs
->USER
, (long) CNS_INDEX
, (void *) counter
);
1506 fprintf(ptfile
, "\n %ld)", counter
);
1507 if (ptlotrs
->TRNAME
!= NULL
) {
1508 if (isdigit((int)*(ptlotrs
->TRNAME
))) fprintf(ptfile
, " cns_%s", ptlotrs
->TRNAME
);
1509 else fprintf(ptfile
, " %s", ptlotrs
->TRNAME
);
1512 fprintf(ptfile
, " noname");
1514 strcpy(lotrs_type
, "");
1515 if (strcmp(CNS_TECHNO
, "edmesfet") == 0) {
1516 if (MLO_IS_TRANSN(ptlotrs
->TYPE
))
1517 strcat(lotrs_type
, "TE");
1518 else if (MLO_IS_TRANSP(ptlotrs
->TYPE
))
1519 strcat(lotrs_type
, "TD");
1521 else if (strcmp(CNS_TECHNO
, "npmosfet") == 0) {
1522 if (MLO_IS_TRANSN(ptlotrs
->TYPE
))
1523 strcat(lotrs_type
, "TN");
1524 else if (MLO_IS_TRANSP(ptlotrs
->TYPE
))
1525 strcat(lotrs_type
, "TP");
1527 if (strlen(lotrs_type
) == 0) {
1528 strcat(lotrs_type
, "?");
1531 fprintf(ptfile
, ", Type %s", lotrs_type
);
1532 if (ptlotrs
->MODINDEX
!= EMPTYHT
) fprintf(ptfile
, " (%s)", getlotrsmodel(ptlotrs
));
1533 if ((ptptype
= getptype(ptlotrs
->USER
, (long) CNS_DRIVINGCONE
)) != NULL
) {
1534 fprintf(ptfile
, " driven by '%s',", ((cone_list
*)ptptype
->DATA
)->NAME
);
1536 else if ((ptptype
= getptype(ptlotrs
->USER
, (long) CNS_LINKTYPE
)) != NULL
) {
1537 if (((long) ptptype
->DATA
& CNS_ACTIVE
) == CNS_ACTIVE
) {
1538 if ((ptcone
= (cone_list
*) ptlotrs
->GRID
) != NULL
) {
1539 fprintf(ptfile
, " driven by %ld,", ptcone
->INDEX
);
1542 fprintf(ptfile
, " driven by ?,");
1546 else if (((long) ptptype
->DATA
& CNS_PULL
) == CNS_PULL
)
1547 fprintf(ptfile
, " puller,");
1548 else if (((long) ptptype
->DATA
& (CNS_DIODE_UP
& CNS_DIODE_DOWN
)) == (CNS_DIODE_UP
& CNS_DIODE_DOWN
))
1549 fprintf(ptfile
, " diode,");
1550 else if (((long) ptptype
->DATA
& CNS_RESIST
) == CNS_RESIST
)
1551 fprintf(ptfile
, " resistance,");
1552 else if (((long) ptptype
->DATA
& CNS_CAPA
) == CNS_CAPA
)
1553 fprintf(ptfile
, " capacity,");
1555 fprintf(ptfile
, " ?");
1560 fprintf(ptfile
, " 0");
1562 if (ptlotrs
->X
!= LONG_MIN
&& ptlotrs
->Y
!= LONG_MIN
) {
1563 fprintf(ptfile
, " Position = (%ld,%ld),", ptlotrs
->X
, ptlotrs
->Y
);
1565 fprintf(ptfile
, " Width=%ld, Length=%ld,", ptlotrs
->WIDTH
, ptlotrs
->LENGTH
);
1566 fprintf(ptfile
, " PS=%ld, PD=%ld", ptlotrs
->PS
, ptlotrs
->PD
);
1567 fprintf(ptfile
, " XS=%ld, XD=%ld", ptlotrs
->XS
, ptlotrs
->XD
);
1569 fprintf(ptfile
, "\n");
1571 /* ---------------------------------------------------------------------------
1572 Cone Netlist Structure cell list
1573 --------------------------------------------------------------------------- */
1574 if (ptcnsfig
->CELL
!= NULL
) {
1575 fprintf(ptfile
, "\nCELLS");
1577 for (ptcell
= ptcnsfig
->CELL
; ptcell
!= NULL
; ptcell
= ptcell
->NEXT
) {
1578 if (ptcell
->CONES
== NULL
) continue;
1580 if ((ptptype
= getptype(ptcell
->USER
, (long) CNS_INDEX
)) != NULL
) {
1581 ptptype
->DATA
= (void *) counter
;
1584 ptcell
->USER
= addptype(ptcell
->USER
, (long) CNS_INDEX
, (void *) counter
);
1586 fprintf(ptfile
, "\n\n %ld)", counter
);
1587 if ((ptcell
->TYPE
& CNS_UNKNOWN
) == CNS_UNKNOWN
) {
1588 if (ptcell
->TYPE
!= 0) {
1589 fprintf(ptfile
, " Model %ld", (ptcell
->TYPE
& ~CNS_UNKNOWN
));
1592 fprintf(ptfile
, " Model ?");
1597 strcpy(cell_type
, "");
1598 if ((ptcell
->TYPE
& CNS_SUPER_BUFFER
) == CNS_SUPER_BUFFER
)
1599 strcat(cell_type
, "Super_Buffer");
1600 else if ((ptcell
->TYPE
& CNS_TRISTATE_E
) == CNS_TRISTATE_E
)
1601 strcat(cell_type
, "Tristate");
1602 else if ((ptcell
->TYPE
& CNS_SQUIRT_BUFFER
) == CNS_SQUIRT_BUFFER
)
1603 strcat(cell_type
, "Squirt_Buffer");
1604 else if ((ptcell
->TYPE
& CNS_LATCH_E
) == CNS_LATCH_E
)
1605 strcat(cell_type
, "Latch");
1606 else if ((ptcell
->TYPE
& CNS_READ
) == CNS_READ
)
1607 strcat(cell_type
, "Read");
1608 else if ((ptcell
->TYPE
& CNS_MS_FF
) == CNS_MS_FF
)
1609 strcat(cell_type
, "Ms_Ff");
1610 if (strlen(cell_type
) == 0) {
1611 strcat(cell_type
, "?");
1614 fprintf(ptfile
, " %s", cell_type
);
1616 for (ptchain
= ptcell
->CONES
; ptchain
!= NULL
; ptchain
= ptchain
->NEXT
) {
1617 if (ptchain
->DATA
!= NULL
) {
1618 fprintf(ptfile
, "\n %s", ((cone_list
*) ptchain
->DATA
)->NAME
);
1621 fprintf(ptfile
, " ?");
1626 fprintf(ptfile
, "\n");
1629 /* ---------------------------------------------------------------------------
1630 Cone Netlist Structure cone list
1631 --------------------------------------------------------------------------- */
1632 fprintf(ptfile
, "\nCONES");
1633 for (ptcone0
= ptcnsfig
->CONE
; ptcone0
!= NULL
; ptcone0
= ptcone0
->NEXT
) {
1634 if (strchr(ptcone0
->NAME
, ' ') != NULL
) {
1635 fprintf(ptfile
, "\n\n%ld) %s[%d]", ptcone0
->INDEX
, vectorradical(ptcone0
->NAME
), vectorindex(ptcone0
->NAME
));
1637 else fprintf(ptfile
, "\n\n%ld) %s", ptcone0
->INDEX
, ptcone0
->NAME
);
1638 strcpy(cone_type
, "");
1639 if ((ptcone0
->TYPE
& CNS_MEMSYM
) == CNS_MEMSYM
)
1640 strcat(cone_type
, "MemSym,");
1641 if ((ptcone0
->TYPE
& CNS_LATCH
) == CNS_LATCH
)
1642 strcat(cone_type
, "Latch,");
1643 if ((ptcone0
->TYPE
& CNS_RS
) == CNS_RS
)
1644 strcat(cone_type
, "RS,");
1645 if ((ptcone0
->TYPE
& CNS_FLIP_FLOP
) == CNS_FLIP_FLOP
)
1646 strcat(cone_type
, "Flip-Flop,");
1647 if ((ptcone0
->TYPE
& CNS_MASTER
) == CNS_MASTER
)
1648 strcat(cone_type
, "Master,");
1649 if ((ptcone0
->TYPE
& CNS_SLAVE
) == CNS_SLAVE
)
1650 strcat(cone_type
, "Slave,");
1651 if ((ptcone0
->TYPE
& CNS_PRECHARGE
) == CNS_PRECHARGE
)
1652 strcat(cone_type
, "Precharge,");
1653 if ((ptcone0
->TYPE
& CNS_TRI
) == CNS_TRI
)
1654 strcat(cone_type
, "Tristate,");
1655 if ((ptcone0
->TYPE
& CNS_CONFLICT
) == CNS_CONFLICT
)
1656 strcat(cone_type
, "Conflict,");
1657 if ((ptcone0
->TYPE
& CNS_EXT
) == CNS_EXT
)
1658 strcat(cone_type
, "External,");
1659 if ((ptcone0
->TYPE
& CNS_VDD
) == CNS_VDD
)
1660 strcat(cone_type
, "Vdd,");
1661 if ((ptcone0
->TYPE
& CNS_GND
) == CNS_GND
)
1662 strcat(cone_type
, "Gnd,");
1663 if ((ptcone0
->TYPE
& CNS_VSS
) == CNS_VSS
)
1664 strcat(cone_type
, "Vss,");
1665 if (strlen(cone_type
) > 0) cone_type
[strlen(cone_type
)-1] = '\0';
1666 fprintf(ptfile
, "\n Type: %s", cone_type
);
1668 strcpy(cone_tectype
, "");
1669 if ((ptcone0
->TECTYPE
& CNS_ZERO
) == CNS_ZERO
)
1670 strcat(cone_tectype
, "Stuck Zero,");
1671 if ((ptcone0
->TECTYPE
& CNS_ONE
) == CNS_ONE
)
1672 strcat(cone_tectype
, "Stuck One,");
1673 if ((ptcone0
->TECTYPE
& CNS_DUAL_CMOS
) == CNS_DUAL_CMOS
)
1674 strcat(cone_tectype
, "CMOS dual,");
1675 else if ((ptcone0
->TECTYPE
& CNS_CMOS
) == CNS_CMOS
)
1676 strcat(cone_tectype
, "CMOS,");
1677 if ((ptcone0
->TECTYPE
& CNS_VDD_DEGRADED
) == CNS_VDD_DEGRADED
)
1678 strcat(cone_tectype
, "Degraded Vdd,");
1679 if ((ptcone0
->TECTYPE
& CNS_GND_DEGRADED
) == CNS_GND_DEGRADED
)
1680 strcat(cone_tectype
, "Degraded Gnd,");
1681 if ((ptcone0
->TECTYPE
& CNS_VSS_DEGRADED
) == CNS_VSS_DEGRADED
)
1682 strcat(cone_tectype
, "Degraded Vss,");
1684 if (strlen(cone_tectype
) > 0) cone_tectype
[strlen(cone_tectype
)-1] = '\0';
1685 fprintf(ptfile
, "\n TecTytpe: %s", cone_tectype
);
1687 /* ------------------------------------------------------------------------
1689 ------------------------------------------------------------------------ */
1690 fprintf(ptfile
, "\n INPUTS");
1691 if (ptcone0
->INCONE
!= NULL
) {
1692 for (ptedge
= ptcone0
->INCONE
; ptedge
!= NULL
; ptedge
= ptedge
->NEXT
) {
1693 if ((ptedge
->TYPE
& CNS_CONE
) == CNS_CONE
) {
1694 fprintf(ptfile
, "\n Cone");
1695 ptcone1
= ptedge
->UEDGE
.CONE
;
1696 if (ptcone1
!= NULL
) {
1697 if ((ptedge
->TYPE
& CNS_BLEEDER
) == CNS_BLEEDER
) {
1698 fprintf(ptfile
, " bleeder");
1700 if ((ptedge
->TYPE
& CNS_COMMAND
) == CNS_COMMAND
) {
1701 fprintf(ptfile
, " command");
1703 if ((ptedge
->TYPE
& CNS_ASYNC
) == CNS_ASYNC
) {
1704 fprintf(ptfile
, " async");
1706 if ((ptedge
->TYPE
& CNS_LOOP
) == CNS_LOOP
) {
1707 fprintf(ptfile
, " loop");
1709 if ((ptedge
->TYPE
& CNS_FEEDBACK
) == CNS_FEEDBACK
) {
1710 fprintf(ptfile
, " feedback");
1712 if ((ptedge
->TYPE
& CNS_MEMSYM
) == CNS_MEMSYM
) {
1713 fprintf(ptfile
, " memsym");
1715 if ((ptedge
->TYPE
& CNS_HZCOM
) == CNS_HZCOM
) {
1716 fprintf(ptfile
, " hz_command");
1718 fprintf(ptfile
, " '%s' (Index=%ld)", ptcone1
->NAME
, ptcone1
->INDEX
);
1721 fprintf(ptfile
, " ?");
1725 else if ((ptedge
->TYPE
& CNS_VDD
) == CNS_VDD
) {
1726 fprintf(ptfile
, "\n Vdd");
1727 ptcone1
= ptedge
->UEDGE
.CONE
;
1728 if (ptcone1
!= NULL
) {
1729 fprintf(ptfile
, " '%s' (Index=%ld)", ptcone1
->NAME
, ptcone1
->INDEX
);
1732 fprintf(ptfile
, " ?");
1736 else if ((ptedge
->TYPE
& CNS_GND
) == CNS_GND
) {
1737 fprintf(ptfile
, "\n Gnd");
1738 ptcone1
= ptedge
->UEDGE
.CONE
;
1739 if (ptcone1
!= NULL
) {
1740 fprintf(ptfile
, " '%s' (Index=%ld)", ptcone1
->NAME
, ptcone1
->INDEX
);
1743 fprintf(ptfile
, " ?");
1747 else if ((ptedge
->TYPE
& CNS_VSS
) == CNS_VSS
) {
1748 fprintf(ptfile
, "\n Vss");
1749 ptcone1
= ptedge
->UEDGE
.CONE
;
1750 if (ptcone1
!= NULL
) {
1751 fprintf(ptfile
, " '%s' (Index=%ld)", ptcone1
->NAME
, ptcone1
->INDEX
);
1754 fprintf(ptfile
, " ?");
1758 else if ((ptedge
->TYPE
& CNS_EXT
) == CNS_EXT
) {
1759 fprintf(ptfile
, "\n Ext");
1760 ptlocon
= ptedge
->UEDGE
.LOCON
;
1761 if (ptlocon
!= NULL
) {
1762 fprintf(ptfile
, " '%s'", ptlocon
->NAME
);
1765 fprintf(ptfile
, " ?");
1770 fprintf(ptfile
, "\n ? ?");
1776 /* ------------------------------------------------------------------------
1778 ------------------------------------------------------------------------ */
1779 fprintf(ptfile
, "\n OUTPUTS");
1780 if (ptcone0
->OUTCONE
!= NULL
) {
1781 for (ptedge
= ptcone0
->OUTCONE
; ptedge
!= NULL
; ptedge
= ptedge
->NEXT
) {
1782 if ((ptedge
->TYPE
& CNS_CONE
) == CNS_CONE
) {
1783 fprintf(ptfile
, "\n Cone");
1784 ptcone1
= ptedge
->UEDGE
.CONE
;
1785 if (ptcone1
!= NULL
) {
1786 if ((ptedge
->TYPE
& CNS_BLEEDER
) == CNS_BLEEDER
) {
1787 fprintf(ptfile
, " bleeder");
1789 if ((ptedge
->TYPE
& CNS_COMMAND
) == CNS_COMMAND
) {
1790 fprintf(ptfile
, " command");
1792 if ((ptedge
->TYPE
& CNS_ASYNC
) == CNS_ASYNC
) {
1793 fprintf(ptfile
, " async");
1795 if ((ptedge
->TYPE
& CNS_LOOP
) == CNS_LOOP
) {
1796 fprintf(ptfile
, " loop");
1798 if ((ptedge
->TYPE
& CNS_FEEDBACK
) == CNS_FEEDBACK
) {
1799 fprintf(ptfile
, " feedback");
1801 if ((ptedge
->TYPE
& CNS_MEMSYM
) == CNS_MEMSYM
) {
1802 fprintf(ptfile
, " memsym");
1804 fprintf(ptfile
, " '%s' (Index=%ld)", ptcone1
->NAME
, ptcone1
->INDEX
);
1807 fprintf(ptfile
, " ?");
1811 else if ((ptedge
->TYPE
& CNS_EXT
) == CNS_EXT
) {
1812 fprintf(ptfile
, "\n Ext");
1813 ptlocon
= ptedge
->UEDGE
.LOCON
;
1814 if (ptlocon
!= NULL
) {
1815 fprintf(ptfile
, " '%s'", ptlocon
->NAME
);
1818 fprintf(ptfile
, " ?");
1823 fprintf(ptfile
, "\n ? ?");
1829 /* ------------------------------------------------------------------------
1831 ------------------------------------------------------------------------ */
1832 fprintf(ptfile
, "\n BRANCHES");
1834 for (ptbranch
= ptcone0
->BRVDD
; ptbranch
!= NULL
; ptbranch
= ptbranch
->NEXT
) {
1835 if (treatbrv(ptfile
, ptbranch
, ++counter
)) {
1840 for (ptbranch
= ptcone0
->BRGND
; ptbranch
!= NULL
; ptbranch
= ptbranch
->NEXT
) {
1841 if (treatbrv(ptfile
, ptbranch
, ++counter
)) {
1846 for (ptbranch
= ptcone0
->BRVSS
; ptbranch
!= NULL
; ptbranch
= ptbranch
->NEXT
) {
1847 if (treatbrv(ptfile
, ptbranch
, ++counter
)) {
1852 for (ptbranch
= ptcone0
->BREXT
; ptbranch
!= NULL
; ptbranch
= ptbranch
->NEXT
) {
1853 if (treatbrv(ptfile
, ptbranch
, ++counter
)) {
1859 /* ------------------------------------------------------------------------
1860 cells containg the cone
1861 ------------------------------------------------------------------------ */
1862 if ((ptchain
= ptcone0
->CELLS
) != NULL
) {
1863 fprintf(ptfile
, "\n CELLS");
1864 if ((ptptype
= getptype(((cell_list
*) ptchain
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1865 fprintf(ptfile
, "\n (%ld", (long) ptptype
->DATA
);
1868 fprintf(ptfile
, "\n (?");
1871 for (ptchain
= ptchain
->NEXT
; ptchain
!= NULL
; ptchain
= ptchain
->NEXT
) {
1872 if (counter1
++ == 9) {
1873 fprintf(ptfile
, "\n");
1876 if (ptchain
->DATA
!= NULL
) {
1877 if ((ptptype
= getptype(((cell_list
*) ptchain
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1878 fprintf(ptfile
, " %ld", (long) ptptype
->DATA
);
1881 fprintf(ptfile
, " ?");
1885 fprintf(ptfile
, " ?");
1889 fprintf(ptfile
, ")");
1892 /* ------------------------------------------------------------------------
1894 ------------------------------------------------------------------------ */
1895 if (((getptype(ptcone0
->USER
, (long) CNS_PARALLEL
)) != NULL
)
1896 || ((getptype(ptcone0
->USER
, (long) CNS_BLEEDER
)) != NULL
)
1897 || ((getptype(ptcone0
->USER
, (long) CNS_PARATRANS
)) != NULL
)
1898 || ((getptype(ptcone0
->USER
, (long) CNS_SWITCH
)) != NULL
)) {
1899 fprintf(ptfile
, "\n MISCELLANEOUS");
1901 /* ---------------------------------------------------------------------
1902 cone parallel branches
1903 --------------------------------------------------------------------- */
1904 if ((ptptype
= getptype(ptcone0
->USER
, (long) CNS_PARALLEL
)) != NULL
) {
1905 if ((ptchain0
= (chain_list
*) ptptype
->DATA
) != NULL
) {
1906 fprintf(ptfile
, "\n PARALLEL BRANCHES");
1907 for (ptchain0
= ptchain0
; ptchain0
!= NULL
; ptchain0
= ptchain0
->NEXT
) {
1908 if (ptchain0
->DATA
!= NULL
) {
1909 ptchain1
= (chain_list
*) ptchain0
->DATA
;
1910 if ((ptptype1
= getptype(((branch_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1911 fprintf(ptfile
, "\n (%ld", (long) ptptype1
->DATA
);
1914 fprintf(ptfile
, "\n (?");
1916 for (ptchain1
= ptchain1
->NEXT
; ptchain1
!= NULL
; ptchain1
= ptchain1
->NEXT
) {
1917 if ((ptptype1
= getptype(((branch_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1918 fprintf(ptfile
, " %ld", (long) ptptype1
->DATA
);
1921 fprintf(ptfile
, " ?");
1924 fprintf(ptfile
, ")");
1930 /* ---------------------------------------------------------------------
1932 --------------------------------------------------------------------- */
1933 if ((ptptype
= getptype(ptcone0
->USER
, (long) CNS_BLEEDER
)) != NULL
) {
1934 if ((ptchain0
= (chain_list
*) ptptype
->DATA
) != NULL
) {
1935 fprintf(ptfile
, "\n BLEEDER BRANCHES");
1936 if ((ptptype0
= getptype(((branch_list
*) ptchain0
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1937 fprintf(ptfile
, "\n (%ld", (long) ptptype0
->DATA
);
1940 fprintf(ptfile
, "\n (?");
1942 for (ptchain1
= ptchain0
->NEXT
; ptchain1
!= NULL
; ptchain1
= ptchain1
->NEXT
) {
1943 if ((ptptype1
= getptype(((branch_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1944 fprintf(ptfile
, " %ld", (long) ptptype1
->DATA
);
1947 fprintf(ptfile
, " ?");
1950 fprintf(ptfile
, ")");
1954 /* ---------------------------------------------------------------------
1956 --------------------------------------------------------------------- */
1957 if ((ptptype
= getptype(ptcone0
->USER
, (long) CNS_SWITCH
)) != NULL
) {
1958 if ((ptchain0
= (chain_list
*) ptptype
->DATA
) != NULL
) {
1959 fprintf(ptfile
, "\n SWITCH TRANSISTOR PAIRS");
1961 for (ptchain0
= ptchain0
; ptchain0
!= NULL
; ptchain0
= ptchain0
->NEXT
) {
1962 if ((ptchain1
= (chain_list
*) ptchain0
->DATA
) != NULL
) {
1963 if ((ptptype1
= getptype(((lotrs_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1964 fprintf(ptfile
, "\n (%ld", (long) ptptype1
->DATA
);
1967 fprintf(ptfile
, "\n (?");
1969 if ((ptchain1
= ptchain1
->NEXT
) != NULL
) {
1970 if ((ptptype1
= getptype(((lotrs_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1971 fprintf(ptfile
, " %ld)", (long) ptptype1
->DATA
);
1974 fprintf(ptfile
, " ?)");
1978 fprintf(ptfile
, " ?)");
1982 fprintf(ptfile
, " (? ?)\n");
1987 /* ---------------------------------------------------------------------
1988 cone parallel transistors
1989 --------------------------------------------------------------------- */
1990 if ((ptptype
= getptype(ptcone0
->USER
, (long) CNS_PARATRANS
)) != NULL
) {
1991 if ((ptchain0
= (chain_list
*) ptptype
->DATA
) != NULL
) {
1992 fprintf(ptfile
, "\n PARALLEL TRANSISTORS");
1993 for (ptchain0
= ptchain0
; ptchain0
!= NULL
; ptchain0
= ptchain0
->NEXT
) {
1994 if (ptchain0
->DATA
!= NULL
) {
1995 ptchain1
= (chain_list
*)getptype(((lotrs_list
*)ptchain0
->DATA
)->USER
, MBK_TRANS_PARALLEL
)->DATA
;
1996 if ((ptptype1
= getptype(((lotrs_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
1997 fprintf(ptfile
, "\n (%ld", (long) ptptype1
->DATA
);
2000 fprintf(ptfile
, "\n (?");
2002 for (ptchain1
= ptchain1
->NEXT
; ptchain1
!= NULL
; ptchain1
= ptchain1
->NEXT
) {
2003 if ((ptptype1
= getptype(((lotrs_list
*) ptchain1
->DATA
)->USER
, (long) CNS_INDEX
)) != NULL
) {
2004 fprintf(ptfile
, " %ld", (long) ptptype1
->DATA
);
2007 fprintf(ptfile
, " ?");
2010 fprintf(ptfile
, ")");
2016 /* ---------------------------------------------------------------------
2017 end of cone user fields
2018 --------------------------------------------------------------------- */
2021 /* ------------------------------------------------------------------------
2023 ------------------------------------------------------------------------ */
2026 /* ---------------------------------------------------------------------------
2028 --------------------------------------------------------------------------- */
2030 for (ptcell
= ptcnsfig
->CELL
; ptcell
!= NULL
; ptcell
= ptcell
->NEXT
) {
2031 if (ptcell
->CONES
== NULL
) continue;
2032 ptcell
->USER
= testanddelptype(ptcell
->USER
, (long) CNS_INDEX
);
2035 /* ---------------------------------------------------------------------------
2037 --------------------------------------------------------------------------- */
2039 (void) fflush(stdout
);
2040 (void) fprintf(stderr
, "*** cns warning ***");
2041 (void) fprintf(stderr
, " savecnvfig(): unknown fields found (marked by '?')\n");
2044 if (fclose(ptfile
) != 0) {
2045 (void) fflush(stdout
);
2046 (void) fprintf(stderr
, "*** cns error ***");
2047 (void) fprintf(stderr
, " savecnvfig() impossible: can't close file %s.cnv\n", ptcnsfig
->NAME
);
2048 if (CNS_TRACE_MODE
>= CNS_TRACE
)
2049 (void) printf("TRA_cns savecnvfig out\n");
2053 if (CNS_TRACE_MODE
>= CNS_TRACE
)
2054 (void) printf("TRA_cns savecnvfig out\n");
2057 /*============================================================================*
2058 | function treatbrv(); |
2059 *============================================================================*/
2061 treatbrv(ptfile
, ptbranch
, counter
)
2063 branch_list
*ptbranch
;
2067 char branch_type
[256];
2068 char lotrs_type
[256];
2070 link_list
*ptlink
= NULL
;
2071 lotrs_list
*ptlotrs
= NULL
;
2072 ptype_list
*ptptype
= NULL
;
2073 locon_list
*ptlocon
= NULL
;
2076 if (CNS_TRACE_MODE
>= CNS_TRACE
)
2077 (void) printf("TRA_cns treatbr\n");
2079 if (ptbranch
->LINK
!= NULL
) {
2080 if ((ptptype
= getptype(ptbranch
->USER
, (long) CNS_INDEX
)) != NULL
) {
2081 ptptype
->DATA
= (void *) counter
;
2084 ptbranch
->USER
= addptype(ptbranch
->USER
, (long) CNS_INDEX
, (void *) counter
);
2086 fprintf(ptfile
, "\n %ld) ", counter
);
2088 if ((ptbranch
->TYPE
& CNS_VDD
) == CNS_VDD
)
2089 fprintf(ptfile
, "Vdd");
2090 if ((ptbranch
->TYPE
& CNS_GND
) == CNS_GND
)
2091 fprintf(ptfile
, "Gnd");
2092 if ((ptbranch
->TYPE
& CNS_VSS
) == CNS_VSS
)
2093 fprintf(ptfile
, "Vss");
2094 if ((ptbranch
->TYPE
& CNS_EXT
) == CNS_EXT
)
2095 fprintf(ptfile
, "Ext");
2097 strcpy(branch_type
, "");
2098 if ((ptbranch
->TYPE
& CNS_NOT_FUNCTIONAL
) == CNS_NOT_FUNCTIONAL
)
2099 strcat(branch_type
, "Non-Functional,");
2100 if ((ptbranch
->TYPE
& CNS_NOT_UP
) == CNS_NOT_UP
)
2101 strcat(branch_type
, "Non-Up,");
2102 if ((ptbranch
->TYPE
& CNS_NOT_DOWN
) == CNS_NOT_DOWN
)
2103 strcat(branch_type
, "Non-Down,");
2104 if ((ptbranch
->TYPE
& CNS_BLEEDER
) == CNS_BLEEDER
)
2105 strcat(branch_type
, "Bleeder,");
2106 if ((ptbranch
->TYPE
& CNS_VDD_DEGRADED
) == CNS_VDD_DEGRADED
)
2107 strcat(branch_type
, "Vdd-Degraded,");
2108 if ((ptbranch
->TYPE
& CNS_VSS_DEGRADED
) == CNS_VSS_DEGRADED
)
2109 strcat(branch_type
, "Vss-Degraded,");
2110 if ((ptbranch
->TYPE
& CNS_FEEDBACK
) == CNS_FEEDBACK
)
2111 strcat(branch_type
, "Feedback,");
2112 if ((ptbranch
->TYPE
& CNS_NOTCONFLICTUAL
) == CNS_NOTCONFLICTUAL
)
2113 strcat(branch_type
, "Non-Conflictual,");
2114 if ((ptbranch
->TYPE
& CNS_PARALLEL_INS
) == CNS_PARALLEL_INS
)
2115 strcat(branch_type
, "Parallel instance,");
2116 else if ((ptbranch
->TYPE
& CNS_PARALLEL
) == CNS_PARALLEL
)
2117 strcat(branch_type
, "Parallel,");
2119 if (strlen(branch_type
) > 0) {
2120 branch_type
[strlen(branch_type
)-1] = '\0';
2121 fprintf(ptfile
, " (%s)", branch_type
);
2124 for (ptlink
= ptbranch
->LINK
; ptlink
!= NULL
; ptlink
= ptlink
->NEXT
) {
2125 if ((ptlink
->TYPE
& CNS_EXT
) != CNS_EXT
) {
2126 ptlotrs
= ptlink
->ULINK
.LOTRS
;
2127 if (ptlotrs
!= NULL
) {
2128 if (strcmp(CNS_TECHNO
, "edmesfet") == 0) {
2129 if (MLO_IS_TRANSN(ptlotrs
->TYPE
))
2130 fprintf(ptfile
, "\n TE ");
2131 else if (MLO_IS_TRANSP(ptlotrs
->TYPE
))
2132 fprintf(ptfile
, "\n TD ");
2134 fprintf(ptfile
, "\n ?");
2138 else if (strcmp(CNS_TECHNO
, "npmosfet") == 0) {
2139 if (MLO_IS_TRANSN(ptlotrs
->TYPE
))
2140 fprintf(ptfile
, "\n TN ");
2141 else if (MLO_IS_TRANSP(ptlotrs
->TYPE
))
2142 fprintf(ptfile
, "\n TP ");
2144 fprintf(ptfile
, "\n ? ");
2149 fprintf(ptfile
, "\n ? ");
2152 if (ptlotrs
->TRNAME
!= NULL
) {
2153 fprintf(ptfile
, "%s ", ptlotrs
->TRNAME
);
2155 if ((ptptype
= getptype(ptlotrs
->USER
, (long) CNS_INDEX
)) != NULL
) {
2156 fprintf(ptfile
, "(Index=%ld) ", (long)ptptype
->DATA
);
2159 strcpy(lotrs_type
, "");
2160 if ((ptlink
->TYPE
& CNS_DIODE_UP
) == CNS_DIODE_UP
)
2161 strcat(lotrs_type
, "Diode Up,");
2162 if ((ptlink
->TYPE
& CNS_DIODE_DOWN
) == CNS_DIODE_DOWN
)
2163 strcat(lotrs_type
, "Diode Down,");
2164 if ((ptlink
->TYPE
& CNS_RESIST
) == CNS_RESIST
)
2165 strcat(lotrs_type
, "Resist,");
2166 if ((ptlink
->TYPE
& CNS_CAPA
) == CNS_CAPA
)
2167 strcat(lotrs_type
, "Capa,");
2168 if ((ptlink
->TYPE
& CNS_SWITCH
) == CNS_SWITCH
)
2169 strcat(lotrs_type
, "Switch,");
2170 if ((ptlink
->TYPE
& CNS_COMMAND
) == CNS_COMMAND
)
2171 strcat(lotrs_type
, "Command,");
2172 if ((ptlink
->TYPE
& CNS_ASYNCLINK
) == CNS_ASYNCLINK
)
2173 strcat(lotrs_type
, "Async,");
2175 if (strlen(lotrs_type
) > 0) {
2176 lotrs_type
[strlen(lotrs_type
)-1] = '\0';
2177 fprintf(ptfile
, "(%s) ", lotrs_type
);
2180 ptuser
= getptype(ptlotrs
->USER
, CNS_DRIVINGCONE
);
2181 if (ptuser
!= NULL
) {
2182 fprintf(ptfile
, "Driven by '%s' (Index=%ld)", ((cone_list
*)ptuser
->DATA
)->NAME
, ((cone_list
*)ptuser
->DATA
)->INDEX
);
2188 if ((ptlink
->TYPE
& CNS_IN
) == CNS_IN
) {
2189 fprintf(ptfile
, "\n In");
2191 else if ((ptlink
->TYPE
& CNS_INOUT
) == CNS_INOUT
) {
2192 fprintf(ptfile
, "\n InOut");
2195 fprintf(ptfile
, "\n ?");
2198 ptlocon
= ptlink
->ULINK
.LOCON
;
2199 if (ptlocon
!= NULL
) {
2200 fprintf(ptfile
, " %s, ", ptlocon
->NAME
);
2203 fprintf(ptfile
, " ?, ");