Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / yagle / fcl / fcl_phase1.c
1 /****************************************************************************/
2 /* */
3 /* Chaine de CAO & VLSI Alliance */
4 /* */
5 /* Produit : FCL v1.02 */
6 /* Fichier : fcl_phase1.c */
7 /* */
8 /* (c) copyright 1996 Laboratoire MASI equipe CAO & VLSI */
9 /* Tous droits reserves */
10 /* Support : e-mail alliance-support@asim.lip6.fr */
11 /* */
12 /* */
13 /****************************************************************************/
14
15 #include "fcl_headers.h"
16
17 /*
18 ####====================================================================####
19 ## ##
20 ## EN TETE DES FONCTIONS ##
21 ## ##
22 ####====================================================================####
23 */
24
25 partition_list *init_phase1();
26 partition_list *phase1();
27 partition_list *relabel_sig();
28 partition_list *relabel_trs();
29 partition_list *corrompre_trs();
30 partition_list *corrompre_sig();
31 void *getcle();
32
33
34 /*
35 ####====================================================================####
36 ## ##
37 ## VARIABLES GLOBALES ##
38 ## ##
39 ####====================================================================####
40 */
41
42 static chain_list *ptchain_losig = NULL; /* List des signaux corrompus a traiter */
43 static chain_list *ptchain_lotrs = NULL; /* List des trs corrompus a traiter */
44
45
46 /*
47 ####====================================================================####
48 ## ##
49 ## init_phase1() ##
50 ## ##
51 ## Initialise les labels des vecteurs d'une netlist. Le poid des labels ##
52 ## est fonction pour les transistors de son type (Tn ou Tp) et pour les ##
53 ## signaux du nombre de connexion. Les connecteurs ont un label qui ##
54 ## depend du type de connecteur (Drain, Source, ...) ##
55 ####====================================================================####
56 ## entree : pointeur sur une liste de logfig (memoire ou circuit ) ##
57 ## : caractere du type de liste (M=memoire, C=Circuit) ##
58 ## sortie : pointeur sur une liste de partition ##
59 ####====================================================================####
60 */
61 partition_list *
62 init_phase1(ptlofig, type)
63 lofig_list *ptlofig;
64 char type;
65 {
66 losig_list *ptlosig = NULL;
67 lotrs_list *ptlotrs = NULL;
68 locon_list *ptlocon = NULL;
69 ptype_list *ptype = NULL;
70 partition_list *ptpartition = NULL;
71 fcl_label i;
72
73 /* scan lotrs list */
74 for (ptlotrs = ptlofig->LOTRS; ptlotrs; ptlotrs = ptlotrs->NEXT) {
75 ptype = getptype(ptlotrs->USER, FCL_LABEL_PTYPE);
76
77 /* for each transistor init his LABEL */
78 if (ptype == (ptype_list *) NULL) {
79 if (MLO_IS_TRANSN(ptlotrs->TYPE))
80 ptlotrs->USER = addptype(ptlotrs->USER, FCL_LABEL_PTYPE, (void *)(long) POID_TN);
81 else
82 ptlotrs->USER = addptype(ptlotrs->USER, FCL_LABEL_PTYPE, (void *)(long) POID_TP);
83 }
84 else {
85 if (MLO_IS_TRANSN(ptlotrs->TYPE))
86 ptype->DATA = (void *)(long) POID_TN;
87 else
88 ptype->DATA = (void *)(long) POID_TP;
89 }
90
91 /* and save the trs in the corresponding partition */
92 ptpartition = addpartition(ptpartition, ptlotrs, getlabeltrs(ptlotrs), 'T');
93
94 /* shared transistors corrupt neighbouring signals */
95 ptype = getptype(ptlotrs->USER, FCL_TRANSFER_PTYPE);
96 if (ptype != NULL) {
97 if (((long)ptype->DATA & FCL_SHARE_TRANS) != 0) {
98 fclCorruptLosig(ptlotrs->SOURCE->SIG);
99 fclCorruptLosig(ptlotrs->DRAIN->SIG);
100 fclCorruptLosig(ptlotrs->GRID->SIG);
101 if (ptlotrs->BULK && ptlotrs->BULK->SIG) fclCorruptLosig(ptlotrs->BULK->SIG);
102 }
103 }
104
105 /* To avoid using bulk signals as key vectors when ignoring bulk */
106 if (type == 'M' && SPI_IGNORE_BULK == 'Y' && ptlotrs->BULK && ptlotrs->BULK->SIG) {
107 fclCorruptLosig(ptlotrs->BULK->SIG);
108 }
109 }
110
111 /* scan signal list */
112 for (ptlosig = ptlofig->LOSIG; ptlosig; ptlosig = ptlosig->NEXT) {
113 if (ptlosig->TYPE == 'I') { /* LE SIGNAL EST INTERNE */
114
115 /* Corrupted memory signals correspond to shared transistors */
116 if (type == 'C' || getlabelsig(ptlosig) != FCL_CORRUPT) {
117 /* for each signal count the number of connection */
118 ptype = getptype(ptlosig->USER, (long) LOFIGCHAIN);
119 i = CountChain((chain_list *) ptype->DATA);
120
121 /* and save this value */
122 ptype = getptype(ptlosig->USER, FCL_LABEL_PTYPE);
123 if (ptype == NULL) {
124 ptlosig->USER = addptype(ptlosig->USER, FCL_LABEL_PTYPE, (void *)(long)i);
125 }
126 else {
127 ptype->DATA = (void *)(long) i;
128 }
129
130 /* and save the signal in the corresponding partition */
131 ptpartition = addpartition(ptpartition, ptlosig, i, 'S');
132 }
133 }
134 else { /* LE SIGNAL EST EXTERNE */
135
136 if (type == 'M') {
137 /* Le signal est externe, il est donc corrompu */
138 /* Le signal est marque corrompu et ajoute a */
139 /* la liste des signaux corrompus */
140 fclCorruptLosig(ptlosig);
141 ptchain_losig = addchain(ptchain_losig, (void *) ptlosig);
142 }
143 else {
144 /* for each signal count the number of connection */
145 ptype = getptype(ptlosig->USER, (long) LOFIGCHAIN);
146 i = CountChain((chain_list *) ptype->DATA);
147
148 /* and save this value */
149 ptype = getptype(ptlosig->USER, (long) FCL_LABEL_PTYPE);
150 if (ptype == NULL) {
151 ptlosig->USER = addptype(ptlosig->USER, (long) FCL_LABEL_PTYPE, (void *)(long)i);
152 }
153 else ptype->DATA = (void *)(long)i;
154 }
155 }
156
157 if (FCL_TRACE_LEVEL > 3) {
158 printf(" nb de connexion de %ld '%s' (%c): %d\n", ptlosig->INDEX, getsigname(ptlosig), ptlosig->TYPE, getlabelsig(ptlosig));
159 }
160 }
161
162 /* scan locon list from FIG */
163 for (ptlocon = ptlofig->LOCON; ptlocon; ptlocon = ptlocon->NEXT) {
164 if (FCL_TRACE_LEVEL > 3) {
165 printf(" connecteur %s : %d\n", ptlocon->NAME, getlabellocon(ptlocon));
166 }
167 }
168
169 return ptpartition;
170 }
171
172 void
173 clean_phase1(ptlofig)
174 lofig_list *ptlofig;
175 {
176 lotrs_list *ptlotrs = NULL;
177 ptype_list *ptype;
178
179 freechain(ptchain_losig);
180 ptchain_losig = NULL;
181 freechain(ptchain_lotrs);
182 ptchain_lotrs = NULL;
183
184 /* scan lotrs list */
185 for (ptlotrs = ptlofig->LOTRS; ptlotrs; ptlotrs = ptlotrs->NEXT) {
186 ptype = getptype(ptlotrs->USER, (long) FCL_LABEL_PTYPE);
187 if (ptype != NULL) ptlotrs->USER = delptype(ptlotrs->USER, FCL_LABEL_PTYPE);
188 }
189 }
190
191 /*
192 ####====================================================================####
193 ## ##
194 ## phase1() ##
195 ## ##
196 ## Fait apparaitre des vecteurs candidats dans la netlist du circuit ##
197 ####====================================================================####
198 ## entree : pointeur sur la netlist du circuit ##
199 ## : pointeur sur la netlist du point memoire ##
200 ## : pointeur sur le future vecteur cle ##
201 ## sortie : pointeur sur le vecteur cle ##
202 ####====================================================================####
203 */
204
205 static void freepartition(partition_list *ptpartition_c)
206 {
207 while (ptpartition_c) {
208 ptpartition_c = delpartition(ptpartition_c, ptpartition_c->LABEL, ptpartition_c->TYPE);
209 }
210 }
211 partition_list *
212 phase1(ptlofig_c, ptlofig_m, ptcle)
213 lofig_list *ptlofig_c;
214 lofig_list *ptlofig_m;
215 void **ptcle;
216 {
217 partition_list *ptpartition_c = (partition_list *) NULL;
218 partition_list *ptpartition_m = (partition_list *) NULL;
219 lotrs_list *ptlotrs = (lotrs_list *) NULL;
220 losig_list *ptlosig = (losig_list *) NULL;
221
222 if (FCL_TRACE_LEVEL > 4) {
223 printf(" initialisation du point memoire\n");
224 }
225 ptpartition_m = init_phase1(ptlofig_m, 'M');
226 if (FCL_TRACE_LEVEL > 4) {
227 printf(" initialisation du circuit\n");
228 }
229 ptpartition_c = init_phase1(ptlofig_c, 'C');
230
231 do {
232 if ((ptpartition_c = comparepartition(ptpartition_c, ptpartition_m)) == NULL) {
233 /* Pas de vecteurs candidats */
234 *ptcle = (void *) NULL;
235 freepartition(ptpartition_m);
236 return (partition_list *) NULL;
237 }
238
239 if (FCL_TRACE_LEVEL > 4) {
240 printf("\tcomparer les partitions :\n");
241 printf("CHIP\n");
242 printpartition(ptpartition_c);
243 printf("MEM\n");
244 printpartition(ptpartition_m);
245 }
246
247
248 for (ptlosig = ptlofig_m->LOSIG; ptlosig && (getlabelsig(ptlosig) == FCL_CORRUPT); ptlosig = ptlosig->NEXT);
249 if (!ptlosig) {
250 for (ptlosig = ptlofig_c->LOSIG; ptlosig && (getpartition(ptpartition_c, getlabelsig(ptlosig), 'S') == NULL); ptlosig = ptlosig->NEXT);
251 if (!ptlosig) {
252 ptpartition_c = smallestpartition(ptpartition_c);
253 *ptcle = getcle(ptpartition_c, ptpartition_m);
254 freepartition(ptpartition_m);
255 return ptpartition_c;
256 }
257 }
258
259 if (FCL_TRACE_LEVEL > 4) {
260 printf(" traitement des SIGNAUX ........:\n");
261 printf("\tCHIP\n");
262 printpartition(ptpartition_c);
263 printf("\tMEM\n");
264 printpartition(ptpartition_m);
265 }
266
267 ptpartition_c = relabel_sig(ptlofig_c, ptpartition_c, 'C');
268 ptpartition_m = relabel_sig(ptlofig_m, ptpartition_m, 'M');
269
270 if (FCL_TRACE_LEVEL > 4) {
271 printf("\tafter signal relabelling :\n");
272 printf("\tCHIP\n");
273 printpartition(ptpartition_c);
274 printf("\tMEM\n");
275 printpartition(ptpartition_m);
276 }
277
278 ptpartition_m = corrompre_sig(ptpartition_m);
279
280 if (FCL_TRACE_LEVEL > 4) {
281 printf("\tcorrompre les transistors :\n");
282 printf("\tMEM\n");
283 printpartition(ptpartition_m);
284 printf("\tCHIP\n");
285 printpartition(ptpartition_c);
286 }
287
288 if ((ptpartition_c = comparepartition(ptpartition_c, ptpartition_m)) == NULL) {
289 *ptcle = NULL;
290 freepartition(ptpartition_m);
291 return NULL;
292 }
293 if (FCL_TRACE_LEVEL > 4) {
294 printf("\tcomparer les partitions :\n");
295 printf("\tCHIP\n");
296 printpartition(ptpartition_c);
297 printf("\tMEM\n");
298 printpartition(ptpartition_m);
299 }
300
301 for (ptlotrs = ptlofig_m->LOTRS; ptlotrs && (getlabeltrs(ptlotrs) == FCL_CORRUPT); ptlotrs = ptlotrs->NEXT);
302 if (!ptlotrs) {
303 for (ptlotrs = ptlofig_c->LOTRS; ptlotrs && (getpartition(ptpartition_c, getlabeltrs(ptlotrs), 'T') == NULL); ptlotrs = ptlotrs->NEXT);
304 if (!ptlotrs) {
305 ptpartition_c = smallestpartition(ptpartition_c);
306 *ptcle = getcle(ptpartition_c, ptpartition_m);
307 freepartition(ptpartition_m);
308 return ptpartition_c;
309 }
310 }
311 if (FCL_TRACE_LEVEL > 4) {
312 printf(" traitement des TRS ............:\n");
313 }
314
315 ptpartition_c = relabel_trs(ptlofig_c, ptpartition_c, 'C');
316 ptpartition_m = relabel_trs(ptlofig_m, ptpartition_m, 'M');
317
318 if (FCL_TRACE_LEVEL > 4) {
319 printf("\trelabel les transistors...:\n");
320 printf("\tCHIP\n");
321 printpartition(ptpartition_c);
322 printf("\tMEM\n");
323 printpartition(ptpartition_m);
324 }
325
326 ptpartition_m = corrompre_trs(ptpartition_m);
327 if (FCL_TRACE_LEVEL > 4) {
328 printf("\tcorrompre les signaux :\n");
329 printf("MEM\n");
330 printpartition(ptpartition_m);
331 }
332
333 }
334 while (1);
335 }
336
337 /*
338 ####====================================================================####
339 ## ##
340 ## relabel_sig() ##
341 ## ##
342 ## Calcul les labels des signaux suivant les labels de ses voisins ##
343 ####====================================================================####
344 ## entree : pointeur sur une liste de logfig (memoire ou circuit ) ##
345 ## : pointeur sur une liste de partition de vecteur a renommer ##
346 ## : caractere du type de liste (M=memoire, C=Circuit) ##
347 ## sortie : pointeur sur une liste de partition de vecteurs renommes ##
348 ####====================================================================####
349 */
350 partition_list *
351 relabel_sig(ptlofig, ptpartition, type)
352 lofig_list *ptlofig;
353 partition_list *ptpartition;
354 char type;
355 {
356 losig_list *ptlosig;
357 locon_list *ptlocon;
358 chain_list *ptchain;
359 ptype_list *ptype;
360 fcl_label newlabel;
361
362 /* On parcourt tous les signaux de la figure */
363 for (ptlosig = ptlofig->LOSIG; ptlosig; ptlosig = ptlosig->NEXT) {
364 /* Les signaux recalcules sont :
365 tous les internes du circuits
366 tous les internes du point memoire non corrompus */
367
368 if (ptlosig->TYPE == 'I' && type == 'C' && getpartition(ptpartition, getlabelsig(ptlosig), 'S') == NULL) {
369 /* le signal du circuit a ete elimine */
370 /* par l'operation de comparaison */
371 /* Il n'est plus dans aucune partition */
372
373 /* On recalcule son LABEL */
374
375 newlabel = 0;
376 ptype = getptype(ptlosig->USER, (long) LOFIGCHAIN);
377 for (ptchain = (chain_list *) ptype->DATA; ptchain; ptchain = ptchain->NEXT) {
378 ptlocon = (locon_list *) ptchain->DATA;
379 if (ptlocon->TYPE != 'T') continue;
380
381 newlabel += getlabellocon(ptlocon) * getlabeltrs((lotrs_list *) ptlocon->ROOT);
382 }
383 /* Et on modifie le LABEL de la structure */
384 ptype = getptype(ptlosig->USER, (long) FCL_LABEL_PTYPE);
385 ptype->DATA = (void *) (long)((fcl_label)(long) (ptype->DATA) + newlabel);
386 if (FCL_TRACE_LEVEL > 4) {
387 printf(" new label for partitionless signal %ld '%s' (%c): %d\n", ptlosig->INDEX, getsigname(ptlosig), ptlosig->TYPE, getlabelsig(ptlosig));
388 }
389 }
390 else {
391 if (ptlosig->TYPE == 'I' && (type == 'C' || getlabelsig(ptlosig) != FCL_CORRUPT)) {
392 /* le signal est enleve de sa partition */
393 /* puis il est recalcule, et remis dans */
394 /* une nouvelle partition */
395 ptpartition = removepartitionelement(ptpartition, getlabelsig(ptlosig), 'S');
396 /* On recalcule son LABEL */
397
398 newlabel = 0;
399 ptype = getptype(ptlosig->USER, (long) LOFIGCHAIN);
400 for (ptchain = (chain_list *) ptype->DATA; ptchain; ptchain = ptchain->NEXT) {
401 ptlocon = (locon_list *) ptchain->DATA;
402 if (ptlocon->TYPE != 'T') continue;
403
404 newlabel += getlabellocon(ptlocon) * getlabeltrs((lotrs_list *) ptlocon->ROOT);
405 }
406
407 /* Et on modifie le LABEL de la structure */
408 ptype = getptype(ptlosig->USER, (long) FCL_LABEL_PTYPE);
409 ptype->DATA = (void *) (long)((fcl_label)(long) (ptype->DATA) + newlabel);
410
411 /* Puis on rajoute le signal dans la partition */
412 ptpartition = addpartition(ptpartition, (void *) ptlosig, getlabelsig(ptlosig), 'S');
413 if (FCL_TRACE_LEVEL > 4) {
414 printf(" new label for signal %ld '%s' (%c): %d\n", ptlosig->INDEX, getsigname(ptlosig), ptlosig->TYPE, getlabelsig(ptlosig));
415 }
416 }
417 }
418 }
419 return ptpartition;
420 }
421
422 /*
423 ####====================================================================####
424 ## ##
425 ## relabel_trs() ##
426 ## ##
427 ## Calcul les labels des transistors suivant les labels de ses voisins ##
428 ####====================================================================####
429 ## entree : pointeur sur une liste de logfig (memoire ou circuit ) ##
430 ## : pointeur sur une liste de partition de vecteur a renommer ##
431 ## : caractere du type de liste (M=memoire, C=Circuit) ##
432 ## sortie : pointeur sur une liste de partition de vecteurs renommes ##
433 ####====================================================================####
434 */
435 partition_list *
436 relabel_trs(ptlofig, ptpartition, type)
437 lofig_list *ptlofig;
438 partition_list *ptpartition;
439 char type;
440 {
441 lotrs_list *ptlotrs;
442 ptype_list *ptype;
443 fcl_label newlabel;
444
445 /* On parcourt tous les transistors de la figure */
446 for (ptlotrs = ptlofig->LOTRS; ptlotrs; ptlotrs = ptlotrs->NEXT) {
447 /* Les transistors recalcules sont :
448 tous ceux du circuit
449 tous ceux du point memoire non corrompus */
450
451 if (type == 'C' && getpartition(ptpartition, getlabeltrs(ptlotrs), 'T') == NULL) {
452 /* le transi du circuit a ete elimine */
453 /* par l'operation de comparaison */
454 /* Il n'est plus dans aucune partition */
455
456 /* On recalcule son LABEL */
457
458 newlabel = getlabellocon(ptlotrs->DRAIN) *
459 getlabelsig(ptlotrs->DRAIN->SIG) +
460 getlabellocon(ptlotrs->GRID) *
461 getlabelsig(ptlotrs->GRID->SIG) +
462 getlabellocon(ptlotrs->SOURCE) *
463 getlabelsig(ptlotrs->SOURCE->SIG);
464
465 if (ptlotrs->BULK && ptlotrs->BULK->SIG) {
466 if (ptlotrs->BULK->SIG->TYPE == 'I') {
467 newlabel += getlabellocon(ptlotrs->BULK) * getlabelsig(ptlotrs->BULK->SIG);
468 }
469 }
470
471 /* Et on modifie le LABEL de la structure */
472 ptype = getptype(ptlotrs->USER, (long) FCL_LABEL_PTYPE);
473 ptype->DATA = (void *)(long) ((fcl_label)(long) (ptype->DATA) + newlabel);
474 }
475 else {
476 if (type == 'C' || getlabeltrs(ptlotrs) != FCL_CORRUPT) {
477 /* le transi est enleve de sa partition */
478 /* puis il est recalcule, et remis dans */
479 /* une nouvelle partition */
480 ptpartition = removepartitionelement(ptpartition, getlabeltrs(ptlotrs), 'T');
481 /* On recalcule son LABEL */
482
483 newlabel = getlabellocon(ptlotrs->DRAIN) *
484 getlabelsig(ptlotrs->DRAIN->SIG) +
485 getlabellocon(ptlotrs->GRID) *
486 getlabelsig(ptlotrs->GRID->SIG) +
487 getlabellocon(ptlotrs->SOURCE) *
488 getlabelsig(ptlotrs->SOURCE->SIG);
489
490 if (ptlotrs->BULK && ptlotrs->BULK->SIG) {
491 if (ptlotrs->BULK->SIG->TYPE == 'I') {
492 newlabel += getlabellocon(ptlotrs->BULK) * getlabelsig(ptlotrs->BULK->SIG);
493 }
494 }
495
496 /* Et on modifie le LABEL de la structure */
497 ptype = getptype(ptlotrs->USER, (long) FCL_LABEL_PTYPE);
498 ptype->DATA = (void *)(long) ((fcl_label)(long) (ptype->DATA) + newlabel);
499
500 /* Puis on rajoute le transi dans la partition */
501 ptpartition = addpartition(ptpartition, ptlotrs, getlabeltrs(ptlotrs), 'T');
502 }
503 }
504 }
505 return ptpartition;
506 }
507
508 /*
509 ####====================================================================####
510 ## ##
511 ## corrompre_sig() ##
512 ## ##
513 ## Marque corrompu les transistors suivant les signaux deja corrompus ##
514 ####====================================================================####
515 ## entree : pointeur sur une liste de lofig (memoire ou circuit ) ##
516 ## : pointeur sur une liste de partition de vecteur ##
517 ## sortie : pointeur sur une liste de partition de vecteur ##
518 ####====================================================================####
519 */
520 partition_list *
521 corrompre_sig(ptpartition)
522 partition_list *ptpartition;
523 {
524 chain_list *ptchain;
525 chain_list *ptchain2;
526 lotrs_list *ptlotrs;
527 losig_list *ptlosig;
528 locon_list *ptlocon;
529 ptype_list *ptype;
530
531 for (ptchain = ptchain_losig; ptchain; ptchain = ptchain->NEXT) {
532 ptlosig = (losig_list *) ptchain->DATA;
533 ptype = getptype(ptlosig->USER, (long) LOFIGCHAIN);
534
535 /* Corrompre tous les transistors des connecteurs */
536 for (ptchain2 = (chain_list *) ptype->DATA; ptchain2; ptchain2 = ptchain2->NEXT) {
537 ptlocon = (locon_list *) (ptchain2->DATA);
538 if (ptlocon->TYPE == 'T') {
539 /* Si pas 'T' on est sur un connecteur externe */
540
541 if (ptlocon->NAME == MBK_BULK_NAME && (ptlosig->TYPE == CNS_SIGVSS || ptlosig->TYPE == CNS_SIGVDD)) continue;
542
543 ptlotrs = (lotrs_list *) (ptlocon->ROOT);
544 /* On marque le transistor corrompu */
545 if (getlabeltrs(ptlotrs) != FCL_CORRUPT) {
546
547 /* On l'ajoute a la liste des nouveaux corrompus */
548 ptchain_lotrs = addchain(ptchain_lotrs, ptlotrs);
549
550 /* On l'enleve de sa partition */
551 ptpartition = removepartitionelement(ptpartition, getlabeltrs(ptlotrs), 'T');
552
553 fclCorruptLotrs(ptlotrs);
554 }
555 }
556 }
557 }
558
559 freechain(ptchain_losig);
560 ptchain_losig = NULL;
561
562 return ptpartition;
563 }
564
565 /*
566 ####====================================================================####
567 ## ##
568 ## corrompre_trs() ##
569 ## ##
570 ## Marque corrompu les signaux suivant les transistors deja corrompus ##
571 ####====================================================================####
572 ## entree : pointeur sur une liste de logfig (memoire ou circuit ) ##
573 ## : pointeur sur une liste de partition de vecteur ##
574 ## sortie : pointeur sur une liste de partition de vecteur ##
575 ####====================================================================####
576 */
577 partition_list *
578 corrompre_trs(ptpartition)
579 partition_list *ptpartition;
580 {
581 chain_list *ptchain;
582 losig_list *ptlosig;
583 lotrs_list *ptlotrs;
584
585 /* pour tous les transistors qui viennent d'etre marques corrompus */
586 for (ptchain = ptchain_lotrs; ptchain; ptchain = ptchain->NEXT) {
587 /* Corrompre le signal du connecteur DRAIN */
588 ptlosig = ((lotrs_list *) (ptchain->DATA))->DRAIN->SIG;
589
590 if (getlabelsig(ptlosig) != FCL_CORRUPT) {
591
592 /* On l'ajoute a la liste des nouveaux corrompus */
593 ptchain_losig = addchain(ptchain_losig, ptlosig);
594
595 /* On l'enleve de sa partition */
596 ptpartition = removepartitionelement(ptpartition, getlabelsig(ptlosig), 'S');
597
598 fclCorruptLosig(ptlosig);
599 }
600
601 /* Corrompre le signal du connecteur SOURCE */
602 ptlosig = ((lotrs_list *) (ptchain->DATA))->SOURCE->SIG;
603
604 if (getlabelsig(ptlosig) != FCL_CORRUPT) {
605
606 /* On l'ajoute a la liste des nouveaux corrompus */
607 ptchain_losig = addchain(ptchain_losig, ptlosig);
608
609 /* On l'enleve de sa partition */
610 ptpartition = removepartitionelement(ptpartition, getlabelsig(ptlosig), 'S');
611
612 fclCorruptLosig(ptlosig);
613 }
614
615 /* Corrompre le signal du connecteur GRID */
616 ptlosig = ((lotrs_list *) (ptchain->DATA))->GRID->SIG;
617
618 if (getlabelsig(ptlosig) != FCL_CORRUPT) {
619
620 /* On l'ajoute a la liste des nouveaux corrompus */
621 ptchain_losig = addchain(ptchain_losig, ptlosig);
622
623 /* On l'enleve de sa partition */
624 ptpartition = removepartitionelement(ptpartition, getlabelsig(ptlosig), 'S');
625
626 fclCorruptLosig(ptlosig);
627 }
628
629 /* Corrompre le signal du connecteur BULK */
630 ptlotrs = (lotrs_list *) (ptchain->DATA);
631 if (ptlotrs->BULK && ptlotrs->BULK->SIG) {
632 ptlosig = ((lotrs_list *) (ptchain->DATA))->BULK->SIG;
633
634 if (getlabelsig(ptlosig) != FCL_CORRUPT) {
635
636 /* On l'ajoute a la liste des nouveaux corrompus */
637 ptchain_losig = addchain(ptchain_losig, ptlosig);
638
639 /* On l'enleve de sa partition */
640 ptpartition = removepartitionelement(ptpartition, getlabelsig(ptlosig), 'S');
641
642 fclCorruptLosig(ptlosig);
643 }
644 }
645 }
646
647 freechain(ptchain_lotrs);
648 ptchain_lotrs = NULL;
649
650 return ptpartition;
651 }
652
653 /*
654 ####====================================================================####
655 ## ##
656 ## getcle() ##
657 ## ##
658 ## Renvoi un pointeur sur un vecteur cle ##
659 ####====================================================================####
660 ## entree : pointeur sur la partition du circuit ##
661 ## : pointeur sur la partition du point memoire ##
662 ## sortie : pointeur sur un vecteur cle ##
663 ####====================================================================####
664 */
665 void *
666 getcle(ptpartition_c, ptpartition_m)
667 partition_list *ptpartition_c;
668 partition_list *ptpartition_m;
669 {
670 partition_list *ptpartition;
671 void *vect_cle;
672
673 ptpartition = getpartition(ptpartition_m, ptpartition_c->LABEL, ptpartition_c->TYPE);
674 vect_cle = (((chain_list *) (ptpartition->DATA))->DATA);
675 // freechain((chain_list *) (ptpartition->DATA));
676
677 return (vect_cle);
678
679 }