Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / tas / tas / tas_class.c
1 /****************************************************************************/
2 /* */
3 /* Chaine de CAO & VLSI Alliance */
4 /* */
5 /* Produit : TAS Verison 5 */
6 /* Fichier : tas_class.c */
7 /* */
8 /* (c) copyright 1991-1998 Laboratoire LIP6 equipe ASIM */
9 /* Tous droits reserves */
10 /* Support : e-mail alliance-support@asim.lip6.fr */
11 /* */
12 /* Auteur(s) : Amjad HAJJAR et Payam KIANI */
13 /* Karim DIOURY */
14 /* */
15 /****************************************************************************/
16 /* fonctions relatives aux calculs des fronts des cones */
17 /****************************************************************************/
18
19 #include "tas.h"
20
21 char *CELL ;
22
23 //extern char* yagGetName __P(( losig_list* ));
24
25 /*****************************************************************************/
26 /* fonction tas_isnowire() */
27 /* verifie qu'il y a bien une resistance */
28 /*****************************************************************************/
29 int tas_isnowire(losig)
30 losig_list *losig ;
31 {
32 lowire_list *ptwire ;
33 float resi = 0.0 ;
34 char flag = 'N' ;
35
36 if(losig->PRCN == NULL)
37 return(0) ;
38
39 for(ptwire = losig->PRCN->PWIRE ; ptwire != NULL ; ptwire = ptwire->NEXT)
40 {
41 resi += ptwire->RESI ;
42
43 if(ptwire->RESI > 0.0)
44 flag = 'Y' ;
45
46 if((flag == 'Y') && (resi > 1.0))
47 break ;
48 }
49
50 if(ptwire != NULL)
51 return(1) ;
52 else
53 return(0) ;
54 }
55
56 /*****************************************************************************/
57 /* fonction tas_getfcritic() */
58 /* donne les fronts max et min d'un cone */
59 /*****************************************************************************/
60 void tas_getfcritic(cone,frontmax,frontmin)
61 cone_list *cone ;
62 front_list *frontmax ;
63 front_list *frontmin ;
64 {
65 delay_list *delay ;
66 ptype_list *ptype ;
67 edge_list *incone ;
68
69 frontmax->FUP = TAS_NOFRONT ;
70 frontmax->FDOWN = TAS_NOFRONT ;
71 frontmin->FUP = TAS_NOFRONT ;
72 frontmin->FDOWN = TAS_NOFRONT ;
73
74 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
75 {
76 if((ptype = getptype(incone->USER,TAS_DELAY_MAX)) != NULL)
77 {
78 delay = (delay_list *)ptype->DATA ;
79 if(((delay->FLL != TAS_NOFRONT) && (delay->FLL > frontmax->FDOWN)) ||
80 (frontmax->FDOWN == TAS_NOFRONT))
81 frontmax->FDOWN = delay->FLL ;
82 if(((delay->FHL != TAS_NOFRONT) && (delay->FHL > frontmax->FDOWN)) ||
83 (frontmax->FDOWN == TAS_NOFRONT))
84 frontmax->FDOWN = delay->FHL ;
85 if(((delay->FLH != TAS_NOFRONT) && (delay->FLH > frontmax->FUP)) ||
86 (frontmax->FUP == TAS_NOFRONT))
87 frontmax->FUP = delay->FLH ;
88 if(((delay->FHH != TAS_NOFRONT) && (delay->FHH > frontmax->FUP)) ||
89 (frontmax->FUP == TAS_NOFRONT))
90 frontmax->FUP = delay->FHH ;
91 }
92 if((ptype = getptype(incone->USER,TAS_DELAY_MIN)) != NULL)
93 {
94 delay = (delay_list *)ptype->DATA ;
95 if(((delay->FLL != TAS_NOFRONT) && (delay->FLL < frontmin->FDOWN)) ||
96 (frontmin->FDOWN == TAS_NOFRONT))
97 frontmin->FDOWN = delay->FLL ;
98 if(((delay->FHL != TAS_NOFRONT) && (delay->FHL < frontmin->FDOWN)) ||
99 (frontmin->FDOWN == TAS_NOFRONT))
100 frontmin->FDOWN = delay->FHL ;
101 if(((delay->FLH != TAS_NOFRONT) && (delay->FLH < frontmin->FUP)) ||
102 (frontmin->FUP == TAS_NOFRONT))
103 frontmin->FUP = delay->FLH ;
104 if(((delay->FHH != TAS_NOFRONT) && (delay->FHH < frontmin->FUP)) ||
105 (frontmin->FUP == TAS_NOFRONT))
106 frontmin->FUP = delay->FHH ;
107 }
108 if((ptype = getptype(incone->USER,TAS_DELAY_MAXT)) != NULL)
109 {
110 delay = (delay_list *)ptype->DATA ;
111 if(((delay->FLL != TAS_NOFRONT) && (delay->FLL > frontmax->FDOWN)) ||
112 (frontmax->FDOWN == TAS_NOFRONT))
113 frontmax->FDOWN = delay->FLL ;
114 if(((delay->FHL != TAS_NOFRONT) && (delay->FHL > frontmax->FDOWN)) ||
115 (frontmax->FDOWN == TAS_NOFRONT))
116 frontmax->FDOWN = delay->FHL ;
117 if(((delay->FLH != TAS_NOFRONT) && (delay->FLH > frontmax->FUP)) ||
118 (frontmax->FUP == TAS_NOFRONT))
119 frontmax->FUP = delay->FLH ;
120 if(((delay->FHH != TAS_NOFRONT) && (delay->FHH > frontmax->FUP)) ||
121 (frontmax->FUP == TAS_NOFRONT))
122 frontmax->FUP = delay->FHH ;
123 }
124 if((ptype = getptype(incone->USER,TAS_DELAY_MINT)) != NULL)
125 {
126 delay = (delay_list *)ptype->DATA ;
127 if(((delay->FLL != TAS_NOFRONT) && (delay->FLL < frontmin->FDOWN)) ||
128 (frontmin->FDOWN == TAS_NOFRONT))
129 frontmin->FDOWN = delay->FLL ;
130 if(((delay->FHL != TAS_NOFRONT) && (delay->FHL < frontmin->FDOWN)) ||
131 (frontmin->FDOWN == TAS_NOFRONT))
132 frontmin->FDOWN = delay->FHL ;
133 if(((delay->FLH != TAS_NOFRONT) && (delay->FLH < frontmin->FUP)) ||
134 (frontmin->FUP == TAS_NOFRONT))
135 frontmin->FUP = delay->FLH ;
136 if(((delay->FHH != TAS_NOFRONT) && (delay->FHH < frontmin->FUP)) ||
137 (frontmin->FUP == TAS_NOFRONT))
138 frontmin->FUP = delay->FHH ;
139 }
140 }
141 }
142
143 /*****************************************************************************/
144 /* fonction tas_comdelay() */
145 /* prend le plus critique des deux delays */
146 /*****************************************************************************/
147 void tas_comdelay(delayext,delaycone,type)
148 delay_list *delayext ;
149 delay_list *delaycone ;
150 long type ;
151 {
152 long delay1 ;
153 long delay2 ;
154
155 if(delayext->TPHH != TAS_NOTIME)
156 delay1 = delayext->TPHH ;
157 else
158 delay1 = TAS_NOTIME ;
159
160 if((delayext->RCHH != TAS_NOTIME) && (delay1 != TAS_NOTIME))
161 delay1 += delayext->RCHH ;
162
163 if(delaycone->TPHH != TAS_NOTIME)
164 delay2 = delaycone->TPHH ;
165 else
166 delay2 = TAS_NOTIME ;
167
168 if((delaycone->RCHH != TAS_NOTIME) && (delay2 != TAS_NOTIME))
169 delay2 += delaycone->RCHH ;
170
171 if((delay1 != TAS_NOTIME) && (delay2 != TAS_NOTIME))
172 {
173 if(type == TAS_DELAY_MAX)
174 {
175 if(delay1 > delay2){
176 delaycone->TPHH = TAS_NOTIME ;
177 #ifdef USEOLDTEMP
178 delaycone->SHH = TAS_NOS ;
179 #endif
180 delaycone->FHH = TAS_NOFRONT ;
181 if(delaycone->TMHH){
182 if(delaycone->FMHH && (delaycone->TMHH != delaycone->FMHH)){
183 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
184 stm_freemodel (CELL, delaycone->FMHH->NAME);
185 }
186 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
187 stm_freemodel (CELL, delaycone->TMHH->NAME);
188 delaycone->TMHH = NULL;
189 delaycone->FMHH = NULL;
190 }
191 }else{
192 delayext->TPHH = TAS_NOTIME ;
193 #ifdef USEOLDTEMP
194 delayext->SHH = TAS_NOS ;
195 #endif
196 delayext->FHH = TAS_NOFRONT ;
197 if(delayext->TMHH){
198 if(delayext->FMHH && (delayext->TMHH != delayext->FMHH)){
199 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
200 stm_freemodel (CELL, delayext->FMHH->NAME);
201 }
202 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
203 stm_freemodel (CELL, delayext->TMHH->NAME);
204 delayext->TMHH = NULL;
205 delayext->FMHH = NULL;
206 }
207 }
208 }
209 else
210 {
211 if(delay1 < delay2){
212 delaycone->TPHH = TAS_NOTIME ;
213 #ifdef USEOLDTEMP
214 delaycone->SHH = TAS_NOS ;
215 #endif
216 delaycone->FHH = TAS_NOFRONT ;
217 if(delaycone->TMHH){
218 if(delaycone->FMHH && (delaycone->TMHH != delaycone->FMHH)){
219 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
220 stm_freemodel (CELL, delaycone->FMHH->NAME);
221 }
222 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
223 stm_freemodel (CELL, delaycone->TMHH->NAME);
224 delaycone->TMHH = NULL;
225 delaycone->FMHH = NULL;
226 }
227 }else{
228 delayext->TPHH = TAS_NOTIME ;
229 #ifdef USEOLDTEMP
230 delayext->SHH = TAS_NOS ;
231 #endif
232 delayext->FHH = TAS_NOFRONT ;
233 if(delayext->TMHH){
234 if(delayext->FMHH && (delayext->TMHH != delayext->FMHH)){
235 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
236 stm_freemodel (CELL, delayext->FMHH->NAME);
237 }
238 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
239 stm_freemodel (CELL, delayext->TMHH->NAME);
240 delayext->TMHH = NULL;
241 delayext->FMHH = NULL;
242 }
243 }
244 }
245 }
246
247 if(delayext->TPHL != TAS_NOTIME)
248 delay1 = delayext->TPHL ;
249 else
250 delay1 = TAS_NOTIME ;
251
252 if((delayext->RCHH != TAS_NOTIME) && (delay1 != TAS_NOTIME))
253 delay1 += delayext->RCHH ;
254
255 if(delaycone->TPHL != TAS_NOTIME)
256 delay2 = delaycone->TPHL ;
257 else
258 delay2 = TAS_NOTIME ;
259
260 if((delaycone->RCHH != TAS_NOTIME) && (delay2 != TAS_NOTIME))
261 delay2 += delaycone->RCHH ;
262
263 if((delay1 != TAS_NOTIME) && (delay2 != TAS_NOTIME))
264 {
265 if(type == TAS_DELAY_MAX)
266 {
267 if(delay1 > delay2){
268 delaycone->TPHL = TAS_NOTIME ;
269 #ifdef USEOLDTEMP
270 delaycone->SHL = TAS_NOS ;
271 #endif
272 delaycone->FHL = TAS_NOFRONT ;
273 if(delaycone->TMHL){
274 if(delaycone->FMHL && (delaycone->TMHL != delaycone->FMHL)){
275 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
276 stm_freemodel (CELL, delaycone->FMHL->NAME);
277 }
278 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
279 stm_freemodel (CELL, delaycone->TMHL->NAME);
280 delaycone->TMHL = NULL;
281 delaycone->FMHL = NULL;
282 }
283 }else{
284 delayext->TPHL = TAS_NOTIME ;
285 #ifdef USEOLDTEMP
286 delayext->SHL = TAS_NOS ;
287 #endif
288 delayext->FHL = TAS_NOFRONT ;
289 if(delayext->TMHL){
290 if(delayext->FMHL && (delayext->TMHL != delayext->FMHL)){
291 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
292 stm_freemodel (CELL, delayext->FMHL->NAME);
293 }
294 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
295 stm_freemodel (CELL, delayext->TMHL->NAME);
296 delayext->TMHL = NULL;
297 delayext->FMHL = NULL;
298 }
299 }
300 }
301 else
302 {
303 if(delay1 < delay2){
304 delaycone->TPHL = TAS_NOTIME ;
305 #ifdef USEOLDTEMP
306 delaycone->SHL = TAS_NOS ;
307 #endif
308 delaycone->FHL = TAS_NOFRONT ;
309 if(delaycone->TMHL){
310 if(delaycone->FMHL && (delaycone->TMHL != delaycone->FMHL)){
311 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
312 stm_freemodel (CELL, delaycone->FMHL->NAME);
313 }
314 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
315 stm_freemodel (CELL, delaycone->TMHL->NAME);
316 delaycone->TMHL = NULL;
317 delaycone->FMHL = NULL;
318 }
319 }else{
320 delayext->TPHL = TAS_NOTIME ;
321 #ifdef USEOLDTEMP
322 delayext->SHL = TAS_NOS ;
323 #endif
324 delayext->FHL = TAS_NOFRONT ;
325 if(delayext->TMHL){
326 if(delayext->FMHL && (delayext->TMHL != delayext->FMHL)){
327 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
328 stm_freemodel (CELL, delayext->FMHL->NAME);
329 }
330 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
331 stm_freemodel (CELL, delayext->TMHL->NAME);
332 delayext->TMHL = NULL;
333 delayext->FMHL = NULL;
334 }
335 }
336 }
337 }
338
339
340 if(delayext->TPLL != TAS_NOTIME)
341 delay1 = delayext->TPLL ;
342 else
343 delay1 = TAS_NOTIME ;
344
345 if((delayext->RCLL != TAS_NOTIME) && (delay1 != TAS_NOTIME))
346 delay1 += delayext->RCLL ;
347
348 if(delaycone->TPLL != TAS_NOTIME)
349 delay2 = delaycone->TPLL ;
350 else
351 delay2 = TAS_NOTIME ;
352
353 if((delaycone->RCLL != TAS_NOTIME) && (delay2 != TAS_NOTIME))
354 delay2 += delaycone->RCLL ;
355
356 if((delay1 != TAS_NOTIME) && (delay2 != TAS_NOTIME))
357 {
358 if(type == TAS_DELAY_MAX)
359 {
360 if(delay1 > delay2){
361 delaycone->TPLL = TAS_NOTIME ;
362 #ifdef USEOLDTEMP
363 delaycone->SLL = TAS_NOS ;
364 #endif
365 delaycone->FLL = TAS_NOFRONT ;
366 if(delaycone->TMLL){
367 if(delaycone->FMLL && (delaycone->TMLL != delaycone->FMLL)){
368 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
369 stm_freemodel (CELL, delaycone->FMLL->NAME);
370 }
371 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
372 stm_freemodel (CELL, delaycone->TMLL->NAME);
373 delaycone->TMLL = NULL;
374 delaycone->FMLL = NULL;
375 }
376 }else{
377 delayext->TPLL = TAS_NOTIME ;
378 #ifdef USEOLDTEMP
379 delayext->SLL = TAS_NOS ;
380 #endif
381 delayext->FLL = TAS_NOFRONT ;
382 if(delayext->TMLL){
383 if(delayext->FMLL && (delayext->TMLL != delayext->FMLL)){
384 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
385 stm_freemodel (CELL, delayext->FMLL->NAME);
386 }
387 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
388 stm_freemodel (CELL, delayext->TMLL->NAME);
389 delayext->TMLL = NULL;
390 delayext->FMLL = NULL;
391 }
392 }
393 }
394 else
395 {
396 if(delay1 < delay2){
397 delaycone->TPLL = TAS_NOTIME ;
398 #ifdef USEOLDTEMP
399 delaycone->SLL = TAS_NOS ;
400 #endif
401 delaycone->FLL = TAS_NOFRONT ;
402 if(delaycone->TMLL && (delaycone->TMLL != delaycone->FMLL)){
403 if(delaycone->FMLL){
404 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
405 stm_freemodel (CELL, delaycone->FMLL->NAME);
406 }
407 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
408 stm_freemodel (CELL, delaycone->TMLL->NAME);
409 delaycone->TMLL = NULL;
410 delaycone->FMLL = NULL;
411 }
412 }else{
413 delayext->TPLL = TAS_NOTIME ;
414 #ifdef USEOLDTEMP
415 delayext->SLL = TAS_NOS ;
416 #endif
417 delayext->FLL = TAS_NOFRONT ;
418 if(delayext->TMLL){
419 if(delayext->FMLL && (delayext->TMLL != delayext->FMLL)){
420 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
421 stm_freemodel (CELL, delayext->FMLL->NAME);
422 }
423 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
424 stm_freemodel (CELL, delayext->TMLL->NAME);
425 delayext->TMLL = NULL;
426 delayext->FMLL = NULL;
427 }
428 }
429 }
430 }
431
432 if(delayext->TPLH != TAS_NOTIME)
433 delay1 = delayext->TPLH ;
434 else
435 delay1 = TAS_NOTIME ;
436
437 if((delayext->RCLL != TAS_NOTIME) && (delay1 != TAS_NOTIME))
438 delay1 += delayext->RCLL ;
439
440 if(delaycone->TPLH != TAS_NOTIME)
441 delay2 = delaycone->TPLH ;
442 else
443 delay2 = TAS_NOTIME ;
444
445 if((delaycone->RCLL != TAS_NOTIME) && (delay2 != TAS_NOTIME))
446 delay2 += delaycone->RCLL ;
447
448 if((delay1 != TAS_NOTIME) && (delay2 != TAS_NOTIME))
449 {
450 if(type == TAS_DELAY_MAX)
451 {
452 if(delay1 > delay2){
453 delaycone->TPLH = TAS_NOTIME ;
454 #ifdef USEOLDTEMP
455 delaycone->SLH = TAS_NOS ;
456 #endif
457 delaycone->FLH = TAS_NOFRONT ;
458 if(delaycone->TMLH){
459 if(delaycone->FMLH && (delaycone->TMLH != delaycone->FMLH)){
460 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
461 stm_freemodel (CELL, delaycone->FMLH->NAME);
462 }
463 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
464 stm_freemodel (CELL, delaycone->TMLH->NAME);
465 delaycone->TMLH = NULL;
466 delaycone->FMLH = NULL;
467 }
468 }else{
469 delayext->TPLH = TAS_NOTIME ;
470 #ifdef USEOLDTEMP
471 delayext->SLH = TAS_NOS ;
472 #endif
473 delayext->FLH = TAS_NOFRONT ;
474 if(delayext->TMLH){
475 if(delayext->FMLH && (delayext->TMLH != delayext->FMLH)){
476 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
477 stm_freemodel (CELL, delayext->FMLH->NAME);
478 }
479 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
480 stm_freemodel (CELL, delayext->TMLH->NAME);
481 delayext->TMLH = NULL;
482 delayext->FMLH = NULL;
483 }
484 }
485 }
486 else
487 {
488 if(delay1 < delay2){
489 delaycone->TPLH = TAS_NOTIME ;
490 #ifdef USEOLDTEMP
491 delaycone->SLH = TAS_NOS ;
492 #endif
493 delaycone->FLH = TAS_NOFRONT ;
494 if(delaycone->TMLH){
495 if(delaycone->FMLH && (delaycone->TMLH != delaycone->FMLH)){
496 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
497 stm_freemodel (CELL, delaycone->FMLH->NAME);
498 }
499 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
500 stm_freemodel (CELL, delaycone->TMLH->NAME);
501 delaycone->TMLH = NULL;
502 delaycone->FMLH = NULL;
503 }
504 }else{
505 delayext->TPLH = TAS_NOTIME ;
506 #ifdef USEOLDTEMP
507 delayext->SLH = TAS_NOS ;
508 #endif
509 delayext->FLH = TAS_NOFRONT ;
510 if(delayext->TMLH){
511 if(delayext->FMLH && (delayext->TMLH != delayext->FMLH)){
512 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
513 stm_freemodel (CELL, delayext->FMLH->NAME);
514 }
515 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
516 stm_freemodel (CELL, delayext->TMLH->NAME);
517 delayext->TMLH = NULL;
518 delayext->FMLH = NULL;
519 }
520 }
521 }
522 }
523
524 if((delayext->TPHH == TAS_NOTIME) && (delayext->TPHL == TAS_NOTIME))
525 delayext->RCHH = TAS_NOTIME ;
526 if((delayext->TPLL == TAS_NOTIME) && (delayext->TPLH == TAS_NOTIME))
527 delayext->RCLL = TAS_NOTIME ;
528
529 if((delaycone->TPHH == TAS_NOTIME) && (delaycone->TPHL == TAS_NOTIME))
530 delaycone->RCHH = TAS_NOTIME ;
531 if((delaycone->TPLL == TAS_NOTIME) && (delaycone->TPLH == TAS_NOTIME))
532 delaycone->RCLL = TAS_NOTIME ;
533 }
534
535 /*****************************************************************************/
536 /* fonction tas_cleanloconin() */
537 /* detect les entrees sur connecteur et sur cone */
538 /*****************************************************************************/
539 void tas_cleanloconin(cnsfig)
540 cnsfig_list *cnsfig ;
541 {
542 locon_list *locon ;
543 ptype_list *ptype ;
544 chain_list *chain ;
545 cone_list *conein ;
546 cone_list *cone ;
547 edge_list *incone ;
548 edge_list *inconecone ;
549 edge_list *inconelocon ;
550 delay_list *delayext ;
551 delay_list *delaycone ;
552
553 for(locon = cnsfig->LOCON ; locon != NULL ; locon = locon->NEXT)
554 {
555 if((ptype = getptype(locon->USER,CNS_EXT)) != NULL)
556 {
557 conein = (cone_list *)ptype->DATA ;
558 if((ptype = getptype(locon->USER,CNS_CONE)) != NULL)
559 {
560 for(chain = (chain_list *)ptype->DATA ; chain != NULL ;
561 chain = chain->NEXT)
562 {
563 cone = (cone_list *)chain->DATA ;
564 inconecone = NULL ;
565 inconelocon = NULL ;
566 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
567 {
568 if((incone->TYPE & CNS_EXT) == CNS_EXT)
569 {
570 if(incone->UEDGE.LOCON == locon)
571 inconelocon = incone ;
572 }
573 else
574 {
575 if(incone->UEDGE.CONE == conein)
576 inconecone = incone ;
577 }
578 }
579 if((inconecone != NULL) && (inconelocon != NULL))
580 {
581 if((ptype = getptype(inconelocon->USER,TAS_DELAY_MIN)) != NULL)
582 {
583 delayext = ptype->DATA ;
584 if((ptype = getptype(inconecone->USER,TAS_DELAY_MIN)) != NULL)
585 {
586 delaycone = ptype->DATA ;
587 tas_comdelay(delayext,delaycone,TAS_DELAY_MIN) ;
588 }
589 }
590 if((ptype = getptype(inconelocon->USER,TAS_DELAY_MAX)) != NULL)
591 {
592 delayext = ptype->DATA ;
593 if((ptype = getptype(inconecone->USER,TAS_DELAY_MAX)) != NULL)
594 {
595 delaycone = ptype->DATA ;
596 tas_comdelay(delayext,delaycone,TAS_DELAY_MAX) ;
597 }
598 }
599 }
600 }
601 }
602 }
603 }
604 }
605
606 /*****************************************************************************/
607 /* fonction tas_mergercdelay() */
608 /* merge les delay de portes et les delay rc */
609 /*****************************************************************************/
610 void tas_mergercdelay(cnsfig)
611 cnsfig_list *cnsfig ;
612 {
613 cone_list *cone ;
614 cone_list *conex ;
615 edge_list *incone ;
616 locon_list *locon ;
617 delay_list *delay ;
618 delay_list *delayxmin ;
619 delay_list *delayxmax ;
620 ptype_list *ptype ;
621 chain_list *chain = NULL ;
622 chain_list *chainx ;
623 ptype_list *ptypemaxuu ;
624 ptype_list *ptypemaxdd ;
625 ptype_list *ptypeminuu ;
626 ptype_list *ptypemindd ;
627
628 for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT)
629 {
630 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
631 {
632 if((ptype = getptype(incone->USER,TAS_DELAY_MIN)) != NULL)
633 {
634 delay = (delay_list *)ptype->DATA ;
635 if((delay->TPHH != TAS_NOTIME) && (delay->RCHH != TAS_NOTIME))
636 {
637 delay->TPHH += delay->RCHH ;
638 }
639 if((delay->TPHL != TAS_NOTIME) && (delay->RCHH != TAS_NOTIME))
640 {
641 delay->TPHL += delay->RCHH ;
642 }
643 if((delay->TPLH != TAS_NOTIME) && (delay->RCLL != TAS_NOTIME))
644 {
645 delay->TPLH += delay->RCLL ;
646 }
647 if((delay->TPLL != TAS_NOTIME) && (delay->RCLL != TAS_NOTIME))
648 {
649 delay->TPLL += delay->RCLL ;
650 }
651 }
652 if((ptype = getptype(incone->USER,TAS_DELAY_MAX)) != NULL)
653 {
654 delay = (delay_list *)ptype->DATA ;
655 if((delay->TPHH != TAS_NOTIME) && (delay->RCHH != TAS_NOTIME))
656 {
657 delay->TPHH += delay->RCHH ;
658 }
659 if((delay->TPHL != TAS_NOTIME) && (delay->RCHH != TAS_NOTIME))
660 {
661 delay->TPHL += delay->RCHH ;
662 }
663 if((delay->TPLH != TAS_NOTIME) && (delay->RCLL != TAS_NOTIME))
664 {
665 delay->TPLH += delay->RCLL ;
666 }
667 if((delay->TPLL != TAS_NOTIME) && (delay->RCLL != TAS_NOTIME))
668 {
669 delay->TPLL += delay->RCLL ;
670 }
671 }
672 }
673
674 if((cone->TYPE & CNS_EXT) == CNS_EXT)
675 {
676 chain_list *cl;
677 cl=cns_get_cone_external_connectors(cone);
678 while (cl!=NULL)
679 {
680 /*ptype = getptype(cone->USER,CNS_EXT) ;
681 if(ptype != NULL)*/
682
683 // locon = (locon_list *)ptype->DATA ;
684 locon = (locon_list *)cl->DATA ;
685 if((locon->DIRECTION == CNS_O) ||
686 (locon->DIRECTION == CNS_B) ||
687 (locon->DIRECTION == CNS_T) ||
688 (locon->DIRECTION == CNS_Z))
689 {
690 if((ptype = getptype(locon->USER,TAS_DELAY_MAX)) != NULL)
691 {
692 delayxmax = (delay_list *)ptype->DATA ;
693 }
694 else
695 delayxmax = NULL ;
696 if((ptype = getptype(locon->USER,TAS_DELAY_MIN)) != NULL)
697 {
698 delayxmin = (delay_list *)ptype->DATA ;
699 }
700 else
701 delayxmin = NULL ;
702 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
703 {
704 if(((ptype = getptype(incone->USER,TAS_DELAY_MIN)) != NULL) &&
705 (delayxmin != NULL))
706 {
707 delay = (delay_list *)ptype->DATA ;
708 if((delay->TPHH != TAS_NOTIME) && (delayxmin->RCHH != TAS_NOTIME))
709 {
710 delay->TPHH += delayxmin->RCHH ;
711 }
712 if((delay->TPLH != TAS_NOTIME) && (delayxmin->RCHH != TAS_NOTIME))
713 {
714 delay->TPLH += delayxmin->RCHH ;
715 }
716 if((delay->TPHL != TAS_NOTIME) && (delayxmin->RCLL != TAS_NOTIME))
717 {
718 delay->TPHL += delayxmin->RCLL ;
719 }
720 if((delay->TPLL != TAS_NOTIME) && (delayxmin->RCLL != TAS_NOTIME))
721 {
722 delay->TPLL += delayxmin->RCLL ;
723 }
724 }
725 if(((ptype = getptype(incone->USER,TAS_DELAY_MAX)) != NULL) &&
726 (delayxmax != NULL))
727 {
728 delay = (delay_list *)ptype->DATA ;
729 if((delay->TPHH != TAS_NOTIME) && (delayxmax->RCHH != TAS_NOTIME))
730 {
731 delay->TPHH += delayxmax->RCHH ;
732 }
733 if((delay->TPLH != TAS_NOTIME) && (delayxmax->RCHH != TAS_NOTIME))
734 {
735 delay->TPLH += delayxmax->RCHH ;
736 }
737 if((delay->TPHL != TAS_NOTIME) && (delayxmax->RCLL != TAS_NOTIME))
738 {
739 delay->TPHL += delayxmax->RCLL ;
740 }
741 if((delay->TPLL != TAS_NOTIME) && (delayxmax->RCLL != TAS_NOTIME))
742 {
743 delay->TPLL += delayxmax->RCLL ;
744 }
745 }
746 }
747 }
748
749 cl=delchain(cl,cl);
750 }
751 }
752
753 if((cone->TYPE & (CNS_LATCH | CNS_FLIP_FLOP)) != 0)
754 {
755 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
756 {
757 if((incone->TYPE & (CNS_EXT|CNS_COMMAND)) == CNS_COMMAND)
758 {
759 conex = incone->UEDGE.CONE ;
760
761 if((conex->TYPE & TAS_DEJAEMPILE) != TAS_DEJAEMPILE)
762 {
763 chain = addchain(chain,(void*)conex) ;
764 conex->TYPE |= TAS_DEJAEMPILE ;
765 }
766
767 if((ptypeminuu = getptype(conex->USER,TAS_RC_MINHH)) == NULL)
768 {
769 conex->USER = addptype(conex->USER,TAS_RC_MINHH,(void *)TAS_NOTIME) ;
770 ptypeminuu = conex->USER ;
771 }
772
773 if((ptypemindd = getptype(conex->USER,TAS_RC_MINLL)) == NULL)
774 {
775 conex->USER = addptype(conex->USER,TAS_RC_MINLL,(void *)TAS_NOTIME) ;
776 ptypemindd = conex->USER ;
777 }
778
779 if((ptypemaxuu = getptype(conex->USER,TAS_RC_MAXHH)) == NULL)
780 {
781 conex->USER = addptype(conex->USER,TAS_RC_MAXHH,(void *)TAS_NOTIME) ;
782 ptypemaxuu = conex->USER ;
783 }
784
785 if((ptypemaxdd = getptype(conex->USER,TAS_RC_MAXLL)) == NULL)
786 {
787 conex->USER = addptype(conex->USER,TAS_RC_MAXLL,(void *)TAS_NOTIME) ;
788 ptypemaxdd = conex->USER ;
789 }
790
791 if((ptype = getptype(incone->USER,TAS_DELAY_MAX)) != NULL)
792 {
793 delayxmax = (delay_list *)ptype->DATA ;
794 }
795 if((ptype = getptype(incone->USER,TAS_DELAY_MIN)) != NULL)
796 {
797 delayxmin = (delay_list *)ptype->DATA ;
798 }
799 if(delayxmin->RCHH != TAS_NOTIME)
800 {
801 if(((long)ptypeminuu->DATA == TAS_NOTIME) ||
802 ((long)ptypeminuu->DATA > delayxmin->RCHH))
803 ptypeminuu->DATA = (void *)delayxmin->RCHH ;
804 }
805 if(delayxmin->RCLL != TAS_NOTIME)
806 {
807 if(((long)ptypemindd->DATA == TAS_NOTIME) ||
808 ((long)ptypemindd->DATA > delayxmin->RCLL))
809 ptypemindd->DATA = (void *)delayxmin->RCLL ;
810 }
811 if(delayxmax->RCHH != TAS_NOTIME)
812 {
813 if(((long)ptypemaxuu->DATA == TAS_NOTIME) ||
814 ((long)ptypemaxuu->DATA < delayxmax->RCHH))
815 ptypemaxuu->DATA = (void *)delayxmax->RCHH ;
816 }
817 if(delayxmax->RCLL != TAS_NOTIME)
818 {
819 if(((long)ptypemaxdd->DATA == TAS_NOTIME) ||
820 ((long)ptypemaxdd->DATA < delayxmax->RCLL))
821 ptypemaxdd->DATA = (void *)delayxmax->RCLL ;
822 }
823 }
824 }
825 }
826 }
827
828 for(chainx = chain ; chainx != NULL ; chainx = chainx->NEXT)
829 {
830 cone = (cone_list *)chainx->DATA ;
831 cone->TYPE &= ~(TAS_DEJAEMPILE) ;
832
833 ptypeminuu = getptype(cone->USER,TAS_RC_MINHH) ;
834 ptypemindd = getptype(cone->USER,TAS_RC_MINLL) ;
835 ptypemaxuu = getptype(cone->USER,TAS_RC_MAXHH) ;
836 ptypemaxdd = getptype(cone->USER,TAS_RC_MAXLL) ;
837
838 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
839 {
840 if((incone->TYPE & CNS_EXT) == CNS_EXT)
841 continue ;
842 if((ptype = getptype(incone->USER,TAS_DELAY_MIN)) != NULL)
843 {
844 delay = (delay_list *)ptype->DATA ;
845 if((delay->TPHH != TAS_NOTIME) &&
846 ((long)ptypeminuu->DATA != TAS_NOTIME))
847 {
848 delay->TPHH += (long)ptypeminuu->DATA ;
849 }
850 if((delay->TPLH != TAS_NOTIME) &&
851 ((long)ptypeminuu->DATA != TAS_NOTIME))
852 {
853 delay->TPLH += (long)ptypeminuu->DATA ;
854 }
855 if((delay->TPHL != TAS_NOTIME) &&
856 ((long)ptypemindd->DATA != TAS_NOTIME))
857 {
858 delay->TPHL += (long)ptypemindd->DATA ;
859 }
860 if((delay->TPLL != TAS_NOTIME) &&
861 ((long)ptypemindd->DATA != TAS_NOTIME))
862 {
863 delay->TPLL += (long)ptypemindd->DATA ;
864 }
865 }
866 if((ptype = getptype(incone->USER,TAS_DELAY_MAX)) != NULL)
867 {
868 delay = (delay_list *)ptype->DATA ;
869 if((delay->TPHH != TAS_NOTIME) &&
870 ((long)ptypemaxuu->DATA != TAS_NOTIME))
871 {
872 delay->TPHH += (long)ptypemaxuu->DATA ;
873 }
874 if((delay->TPLH != TAS_NOTIME) &&
875 ((long)ptypemaxuu->DATA != TAS_NOTIME))
876 {
877 delay->TPLH += (long)ptypemaxuu->DATA ;
878 }
879 if((delay->TPHL != TAS_NOTIME) &&
880 ((long)ptypemaxdd->DATA != TAS_NOTIME))
881 {
882 delay->TPHL += (long)ptypemaxdd->DATA ;
883 }
884 if((delay->TPLL != TAS_NOTIME) &&
885 ((long)ptypemaxdd->DATA != TAS_NOTIME))
886 {
887 delay->TPLL += (long)ptypemaxdd->DATA ;
888 }
889 }
890 }
891 cone->USER = delptype(cone->USER,TAS_RC_MINHH) ;
892 cone->USER = delptype(cone->USER,TAS_RC_MINLL) ;
893 cone->USER = delptype(cone->USER,TAS_RC_MAXHH) ;
894 cone->USER = delptype(cone->USER,TAS_RC_MAXLL) ;
895 }
896
897 freechain(chain) ;
898
899 for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT)
900 {
901 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
902 {
903 if((ptype = getptype(incone->USER,TAS_DELAY_MIN)) != NULL)
904 {
905 delay = (delay_list *)ptype->DATA ;
906 delay->RCLL=delay->RCHH=TAS_NOTIME;
907 }
908 if((ptype = getptype(incone->USER,TAS_DELAY_MAX)) != NULL)
909 {
910 delay = (delay_list *)ptype->DATA ;
911 delay->RCLL=delay->RCHH=TAS_NOTIME;
912 }
913 }
914 }
915
916 }
917
918 /*****************************************************************************
919 * fonction tas_getlosigcone() *
920 * renvoie le signal du cone s'il existe *
921 *****************************************************************************/
922 losig_list *tas_getlosigcone(cone)
923 cone_list *cone ;
924 {
925 branch_list *branch[3];
926 link_list *link ;
927 link_list *link1 = NULL ;
928 link_list *link2 = NULL ;
929 int i ;
930
931 branch[0]=cone->BRVDD ;
932 branch[1]=cone->BRVSS ;
933 branch[2]=cone->BREXT ;
934
935 for(i = 0 ; i < 3 ; i++)
936 {
937 for(; branch[i] != NULL ; branch[i] = branch[i]->NEXT)
938 {
939 for(link = branch[i]->LINK ; link != NULL ; link = link->NEXT)
940 {
941 if(link1 == NULL)
942 link1 = link ;
943 else if(link2 == NULL)
944 link2 = link ;
945 else
946 break ;
947 }
948 if(link1 != NULL)
949 break ;
950 }
951 if(link1 != NULL)
952 break ;
953 }
954
955 if(link1 == NULL)
956 {
957 return(NULL) ;
958 }
959 else if(link2 == NULL)
960 {
961 if((link1->TYPE & (CNS_IN | CNS_INOUT)) != 0)
962 {
963 return(link1->ULINK.LOCON->SIG) ;
964 }
965 else
966 {
967 if((link1->ULINK.LOTRS->DRAIN == NULL) ||
968 (link1->ULINK.LOTRS->SOURCE == NULL))
969 return(NULL) ;
970 if((link1->ULINK.LOTRS->DRAIN->SIG == NULL) ||
971 (link1->ULINK.LOTRS->SOURCE->SIG == NULL))
972 return(NULL) ;
973 if(link1->ULINK.LOTRS->DRAIN->SIG->TYPE == TAS_ALIM)
974 return(link1->ULINK.LOTRS->SOURCE->SIG) ;
975 else
976 return(link1->ULINK.LOTRS->DRAIN->SIG) ;
977 }
978 }
979 else
980 {
981 if((link1->ULINK.LOTRS->DRAIN == NULL) ||
982 (link1->ULINK.LOTRS->SOURCE == NULL))
983 return(NULL) ;
984 if((link1->ULINK.LOTRS->DRAIN->SIG == NULL) ||
985 (link1->ULINK.LOTRS->SOURCE->SIG == NULL))
986 return(NULL) ;
987 if((link2->TYPE & (CNS_IN | CNS_INOUT)) != 0)
988 {
989 if(link2->ULINK.LOCON->SIG == NULL)
990 return(NULL) ;
991 if(link2->ULINK.LOCON->SIG == link1->ULINK.LOTRS->DRAIN->SIG)
992 return(link1->ULINK.LOTRS->SOURCE->SIG) ;
993 else
994 return(link1->ULINK.LOTRS->DRAIN->SIG) ;
995 }
996 else
997 {
998 if((link2->ULINK.LOTRS->DRAIN == NULL) ||
999 (link2->ULINK.LOTRS->SOURCE == NULL))
1000 return(NULL) ;
1001 if((link2->ULINK.LOTRS->DRAIN->SIG == NULL) ||
1002 (link2->ULINK.LOTRS->SOURCE->SIG == NULL))
1003 return(NULL) ;
1004 if((link2->ULINK.LOTRS->DRAIN->SIG == link1->ULINK.LOTRS->DRAIN->SIG) ||
1005 (link2->ULINK.LOTRS->SOURCE->SIG == link1->ULINK.LOTRS->DRAIN->SIG))
1006 return(link1->ULINK.LOTRS->SOURCE->SIG) ;
1007 else
1008 return(link1->ULINK.LOTRS->DRAIN->SIG) ;
1009 }
1010 }
1011 }
1012
1013 /*****************************************************************************
1014 * fonction tas_setelmlimits() *
1015 * met les limits de delai d'elmore des signaux *
1016 *****************************************************************************/
1017 void tas_setelmlimits(losig,max,min)
1018 losig_list *losig ;
1019 long max ;
1020 long min ;
1021 {
1022 ptype_list *ptype ;
1023
1024 if(TAS_CONTEXT->TAS_FIND_MIN != 'Y')
1025 min = max ;
1026
1027 ptype = getptype(losig->USER,TAS_SIG_MAXELM) ;
1028 if(ptype == NULL)
1029 {
1030 losig->USER = addptype(losig->USER,TAS_SIG_MAXELM,(void *)max) ;
1031 }
1032 else
1033 {
1034 if(max > (long)ptype->DATA)
1035 ptype->DATA = (void *)max ;
1036 }
1037 ptype = getptype(losig->USER,TAS_SIG_MINELM) ;
1038 if(ptype == NULL)
1039 {
1040 losig->USER = addptype(losig->USER,TAS_SIG_MINELM,(void *)min) ;
1041 }
1042 else
1043 {
1044 if(min < (long)ptype->DATA)
1045 ptype->DATA = (void *)min ;
1046 }
1047 }
1048
1049 /*****************************************************************************
1050 * fonction tas_reducechaincon() *
1051 * reduit la list des connecteurs *
1052 *****************************************************************************/
1053 chain_list *tas_reducechaincon(chaincon)
1054 chain_list *chaincon ;
1055 {
1056 locon_list *locon ;
1057 locon_list *loconnext ;
1058 chain_list *chain ;
1059 chain_list *chainx ;
1060 chain_list *chainw ;
1061 chain_list *chainwire ;
1062 chain_list *chainres = NULL ;
1063 num_list *node ;
1064 num_list *nodex ;
1065 float res ;
1066 float maxres ;
1067 char flag ;
1068
1069 for(chain = chaincon ; chain != NULL ; chain = chain->NEXT)
1070 {
1071 locon = (locon_list *)chain->DATA ;
1072 if(getptype(locon->USER,TAS_CON_MARQUE) == NULL)
1073 locon->USER = addptype(locon->USER,TAS_CON_MARQUE,NULL) ;
1074 }
1075
1076 for(chain = chaincon ; chain != NULL ; chain = chain->NEXT)
1077 {
1078 locon = (locon_list *)chain->DATA ;
1079 if(getptype(locon->USER,TAS_CON_MARQUE) == NULL)
1080 continue ;
1081 for(chainx = chain->NEXT ; chainx != NULL ; chainx = chainx->NEXT)
1082 {
1083 loconnext = (locon_list *)chainx->DATA ;
1084 if(getptype(loconnext->USER,TAS_CON_MARQUE) == NULL)
1085 continue ;
1086 maxres = 0.0 ;
1087 flag = 'N' ;
1088 for(node = locon->PNODE ; node != NULL ; node = node->NEXT)
1089 {
1090 for(nodex = loconnext->PNODE ; nodex != NULL ; nodex = nodex->NEXT)
1091 {
1092 chainwire = NULL ;
1093 res = 0.0 ;
1094 if(node->DATA == nodex->DATA/* || (chainwire = getway(locon->SIG,node->DATA, nodex->DATA)) != NULL*/)
1095 {
1096 flag = 'Y' ;
1097 }
1098 for(chainw = chainwire ; chainw != NULL ; chainw = chainw->NEXT)
1099 {
1100 res += ((lowire_list *)chainw->DATA)->RESI ;
1101 }
1102 freechain(chainwire) ;
1103 }
1104 if(res > maxres)
1105 maxres = res ;
1106 }
1107 if((maxres < 10.0) && (flag == 'Y'))
1108 loconnext->USER = delptype(loconnext->USER,TAS_CON_MARQUE) ;
1109 }
1110 }
1111 for(chain = chaincon ; chain != NULL ; chain = chain->NEXT)
1112 {
1113 locon = (locon_list *)chain->DATA ;
1114 if(getptype(locon->USER,TAS_CON_MARQUE) != NULL)
1115 {
1116 locon->USER = delptype(locon->USER,TAS_CON_MARQUE) ;
1117 chainres = addchain(chainres,locon) ;
1118 }
1119 }
1120 return(chainres) ;
1121 }
1122
1123 /*****************************************************************************
1124 * fonction tas_calc_not_func() *
1125 *****************************************************************************/
1126 void tas_calc_not_func(cnsfig)
1127 cnsfig_list *cnsfig ;
1128 {
1129 locon_list *locon ;
1130 chain_list *chain ;
1131 cone_list *cone ;
1132 front_list *front ;
1133 ptype_list *ptype ;
1134 char flag ;
1135
1136 if((TAS_CONTEXT->TAS_MERGERCN == 'N') && (TAS_CONTEXT->TAS_CALCRCX == 'Y'))
1137 {
1138 for(locon = cnsfig->LOCON ; locon != NULL ; locon = locon->NEXT)
1139 {
1140 if((locon->DIRECTION == CNS_B) || (locon->DIRECTION == CNS_O) ||
1141 (locon->DIRECTION == CNS_Z) || (locon->DIRECTION == CNS_T))
1142 {
1143 ptype = getptype(locon->USER,CNS_EXT) ;
1144 if(ptype != NULL)
1145 {
1146 cone = (cone_list *)ptype->DATA ;
1147 chain = NULL ;
1148 if(locon->SIG != NULL)
1149 if((ptype = getptype(locon->SIG->USER,LOFIGCHAIN)) != NULL)
1150 {
1151 for(chain = (chain_list *)ptype->DATA ; chain != NULL ;
1152 chain = chain->NEXT)
1153 if((((locon_list *)chain->DATA)->TYPE == INTERNAL) &&
1154 ((((locon_list *)chain->DATA)->DIRECTION == CNS_B) ||
1155 (((locon_list *)chain->DATA)->DIRECTION == CNS_O) ||
1156 (((locon_list *)chain->DATA)->DIRECTION == CNS_Z) ||
1157 (((locon_list *)chain->DATA)->DIRECTION == CNS_T)))
1158 break ;
1159 }
1160
1161 if(chain != NULL)
1162 continue ;
1163
1164 if(cone->BRVDD == NULL)
1165 flag = 'Y' ;
1166 else if((cone->BRVDD->TYPE & CNS_NOT_FUNCTIONAL) ==
1167 CNS_NOT_FUNCTIONAL)
1168 flag = 'Y' ;
1169 else
1170 flag = 'N' ;
1171 if(flag == 'Y')
1172 {
1173 front = (front_list *)getptype(cone->USER,TAS_SLOPE_MAX)->DATA ;
1174 front->FUP = TAS_NOFRONT ;
1175 front = (front_list *)getptype(cone->USER,TAS_SLOPE_MIN)->DATA ;
1176 front->FUP = TAS_NOFRONT ;
1177 }
1178 if(cone->BRVSS == NULL)
1179 flag = 'Y' ;
1180 else if((cone->BRVSS->TYPE & CNS_NOT_FUNCTIONAL) ==
1181 CNS_NOT_FUNCTIONAL)
1182 flag = 'Y' ;
1183 else
1184 flag = 'N' ;
1185 if(flag == 'Y')
1186 {
1187 front = (front_list *)getptype(cone->USER,TAS_SLOPE_MAX)->DATA ;
1188 front->FDOWN = TAS_NOFRONT ;
1189 front = (front_list *)getptype(cone->USER,TAS_SLOPE_MIN)->DATA ;
1190 front->FDOWN = TAS_NOFRONT ;
1191 }
1192 }
1193 }
1194 }
1195 }
1196 }
1197
1198 /*****************************************************************************
1199 * fonction tas_tprc_ext() *
1200 *****************************************************************************/
1201 long tas_tprc_ext(ifl,cone,nbfront)
1202 inffig_list *ifl;
1203 cone_list *cone ;
1204 long nbfront ;
1205 {
1206 locon_list *locon ;
1207 losig_list *losig ;
1208 edge_list *incone ;
1209
1210 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
1211 {
1212 if((incone->TYPE & CNS_EXT) == CNS_EXT)
1213 {
1214 locon = incone->UEDGE.LOCON ;
1215 losig = locon->SIG ;
1216
1217 if(locon->TYPE != EXTERNAL)
1218 continue ;
1219
1220 nbfront = tas_tprcincone(ifl,cone,incone,'N','Y',nbfront) ;
1221
1222 }
1223 }
1224 return nbfront;
1225 }
1226
1227 /*****************************************************************************
1228 * fonction tas_tprc_cone() *
1229 *****************************************************************************/
1230 long tas_tprc_cone(ifl,cone, nbfront)
1231 inffig_list *ifl;
1232 cone_list *cone ;
1233 long nbfront;
1234 {
1235 losig_list *losig ;
1236 locon_list *locon ;
1237 edge_list *incone ;
1238 edge_list *outcone ;
1239 chain_list *chainincone ;
1240 chain_list *chaincone ;
1241 chain_list *chain ;
1242 chain_list *chainx ;
1243 char flag ;
1244
1245 chainincone = NULL ;
1246 chaincone = NULL ;
1247
1248 if((losig = tas_getlosigcone(cone)) == NULL)
1249 return (nbfront) ;
1250
1251 if(getptype(losig->USER,TAS_SIG_NORCDELAY) != NULL)
1252 return (nbfront) ;
1253
1254 if((cone->TYPE & CNS_EXT) == CNS_EXT)
1255 {
1256 chain_list *cl;
1257 cl=cns_get_cone_external_connectors(cone);
1258 if (cl!=NULL)
1259 {
1260 locon = (locon_list *)cl->DATA;//getptype(cone->USER,CNS_EXT)->DATA ;
1261 if(locon->TYPE == EXTERNAL)
1262 nbfront = tas_tprcincone(ifl,cone,NULL,'Y','N',nbfront) ;
1263 freechain(cl);
1264 }
1265 }
1266
1267 for(outcone = cone->OUTCONE ; outcone != NULL ; outcone = outcone->NEXT)
1268 {
1269 if((outcone->TYPE & CNS_EXT) != CNS_EXT)
1270 {
1271 for(incone = outcone->UEDGE.CONE->INCONE ; incone != NULL ;
1272 incone = incone->NEXT)
1273 {
1274 if((incone->TYPE & CNS_EXT) != CNS_EXT)
1275 if(incone->UEDGE.CONE == cone)
1276 {
1277 chainincone = addchain(chainincone,incone) ;
1278 chaincone = addchain(chaincone,outcone->UEDGE.CONE) ;
1279 }
1280 }
1281 }
1282 }
1283
1284 for(chain = chainincone , chainx = chaincone ;
1285 chain != NULL ; chain = chain->NEXT , chainx = chainx->NEXT)
1286 {
1287 incone = (edge_list *)chain->DATA ;
1288 nbfront = tas_tprcincone(ifl,(cone_list *)chainx->DATA,incone,'N','Y',nbfront);
1289 flag = 'N' ;
1290 }
1291
1292 freechain(chainincone) ;
1293 freechain(chaincone) ;
1294
1295 return (nbfront) ;
1296 }
1297
1298 /*****************************************************************************
1299 * fonction tas_tprcincone() *
1300 * calcul des delai d'elmore entre les cones *
1301 *****************************************************************************/
1302 long tas_tprcincone(ifl,cone,incone,flagcone,flagincone,nbfront )
1303 inffig_list *ifl;
1304 cone_list *cone ;
1305 edge_list *incone ;
1306 char flagcone ;
1307 char flagincone ;
1308 long nbfront ;
1309 {
1310 static front_list *front ;
1311 locon_list *loconcone ;
1312 locon_list *loconincone ;
1313 locon_list *locont ;
1314 locon_list *locontx ;
1315 ptype_list *ptypecone ;
1316 ptype_list *ptypeincone ;
1317 chain_list *chaincone ;
1318 chain_list *chainincone ;
1319 chain_list *chainin ;
1320 chain_list *chainc ;
1321 delay_list *delay ;
1322 delay_list *delaymax ;
1323 delay_list *delaymin ;
1324 front_list *frontconemax ;
1325 front_list *frontconemin ;
1326 front_list *frontinconemax ;
1327 front_list *frontinconemin ;
1328 rcx_list *ptrcx ;
1329 ptype_list *ptype ;
1330 long valmaxcup, valfmaxcup ;
1331 long valmincup, valfmincup ;
1332 long valmaxup, valfmaxup ;
1333 long valminup, valfminup ;
1334 long valmaxxup, valfmaxxup ;
1335 long valminxup, valfminxup ;
1336 long valmaxcdown, valfmaxcdown ;
1337 long valmincdown, valfmincdown ;
1338 long valmaxdown, valfmaxdown ;
1339 long valmindown, valfmindown ;
1340 long valmaxxdown, valfmaxxdown ;
1341 long valminxdown, valfminxdown ;
1342 long nbdelay = (long)0 ;
1343 char flag ;
1344 stm_pwl *pwlmax_up_out ;
1345 stm_pwl *pwlmax_dw_out ;
1346 stm_pwl *pwlmin_up_out ;
1347 stm_pwl *pwlmin_dw_out ;
1348 mbk_pwl *mbkpwlmax = NULL;
1349 mbk_pwl *mbkpwlmin = NULL;
1350 mbk_pwl **ptmbkpwlmax;
1351 mbk_pwl **ptmbkpwlmin;
1352
1353 RCXFLOAT dmaxup = 0.0,
1354 dminup = 0.0,
1355 fmaxup = 0.0,
1356 fminup = 0.0,
1357 dmaxdown = 0.0,
1358 dmindown = 0.0,
1359 fmaxdown = 0.0,
1360 fmindown = 0.0;
1361 rcx_slope slope;
1362 cone_list *driver = NULL;
1363 output_carac_trans s_carac_min ;
1364 output_carac_trans s_carac_max ;
1365 stm_pwl *pwlmaxup = NULL ;
1366 stm_pwl *pwlminup = NULL ;
1367 stm_pwl *pwlmaxdw = NULL ;
1368 stm_pwl *pwlmindw = NULL ;
1369 stm_pwl *pwlmaxcup = NULL ;
1370 stm_pwl *pwlmincup = NULL ;
1371 stm_pwl *pwlmaxcdw = NULL ;
1372 stm_pwl *pwlmincdw = NULL ;
1373 int usedmax ;
1374 int usedmin ;
1375 tas_driver drivermaxup, drivermaxdn, driverminup, drivermindn ;
1376 tas_driver drivermaxxup, drivermaxxdn, driverminxup, driverminxdn ;
1377 tas_driver drivermaxcup, drivermaxcdn, drivermincup, drivermincdn ;
1378 lotrs_list *lotrs ;
1379 int ongrid ;
1380
1381 long valmaxup_grid ;
1382 long valfmaxup_grid ;
1383 long valminup_grid ;
1384 long valfminup_grid ;
1385 long valmaxdown_grid ;
1386 long valfmaxdown_grid ;
1387 long valmindown_grid ;
1388 long valfmindown_grid ;
1389 tas_driver drivermaxxup_grid, drivermaxxdn_grid, driverminxup_grid, driverminxdn_grid ;
1390
1391 if( V_BOOL_TAB[__STM_USE_MSC].VALUE ) {
1392 ptmbkpwlmax = &mbkpwlmax ;
1393 ptmbkpwlmin = &mbkpwlmin ;
1394 }
1395 else {
1396 ptmbkpwlmax = NULL ;
1397 ptmbkpwlmin = NULL ;
1398 }
1399
1400 if (flagincone == 'Y') {
1401 if((incone->TYPE & CNS_EXT) == CNS_EXT)
1402 avt_log (LOGTAS, 2, "Computing RC delay from connector '%s' to cone %ld '%s'\n", incone->UEDGE.LOCON->NAME,
1403 cone->INDEX,
1404 cone->NAME);
1405 else
1406 if((incone->UEDGE.CONE->TYPE & CNS_EXT) == CNS_EXT)
1407 avt_log (LOGTAS, 2, "Computing RC delay from connector '%s' to cone %ld '%s'\n", incone->UEDGE.CONE->NAME,
1408 cone->INDEX,
1409 cone->NAME);
1410 else
1411 avt_log (LOGTAS, 2, "Computing RC delay from cone %ld '%s' to cone %ld '%s'\n", incone->UEDGE.CONE->INDEX,
1412 incone->UEDGE.CONE->NAME,
1413 cone->INDEX,
1414 cone->NAME);
1415 }
1416
1417 if(flagincone == 'Y')
1418 if((ptypeincone = getptype(incone->USER,TAS_RC_LOCON)) != NULL){
1419 locont = NULL ;
1420 flag = 'N' ;
1421 if((incone->TYPE & CNS_EXT) == CNS_EXT){
1422 if((incone->UEDGE.LOCON->DIRECTION == CNS_T)){
1423 locont = incone->UEDGE.LOCON ;
1424 if(locont->TYPE != EXTERNAL)
1425 locont = NULL ;
1426 }
1427 if((ptype = getptype(incone->UEDGE.LOCON->USER,CNS_EXT)) != NULL){
1428 if((ptype = getptype(((cone_list *)ptype->DATA)->USER,TAS_RC_CONE)) != NULL){
1429 ptypecone = ptype ;
1430 }
1431 }
1432 if(ptype == NULL){
1433 if(incone->UEDGE.LOCON->TYPE == EXTERNAL)
1434 ptypecone = addptype(NULL,TAS_RC_CONE, addchain(NULL,incone->UEDGE.LOCON)) ;
1435 else
1436 ptypecone = NULL ;
1437 flag = 'Y' ;
1438 }
1439 }else{
1440 driver = incone->UEDGE.CONE ;
1441 if((incone->UEDGE.CONE->TYPE & CNS_EXT) == CNS_EXT){
1442 chain_list *cl;
1443 cl=cns_get_cone_external_connectors(incone->UEDGE.CONE);
1444
1445 // ptype = getptype(incone->UEDGE.CONE->USER,CNS_EXT) ;
1446 if(cl!=NULL/*ptype != NULL*/){
1447 if(((locon_list *)cl->DATA)->DIRECTION == CNS_T){
1448 locont = (locon_list *)cl->DATA ;
1449 if(locont->TYPE != EXTERNAL)
1450 locont = NULL ;
1451 }
1452 freechain(cl);
1453 }
1454 }
1455 ptypecone = getptype(incone->UEDGE.CONE->USER,TAS_RC_CONE) ;
1456 }
1457 if(ptypecone != NULL){
1458 if(nbfront == (long)0){
1459 front = (front_list*)mbkalloc(TAS_BLOC_SIZE*sizeof(front_list)) ;
1460 HEAD_FRONT = addchain(HEAD_FRONT,(void*)front) ;
1461 for(nbfront = 0 ; nbfront < TAS_BLOC_SIZE ; nbfront++){
1462 (front + nbfront)->FUP = TAS_NOFRONT ;
1463 (front + nbfront)->FDOWN = TAS_NOFRONT ;
1464 (front + nbfront)->PWLUP = NULL ;
1465 (front + nbfront)->PWLDN = NULL ;
1466 (front + nbfront)->DRIVERUP.R = -1.0 ;
1467 (front + nbfront)->DRIVERUP.V = -1.0 ;
1468 (front + nbfront)->DRIVERDN.V = -1.0 ;
1469 (front + nbfront)->DRIVERDN.V = -1.0 ;
1470 }
1471 }
1472 nbfront -=2 ;
1473
1474 incone->USER = addptype(incone->USER,TAS_SLOPE_MIN,front+nbfront);
1475 incone->USER = addptype(incone->USER,TAS_SLOPE_MAX,front+nbfront+1);
1476
1477 delaymax = (delay_list *)getptype(incone->USER,TAS_DELAY_MAX)->DATA ;
1478 delaymin = (delay_list *)getptype(incone->USER,TAS_DELAY_MIN)->DATA ;
1479
1480 if((incone->TYPE & CNS_EXT) != CNS_EXT){
1481 frontconemax = (front_list *)getptype(incone->UEDGE.CONE->USER, TAS_SLOPE_MAX)->DATA ;
1482 frontconemin = (front_list *)getptype(incone->UEDGE.CONE->USER, TAS_SLOPE_MIN)->DATA ;
1483 }else if((ptype = getptype(incone->UEDGE.LOCON->USER,CNS_EXT)) != NULL){
1484 frontconemax = (front_list *)getptype(((cone_list *)ptype->DATA)->USER,TAS_SLOPE_MAX)->DATA ;
1485 frontconemin = (front_list *)getptype(((cone_list *)ptype->DATA)->USER,TAS_SLOPE_MIN)->DATA ;
1486 }else{
1487 frontconemax = (front_list *)getptype(incone->UEDGE.LOCON->USER,TAS_SLOPE_MAX)->DATA ;
1488 frontconemin = (front_list *)getptype(incone->UEDGE.LOCON->USER,TAS_SLOPE_MIN)->DATA ;
1489 }
1490
1491 frontinconemax = front+nbfront+1 ;
1492 frontinconemin = front+nbfront ;
1493
1494 valmaxcup = TAS_NOTIME ;
1495 valmincup = TAS_NOTIME ;
1496 valmaxcdown = TAS_NOTIME ;
1497 valmincdown = TAS_NOTIME ;
1498 locontx = locont ;
1499 valmaxup = TAS_NOTIME ;
1500 valminup = TAS_NOTIME ;
1501 valmaxdown = TAS_NOTIME ;
1502 valmindown = TAS_NOTIME ;
1503
1504 valmaxup_grid = TAS_NOTIME ;
1505 valminup_grid = TAS_NOTIME ;
1506 valmaxdown_grid = TAS_NOTIME ;
1507 valmindown_grid = TAS_NOTIME ;
1508 valfmaxup_grid = TAS_NOFRONT ;
1509 valfminup_grid = TAS_NOFRONT ;
1510 valfmaxdown_grid = TAS_NOFRONT ;
1511 valfmindown_grid = TAS_NOFRONT ;
1512
1513 pwlmaxup = NULL ;
1514 pwlminup = NULL ;
1515 pwlmaxdw = NULL ;
1516 pwlmindw = NULL ;
1517 pwlmaxcup = NULL ;
1518 pwlmincup = NULL ;
1519 pwlmaxcdw = NULL ;
1520 pwlmincdw = NULL ;
1521 drivermaxxup.R = -1.0 ;
1522 drivermaxxup.V = -1.0 ;
1523 driverminxup.R = -1.0 ;
1524 driverminxup.V = -1.0 ;
1525 drivermaxcup.R = -1.0 ;
1526 drivermaxcup.V = -1.0 ;
1527 drivermincup.R = -1.0 ;
1528 drivermincup.V = -1.0 ;
1529 drivermaxxdn.R = -1.0 ;
1530 drivermaxxdn.V = -1.0 ;
1531 driverminxdn.R = -1.0 ;
1532 driverminxdn.V = -1.0 ;
1533 drivermaxcdn.R = -1.0 ;
1534 drivermaxcdn.V = -1.0 ;
1535 drivermincdn.R = -1.0 ;
1536 drivermincdn.V = -1.0 ;
1537 chaincone = (chain_list *)ptypecone->DATA ;
1538 chainc = tas_reducechaincon(chaincone) ;
1539 chaincone = chainc ;
1540 while(chaincone != NULL ){
1541 if(locontx != NULL)
1542 loconcone = locontx ;
1543 else
1544 loconcone = (locon_list *)chaincone->DATA ;
1545 ptrcx = getrcx(loconcone->SIG) ;
1546 chainin = tas_reducechaincon((chain_list *)ptypeincone->DATA) ;
1547 if((ptrcx) && (loconcone->TYPE != 'C')){
1548 for(chainincone = chainin ; chainincone != NULL ; chainincone = chainincone->NEXT){
1549 loconincone = (locon_list *)chainincone->DATA ;
1550 if(loconcone == loconincone)
1551 continue ;
1552
1553 pwlmax_up_out = NULL;
1554 pwlmin_up_out = NULL;
1555 pwlmax_dw_out = NULL;
1556 pwlmin_dw_out = NULL;
1557 if(loconcone->SIG == loconincone->SIG){
1558 ongrid = 0 ;
1559 lotrs = NULL ;
1560 if( loconincone->TYPE == 'T' ) {
1561 lotrs = (lotrs_list*)(loconincone->ROOT);
1562 if( lotrs->GRID == loconincone )
1563 ongrid = 1 ;
1564 }
1565
1566 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y'){
1567 tas_get_output_carac( driver, 'm', 'U', &s_carac_min );
1568 tas_get_output_carac( driver, 'M', 'U', &s_carac_max );
1569 if((frontconemax->FUP != TAS_NOFRONT) && (frontconemin->FUP != TAS_NOFRONT)){
1570 fmaxup = stm_thr2scm (frontconemax->FUP/TTV_UNIT, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_UP);
1571 fminup = stm_thr2scm (frontconemin->FUP/TTV_UNIT, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, s_carac_min.VT, s_carac_min.VF, s_carac_min.VDD, STM_UP);
1572 slope.F0MAX = fmaxup ;
1573 slope.FCCMAX = fmaxup ;
1574 slope.SENS = TRC_SLOPE_UP;
1575 slope.CCA = -1.0;
1576 slope.MIN.slope = fminup ; slope.MAX.slope = fmaxup ;
1577 slope.MIN.vend = s_carac_min.VF ; slope.MAX.vend = s_carac_max.VF ;
1578 slope.MIN.vt = s_carac_min.VT ; slope.MAX.vt = s_carac_max.VT ;
1579 slope.MIN.vdd = s_carac_min.VDD ; slope.MAX.vdd = s_carac_max.VDD ;
1580 slope.MIN.rlin = s_carac_min.RLIN ; slope.MAX.rlin = s_carac_max.RLIN ;
1581 slope.MIN.vth = s_carac_min.VTH ; slope.MAX.vth = s_carac_max.VTH ;
1582 slope.MIN.vsat = s_carac_min.VSAT ; slope.MAX.vsat = s_carac_max.VSAT ;
1583 slope.MIN.r = s_carac_min.R ; slope.MAX.r = s_carac_max.R ;
1584 slope.MIN.c1 = s_carac_min.C1 ; slope.MAX.c1 = s_carac_max.C1 ;
1585 slope.MIN.c2 = s_carac_min.C2 ; slope.MAX.c2 = s_carac_max.C2 ;
1586 slope.MIN.slnrm = frontconemin->FUP/TTV_UNIT ;
1587 slope.MAX.slnrm = frontconemax->FUP/TTV_UNIT ;
1588 slope.MIN.pwl = stm_pwl_to_mbk_pwl( frontconemin->PWLUP, s_carac_min.VT, s_carac_min.VDD );
1589 slope.MAX.pwl = stm_pwl_to_mbk_pwl( frontconemax->PWLUP, s_carac_max.VT, s_carac_max.VDD );
1590 rcx_getdelayslope( TAS_CONTEXT->TAS_LOFIG, loconcone, loconincone, &slope, (double)tas_get_cone_output_capacitance(cone)/*TAS_CONTEXT->TAS_CAPAOUT*/,
1591 &dmaxup, &dminup, &fmaxup, &fminup, ptmbkpwlmax, ptmbkpwlmin );
1592 mbk_pwl_free_pwl( slope.MIN.pwl );
1593 mbk_pwl_free_pwl( slope.MAX.pwl );
1594 if( mbkpwlmax ) {
1595 pwlmax_up_out = mbk_pwl_to_stm_pwl( mbkpwlmax );
1596 mbk_pwl_free_pwl( mbkpwlmax );
1597 }
1598 if( mbkpwlmin ) {
1599 pwlmin_up_out = mbk_pwl_to_stm_pwl( mbkpwlmin );
1600 mbk_pwl_free_pwl( mbkpwlmin );
1601 }
1602 fmaxup = stm_scm2thr (fmaxup, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_UP);
1603 fminup = stm_scm2thr (fminup, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, s_carac_min.VT, s_carac_min.VF, s_carac_min.VDD, STM_UP);
1604 dmaxup = TTV_UNIT * dmaxup ;
1605 dminup = TTV_UNIT * dminup ;
1606 fmaxup = TTV_UNIT * fmaxup ;
1607 fminup = TTV_UNIT * fminup ;
1608 }
1609 tas_get_output_carac( driver, 'm', 'D', &s_carac_min );
1610 tas_get_output_carac( driver, 'M', 'D', &s_carac_max );
1611 if((frontconemax->FDOWN != TAS_NOFRONT) && (frontconemin->FDOWN != TAS_NOFRONT)){
1612 fmaxdown = stm_thr2scm (frontconemax->FDOWN/TTV_UNIT, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_DN);
1613 fmindown = stm_thr2scm (frontconemin->FDOWN/TTV_UNIT, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, s_carac_min.VT, s_carac_min.VF, s_carac_min.VDD, STM_DN);
1614 slope.F0MAX = fmaxdown;
1615 slope.FCCMAX = fmaxdown;
1616 slope.SENS = TRC_SLOPE_DOWN;
1617 slope.CCA = -1.0;
1618 slope.MIN.slope = fmindown ; slope.MAX.slope = fmaxdown ;
1619 slope.MIN.vend = s_carac_min.VF ; slope.MAX.vend = s_carac_max.VF ;
1620 slope.MIN.vt = s_carac_min.VT ; slope.MAX.vt = s_carac_max.VT ;
1621 slope.MIN.vdd = s_carac_min.VDD ; slope.MAX.vdd = s_carac_max.VDD ;
1622 slope.MIN.rlin = s_carac_min.RLIN ; slope.MAX.rlin = s_carac_max.RLIN ;
1623 slope.MIN.vth = s_carac_min.VTH ; slope.MAX.vth = s_carac_max.VTH ;
1624 slope.MIN.vsat = s_carac_min.VSAT ; slope.MAX.vsat = s_carac_max.VSAT ;
1625 slope.MIN.r = s_carac_min.R ; slope.MAX.r = s_carac_max.R ;
1626 slope.MIN.c1 = s_carac_min.C1 ; slope.MAX.c1 = s_carac_max.C1 ;
1627 slope.MIN.c2 = s_carac_min.C2 ; slope.MAX.c2 = s_carac_max.C2 ;
1628 slope.MIN.slnrm = frontconemin->FDOWN/TTV_UNIT ;
1629 slope.MAX.slnrm = frontconemax->FDOWN/TTV_UNIT ;
1630 slope.MIN.pwl = stm_pwl_to_mbk_pwl( frontconemin->PWLDN, s_carac_min.VT, s_carac_min.VDD );
1631 slope.MAX.pwl = stm_pwl_to_mbk_pwl( frontconemax->PWLDN, s_carac_max.VT, s_carac_max.VDD );
1632 pwlmax_dw_out = NULL;
1633 pwlmin_dw_out = NULL;
1634 rcx_getdelayslope( TAS_CONTEXT->TAS_LOFIG, loconcone, loconincone, &slope, (double)tas_get_cone_output_capacitance(cone)/*TAS_CONTEXT->TAS_CAPAOUT*/,
1635 &dmaxdown, &dmindown, &fmaxdown, &fmindown, ptmbkpwlmax, ptmbkpwlmin );
1636 mbk_pwl_free_pwl( slope.MIN.pwl );
1637 mbk_pwl_free_pwl( slope.MAX.pwl );
1638 if( mbkpwlmax ) {
1639 pwlmax_dw_out = mbk_pwl_to_stm_pwl( mbkpwlmax );
1640 mbk_pwl_free_pwl( mbkpwlmax );
1641 }
1642 if( mbkpwlmin ) {
1643 pwlmin_dw_out = mbk_pwl_to_stm_pwl( mbkpwlmin );
1644 mbk_pwl_free_pwl( mbkpwlmin );
1645 }
1646 fmaxdown = stm_scm2thr (fmaxdown, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_DN);
1647 fmindown = stm_scm2thr (fmindown, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, s_carac_min.VT, s_carac_min.VF, s_carac_min.VDD, STM_DN);
1648 dmaxdown = TTV_UNIT * dmaxdown ;
1649 dmindown = TTV_UNIT * dmindown ;
1650 fmaxdown = TTV_UNIT * fmaxdown ;
1651 fmindown = TTV_UNIT * fmindown ;
1652 }
1653 }else{
1654 tas_get_output_carac( driver, 'M', 'U', &s_carac_max );
1655 if(frontconemax->FUP != TAS_NOFRONT){
1656 fmaxup = stm_thr2scm (frontconemax->FUP/TTV_UNIT, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_UP);
1657 slope.F0MAX = fmaxup;
1658 slope.FCCMAX = fmaxup;
1659 slope.SENS = TRC_SLOPE_UP;
1660 slope.CCA = -1.0;
1661 slope.MIN.slope = -1.0 ; slope.MAX.slope = fmaxup ;
1662 slope.MIN.vend = -1.0 ; slope.MAX.vend = s_carac_max.VF ;
1663 slope.MIN.vt = -1.0 ; slope.MAX.vt = s_carac_max.VT ;
1664 slope.MIN.vdd = -1.0 ; slope.MAX.vdd = s_carac_max.VDD ;
1665 slope.MIN.rlin = -1.0 ; slope.MAX.rlin = s_carac_max.RLIN ;
1666 slope.MIN.vth = -1.0 ; slope.MAX.vth = s_carac_max.VTH ;
1667 slope.MIN.vsat = -1.0 ; slope.MAX.vsat = s_carac_max.VSAT ;
1668 slope.MIN.r = -1.0 ; slope.MAX.r = s_carac_max.R ;
1669 slope.MIN.c1 = -1.0 ; slope.MAX.c1 = s_carac_max.C1 ;
1670 slope.MIN.c2 = -1.0 ; slope.MAX.c2 = s_carac_max.C2 ;
1671 slope.MIN.slnrm = -1.0 ;
1672 slope.MAX.slnrm = frontconemax->FUP/TTV_UNIT ;
1673 slope.MIN.pwl = NULL ;
1674 slope.MAX.pwl = stm_pwl_to_mbk_pwl( frontconemax->PWLUP, s_carac_max.VT, s_carac_max.VDD );
1675 rcx_getdelayslope( TAS_CONTEXT->TAS_LOFIG, loconcone, loconincone, &slope, (double)tas_get_cone_output_capacitance(cone)/*TAS_CONTEXT->TAS_CAPAOUT*/,
1676 &dmaxup, NULL, &fmaxup, NULL, ptmbkpwlmax, NULL );
1677 mbk_pwl_free_pwl( slope.MAX.pwl );
1678 if( mbkpwlmax ) {
1679 pwlmax_up_out = mbk_pwl_to_stm_pwl( mbkpwlmax );
1680 mbk_pwl_free_pwl( mbkpwlmax );
1681 }
1682 fmaxup = stm_scm2thr (fmaxup, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_UP);
1683 dmaxup = TTV_UNIT * dmaxup ;
1684 fmaxup = TTV_UNIT * fmaxup ;
1685 }
1686 tas_get_output_carac( driver, 'M', 'D', &s_carac_max );
1687 if(frontconemax->FDOWN != TAS_NOFRONT){
1688 fmaxdown = stm_thr2scm (frontconemax->FDOWN/TTV_UNIT, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_DN);
1689 slope.F0MAX = fmaxdown;
1690 slope.FCCMAX = fmaxdown;
1691 slope.SENS = TRC_SLOPE_DOWN;
1692 slope.CCA = -1.0;
1693 slope.MIN.slope = -1.0 ; slope.MAX.slope = fmaxdown ;
1694 slope.MIN.vend = -1.0 ; slope.MAX.vend = s_carac_max.VF ;
1695 slope.MIN.vt = -1.0 ; slope.MAX.vt = s_carac_max.VT ;
1696 slope.MIN.vdd = -1.0 ; slope.MAX.vdd = s_carac_max.VDD ;
1697 slope.MIN.rlin = -1.0 ; slope.MAX.rlin = s_carac_max.RLIN ;
1698 slope.MIN.vth = -1.0 ; slope.MAX.vth = s_carac_max.VTH ;
1699 slope.MIN.vsat = -1.0 ; slope.MAX.vsat = s_carac_max.VSAT ;
1700 slope.MIN.r = -1.0 ; slope.MAX.r = s_carac_max.R ;
1701 slope.MIN.c1 = -1.0 ; slope.MAX.c1 = s_carac_max.C1 ;
1702 slope.MIN.c2 = -1.0 ; slope.MAX.c2 = s_carac_max.C2 ;
1703 slope.MIN.slnrm = -1.0 ;
1704 slope.MAX.slnrm = frontconemax->FDOWN/TTV_UNIT ;
1705 slope.MIN.pwl = NULL ;
1706 slope.MAX.pwl = stm_pwl_to_mbk_pwl( frontconemax->PWLDN, s_carac_max.VT, s_carac_max.VDD );
1707 rcx_getdelayslope( TAS_CONTEXT->TAS_LOFIG, loconcone, loconincone, &slope, (double)tas_get_cone_output_capacitance(cone)/*TAS_CONTEXT->TAS_CAPAOUT*/,
1708 &dmaxdown, NULL, &fmaxdown, NULL, ptmbkpwlmax, NULL );
1709 mbk_pwl_free_pwl( slope.MAX.pwl );
1710 if( mbkpwlmax ) {
1711 pwlmax_dw_out = mbk_pwl_to_stm_pwl( mbkpwlmax );
1712 mbk_pwl_free_pwl( mbkpwlmax );
1713 }
1714 fmaxdown = stm_scm2thr (fmaxdown, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_DN);
1715 dmaxdown = TTV_UNIT * dmaxdown ;
1716 fmaxdown = TTV_UNIT * fmaxdown ;
1717 }
1718 }
1719 }
1720
1721 usedmax = 0 ;
1722 usedmin = 0 ;
1723
1724 drivermaxup = frontconemax->DRIVERUP ;
1725 driverminup = frontconemin->DRIVERUP ;
1726
1727 if(dmaxup >= 0.0){
1728 valmaxxup = (long)(dmaxup + 0.5) ;
1729 valfmaxxup = (long)(fmaxup + 0.5) ;
1730 if((TAS_CONTEXT->TAS_FIND_MIN == 'Y') && (dminup >= 0.0)){
1731 valminxup = (long)(dminup + 0.5) ;
1732 valfminxup = (long)(fminup + 0.5) ;
1733 if(valmaxxup < valminxup){
1734 long delay;
1735 delay = valminxup ;
1736 valminxup = valmaxxup ;
1737 valmaxxup = delay ;
1738 }
1739 if(valfmaxxup < valfminxup){
1740 long delay;
1741 tas_driver driver;
1742 stm_pwl *ptpwl ;
1743 delay = valfminxup ;
1744 valfminxup = valfmaxxup ;
1745 valfmaxxup = delay ;
1746 ptpwl = pwlmax_up_out ;
1747 pwlmax_up_out = pwlmin_up_out ;
1748 pwlmin_up_out = ptpwl ;
1749 driver = driverminup ;
1750 driverminup = drivermaxup ;
1751 drivermaxup = driver ;
1752 }
1753 }else valminxup = TAS_NOTIME ;
1754 }else{
1755 valmaxxup = TAS_NOTIME ;
1756 valminxup = TAS_NOTIME ;
1757 tas_error(58,yagGetName(ifl, loconcone->SIG),TAS_WARNING) ;
1758 }
1759 if(locontx == NULL){
1760 if(((valmaxup < valmaxxup) || (valmaxup == TAS_NOTIME)) && (valmaxxup != TAS_NOTIME)){
1761 valmaxup = valmaxxup ;
1762 valfmaxup = valfmaxxup ;
1763 drivermaxxup = drivermaxup ;
1764 if( pwlmaxup ) stm_pwl_destroy( pwlmaxup );
1765 pwlmaxup = pwlmax_up_out ;
1766 usedmax = 1;
1767 }
1768 if(((valmaxup == valmaxxup) || (valmaxup == TAS_NOTIME)) && (valmaxxup != TAS_NOTIME)){
1769 if(valfmaxup < valfmaxxup){
1770 valmaxup = valmaxxup ;
1771 valfmaxup = valfmaxxup ;
1772 drivermaxxup = drivermaxup ;
1773 if( pwlmaxup ) stm_pwl_destroy( pwlmaxup );
1774 pwlmaxup = pwlmax_up_out ;
1775 usedmax = 1;
1776 }
1777 }
1778 if(((valminup > valminxup) || (valminup == TAS_NOTIME)) && (valminxup != TAS_NOTIME)){
1779 valminup = valminxup ;
1780 valfminup = valfminxup ;
1781 driverminxup = driverminup ;
1782 if( pwlminup ) stm_pwl_destroy( pwlminup );
1783 pwlminup = pwlmin_up_out ;
1784 usedmin = 1;
1785 }
1786 if(((valminup == valminxup) || (valminup == TAS_NOTIME)) && (valminxup != TAS_NOTIME)){
1787 if(valfminup > valfminxup){
1788 valminup = valminxup ;
1789 valfminup = valfminxup ;
1790 driverminxup = driverminup ;
1791 if( pwlminup ) stm_pwl_destroy( pwlminup );
1792 pwlminup = pwlmin_up_out ;
1793 usedmin = 1;
1794 }
1795 }
1796 if( ongrid && MLO_IS_TRANSN( lotrs->TYPE ) ) {
1797 if(((valmaxup_grid < valmaxxup) || (valmaxup_grid == TAS_NOTIME)) && (valmaxxup != TAS_NOTIME)){
1798 valmaxup_grid = valmaxxup ;
1799 valfmaxup_grid = valfmaxxup ;
1800 drivermaxxup_grid = drivermaxup ;
1801 }
1802 if(((valmaxup_grid == valmaxxup) || (valmaxup_grid == TAS_NOTIME)) && (valmaxxup != TAS_NOTIME)){
1803 if(valfmaxup_grid < valfmaxxup){
1804 valmaxup_grid = valmaxxup ;
1805 valfmaxup_grid = valfmaxxup ;
1806 drivermaxxup_grid = drivermaxup ;
1807 }
1808 }
1809 if(((valminup_grid > valminxup) || (valminup_grid == TAS_NOTIME)) && (valminxup != TAS_NOTIME)){
1810 valminup_grid = valminxup ;
1811 valfminup_grid = valfminxup ;
1812 driverminxup_grid = driverminup ;
1813 }
1814 if(((valminup_grid == valminxup) || (valminup_grid == TAS_NOTIME)) && (valminxup != TAS_NOTIME)){
1815 if(valfminup_grid > valfminxup){
1816 valminup_grid = valminxup ;
1817 valfminup_grid = valfminxup ;
1818 driverminxup_grid = driverminup ;
1819 }
1820 }
1821 }
1822 }else{
1823 if(((valmaxcup < valmaxxup) || (valmaxcup == TAS_NOTIME)) && (valmaxxup != TAS_NOTIME)){
1824 valmaxcup = valmaxxup ;
1825 valfmaxcup = valfmaxxup ;
1826 drivermaxcup = drivermaxup ;
1827 if( pwlmaxcup ) stm_pwl_destroy( pwlmaxcup );
1828 pwlmaxcup = pwlmax_up_out;
1829 usedmax = 1;
1830 }
1831 if(((valmaxcup == valmaxxup) || (valmaxcup == TAS_NOTIME)) && (valmaxxup != TAS_NOTIME)){
1832 if(valfmaxcup < valfmaxxup){
1833 valmaxcup = valmaxxup ;
1834 valfmaxcup = valfmaxxup ;
1835 drivermaxcup = drivermaxup ;
1836 if( pwlmaxcup ) stm_pwl_destroy( pwlmaxcup );
1837 pwlmaxcup = pwlmax_up_out;
1838 usedmax = 1;
1839 }
1840 }
1841 if(((valmincup > valminxup) || (valmincup == TAS_NOTIME)) && (valminxup != TAS_NOTIME)){
1842 valmincup = valminxup ;
1843 valfmincup = valfminxup ;
1844 drivermincup = driverminup ;
1845 if( pwlmincup ) stm_pwl_destroy( pwlmincup );
1846 pwlmincup = pwlmin_up_out;
1847 usedmin = 1;
1848 }
1849 if(((valmincup == valminxup) || (valmincup == TAS_NOTIME)) && (valminxup != TAS_NOTIME)){
1850 if(valfmincup > valfminxup){
1851 valmincup = valminxup ;
1852 valfmincup = valfminxup ;
1853 drivermincup = driverminup ;
1854 if( pwlmincup ) stm_pwl_destroy( pwlmincup );
1855 pwlmincup = pwlmin_up_out;
1856 usedmin = 1;
1857 }
1858 }
1859 }
1860
1861 if( !usedmax ) stm_pwl_destroy( pwlmax_up_out );
1862 if( !usedmin ) stm_pwl_destroy( pwlmin_up_out );
1863
1864 usedmax = 0 ;
1865 usedmin = 0 ;
1866
1867 drivermaxdn = frontconemax->DRIVERDN ;
1868 drivermindn = frontconemin->DRIVERDN ;
1869
1870 if(dmaxdown >= 0.0){
1871 valmaxxdown = (long)(dmaxdown + 0.5) ;
1872 valfmaxxdown = (long)(fmaxdown + 0.5) ;
1873 if((TAS_CONTEXT->TAS_FIND_MIN == 'Y') && (dmindown >= 0.0)){
1874 valminxdown = (long)(dmindown + 0.5) ;
1875 valfminxdown = (long)(fmindown + 0.5) ;
1876 if(valmaxxdown < valminxdown){
1877 long delay;
1878 delay = valminxdown ;
1879 valminxdown = valmaxxdown ;
1880 valmaxxdown = delay ;
1881 }
1882 if(valfmaxxdown < valfminxdown){
1883 long delay;
1884 tas_driver driver ;
1885 stm_pwl *ptpwl ;
1886 delay = valfminxdown ;
1887 valfminxdown = valfmaxxdown ;
1888 valfmaxxdown = delay ;
1889 ptpwl = pwlmax_dw_out ;
1890 pwlmax_dw_out = pwlmin_dw_out ;
1891 pwlmin_dw_out = ptpwl ;
1892 driver = drivermindn ;
1893 drivermindn = drivermaxdn ;
1894 drivermaxdn = driver ;
1895 }
1896 }else valminxdown = TAS_NOTIME ;
1897 }else{
1898 valmaxxdown = TAS_NOTIME ;
1899 valminxdown = TAS_NOTIME ;
1900 tas_error(58,yagGetName(ifl,loconcone->SIG),TAS_WARNING) ;
1901 }
1902 if(locontx == NULL){
1903 if(((valmaxdown < valmaxxdown) || (valmaxdown == TAS_NOTIME)) && (valmaxxdown != TAS_NOTIME)){
1904 valmaxdown = valmaxxdown ;
1905 valfmaxdown = valfmaxxdown ;
1906 drivermaxxdn = drivermaxdn ;
1907 if( pwlmaxdw ) stm_pwl_destroy( pwlmaxdw );
1908 pwlmaxdw = pwlmax_dw_out ;
1909 usedmax = 1;
1910 }
1911 if(((valmaxdown == valmaxxdown) || (valmaxdown == TAS_NOTIME)) && (valmaxxdown != TAS_NOTIME)){
1912 if(valfmaxdown < valfmaxxdown){
1913 valmaxdown = valmaxxdown ;
1914 valfmaxdown = valfmaxxdown ;
1915 drivermaxxdn = drivermaxdn ;
1916 if( pwlmaxdw ) stm_pwl_destroy( pwlmaxdw );
1917 pwlmaxdw = pwlmax_dw_out ;
1918 usedmax = 1;
1919 }
1920 }
1921 if(((valmindown > valminxdown) || (valmindown == TAS_NOTIME)) && (valminxdown != TAS_NOTIME)){
1922 valmindown = valminxdown ;
1923 valfmindown = valfminxdown ;
1924 driverminxdn = drivermindn ;
1925 if( pwlmindw ) stm_pwl_destroy( pwlmindw );
1926 pwlmindw = pwlmin_dw_out ;
1927 usedmin = 1;
1928 }
1929 if(((valmindown == valminxdown) || (valmindown == TAS_NOTIME)) && (valminxdown != TAS_NOTIME)){
1930 if(valfmindown > valfminxdown){
1931 valmindown = valminxdown ;
1932 valfmindown = valfminxdown ;
1933 driverminxdn = drivermindn ;
1934 if( pwlmindw ) stm_pwl_destroy( pwlmindw );
1935 pwlmindw = pwlmin_dw_out ;
1936 usedmin = 1;
1937 }
1938 }
1939 if( ongrid && MLO_IS_TRANSP( lotrs->TYPE ) ) {
1940 if(((valmaxdown_grid < valmaxxdown) || (valmaxdown_grid == TAS_NOTIME)) && (valmaxxdown != TAS_NOTIME)){
1941 valmaxdown_grid = valmaxxdown ;
1942 valfmaxdown_grid = valfmaxxdown ;
1943 drivermaxxdn_grid = drivermaxdn ;
1944 }
1945 if(((valmaxdown_grid == valmaxxdown) || (valmaxdown_grid == TAS_NOTIME)) && (valmaxxdown != TAS_NOTIME)){
1946 if(valfmaxdown_grid < valfmaxxdown){
1947 valmaxdown_grid = valmaxxdown ;
1948 valfmaxdown_grid = valfmaxxdown ;
1949 drivermaxxdn_grid = drivermaxdn ;
1950 }
1951 }
1952 if(((valmindown_grid > valminxdown) || (valmindown_grid == TAS_NOTIME)) && (valminxdown != TAS_NOTIME)){
1953 valmindown_grid = valminxdown ;
1954 valfmindown_grid = valfminxdown ;
1955 driverminxdn_grid = drivermindn ;
1956 }
1957 if(((valmindown_grid == valminxdown) || (valmindown_grid == TAS_NOTIME)) && (valminxdown != TAS_NOTIME)){
1958 if(valfmindown_grid > valfminxdown){
1959 valmindown_grid = valminxdown ;
1960 valfmindown_grid = valfminxdown ;
1961 driverminxdn_grid = drivermindn ;
1962 }
1963 }
1964 }
1965 }else{
1966 if(((valmaxcdown < valmaxxdown) || (valmaxcdown == TAS_NOTIME)) && (valmaxxdown != TAS_NOTIME)){
1967 valmaxcdown = valmaxxdown ;
1968 valfmaxcdown = valfmaxxdown ;
1969 drivermaxcdn = drivermaxdn ;
1970 if( pwlmaxcdw ) stm_pwl_destroy( pwlmaxcdw );
1971 pwlmaxcdw = pwlmax_dw_out ;
1972 usedmax = 1;
1973 }
1974 if(((valmaxcdown == valmaxxdown) || (valmaxcdown == TAS_NOTIME)) && (valmaxxdown != TAS_NOTIME)){
1975 if(valfmaxcdown < valfmaxxdown){
1976 valmaxcdown = valmaxxdown ;
1977 valfmaxcdown = valfmaxxdown ;
1978 drivermaxcdn = drivermaxdn ;
1979 if( pwlmaxcdw ) stm_pwl_destroy( pwlmaxcdw );
1980 pwlmaxcdw = pwlmax_dw_out ;
1981 usedmax = 1;
1982 }
1983 }
1984 if(((valmincdown > valminxdown) || (valmincdown == TAS_NOTIME)) && (valminxdown != TAS_NOTIME)){
1985 valmincdown = valminxdown ;
1986 valfmincdown = valfminxdown ;
1987 drivermincdn = drivermindn ;
1988 if( pwlmincdw ) stm_pwl_destroy( pwlmincdw );
1989 pwlmincdw = pwlmin_dw_out ;
1990 usedmin = 1;
1991 }
1992 if(((valmincdown == valminxdown) || (valmincdown == TAS_NOTIME)) && (valminxdown != TAS_NOTIME)){
1993 if(valfmincdown > valfminxdown){
1994 valmincdown = valminxdown ;
1995 valfmincdown = valfminxdown ;
1996 drivermincdn = drivermindn ;
1997 if( pwlmincdw ) stm_pwl_destroy( pwlmincdw );
1998 pwlmincdw = pwlmin_dw_out ;
1999 usedmin = 1;
2000 }
2001 }
2002 }
2003
2004 if( !usedmax ) stm_pwl_destroy( pwlmax_dw_out );
2005 if( !usedmin ) stm_pwl_destroy( pwlmin_dw_out );
2006
2007 }
2008 }
2009 freechain(chainin) ;
2010 if(locontx == NULL)
2011 chaincone = chaincone->NEXT ;
2012 else
2013 locontx = NULL ;
2014 }
2015 freechain(chainc) ;
2016
2017 if( V_BOOL_TAB[ __TAS_PROPAGATE_RC_ACTIVE ].VALUE ) {
2018 if( valmaxup != TAS_NOTIME && valmaxup_grid != TAS_NOTIME ) {
2019 valmaxup = valmaxup_grid ;
2020 drivermaxxup = drivermaxxup_grid ;
2021 }
2022 if( valfmaxup != TAS_NOFRONT && valfmaxup_grid != TAS_NOFRONT )
2023 valfmaxup = valfmaxup_grid ;
2024 if( valmaxdown != TAS_NOTIME && valmaxdown_grid != TAS_NOTIME ) {
2025 valmaxdown = valmaxdown_grid ;
2026 drivermaxxdn = drivermaxxdn_grid ;
2027 }
2028 if( valfmaxdown != TAS_NOFRONT && valfmaxdown_grid != TAS_NOFRONT )
2029 valfmaxdown = valfmaxdown_grid ;
2030 if( valminup != TAS_NOTIME && valminup_grid != TAS_NOTIME ) {
2031 valminup = valminup_grid ;
2032 driverminxup = driverminxup_grid ;
2033 }
2034 if( valfminup != TAS_NOFRONT && valfminup_grid != TAS_NOFRONT )
2035 valfminup = valfminup_grid ;
2036 if( valmindown != TAS_NOTIME && valmindown_grid != TAS_NOTIME ) {
2037 valmindown = valmindown_grid ;
2038 driverminxdn = driverminxdn_grid ;
2039 }
2040 if( valfmindown != TAS_NOFRONT && valfmindown_grid != TAS_NOFRONT )
2041 valfmindown = valfmindown_grid ;
2042 }
2043
2044 if((valmaxup != TAS_NOTIME) && (valmaxdown != TAS_NOTIME)){
2045 if(frontconemax->FUP != TAS_NOFRONT){
2046 delaymax->RCHH = valmaxup ;
2047 delaymax->FRCHH = valfmaxup ;
2048 #ifdef USEOLDTEMP
2049 stm_pwl_destroy(delaymax->PWLRCHH);
2050 delaymax->PWLRCHH = pwlmaxup ;
2051 #endif
2052 frontinconemax->FUP = valfmaxup ;
2053 frontinconemax->PWLUP = pwlmaxup ;
2054 frontinconemax->DRIVERUP = drivermaxxup ;
2055 }else if(loconincone->DIRECTION == CNS_T){
2056 frontinconemax->FUP = tas_get_pinslew(loconincone, 'U') ;
2057 }
2058 if(frontconemax->FDOWN != TAS_NOFRONT){
2059 delaymax->RCLL = valmaxdown ;
2060 delaymax->FRCLL = valfmaxdown ;
2061 #ifdef USEOLDTEMP
2062 stm_pwl_destroy( delaymax->PWLRCLL );
2063 delaymax->PWLRCLL = pwlmaxdw ;
2064 #endif
2065 frontinconemax->FDOWN = valfmaxdown ;
2066 frontinconemax->PWLDN = pwlmaxdw ;
2067 frontinconemax->DRIVERDN = drivermaxxdn ;
2068 }else if(loconincone->DIRECTION == CNS_T){
2069 frontinconemax->FDOWN = tas_get_pinslew(loconincone, 'D') ;
2070 }
2071 }
2072 if((TAS_CONTEXT->TAS_FIND_MIN == 'Y') && (valminup != TAS_NOTIME) && (valmindown != TAS_NOTIME)){
2073 if(frontconemin->FUP != TAS_NOFRONT){
2074 delaymin->RCHH = valminup ;
2075 delaymin->FRCHH = valfminup ;
2076 #ifdef USEOLDTEMP
2077 stm_pwl_destroy( delaymin->PWLRCHH );
2078 delaymin->PWLRCHH = pwlminup ;
2079 #endif
2080 frontinconemin->FUP = valfminup ;
2081 frontinconemin->PWLUP = pwlminup ;
2082 frontinconemin->DRIVERUP = driverminxup ;
2083
2084 }else if(loconincone->DIRECTION == CNS_T){
2085 frontinconemin->FUP = tas_get_pinslew(loconincone, 'U') ;
2086 }
2087 if(frontconemin->FDOWN != TAS_NOFRONT){
2088 delaymin->RCLL = valmindown ;
2089 delaymin->FRCLL = valfmindown ;
2090 #ifdef USEOLDTEMP
2091 stm_pwl_destroy( delaymin->PWLRCLL );
2092 delaymin->PWLRCLL = pwlmindw ;
2093 #endif
2094 frontinconemin->FDOWN = valfmindown ;
2095 frontinconemin->PWLDN = pwlmindw ;
2096 frontinconemin->DRIVERDN = driverminxdn ;
2097 }else if(loconincone->DIRECTION == CNS_T){
2098 frontinconemin->FDOWN = tas_get_pinslew(loconincone, 'D') ;
2099 }
2100 }
2101
2102 if(locont != NULL){
2103 if(nbdelay == (long)0){
2104 delay = (delay_list*)mbkalloc(TAS_BLOC_SIZE*sizeof(delay_list)) ;
2105 HEAD_DELAY = addchain(HEAD_DELAY,(void*)delay) ;
2106 for(nbdelay = 0 ; nbdelay < TAS_BLOC_SIZE ; nbdelay++){
2107 (delay + nbdelay)->TPLH = TAS_NOTIME ;
2108 (delay + nbdelay)->TPHL = TAS_NOTIME ;
2109 (delay + nbdelay)->TPHH = TAS_NOTIME ;
2110 (delay + nbdelay)->TPLL = TAS_NOTIME ;
2111 (delay + nbdelay)->FLH = TAS_NOFRONT ;
2112 (delay + nbdelay)->FHL = TAS_NOFRONT ;
2113 (delay + nbdelay)->FHH = TAS_NOFRONT ;
2114 (delay + nbdelay)->FLL = TAS_NOFRONT ;
2115 #ifdef USEOLDTEMP
2116 #ifdef USEOLDTEMP
2117 (delay + nbdelay)->RLH = TAS_NORES ;
2118 #endif
2119 #ifdef USEOLDTEMP
2120 (delay + nbdelay)->RHL = TAS_NORES ;
2121 #endif
2122 #ifdef USEOLDTEMP
2123 (delay + nbdelay)->RHH = TAS_NORES ;
2124 #endif
2125 #ifdef USEOLDTEMP
2126 (delay + nbdelay)->RLL = TAS_NORES ;
2127 #endif
2128 #ifdef USEOLDTEMP
2129 (delay + nbdelay)->SLH = TAS_NOS ;
2130 #endif
2131 #ifdef USEOLDTEMP
2132 (delay + nbdelay)->SHL = TAS_NOS ;
2133 #endif
2134 #ifdef USEOLDTEMP
2135 (delay + nbdelay)->SHH = TAS_NOS ;
2136 #endif
2137 #ifdef USEOLDTEMP
2138 (delay + nbdelay)->SLL = TAS_NOS ;
2139 #endif
2140 (delay + nbdelay)->RCHH = TAS_NOTIME ;
2141 (delay + nbdelay)->RCLL = TAS_NOTIME ;
2142 (delay + nbdelay)->FRCHH = TAS_NOFRONT ;
2143 (delay + nbdelay)->FRCLL = TAS_NOFRONT ;
2144 #endif
2145 #ifdef USEOLDTEMP
2146 (delay + nbdelay)->PWLTPLH = NULL ;
2147 (delay + nbdelay)->PWLTPHL = NULL ;
2148 (delay + nbdelay)->PWLRCLL = NULL ;
2149 (delay + nbdelay)->PWLRCHH = NULL ;
2150 #endif
2151 (delay + nbdelay)->TMLH = NULL ;
2152 (delay + nbdelay)->TMHL = NULL ;
2153 (delay + nbdelay)->TMHH = NULL ;
2154 (delay + nbdelay)->TMLL = NULL ;
2155 (delay + nbdelay)->FMLH = NULL ;
2156 (delay + nbdelay)->FMHL = NULL ;
2157 (delay + nbdelay)->FMHH = NULL ;
2158 (delay + nbdelay)->FMLL = NULL ;
2159 (delay + nbdelay)->CARAC = NULL ;
2160 }
2161 }
2162 nbdelay -=2 ;
2163 incone->USER = addptype(incone->USER,TAS_DELAY_MINT,delay + nbdelay);
2164 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y'){
2165 #ifdef USEOLDTEMP
2166 stm_pwl_destroy( (delay + nbdelay)->PWLRCHH );
2167 stm_pwl_destroy( (delay + nbdelay)->PWLRCLL );
2168 #endif
2169 (delay + nbdelay)->RCHH = valmincup ;
2170 (delay + nbdelay)->RCLL = valmincdown ;
2171 (delay + nbdelay)->FRCHH = valfmincup ;
2172 (delay + nbdelay)->FRCLL = valfmincdown ;
2173 #ifdef USEOLDTEMP
2174 (delay + nbdelay)->PWLRCHH = pwlmincup ;
2175 (delay + nbdelay)->PWLRCLL = pwlmincdw ;
2176 #endif
2177 }
2178 incone->USER = addptype(incone->USER,TAS_DELAY_MAXT,delay + nbdelay + 1);
2179 #ifdef USEOLDTEMP
2180 stm_pwl_destroy( (delay + nbdelay + 1)->PWLRCHH );
2181 stm_pwl_destroy( (delay + nbdelay + 1)->PWLRCLL );
2182 #endif
2183 (delay + nbdelay + 1)->RCHH = valmaxcup ;
2184 (delay + nbdelay + 1)->RCLL = valmaxcdown ;
2185 (delay + nbdelay + 1)->FRCHH = valfmaxcup ;
2186 (delay + nbdelay + 1)->FRCLL = valfmaxcdown ;
2187 #ifdef USEOLDTEMP
2188 (delay + nbdelay + 1)->PWLRCHH = pwlmaxcup ;
2189 (delay + nbdelay + 1)->PWLRCLL = pwlmaxcdw ;
2190 #endif
2191 }
2192
2193 if (valmaxup != TAS_NOTIME)
2194 avt_log (LOGTAS, 3, " TPHH MAX = %ld\n", valmaxup);
2195 if (valmaxdown != TAS_NOTIME)
2196 avt_log (LOGTAS, 3, " TPLL MAX = %ld\n", valmaxdown);
2197 if (valminup != TAS_NOTIME)
2198 avt_log (LOGTAS, 3, " TPHH MIN = %ld\n", valminup);
2199 if (valmindown != TAS_NOTIME)
2200 avt_log (LOGTAS, 3, " TPLL MIN = %ld\n", valmindown);
2201 }
2202 if(flag == 'Y'){
2203 freechain((chain_list *)ptypecone->DATA) ;
2204 freeptype(ptypecone) ;
2205 }
2206 }
2207
2208 if(flagcone == 'Y')
2209 if((cone->TYPE & CNS_EXT) == CNS_EXT){
2210 chain_list *cl;
2211 frontconemax = (front_list *)getptype(cone->USER,TAS_SLOPE_MAX)->DATA ;
2212 frontconemin = (front_list *)getptype(cone->USER,TAS_SLOPE_MIN)->DATA ;
2213
2214
2215 cl=cns_get_cone_external_connectors(cone);
2216 while (cl!=NULL)
2217 {
2218 //loconincone = (locon_list *)getptype(cone->USER,CNS_EXT)->DATA ;
2219 loconincone = (locon_list *)cl->DATA;
2220 if((loconincone->DIRECTION == CNS_O) ||
2221 (loconincone->DIRECTION == CNS_B) ||
2222 (loconincone->DIRECTION == CNS_T) ||
2223 (loconincone->DIRECTION == CNS_Z)){
2224 if((ptypecone = getptype(cone->USER,TAS_RC_CONE)) != NULL){
2225 delaymax = (delay_list *)getptype(loconincone->USER,TAS_DELAY_MAX)->DATA ;
2226 delaymin = (delay_list *)getptype(loconincone->USER,TAS_DELAY_MIN)->DATA ;
2227 valmaxup = TAS_NOTIME ;
2228 valminup = TAS_NOTIME ;
2229 valmaxdown = TAS_NOTIME ;
2230 valmindown = TAS_NOTIME ;
2231 drivermaxxup.R = -1.0 ;
2232 drivermaxxup.V = -1.0 ;
2233 driverminxup.R = -1.0 ;
2234 driverminxup.V = -1.0 ;
2235 drivermaxxdn.R = -1.0 ;
2236 drivermaxxdn.V = -1.0 ;
2237 driverminxdn.R = -1.0 ;
2238 driverminxdn.V = -1.0 ;
2239 pwlmaxup = NULL ;
2240 pwlminup = NULL ;
2241 pwlmaxdw = NULL ;
2242 pwlmindw = NULL ;
2243 chaincone = (chain_list *)ptypecone->DATA ;
2244 chainc = tas_reducechaincon(chaincone) ;
2245 chaincone = chainc ;
2246 for(chaincone = chainc ; chaincone != NULL ; chaincone = chaincone->NEXT){
2247 loconcone = (locon_list *)chaincone->DATA ;
2248 if(loconcone == loconincone)
2249 continue ;
2250 ptrcx = getrcx(loconcone->SIG) ;
2251 if(ptrcx){
2252 pwlmax_up_out = NULL;
2253 pwlmin_up_out = NULL;
2254 pwlmax_dw_out = NULL;
2255 pwlmin_dw_out = NULL;
2256 if(loconcone->SIG == loconincone->SIG){
2257 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y'){
2258 tas_get_output_carac( driver, 'm', 'U', &s_carac_min );
2259 tas_get_output_carac( driver, 'M', 'U', &s_carac_max );
2260 if((frontconemax->FUP != TAS_NOFRONT) && (frontconemin->FUP != TAS_NOFRONT)){
2261 fmaxup = stm_thr2scm (frontconemax->FUP/TTV_UNIT, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_UP);
2262 fminup = stm_thr2scm (frontconemin->FUP/TTV_UNIT, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, s_carac_min.VT, s_carac_min.VF, s_carac_min.VDD, STM_UP);
2263 slope.F0MAX = fmaxup;
2264 slope.FCCMAX = fmaxup;
2265 slope.SENS = TRC_SLOPE_UP;
2266 slope.CCA = -1.0;
2267 slope.MIN.slope = fminup ; slope.MAX.slope = fmaxup ;
2268 slope.MIN.vend = s_carac_min.VF ; slope.MAX.vend = s_carac_max.VF ;
2269 slope.MIN.vt = s_carac_min.VT ; slope.MAX.vt = s_carac_max.VT ;
2270 slope.MIN.vdd = s_carac_min.VDD ; slope.MAX.vdd = s_carac_max.VDD ;
2271 slope.MIN.rlin = s_carac_min.RLIN ; slope.MAX.rlin = s_carac_max.RLIN ;
2272 slope.MIN.vth = s_carac_min.VTH ; slope.MAX.vth = s_carac_max.VTH ;
2273 slope.MIN.vsat = s_carac_min.VSAT ; slope.MAX.vsat = s_carac_max.VSAT ;
2274 slope.MIN.r = s_carac_min.R ; slope.MAX.r = s_carac_max.R ;
2275 slope.MIN.c1 = s_carac_min.C1 ; slope.MAX.c1 = s_carac_max.C1 ;
2276 slope.MIN.c2 = s_carac_min.C2 ; slope.MAX.c2 = s_carac_max.C2 ;
2277 slope.MIN.slnrm = frontconemin->FUP/TTV_UNIT ;
2278 slope.MAX.slnrm = frontconemax->FUP/TTV_UNIT ;
2279 slope.MIN.pwl = stm_pwl_to_mbk_pwl( frontconemin->PWLUP, s_carac_min.VT, s_carac_min.VDD );
2280 slope.MAX.pwl = stm_pwl_to_mbk_pwl( frontconemax->PWLUP, s_carac_max.VT, s_carac_max.VDD );
2281 rcx_getdelayslope( TAS_CONTEXT->TAS_LOFIG, loconcone, loconincone, &slope, (double)tas_get_cone_output_capacitance(cone)/*TAS_CONTEXT->TAS_CAPAOUT*/,
2282 &dmaxup, &dminup, &fmaxup, &fminup, ptmbkpwlmax, ptmbkpwlmin );
2283 mbk_pwl_free_pwl( slope.MIN.pwl );
2284 mbk_pwl_free_pwl( slope.MAX.pwl );
2285 if( mbkpwlmax ) {
2286 pwlmax_up_out = mbk_pwl_to_stm_pwl( mbkpwlmax );
2287 mbk_pwl_free_pwl( mbkpwlmax );
2288 }
2289 if( mbkpwlmin ) {
2290 pwlmin_up_out = mbk_pwl_to_stm_pwl( mbkpwlmin );
2291 mbk_pwl_free_pwl( mbkpwlmin );
2292 }
2293 fmaxup = stm_scm2thr (fmaxup, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_UP);
2294 fminup = stm_scm2thr (fminup, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, s_carac_min.VT, s_carac_min.VF, s_carac_min.VDD, STM_UP);
2295 dmaxup = TTV_UNIT * dmaxup ;
2296 dminup = TTV_UNIT * dminup ;
2297 fmaxup = TTV_UNIT * fmaxup ;
2298 fminup = TTV_UNIT * fminup ;
2299 }
2300 tas_get_output_carac( driver, 'm', 'D', &s_carac_min );
2301 tas_get_output_carac( driver, 'M', 'D', &s_carac_max );
2302 if((frontconemax->FDOWN != TAS_NOFRONT) && (frontconemin->FDOWN != TAS_NOFRONT)){
2303 fmaxdown = stm_thr2scm (frontconemax->FDOWN/TTV_UNIT, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_DN);
2304 fmindown = stm_thr2scm (frontconemin->FDOWN/TTV_UNIT, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, s_carac_min.VT, s_carac_min.VF, s_carac_min.VDD, STM_DN);
2305 slope.F0MAX = fmaxdown;
2306 slope.FCCMAX = fmaxdown;
2307 slope.SENS = TRC_SLOPE_DOWN;
2308 slope.CCA = -1.0;
2309 slope.MIN.slope = fmindown ; slope.MAX.slope = fmaxdown ;
2310 slope.MIN.vend = s_carac_min.VF ; slope.MAX.vend = s_carac_max.VF ;
2311 slope.MIN.vt = s_carac_min.VT ; slope.MAX.vt = s_carac_max.VT ;
2312 slope.MIN.vdd = s_carac_min.VDD ; slope.MAX.vdd = s_carac_max.VDD ;
2313 slope.MIN.rlin = s_carac_min.RLIN ; slope.MAX.rlin = s_carac_max.RLIN ;
2314 slope.MIN.vth = s_carac_min.VTH ; slope.MAX.vth = s_carac_max.VTH ;
2315 slope.MIN.vsat = s_carac_min.VSAT ; slope.MAX.vsat = s_carac_max.VSAT ;
2316 slope.MIN.r = s_carac_min.R ; slope.MAX.r = s_carac_max.R ;
2317 slope.MIN.c1 = s_carac_min.C1 ; slope.MAX.c1 = s_carac_max.C1 ;
2318 slope.MIN.c2 = s_carac_min.C2 ; slope.MAX.c2 = s_carac_max.C2 ;
2319 slope.MIN.slnrm = frontconemin->FDOWN/TTV_UNIT ;
2320 slope.MAX.slnrm = frontconemax->FDOWN/TTV_UNIT ;
2321 slope.MIN.pwl = stm_pwl_to_mbk_pwl( frontconemin->PWLDN, s_carac_min.VT, s_carac_min.VDD );
2322 slope.MAX.pwl = stm_pwl_to_mbk_pwl( frontconemax->PWLDN, s_carac_max.VT, s_carac_max.VDD );
2323 rcx_getdelayslope( TAS_CONTEXT->TAS_LOFIG, loconcone, loconincone, &slope, (double)tas_get_cone_output_capacitance(cone)/*TAS_CONTEXT->TAS_CAPAOUT*/,
2324 &dmaxdown, &dmindown, &fmaxdown, &fmindown, ptmbkpwlmax, ptmbkpwlmin );
2325 mbk_pwl_free_pwl( slope.MIN.pwl );
2326 mbk_pwl_free_pwl( slope.MAX.pwl );
2327 if( mbkpwlmax ) {
2328 pwlmax_dw_out = mbk_pwl_to_stm_pwl( mbkpwlmax );
2329 mbk_pwl_free_pwl( mbkpwlmax );
2330 }
2331 if( mbkpwlmin ) {
2332 pwlmin_dw_out = mbk_pwl_to_stm_pwl( mbkpwlmin );
2333 mbk_pwl_free_pwl( mbkpwlmin );
2334 }
2335 fmaxdown = stm_scm2thr (fmaxdown, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_DN);
2336 fmindown = stm_scm2thr (fmindown, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, s_carac_min.VT, s_carac_min.VF, s_carac_min.VDD, STM_DN);
2337 dmaxdown = TTV_UNIT * dmaxdown ;
2338 dmindown = TTV_UNIT * dmindown ;
2339 fmaxdown = TTV_UNIT * fmaxdown ;
2340 fmindown = TTV_UNIT * fmindown ;
2341 }
2342 }else{
2343 tas_get_output_carac( driver, 'M', 'U', &s_carac_max );
2344 if(frontconemax->FUP != TAS_NOFRONT){
2345 fmaxup = stm_thr2scm (frontconemax->FUP/TTV_UNIT, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_UP);
2346 slope.F0MAX = fmaxup;
2347 slope.FCCMAX = fmaxup;
2348 slope.SENS = TRC_SLOPE_UP;
2349 slope.CCA = -1.0;
2350 slope.MIN.slope = -1.0 ; slope.MAX.slope = fmaxup ;
2351 slope.MIN.vend = -1.0 ; slope.MAX.vend = s_carac_max.VF ;
2352 slope.MIN.vt = -1.0 ; slope.MAX.vt = s_carac_max.VT ;
2353 slope.MIN.vdd = -1.0 ; slope.MAX.vdd = s_carac_max.VDD ;
2354 slope.MIN.rlin = -1.0 ; slope.MAX.rlin = s_carac_max.RLIN ;
2355 slope.MIN.vth = -1.0 ; slope.MAX.vth = s_carac_max.VTH ;
2356 slope.MIN.vsat = -1.0 ; slope.MAX.vsat = s_carac_max.VSAT ;
2357 slope.MIN.r = -1.0 ; slope.MAX.r = s_carac_max.R ;
2358 slope.MIN.c1 = -1.0 ; slope.MAX.c1 = s_carac_max.C1 ;
2359 slope.MIN.c2 = -1.0 ; slope.MAX.c2 = s_carac_max.C2 ;
2360 slope.MIN.slnrm = -1.0 ;
2361 slope.MAX.slnrm = frontconemax->FUP/TTV_UNIT ;
2362 slope.MIN.pwl = NULL ;
2363 slope.MAX.pwl = stm_pwl_to_mbk_pwl( frontconemax->PWLUP, s_carac_max.VT, s_carac_max.VDD );
2364 rcx_getdelayslope( TAS_CONTEXT->TAS_LOFIG, loconcone, loconincone, &slope, (double)tas_get_cone_output_capacitance(cone)/*TAS_CONTEXT->TAS_CAPAOUT*/,
2365 &dmaxup, NULL, &fmaxup, NULL, ptmbkpwlmax, NULL );
2366 mbk_pwl_free_pwl( slope.MAX.pwl );
2367 if( mbkpwlmax ) {
2368 pwlmax_up_out = mbk_pwl_to_stm_pwl( mbkpwlmax );
2369 mbk_pwl_free_pwl( mbkpwlmax );
2370 }
2371 fmaxup = stm_scm2thr (fmaxup, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_UP);
2372 dmaxup = TTV_UNIT * dmaxup ;
2373 fmaxup = TTV_UNIT * fmaxup ;
2374 }
2375 tas_get_output_carac( driver, 'M', 'D', &s_carac_max );
2376 if(frontconemax->FDOWN != TAS_NOFRONT){
2377 fmaxdown = stm_thr2scm (frontconemax->FDOWN/TTV_UNIT, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_DN);
2378 slope.F0MAX = fmaxdown;
2379 slope.FCCMAX = fmaxdown;
2380 slope.SENS = TRC_SLOPE_DOWN;
2381 slope.CCA = -1.0;
2382 slope.MIN.slope = -1.0 ; slope.MAX.slope = fmaxdown ;
2383 slope.MIN.vend = -1.0 ; slope.MAX.vend = s_carac_max.VF ;
2384 slope.MIN.vt = -1.0 ; slope.MAX.vt = s_carac_max.VT ;
2385 slope.MIN.vdd = -1.0 ; slope.MAX.vdd = s_carac_max.VDD ;
2386 slope.MIN.rlin = -1.0 ; slope.MAX.rlin = s_carac_max.RLIN ;
2387 slope.MIN.vth = -1.0 ; slope.MAX.vth = s_carac_max.VTH ;
2388 slope.MIN.vsat = -1.0 ; slope.MAX.vsat = s_carac_max.VSAT ;
2389 slope.MIN.r = -1.0 ; slope.MAX.r = s_carac_max.R ;
2390 slope.MIN.c1 = -1.0 ; slope.MAX.c1 = s_carac_max.C1 ;
2391 slope.MIN.c2 = -1.0 ; slope.MAX.c2 = s_carac_max.C2 ;
2392 slope.MIN.slnrm = -1.0 ;
2393 slope.MAX.slnrm = frontconemax->FDOWN/TTV_UNIT ;
2394 slope.MIN.pwl = NULL ;
2395 slope.MAX.pwl = stm_pwl_to_mbk_pwl( frontconemax->PWLDN, s_carac_max.VT, s_carac_max.VDD );
2396 rcx_getdelayslope( TAS_CONTEXT->TAS_LOFIG, loconcone, loconincone, &slope, (double)tas_get_cone_output_capacitance(cone)/*TAS_CONTEXT->TAS_CAPAOUT*/,
2397 &dmaxdown, NULL, &fmaxdown, NULL, ptmbkpwlmax, NULL );
2398 mbk_pwl_free_pwl( slope.MAX.pwl );
2399 if( mbkpwlmax ) {
2400 pwlmax_dw_out = mbk_pwl_to_stm_pwl( mbkpwlmax );
2401 mbk_pwl_free_pwl( mbkpwlmax );
2402 }
2403 fmaxdown = stm_scm2thr (fmaxdown, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, s_carac_max.VT, s_carac_max.VF, s_carac_max.VDD, STM_DN);
2404 dmaxdown = TTV_UNIT * dmaxdown ;
2405 fmaxdown = TTV_UNIT * fmaxdown ;
2406 }
2407 }
2408 }
2409
2410 usedmax = 0;
2411 usedmin = 0;
2412
2413 drivermaxup = frontconemax->DRIVERUP ;
2414 driverminup = frontconemin->DRIVERUP ;
2415
2416 if(dmaxup >= 0.0){
2417 valmaxxup = (long)(dmaxup + 0.5) ;
2418 valfmaxxup = (long)(fmaxup + 0.5) ;
2419 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y'){
2420 valminxup = (long)(dminup + 0.5) ;
2421 valfminxup = (long)(fminup + 0.5) ;
2422 if(valmaxxup < valminxup){
2423 long delay;
2424 delay = valminxup ;
2425 valminxup = valmaxxup ;
2426 valmaxxup = delay ;
2427 }
2428 if(valfmaxxup < valfminxup){
2429 long delay;
2430 tas_driver driver ;
2431 stm_pwl *ptpwl;
2432 delay = valfminxup ;
2433 valfminxup = valfmaxxup ;
2434 valfmaxxup = delay ;
2435 ptpwl = pwlmax_up_out ;
2436 pwlmax_up_out = pwlmin_up_out ;
2437 pwlmin_up_out = ptpwl ;
2438 driver = drivermaxup ;
2439 drivermaxup = driverminup ;
2440 driverminup = driver ;
2441
2442 }
2443 }else valminxup = TAS_NOTIME ;
2444 }else{
2445 valmaxxup = TAS_NOTIME ;
2446 valminxup = TAS_NOTIME ;
2447 tas_error(58,yagGetName(ifl,loconcone->SIG),TAS_WARNING) ;
2448 }
2449 if(((valmaxup < valmaxxup) || (valmaxup == TAS_NOTIME)) && (valmaxxup != TAS_NOTIME)){
2450 valmaxup = valmaxxup ;
2451 valfmaxup = valfmaxxup ;
2452 drivermaxxup = drivermaxup ;
2453 if( pwlmaxup ) stm_pwl_destroy( pwlmaxup );
2454 pwlmaxup = pwlmax_up_out ;
2455 usedmax = 1 ;
2456 }
2457 if(((valminup > valminxup) || (valminup == TAS_NOTIME)) && (valminxup != TAS_NOTIME)){
2458 valminup = valminxup ;
2459 valfminup = valfminxup ;
2460 driverminxup = driverminup ;
2461 if( pwlminup ) stm_pwl_destroy( pwlminup );
2462 pwlminup = pwlmin_up_out ;
2463 usedmin = 1 ;
2464 }
2465
2466 if( !usedmax ) stm_pwl_destroy( pwlmax_up_out );
2467 if( !usedmin ) stm_pwl_destroy( pwlmin_up_out );
2468
2469 usedmax = 0;
2470 usedmin = 0;
2471
2472 drivermaxdn = frontconemax->DRIVERDN ;
2473 drivermindn = frontconemin->DRIVERDN ;
2474
2475 if(dmaxdown >= 0.0){
2476 valmaxxdown = (long)(dmaxdown + 0.5) ;
2477 valfmaxxdown = (long)(fmaxdown + 0.5) ;
2478 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y'){
2479 valminxdown = (long)(dmindown + 0.5) ;
2480 valfminxdown = (long)(fmindown + 0.5) ;
2481 if(valmaxxdown < valminxdown){
2482 long delay;
2483 delay = valminxdown ;
2484 valminxdown = valmaxxdown ;
2485 valmaxxdown = delay ;
2486 }
2487 if(valfmaxxdown < valfminxdown){
2488 long delay;
2489 tas_driver driver ;
2490 stm_pwl *ptpwl;
2491 delay = valfminxdown ;
2492 valfminxdown = valfmaxxdown ;
2493 valfmaxxdown = delay ;
2494 ptpwl = pwlmax_dw_out ;
2495 pwlmax_dw_out = pwlmin_dw_out ;
2496 pwlmin_dw_out = ptpwl ;
2497 driver = drivermaxdn ;
2498 drivermaxdn = drivermindn ;
2499 drivermindn = driver ;
2500 }
2501 }else valminxdown = TAS_NOTIME ;
2502 }else{
2503 valmaxxdown = TAS_NOTIME ;
2504 valminxdown = TAS_NOTIME ;
2505 tas_error(58,yagGetName(ifl,loconcone->SIG),TAS_WARNING) ;
2506 }
2507 if(((valmaxdown < valmaxxdown) || (valmaxdown == TAS_NOTIME)) && (valmaxxdown != TAS_NOTIME)){
2508 valmaxdown = valmaxxdown ;
2509 valfmaxdown = valfmaxxdown ;
2510 drivermaxxdn = drivermaxdn ;
2511 if( pwlmaxdw ) stm_pwl_destroy( pwlmaxdw );
2512 pwlmaxdw = pwlmax_dw_out ;
2513 usedmax = 1 ;
2514 }
2515 if(((valmindown > valminxdown) || (valmindown == TAS_NOTIME)) && (valminxdown != TAS_NOTIME)){
2516 valmindown = valminxdown ;
2517 valfmindown = valfminxdown ;
2518 driverminxdn = drivermindn ;
2519 if( pwlmindw ) stm_pwl_destroy( pwlmindw );
2520 pwlmindw = pwlmin_dw_out ;
2521 usedmin = 1 ;
2522 }
2523
2524 if( !usedmax ) stm_pwl_destroy( pwlmax_dw_out );
2525 if( !usedmin ) stm_pwl_destroy( pwlmin_dw_out );
2526 }
2527 }
2528 freechain(chainc) ;
2529
2530 if(getptype(loconincone->USER,TAS_SLOPE_MAX) == NULL){
2531 if(nbfront == (long)0){
2532 front = (front_list*)mbkalloc(TAS_BLOC_SIZE*sizeof(front_list)) ;
2533 HEAD_FRONT = addchain(HEAD_FRONT,(void*)front) ;
2534 for(nbfront = 0 ; nbfront < TAS_BLOC_SIZE ; nbfront++){
2535 (front + nbfront)->FUP = TAS_NOFRONT ;
2536 (front + nbfront)->FDOWN = TAS_NOFRONT ;
2537 (front + nbfront)->PWLUP = NULL ;
2538 (front + nbfront)->PWLDN = NULL ;
2539 (front + nbfront)->DRIVERUP.R = -1.0 ;
2540 (front + nbfront)->DRIVERUP.V = -1.0 ;
2541 (front + nbfront)->DRIVERDN.R = -1.0 ;
2542 (front + nbfront)->DRIVERDN.V = -1.0 ;
2543 }
2544 }
2545 nbfront -=2 ;
2546 loconincone->USER = addptype(loconincone->USER,TAS_SLOPE_MIN, front+nbfront);
2547 loconincone->USER = addptype(loconincone->USER,TAS_SLOPE_MAX, front+nbfront+1);
2548 frontinconemin = front+nbfront ;
2549 frontinconemax = front+nbfront+1 ;
2550 }else{
2551 frontinconemin = (front_list *)getptype(loconincone->USER, TAS_SLOPE_MIN)->DATA ;
2552 frontinconemax = (front_list *)getptype(loconincone->USER, TAS_SLOPE_MAX)->DATA ;
2553 }
2554
2555 if((valmaxup != TAS_NOTIME) && (valmaxdown != TAS_NOTIME)){
2556 if(frontconemax->FUP != TAS_NOFRONT){
2557 delaymax->RCHH = valmaxup ;
2558 delaymax->FRCHH = valfmaxup ;
2559 #ifdef USEOLDTEMP
2560 stm_pwl_destroy( delaymax->PWLRCHH );
2561 delaymax->PWLRCHH = pwlmaxup ;
2562 #endif
2563 frontinconemax->FUP = valfmaxup ;
2564 frontinconemax->PWLUP = pwlmaxup ;
2565 frontinconemax->DRIVERUP = drivermaxxup ;
2566 }else if(loconincone->DIRECTION == CNS_T){
2567 frontinconemax->FUP = tas_get_pinslew(loconincone, 'U') ;
2568 }
2569 if(frontconemax->FDOWN != TAS_NOFRONT){
2570 delaymax->RCLL = valmaxdown ;
2571 delaymax->FRCLL = valfmaxdown ;
2572 #ifdef USEOLDTEMP
2573 stm_pwl_destroy( delaymax->PWLRCLL );
2574 delaymax->PWLRCLL = pwlmaxdw ;
2575 #endif
2576 frontinconemax->FDOWN = valfmaxdown ;
2577 frontinconemax->PWLDN = pwlmaxdw ;
2578 frontinconemax->DRIVERDN = drivermaxxdn ;
2579 }else if(loconincone->DIRECTION == CNS_T){
2580 frontinconemax->FDOWN = tas_get_pinslew(loconincone, 'D') ;
2581 }
2582 }
2583 if((TAS_CONTEXT->TAS_FIND_MIN == 'Y') && (valminup != TAS_NOTIME) && (valmindown != TAS_NOTIME)){
2584 if(frontconemin->FUP != TAS_NOFRONT){
2585 delaymin->RCHH = valminup ;
2586 delaymin->FRCHH = valfminup ;
2587 #ifdef USEOLDTEMP
2588 stm_pwl_destroy( delaymin->PWLRCHH );
2589 delaymin->PWLRCHH = pwlminup ;
2590 #endif
2591 frontinconemin->FUP = valfminup ;
2592 frontinconemin->PWLUP = pwlminup;
2593 frontinconemin->DRIVERUP = driverminxup ;
2594 }else if(loconincone->DIRECTION == CNS_T){
2595 frontinconemin->FUP = tas_get_pinslew(loconincone, 'U') ;
2596 }
2597 if(frontconemin->FDOWN != TAS_NOFRONT){
2598 delaymin->RCLL = valmindown ;
2599 delaymin->FRCLL = valfmindown ;
2600 #ifdef USEOLDTEMP
2601 stm_pwl_destroy( delaymin->PWLRCLL );
2602 delaymin->PWLRCLL = pwlmindw ;
2603 #endif
2604 frontinconemin->FDOWN = valfmindown ;
2605 frontinconemin->PWLDN = pwlmindw;
2606 frontinconemin->DRIVERDN = driverminxdn ;
2607 }else if(loconincone->DIRECTION == CNS_T){
2608 frontinconemin->FDOWN = tas_get_pinslew(loconincone, 'D') ;
2609 }
2610 }
2611 }
2612 }
2613 cl=delchain(cl,cl);
2614 }
2615 }
2616
2617 return(nbfront) ;
2618 }
2619
2620 /*****************************************************************************
2621 * fonction tas_flatrcx() *
2622 * tratement des interconexion entre cone *
2623 *****************************************************************************/
2624 void tas_flatrcx(lofig,cnsfig,ttvfig)
2625 lofig_list *lofig ;
2626 cnsfig_list *cnsfig ;
2627 ttvfig_list *ttvfig ;
2628 {
2629 losig_list *losig ;
2630 losig_list *losigcone ;
2631 locon_list *locon ;
2632 lotrs_list *lotrs ;
2633 cone_list *cone ;
2634 cone_list *conex ;
2635 edge_list *incone ;
2636 branch_list *branch[3];
2637 link_list *link ;
2638 ptype_list *ptype ;
2639 ptype_list *ptypecone ;
2640 chain_list *chain ;
2641 rcx_list *ptrcx ;
2642 char flaglocon ;
2643 int i, forceit ;
2644
2645 if((lofig == NULL)/* || (TAS_CONTEXT->TAS_CNS_LOAD == 'Y')*/)
2646 return ;
2647
2648 TAS_CONTEXT->TAS_CALCRCX = 'N' ;
2649
2650 rcx_create(lofig);
2651
2652 for(locon = lofig->LOCON ; locon != NULL ; locon = locon->NEXT)
2653 {
2654 chain = NULL ;
2655
2656 if((ptype = getptype(locon->SIG->USER,LOFIGCHAIN)) != NULL)
2657 {
2658 for(chain = (chain_list *)ptype->DATA ; chain != NULL ; chain = chain->NEXT)
2659 if(((locon_list *)chain->DATA)->TYPE == INTERNAL)
2660 break ;
2661 }
2662
2663 if((getptype(locon->USER,CNS_EXT) == NULL) &&
2664 (getptype(locon->USER,CNS_CONE) == NULL) && (chain == NULL))
2665 {
2666 if(getptype(locon->SIG->USER,TAS_SIG_NORCDELAY) == NULL) {
2667 if( TAS_CONTEXT->TAS_CALCRCN == 'Y' )
2668 locon->SIG->USER = addptype(locon->SIG->USER,TAS_SIG_NORCDELAY,(void*)0x1);
2669 else
2670 locon->SIG->USER = addptype(locon->SIG->USER,TAS_SIG_NORCDELAY,NULL);
2671 }
2672 }
2673 }
2674
2675 tas_builtrcxview(lofig,ttvfig) ;
2676
2677 for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT)
2678 {
2679 if((cone->TYPE & (CNS_VDD|CNS_VSS)) != 0)
2680 continue ;
2681
2682 branch[0]=cone->BREXT ;
2683 branch[1]=cone->BRVDD ;
2684 branch[2]=cone->BRVSS ;
2685 ptypecone = NULL ;
2686 if((losigcone = tas_getlosigcone(cone)) != NULL)
2687 {
2688 if(((ptrcx = getrcx(losigcone)) != NULL) &&
2689 (getptype(losigcone->USER,TAS_SIG_NORCDELAY) == NULL))
2690 {
2691 if(cone->OUTCONE == NULL)
2692 {
2693 losigcone->USER = addptype(losigcone->USER,TAS_SIG_NORCDELAY,NULL) ;
2694 setrcxmodel(lofig,losigcone,RCX_NORCTC) ;
2695 }
2696 else if((ptypecone = getptype(cone->USER,TAS_RC_CONE)) == NULL)
2697 {
2698 cone->USER = addptype(cone->USER,TAS_RC_CONE,(void*)NULL) ;
2699 ptypecone = cone->USER ;
2700 }
2701 }
2702 }
2703
2704 forceit=0;
2705 if ((cone->TYPE & TAS_BREAK)!=0 || (cone->TYPE & (CNS_LATCH|CNS_PRECHARGE))!=0)
2706 {
2707 branch_list *br;
2708 int brk=0;
2709 for(i = 0 ; i < 3 && brk==0; i++)
2710 for(br=branch[i]; br != NULL && brk==0; br = br->NEXT)
2711 if ((br->TYPE & CNS_NOT_FUNCTIONAL)!=CNS_NOT_FUNCTIONAL) brk=1;
2712
2713 if (!brk) forceit=1;
2714 }
2715
2716 for(i = 0 ; i < 3 ; i++)
2717 for(; branch[i] != NULL ; branch[i] = branch[i]->NEXT)
2718 {
2719 // ajout 15/9/2005
2720 if (!forceit && (branch[i]->TYPE & CNS_NOT_FUNCTIONAL)==CNS_NOT_FUNCTIONAL) continue;
2721 //
2722 lotrs = NULL ;
2723 for(link = branch[i]->LINK ; link != NULL ; link=link->NEXT)
2724 {
2725 if((link == branch[i]->LINK) && (ptypecone != NULL) &&
2726 ((cone->TYPE & (CNS_VDD|CNS_VSS)) == 0))
2727 {
2728 if((link->TYPE & (CNS_IN | CNS_INOUT)) != 0)
2729 {
2730 locon = link->ULINK.LOCON ;
2731 if((locon->DIRECTION == CNS_O) || (locon->DIRECTION == CNS_B)
2732 || (locon->DIRECTION == CNS_T) || (locon->DIRECTION == CNS_Z))
2733 flaglocon = 'N' ;
2734 else
2735 flaglocon = 'Y' ;
2736 }
2737 else
2738 {
2739 if(link->ULINK.LOTRS->DRAIN->SIG == losigcone)
2740 locon = link->ULINK.LOTRS->DRAIN ;
2741 else
2742 locon = link->ULINK.LOTRS->SOURCE ;
2743 flaglocon = 'Y' ;
2744 }
2745 if((getptype(locon->USER,TAS_CON_MARQUE) == NULL) &&
2746 (flaglocon == 'Y'))
2747 {
2748 locon->USER = addptype(locon->USER,TAS_CON_MARQUE,(void*)NULL) ;
2749 ptypecone->DATA = (void *)addchain((chain_list *)
2750 ptypecone->DATA,
2751 (void*)locon) ;
2752 }
2753 }
2754 if((link->TYPE & (CNS_IN | CNS_INOUT)) != 0)
2755 {
2756 if((link == branch[i]->LINK) || (lotrs == NULL))
2757 continue ;
2758 locon = link->ULINK.LOCON ;
2759 if((lotrs->DRAIN == NULL) || (lotrs->SOURCE == NULL))
2760 continue ;
2761 losig = locon->SIG ;
2762 if(((ptrcx = getrcx(losig)) == NULL) ||
2763 (getptype(losig->USER,TAS_SIG_NORCDELAY) != NULL))
2764 continue ;
2765 if(locon->SIG == lotrs->DRAIN->SIG)
2766 locon = lotrs->DRAIN ;
2767 else if(locon->SIG == lotrs->SOURCE->SIG)
2768 locon = lotrs->SOURCE ;
2769 else continue ;
2770 }
2771 else
2772 {
2773 lotrs = link->ULINK.LOTRS ;
2774 if(lotrs->GRID == NULL)
2775 continue ;
2776 losig = lotrs->GRID->SIG ;
2777 if(((ptrcx = getrcx(losig)) == NULL) ||
2778 (getptype(losig->USER,TAS_SIG_NORCDELAY) != NULL))
2779 continue ;
2780 conex = (cone_list *)getptype(lotrs->USER,CNS_DRIVINGCONE)->DATA ;
2781 if((conex->TYPE & (CNS_VDD|CNS_VSS)) != 0)
2782 continue ;
2783 }
2784 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
2785 {
2786 if((incone->TYPE & (CNS_FEEDBACK|CNS_VDD|CNS_VSS|TAS_PATH_INOUT|CNS_BLEEDER)) != 0)
2787 if((incone->TYPE & (CNS_COMMAND|CNS_VDD|CNS_VSS|CNS_BLEEDER|TAS_PATH_INOUT)) != CNS_COMMAND)
2788 continue ;
2789
2790 if(((incone->TYPE & CNS_EXT) != CNS_EXT) &&
2791 ((link->TYPE & (CNS_IN | CNS_INOUT)) == 0))
2792 {
2793 if(conex == incone->UEDGE.CONE)
2794 {
2795 if((ptype = getptype(lotrs->GRID->USER,
2796 TAS_CON_INCONE)) != NULL)
2797 {
2798 if(ptype->DATA != incone)
2799 {
2800 ptype->DATA = incone ;
2801 if((ptype = getptype(incone->USER,
2802 TAS_RC_LOCON)) != NULL)
2803 {
2804 ptype->DATA = (void *)addchain(
2805 (chain_list*)ptype->DATA,lotrs->GRID) ;
2806 }
2807 else
2808 {
2809 incone->USER = addptype(incone->USER,TAS_RC_LOCON,
2810 (void*)addchain((chain_list*)NULL,
2811 (void *)lotrs->GRID)) ;
2812 }
2813 }
2814 }
2815 else
2816 {
2817 lotrs->GRID->USER = addptype(lotrs->GRID->USER,
2818 TAS_CON_INCONE,(void *)incone) ;
2819 if((ptype = getptype(incone->USER,
2820 TAS_RC_LOCON)) != NULL)
2821 {
2822 ptype->DATA = (void *)addchain(
2823 (chain_list*)ptype->DATA,lotrs->GRID) ;
2824 }
2825 else
2826 {
2827 incone->USER = addptype(incone->USER,TAS_RC_LOCON,
2828 (void*)addchain((chain_list*)NULL,
2829 (void *)lotrs->GRID)) ;
2830 }
2831 }
2832 break ;
2833 }
2834 }
2835 else if(((incone->TYPE & CNS_EXT) == CNS_EXT) &&
2836 ((link->TYPE & (CNS_IN | CNS_INOUT)) != 0))
2837 {
2838 if(link->ULINK.LOCON == incone->UEDGE.LOCON)
2839 {
2840 if((ptype = getptype(locon->USER,
2841 TAS_CON_INCONE)) != NULL)
2842 {
2843 if(ptype->DATA != incone)
2844 {
2845 ptype->DATA = incone ;
2846 if((ptype = getptype(incone->USER,
2847 TAS_RC_LOCON)) != NULL)
2848 {
2849 ptype->DATA = (void *)addchain(
2850 (chain_list*)ptype->DATA,locon) ;
2851 }
2852 else
2853 {
2854 incone->USER = addptype(incone->USER,TAS_RC_LOCON,
2855 (void*)addchain((chain_list*)NULL,
2856 (void *)locon)) ;
2857 }
2858 }
2859 }
2860 else
2861 {
2862 locon->USER = addptype(locon->USER,
2863 TAS_CON_INCONE,(void *)incone) ;
2864 if((ptype = getptype(incone->USER,
2865 TAS_RC_LOCON)) != NULL)
2866 {
2867 ptype->DATA = (void *)addchain(
2868 (chain_list*)ptype->DATA,locon) ;
2869 }
2870 else
2871 {
2872 incone->USER = addptype(incone->USER,TAS_RC_LOCON,
2873 (void*)addchain((chain_list*)NULL,
2874 (void *)locon)) ;
2875 }
2876 }
2877 break ;
2878 }
2879 }
2880 }
2881 }
2882 }
2883
2884 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
2885 {
2886 if((ptype = getptype(incone->USER,
2887 TAS_RC_LOCON)) != NULL)
2888 {
2889 for(chain = (chain_list *)ptype->DATA ; chain != NULL ;
2890 chain = chain->NEXT)
2891 {
2892 locon = (locon_list *)chain->DATA ;
2893 if(getptype(locon->USER,TAS_CON_INCONE) != NULL)
2894 locon->USER = delptype(locon->USER,TAS_CON_INCONE) ;
2895 }
2896 }
2897 }
2898
2899 if(ptypecone != NULL)
2900 {
2901 for(chain = (chain_list *)ptypecone->DATA ; chain != NULL ;
2902 chain = chain->NEXT)
2903 {
2904 locon = (locon_list *)chain->DATA ;
2905 locon->USER = delptype(locon->USER,TAS_CON_MARQUE) ;
2906 }
2907 }
2908 }
2909
2910 tas_detectsig(cnsfig) ;
2911
2912 for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT)
2913 {
2914 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
2915 {
2916 if((ptype = getptype(incone->USER,TAS_RC_LOCON)) != NULL)
2917 {
2918 for(chain = (chain_list *)ptype->DATA ; chain != NULL ;
2919 chain = chain->NEXT)
2920 {
2921 locon = (locon_list *)chain->DATA ;
2922 if(getptype(locon->SIG->USER,TAS_SIG_NORCDELAY) != NULL)
2923 break ;
2924 }
2925 if(chain != NULL)
2926 {
2927 freechain((chain_list *)ptype->DATA) ;
2928 incone->USER = delptype(incone->USER,TAS_RC_LOCON) ;
2929 }
2930 else
2931 {
2932 for(chain = (chain_list *)ptype->DATA ; chain != NULL ;
2933 chain = chain->NEXT)
2934 {
2935 locon = (locon_list *)chain->DATA ;
2936 if((ptype = getptype(locon->USER,TAS_CON_INCONE)) != NULL)
2937 {
2938 ptype = (ptype_list *)ptype->DATA ;
2939 if(ptype->DATA == NULL)
2940 {
2941 ptype->DATA = tas_getsigname(NULL,NULL,incone) ;
2942 }
2943 }
2944 }
2945 }
2946 }
2947 }
2948
2949 if((ptype = getptype(cone->USER,TAS_RC_CONE)) != NULL)
2950 {
2951 for(chain = (chain_list *)ptype->DATA ; chain != NULL ;
2952 chain = chain->NEXT)
2953 {
2954 locon = (locon_list *)chain->DATA ;
2955 if(getptype(locon->SIG->USER,TAS_SIG_NORCDELAY) != NULL)
2956 break ;
2957 }
2958 if(chain != NULL)
2959 {
2960 freechain((chain_list *)ptype->DATA) ;
2961 cone->USER = delptype(cone->USER,TAS_RC_CONE) ;
2962 }
2963 else
2964 {
2965 if((cone->TYPE & CNS_EXT) == CNS_EXT)
2966 {
2967 chain_list *cl;
2968 cl=cns_get_cone_external_connectors(cone);
2969 if(cl!=NULL/*(ptype = getptype(cone->USER,CNS_EXT)) != NULL*/)
2970 {
2971 locon = (locon_list *)cl->DATA ;
2972 if((locon->DIRECTION == CNS_O) || (locon->DIRECTION == CNS_B) ||
2973 (locon->DIRECTION == CNS_Z) || (locon->DIRECTION == CNS_T))
2974 {
2975 tas_getsigname(cone,NULL,NULL) ;
2976 }
2977 freechain(cl);
2978 }
2979 else
2980 tas_getsigname(cone,NULL,NULL) ;
2981 }
2982 else
2983 tas_getsigname(cone,NULL,NULL) ;
2984 }
2985 }
2986
2987 tas_rcxsetdriver( cone );
2988 tas_rcxsetnodebytransition( cone );
2989 }
2990
2991 for(losig = lofig->LOSIG; losig; losig = losig->NEXT){
2992 if(((ptrcx = getrcx(losig)) != NULL) &&
2993 (getptype(losig->USER,TAS_SIG_NORCDELAY) == NULL)){
2994 TAS_CONTEXT->TAS_CALCRCX = 'Y';
2995 break;
2996 }
2997 }
2998
2999 buildrcx(lofig) ;
3000 }
3001
3002 /* tas_rcxsetnodebytransition()
3003 Informe rcx des noeuds à prendre pour le calcul des délais rc suivant la
3004 transition.
3005 Version light : ne calcule cette information que sur les grilles des
3006 transistors.
3007 */
3008 void tas_rcxsetnodebytransition( cone_list *cone )
3009 {
3010 edge_list *incone ;
3011 chain_list *chain ;
3012 chain_list *chainin ;
3013 ptype_list *ptypeincone ;
3014 num_list *headup ;
3015 num_list *headdn ;
3016 num_list *pnode ;
3017 locon_list *locon ;
3018 lotrs_list *lotrs ;
3019 losig_list *currentsig ;
3020
3021 if( !V_BOOL_TAB[ __AVT_RC_BY_TRANSITION ].VALUE )
3022 return ;
3023
3024 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT) {
3025
3026 ptypeincone = getptype( incone->USER, TAS_RC_LOCON );
3027
3028 if( !ptypeincone )
3029 continue ;
3030
3031 chainin = tas_reducechaincon( (chain_list *)ptypeincone->DATA ) ;
3032
3033 /* premiere passe : récupère la liste des node up et down */
3034 headup = NULL ;
3035 headdn = NULL ;
3036 currentsig = NULL ;
3037
3038 for( chain = chainin ; chain ; chain = chain->NEXT ) {
3039
3040 locon = (locon_list*)chain->DATA ;
3041 if( currentsig ) {
3042 if( currentsig != locon->SIG ) /* complex case */
3043 break ;
3044 }
3045 currentsig = locon->SIG ;
3046 if( !getrcx( locon->SIG ) )
3047 break ;
3048
3049 if( locon->TYPE == 'T' ) {
3050 lotrs = (lotrs_list*)locon->ROOT ;
3051 if( locon == lotrs->GRID ) {
3052 for( pnode = locon->PNODE ; pnode ; pnode = pnode->NEXT ) {
3053 if( MLO_IS_TRANSN( lotrs->TYPE ) )
3054 headup = addnum( headup, pnode->DATA );
3055 if( MLO_IS_TRANSP( lotrs->TYPE ) )
3056 headdn = addnum( headdn, pnode->DATA );
3057 }
3058 }
3059 }
3060 }
3061
3062 /* seconde passe : met à jour les infos rcx */
3063 if( headup && headdn && !chain ) {
3064 for( chain = chainin ; chain ; chain = chain->NEXT ) {
3065 locon = (locon_list*)chain->DATA ;
3066 if( locon->TYPE == 'T' ) {
3067 lotrs = (lotrs_list*)locon->ROOT ;
3068 if( locon == lotrs->GRID ) {
3069 rcx_setnodebytransition( locon, TRC_SLOPE_UP, headup );
3070 rcx_setnodebytransition( locon, TRC_SLOPE_DOWN, headdn );
3071 }
3072 }
3073 }
3074 }
3075 freenum( headup );
3076 freenum( headdn );
3077
3078 freechain( chainin );
3079 }
3080 }
3081
3082 void tas_rcxsetdriver( cone_list *cone )
3083 {
3084 num_list *driversup ;
3085 num_list *driversdw ;
3086 num_list *driver ;
3087 int i, is_parallel, is_up, is_dw;
3088 losig_list *losig ;
3089 locon_list *locon ;
3090 lotrs_list *lotrs ;
3091 branch_list *br[3] ;
3092 branch_list *branch ;
3093 num_list *pnode ;
3094 static int drivermode=2 ;
3095 static int drivergate=2 ;
3096 char *env ;
3097 char buf[1024] ;
3098 char *ptr ;
3099 ptype_list *ptype ;
3100 chain_list *chain ;
3101 chain_list *chlocon ;
3102
3103 env = V_STR_TAB[__TAS_RCX_DRIVER].VALUE ;
3104
3105 if( env ) {
3106
3107 strncpy( buf, env, 1024 );
3108
3109 ptr = strtok( buf, " ,+" );
3110
3111 while( ptr ) {
3112
3113 if( strcasecmp( ptr, "NONE" ) == 0 ) {
3114 drivermode = 0 ;
3115 }
3116
3117 if( strcasecmp( ptr, "ALL" ) == 0 ) {
3118 drivermode = 1 ;
3119 }
3120
3121 if( strcasecmp( ptr, "ALL_DIRECTION" ) == 0 ) {
3122 drivermode = 2 ;
3123 }
3124
3125 if( strcasecmp( ptr, "SELECT_DIRECTION" ) == 0 ) {
3126 drivermode = 3 ;
3127 }
3128
3129 if( strcasecmp( ptr, "ALL_GATES" ) == 0 ) {
3130 drivergate = 1 ;
3131 }
3132
3133 if( strcasecmp( ptr, "PARALLEL_GATES" ) == 0 ) {
3134 drivergate = 2 ;
3135 }
3136
3137 if( strcasecmp( ptr, "AUTO" ) == 0 ) {
3138 drivermode = 4 ;
3139 drivergate = 1 ;
3140 }
3141
3142 ptr = strtok( NULL, " ,+" );
3143 }
3144 }
3145
3146 if( !drivermode )
3147 return ;
3148
3149 if( getptype(cone->USER,CNS_PARALLEL) || getptype(cone->USER,CNS_PARATRANS) ) {
3150 is_parallel = 1;
3151 }
3152 else {
3153 is_parallel = 0;
3154 if( drivergate == 2 ) return ;
3155 }
3156
3157 driversup = NULL ;
3158 driversdw = NULL ;
3159
3160 losig = tas_getlosigcone(cone);
3161
3162 br[0] = cone->BRVDD ;
3163 br[1] = cone->BRVSS ;
3164 br[2] = cone->BREXT ;
3165
3166 for( i=0 ; i<=2 ; i++ ) {
3167
3168 for( branch = br[i] ; branch ; branch = branch->NEXT ) {
3169
3170 if( ( branch->TYPE & CNS_NOT_FUNCTIONAL ) == CNS_NOT_FUNCTIONAL )
3171 continue ;
3172
3173 is_up = ( ( branch->TYPE & CNS_VDD ) == CNS_VDD || ( branch->TYPE & CNS_EXT ) == CNS_EXT );
3174 is_dw = ( ( branch->TYPE & CNS_VSS ) == CNS_VSS || ( branch->TYPE & CNS_EXT ) == CNS_EXT );
3175
3176 chlocon = NULL ;
3177
3178 if( ( branch->LINK->TYPE & CNS_EXT ) == CNS_EXT ) {
3179
3180 locon = branch->LINK->ULINK.LOCON ;
3181 chlocon = addchain( chlocon, locon );
3182
3183 }
3184 else {
3185
3186 lotrs = branch->LINK->ULINK.LOTRS ;
3187
3188 ptype = getptype( lotrs->USER, MBK_TRANS_PARALLEL );
3189 if( ptype ) {
3190
3191 for( chain = (chain_list*)ptype->DATA ; chain ; chain = chain->NEXT ) {
3192
3193 lotrs = (lotrs_list*)chain->DATA ;
3194
3195 locon = NULL ;
3196
3197 if( lotrs->DRAIN->SIG == losig )
3198 locon = lotrs->DRAIN ;
3199
3200 if( lotrs->SOURCE->SIG == losig )
3201 locon = lotrs->SOURCE ;
3202
3203 if( locon )
3204 chlocon = addchain( chlocon, locon );
3205 }
3206 }
3207 else {
3208
3209 locon = NULL ;
3210
3211 if( lotrs->DRAIN->SIG == losig )
3212 locon = lotrs->DRAIN ;
3213
3214 if( lotrs->SOURCE->SIG == losig )
3215 locon = lotrs->SOURCE ;
3216
3217 if( locon )
3218 chlocon = addchain( chlocon, locon );
3219 }
3220 }
3221
3222 for( chain = chlocon ; chain ; chain = chain->NEXT ) {
3223
3224 locon = (locon_list*)chain->DATA ;
3225
3226 for( pnode = locon->PNODE ; pnode ; pnode = pnode->NEXT ) {
3227
3228 if( ( drivermode == 2 && is_up ) ||
3229 drivermode == 1 ||
3230 ( drivermode == 4 && is_up && ( is_parallel || !driversup ) ) ||
3231 ( drivermode == 3 && is_up && !driversup ) ) {
3232
3233 for( driver = driversup ; driver ; driver = driver->NEXT ) {
3234 if( driver->DATA == pnode->DATA )
3235 break ;
3236 }
3237
3238 if( !driver )
3239 driversup = addnum( driversup, pnode->DATA );
3240 }
3241
3242 if( ( drivermode == 2 && is_dw ) ||
3243 drivermode == 1 ||
3244 ( drivermode == 4 && is_dw && ( is_parallel || !driversdw ) ) ||
3245 ( drivermode == 3 && is_dw && !driversdw ) ) {
3246
3247 for( driver = driversdw ; driver ; driver = driver->NEXT ) {
3248 if( driver->DATA == pnode->DATA )
3249 break ;
3250 }
3251
3252 if( !driver )
3253 driversdw = addnum( driversdw, pnode->DATA );
3254 }
3255 }
3256 }
3257
3258 freechain( chlocon );
3259 }
3260 }
3261
3262 if( driversup || driversdw )
3263 rcx_setdriver( losig, driversup, driversdw );
3264 }
3265
3266 /*****************************************************************************
3267 * fonction visu_branche() *
3268 * debuggage: affiche le type et la resistance du chemin *
3269 *****************************************************************************/
3270 int visu_branche(path)
3271 branch_list *path ;
3272
3273 {
3274 link_list *link ;
3275
3276 if(path != NULL)
3277 {
3278 fprintf(stdout,"path type = %ld - ",(long)path->TYPE) ;
3279 if((path->TYPE & CNS_VDD) == CNS_VDD) fprintf(stdout,"VDD ") ;
3280 else if((path->TYPE & CNS_VSS) == CNS_VSS) fprintf(stdout,"VSS ") ;
3281 else if((path->TYPE & CNS_EXT) == CNS_EXT) fprintf(stdout,"EXT ") ;
3282
3283 if((path->TYPE & CNS_NOT_FUNCTIONAL) == CNS_NOT_FUNCTIONAL)
3284 fprintf(stdout,"non-functional!") ;
3285
3286 fprintf(stdout,"\n\tresistance value = %ld\n",
3287 (long)(getptype(path->USER,TAS_RESIST)->DATA)) ;
3288
3289 fflush(stdout) ;
3290 for(link = (link_list *)path->LINK ; link != NULL ; link = link->NEXT)
3291 affiche_maillon(link) ;
3292 }
3293 return(0);
3294 }
3295
3296 /*****************************************************************************
3297 * fonction tas_caparabl() *
3298 * calcul de la capacite de bleeder ramener de chaque cone *
3299 *****************************************************************************/
3300 void tas_caparabl(cone)
3301 cone_list *cone ;
3302 {
3303 branch_list *path[3] ;
3304 ptype_list *ptype ;
3305 chain_list *chain ;
3306 short i;
3307 char flag = 'N' ;
3308 front_list *slope;
3309
3310 path[0] = cone->BRVDD;
3311 path[1] = cone->BRVSS;
3312 path[2] = cone->BREXT;
3313
3314 if (TAS_PATH_TYPE == 'm')
3315 slope = (front_list *) ((getptype (cone->USER, TAS_SLOPE_MIN))->DATA);
3316 else
3317 slope = (front_list *) ((getptype (cone->USER, TAS_SLOPE_MAX))->DATA);
3318
3319 for(i=0;i<3;i++)
3320 {
3321 for(; path[i] != NULL ; path[i] = path[i]->NEXT)
3322 if((path[i]->TYPE & (CNS_NOT_FUNCTIONAL | CNS_BLEEDER)) == 0)
3323 {
3324 link_list *link = (link_list *)path[i]->LINK ;
3325 for(; link != NULL ; link = link->NEXT)
3326 {
3327 link->TYPE &= ~(TAS_LINK_BL) ;
3328 if((ptype = getptype(link->USER,TAS_LINK_BLDUP)) != NULL)
3329 {
3330
3331 double cb = 0.0 ;
3332 for(chain = (chain_list *)ptype->DATA ; chain != NULL ;
3333 chain = chain->NEXT)
3334 {
3335 if( slope->FUP != TAS_NOFRONT )
3336 cb += calcul_FB((cone_list *)chain->DATA,
3337 ((cone_list *)chain->DATA)->BRVDD,'U') * stm_thr2scm (slope->FUP/TTV_UNIT, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, STM_DEFAULT_VTN, V_FLOAT_TAB[__SIM_POWER_SUPPLY].VALUE, V_FLOAT_TAB[__SIM_POWER_SUPPLY].VALUE, STM_UP);
3338 }
3339 freechain((chain_list *)ptype->DATA) ;
3340 ptype->DATA = (void*)((long)(cb * TAS_CONTEXT->TAS_CAPARAPREC * 1000)) ;
3341 link->TYPE |= TAS_LINK_BL ;
3342 flag = 'Y' ;
3343 }
3344 if((ptype = getptype(link->USER,TAS_LINK_BLDDOWN)) != NULL)
3345 {
3346 double cb = 0.0 ;
3347 for(chain = (chain_list *)ptype->DATA ; chain != NULL ;
3348 chain = chain->NEXT)
3349 {
3350 if( slope->FDOWN != TAS_NOFRONT )
3351 cb += calcul_FB((cone_list *)chain->DATA,
3352 ((cone_list *)chain->DATA)->BRVSS,'D') * stm_thr2scm (slope->FDOWN/TTV_UNIT, STM_DEFAULT_SMINF, STM_DEFAULT_SMAXF, STM_DEFAULT_VTP, 0.0, V_FLOAT_TAB[__SIM_POWER_SUPPLY].VALUE, STM_DN);
3353 }
3354 freechain((chain_list *)ptype->DATA) ;
3355 ptype->DATA = (void*)((long)(cb * TAS_CONTEXT->TAS_CAPARAPREC * 1000)) ;
3356 link->TYPE |= TAS_LINK_BL ;
3357 flag = 'Y' ;
3358 }
3359 }
3360 }
3361 }
3362
3363 if(flag == 'Y')
3364 {
3365 front_list *slope ;
3366 avt_log (LOGTAS, 4, " caparabl: cone %ld '%s'\n", cone->INDEX,cone->NAME);
3367 front(cone) ;
3368 slope = (front_list *)((getptype(cone->USER, TAS_SLOPE_MAX))->DATA) ;
3369
3370 avt_log (LOGTAS, 4, " caparabl: cone %ld '%s' FUP = ",cone->INDEX, cone->NAME) ;
3371 if(slope->FUP == TAS_NOFRONT)
3372 avt_log (LOGTAS, 4, "NOFRONT ") ;
3373 else
3374 avt_log (LOGTAS, 4, "%ld ",slope->FUP) ;
3375 avt_log (LOGTAS, 4, "FDOWN = ") ;
3376 if(slope->FDOWN == TAS_NOFRONT)
3377 avt_log (LOGTAS, 4, "NOFRONT\n") ;
3378 else
3379 avt_log (LOGTAS, 4, "%ld\n",slope->FDOWN) ;
3380 avt_log (LOGTAS, 4, "\n") ;
3381 }
3382 }
3383
3384 /*****************************************************************************
3385 * fonction res_branche() *
3386 * calcul de la resistance equivalente de chaque branche *
3387 *****************************************************************************/
3388 int res_branche(cone)
3389 cone_list *cone ;
3390
3391 {
3392 branch_list *path[3] ;
3393 short i;
3394 ptype_list *ptype_lotrs, *ptype_link ;
3395 lotrs_list *lotrs;
3396 double res_sw;
3397 link_list *link_sw;
3398
3399 /*---------------------------------------------------------------------------*/
3400 /* si c'est une branche fonctionnelle, on rajoute la resistance equivalente */
3401 /* de tous ses transistors. Si c'est une branche non-fonctionnelle, on lui */
3402 /* donne une resistance nulle pour ne pas la prendre en compte. */
3403 /*---------------------------------------------------------------------------*/
3404 path[0] = cone->BRVDD;
3405 path[1] = cone->BRVSS;
3406 path[2] = cone->BREXT;
3407
3408 for(i=0;i<3;i++)
3409 {
3410 for(; path[i] != NULL ; path[i] = path[i]->NEXT)
3411 if((path[i]->TYPE & (CNS_NOT_FUNCTIONAL | CNS_BLEEDER)) == 0)
3412 {
3413 link_list *link = (link_list *)path[i]->LINK ;
3414 long res=0 ;
3415 double resist = 0.0 ;
3416
3417 /* somme des resistances */
3418 for( /* initialise */ ; link != NULL ; link = link->NEXT)
3419 {
3420 if(link->TYPE & (CNS_IN | CNS_INOUT)) continue;
3421 resist = (double)tas_getparam(link->ULINK.LOTRS,TAS_CASE,TP_R) *
3422 (double)TAS_GETLENGTH(link) /
3423 (double)TAS_GETWIDTH(link);
3424 if( (ptype_lotrs = getptype( link->ULINK.LOTRS->USER, TAS_TRANS_SWITCH )) != NULL) {
3425 lotrs = (lotrs_list*)ptype_lotrs->DATA ;
3426 ptype_link = getptype(lotrs->USER, TAS_TRANS_LINK);
3427 if(ptype_link){
3428 link_sw = ((chain_list*)ptype_link->DATA)->DATA;
3429 res_sw = (double)tas_getparam(lotrs,TAS_CASE,TP_R) *
3430 (double)TAS_GETLENGTH(link_sw) /
3431 (double)TAS_GETWIDTH(link_sw);
3432 res += (long)(resist * res_sw / (resist + res_sw));
3433 }else{
3434 res += (long)(resist);
3435 }
3436 }else{
3437 res += (long)(resist);
3438 }
3439 }
3440 getptype(path[i]->USER,TAS_RESIST)->DATA = (void *)res ;
3441 }
3442 else /* si branche non fonctionnelle */
3443 {
3444 getptype(path[i]->USER,TAS_RESIST)->DATA = (void *) TAS_NORES ;
3445 }
3446 }
3447
3448 path[0] = cone->BRVDD;
3449 path[1] = cone->BRVSS;
3450 path[2] = cone->BREXT;
3451
3452 for(i=0;i<3;i++)
3453 {
3454 for(; path[i] != NULL ; path[i] = path[i]->NEXT)
3455 {
3456 avt_log (LOGTAS, 4, " res_branche: to ") ;
3457
3458 if((path[i]->TYPE & CNS_EXT) == CNS_EXT) avt_log (LOGTAS, 4, "EXT") ;
3459 else if((path[i]->TYPE & CNS_VDD) == CNS_VDD) avt_log (LOGTAS, 4, "VDD") ;
3460 else avt_log (LOGTAS, 4, "VSS") ;
3461
3462 avt_log (LOGTAS, 4, " in cone %ld '%s' is ",cone->INDEX,cone->NAME) ;
3463 if((path[i]->TYPE & CNS_NOT_FUNCTIONAL) == CNS_NOT_FUNCTIONAL)
3464 avt_log (LOGTAS, 4, "%ld (false path)\n",
3465 (long)(getptype(path[i]->USER,TAS_RESIST)->DATA)) ;
3466 else avt_log (LOGTAS, 4, "%ld units\n",
3467 (long)(getptype(path[i]->USER,TAS_RESIST)->DATA)) ;
3468 }
3469 }
3470
3471 return(0) ;
3472 }
3473
3474 /*****************************************************************************
3475 * fonction clas_liste_branche() *
3476 * classement de la liste des branches d'un type donne *
3477 *****************************************************************************/
3478 branch_list *clas_liste_branche(path)
3479 branch_list *path ;
3480 {
3481 branch_list *aux_path ;
3482 chain_list *chainpath = NULL ;
3483 chain_list *chain ;
3484 short test=0 ;
3485
3486 for(aux_path = path ; aux_path != NULL ; aux_path = aux_path->NEXT)
3487 {
3488 chainpath = addchain(chainpath,aux_path) ;
3489 }
3490
3491 if(path != NULL) do /* classement si chemin existe */
3492 for(chain = chainpath ; chain->NEXT != NULL ; chain = chain->NEXT)
3493 {
3494 branch_list *nxpath ;
3495 chain_list *chainx ;
3496
3497 aux_path = (branch_list *)chain->DATA ;
3498
3499 test = 0 ;
3500 for(chainx = chain->NEXT ; chainx != NULL ; chainx = chainx->NEXT)
3501 {
3502 nxpath = (branch_list *)chainx->DATA ;
3503
3504 if((long)(getptype(nxpath->USER,TAS_RESIST)->DATA) >
3505 (long)(getptype(aux_path->USER,TAS_RESIST)->DATA))
3506 {
3507 chainx->DATA = (void*)aux_path ;
3508 chain->DATA = (void*)nxpath ;
3509 aux_path = nxpath ;
3510 test = 1 ;
3511 }
3512 }
3513 }
3514 while(test != 0) ;
3515
3516 if(path != NULL)
3517 {
3518 chain = chainpath ;
3519 path = (branch_list *)chain->DATA ;
3520 chain = chain->NEXT ;
3521 aux_path = path ;
3522
3523 for(; chain != NULL ; chain = chain->NEXT)
3524 {
3525 aux_path->NEXT = (branch_list *)chain->DATA ;
3526 aux_path = aux_path->NEXT ;
3527 }
3528 aux_path->NEXT = NULL ;
3529 }
3530
3531 freechain(chainpath) ;
3532
3533 if(path == NULL) avt_log (LOGTAS, 4, " clas_list_br: no path\n") ;
3534 else
3535 {
3536 avt_log (LOGTAS, 4, " clas_list_br: the greatest resistor is %ld",
3537 (long)getptype(path->USER,TAS_RESIST)->DATA) ;
3538 avt_log (LOGTAS, 4, " / path type = %ld\n",path->TYPE ) ;
3539 }
3540
3541 return(path) ;
3542 }
3543
3544
3545 /*****************************************************************************
3546 * fonction clas_branche() *
3547 * classement des branches du cone par ordre de resistivite croissante *
3548 * par type de branche (d'abord celles allant vers les connecteurs externes *
3549 * puis celle allant vers vdd et enfin celles menant vers vss *
3550 *****************************************************************************/
3551 void clas_branche(cone)
3552 cone_list *cone ;
3553
3554 {
3555
3556 if((cone->BRVDD == NULL)&&(cone->BRVSS == NULL)&&(cone->BREXT == NULL))
3557 return ;
3558
3559 avt_log (LOGTAS, 4, " clas_branche: cone %ld '%s'\n",cone->INDEX, cone->NAME) ;
3560 cone->BREXT = clas_liste_branche(cone->BREXT) ;
3561 cone->BRVDD = clas_liste_branche(cone->BRVDD) ;
3562 cone->BRVSS = clas_liste_branche(cone->BRVSS) ;
3563
3564 }
3565
3566 /*****************************************************************************
3567 * fonction valfupfdown() *
3568 * calcul de FUP ou FDOWN sur la branche choisie *
3569 *****************************************************************************/
3570 long valfupfdown(path, sens)
3571 branch_list *path ;
3572 char sens ;
3573
3574 {
3575 link_list *link ;
3576 long slope = 0 ;
3577 double res, capa = 0.0 , restrans = 0.0 ;
3578
3579 /*----------------------------------------------------------------------------*/
3580 /* si il n'y a pas de maillon, il n'y a pas de front=>TAS_NOFRONT. */
3581 /* si il n`y a qu'un seul maillon et que c'est un connecteur => TAS_CONTEXT->FRONT_CON. */
3582 /* sinon on calcule le front du a la branche. */
3583 /*----------------------------------------------------------------------------*/
3584 if(path == NULL) /* aucun maillon */
3585 {
3586 avt_log (LOGTAS, 4, " valfupfdown: no slope\n" ) ;
3587 return(TAS_NOFRONT) ;
3588 }
3589
3590 link = (link_list *)path->LINK ;
3591
3592 if(link->NEXT == NULL) /* si un seul maillon sur la branche */
3593 {
3594 if((link->TYPE & (CNS_IN | CNS_INOUT)) != 0) /* si connecteur => front connecteur */
3595 {
3596 slope = tas_get_pinslew(link->ULINK.LOCON, sens);
3597 avt_log (LOGTAS, 4, " valfupfdown: value of slope is %ld", (long)slope) ;
3598 avt_log (LOGTAS, 4, " -connector slope-\n") ;
3599 return slope;
3600 }
3601 }
3602
3603 while(link->NEXT != NULL) /* il existe des maillons transistors */
3604 {
3605
3606 res = tas_getparam(link->ULINK.LOTRS,TAS_CASE,TP_R);
3607
3608 restrans = (res*(double)TAS_GETLENGTH(link) /
3609 (double)TAS_GETWIDTH(link)) ;
3610
3611 if(slope != 0)
3612 restrans = (restrans * 0.95) ;
3613
3614 if((link->TYPE & CNS_SWITCH) == CNS_SWITCH)
3615 restrans = (restrans * 0.5) ;
3616
3617 if(slope == 0)
3618 capa += (tas_getcapalink(NULL, link,TAS_UNKNOWN_EVENT) + TAS_GETCAPARA(link) +
3619 tas_getcapabl(link)) ;
3620
3621 else
3622 capa += (0.95*(tas_getcapalink(NULL, link,TAS_UNKNOWN_EVENT) + TAS_GETCAPARA(link) +
3623 tas_getcapabl(link))) ;
3624
3625 slope += (long)(restrans*capa*tlc_getcapafactor()) ;
3626 link = link->NEXT ;
3627 }
3628
3629 if((link->TYPE & (CNS_IN | CNS_INOUT)) == 0) /* si dernier maillon PAS connecteur */
3630 {
3631 res = tas_getparam(link->ULINK.LOTRS,TAS_CASE,TP_R);
3632
3633 restrans = (res*(double)TAS_GETLENGTH(link) /
3634 (double)TAS_GETWIDTH(link)) ;
3635
3636 if(slope != 0)
3637 restrans = (restrans * 0.95) ;
3638
3639 if((link->TYPE & CNS_SWITCH) == CNS_SWITCH)
3640 restrans = (restrans * 0.5) ;
3641
3642 if(slope==0L)
3643 capa += (tas_getcapalink(NULL, link,TAS_UNKNOWN_EVENT) + TAS_GETCAPARA(link) +
3644 tas_getcapabl(link)) ;
3645
3646 else
3647 capa += (0.95*(tas_getcapalink(NULL, link,TAS_UNKNOWN_EVENT) + TAS_GETCAPARA(link) +
3648 tas_getcapabl(link))) ;
3649
3650 slope += (long)(restrans*capa*tlc_getcapafactor()) ;
3651 }
3652 /* si dernier maillon connecteur, alors pas touche! */
3653
3654 if( slope > 0 )
3655 slope = stm_scm2thr (slope, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, STM_DEFAULT_VT, V_FLOAT_TAB[__SIM_POWER_SUPPLY].VALUE, V_FLOAT_TAB[__SIM_POWER_SUPPLY].VALUE, STM_UP);
3656
3657 slope = (long)( TTV_UNIT * slope / 1000) ;
3658
3659 if(slope == 0) /* front nul => erreur: plus tard cause des problemes ! */
3660 {
3661 tas_error(1,NULL,TAS_WARNING) ;
3662 slope = 1 ;
3663 }
3664
3665 return(slope) ;
3666 }
3667
3668
3669 /*****************************************************************************
3670 * fonction decision() *
3671 * decide de prendre soit la branche EXT soit la branche VSS,VDD suivant *
3672 * qu'on ait trouve des branches qui convenaient,et si les 2 branches *
3673 * existent prend la branche la plus resistive *
3674 *****************************************************************************/
3675 branch_list *decision(ext,alim,ext_path,alim_path)
3676 char ext ;
3677 char alim ;
3678 branch_list *ext_path ;
3679 branch_list *alim_path ;
3680
3681 {
3682 branch_list *path ; /* branche decide qui doit etre renvoyee */
3683
3684 if(ext == 'n') /* si pas de branche externe */
3685 {
3686 if(alim == 'n') path = NULL ; /* si non plus branche alim */
3687 else path = alim_path ; /* sinon branche alim */
3688 }
3689 else /* si branche externe est oui */
3690 {
3691 if(alim == 'n') path = ext_path ; /* si pas de branche alim=>externe */
3692 else /* si les deux existent, il faut renvoyer la plus resistive */
3693 path = ((long)getptype(ext_path->USER,TAS_RESIST)->DATA >
3694 (long)getptype(alim_path->USER,TAS_RESIST)->DATA) ?
3695 ext_path : alim_path ;
3696 }
3697
3698 return(path) ;
3699 }
3700
3701
3702 /*****************************************************************************
3703 * fonction front() *
3704 * calcul de front *
3705 *****************************************************************************/
3706 long front(cone)
3707 cone_list *cone ;
3708
3709 {
3710 char ext='n',
3711 exl='n',
3712 vdd='n',
3713 vss='n' ;
3714
3715 branch_list *pathext ;
3716 branch_list *pathvdd ;
3717 branch_list *pathvss ;
3718 front_list *slope ;
3719 locon_list *locon ;
3720 ptype_list *ptype ;
3721 chain_list *chain ;
3722
3723 /*---------------------------------------------------------------------------*/
3724 /* a ce niveau, les branches de chaque cone sont classees dans l'ordre */
3725 /* decroissant et par type : EXT, VDD et VSS. Dans un premier temps on */
3726 /* la branche la plus resistive pour chaque type (premiere branche de chaque */
3727 /* liste). */
3728 /*---------------------------------------------------------------------------*/
3729
3730 if(cone->BREXT != NULL)
3731 if((cone->BREXT->TYPE & CNS_NOT_FUNCTIONAL) != CNS_NOT_FUNCTIONAL)
3732 {
3733 ext = 'o' ;
3734 for(pathext = cone->BREXT ; pathext != NULL ; pathext = pathext->NEXT)
3735 if((pathext->LINK->NEXT != NULL) &&
3736 ((pathext->TYPE & CNS_NOT_FUNCTIONAL) != CNS_NOT_FUNCTIONAL))
3737 {
3738 exl = 'o' ;
3739 break ;
3740 }
3741 }
3742 if(cone->BRVDD != NULL)
3743 if((cone->BRVDD->TYPE & CNS_NOT_FUNCTIONAL) != CNS_NOT_FUNCTIONAL)
3744 vdd = 'o' ;
3745 if(cone->BRVSS != NULL)
3746 if((cone->BRVSS->TYPE & CNS_NOT_FUNCTIONAL) != CNS_NOT_FUNCTIONAL)
3747 vss = 'o' ;
3748
3749 if((cone->TYPE & CNS_EXT) == CNS_EXT)
3750 {
3751 if((vdd == 'n') && (vss == 'n') && (exl == 'n'))
3752 {
3753 chain_list *cl;
3754 cl=cns_get_cone_external_connectors(cone);
3755 locon = (locon_list *)cl->DATA; //getptype(cone->USER,CNS_EXT)->DATA ;
3756 freechain(cl);
3757 ptype = getptype(locon->SIG->USER,LOFIGCHAIN) ;
3758 chain = NULL ;
3759 if(ptype != NULL)
3760 {
3761 for(chain = (chain_list *)ptype->DATA ; chain != NULL ; chain = chain->NEXT)
3762 {
3763 if((((locon_list *)chain->DATA)->TYPE == INTERNAL) &&
3764 ((((locon_list *)chain->DATA)->DIRECTION != CNS_I) &&
3765 (((locon_list *)chain->DATA)->DIRECTION != CNS_X)))
3766 break ;
3767 }
3768 }
3769 if(chain == NULL)
3770 {
3771 if(locon->DIRECTION == CNS_T)
3772 {
3773 locon->DIRECTION = CNS_I ;
3774 }
3775 else if((locon->DIRECTION == CNS_Z) || (locon->DIRECTION == CNS_O))
3776 {
3777 locon->DIRECTION = CNS_X ;
3778 }
3779 }
3780 }
3781 }
3782
3783 /*---------------------------------------------------------------------------*/
3784 /* pour calculer FUP il faut prendre la branche la plus resistive entre */
3785 /* une externe et une VDD. Idem pour FDOWN, mais avec une branche VSS. */
3786 /* C'est la fonction decision() qui choisit la branche. */
3787 /*---------------------------------------------------------------------------*/
3788 tlc_setmaxfactor() ;
3789
3790 slope = (front_list *)getptype(cone->USER,TAS_SLOPE_MAX)->DATA ;
3791
3792 if((cone->TYPE & (CNS_VDD | CNS_VSS)) != 0)
3793 {
3794 slope->FUP = TAS_NOFRONT ;
3795 slope->FDOWN = TAS_NOFRONT ;
3796 }
3797 else
3798 {
3799 if((cone->TYPE & TAS_NORISING) != TAS_NORISING)
3800 slope->FUP = valfupfdown(decision(ext,vdd,cone->BREXT,cone->BRVDD), 'U') ;
3801 else
3802 slope->FUP = TAS_NOFRONT ;
3803
3804 if((cone->TYPE & TAS_NOFALLING) != TAS_NOFALLING)
3805 slope->FDOWN = valfupfdown(decision(ext,vss,cone->BREXT,cone->BRVSS), 'D') ;
3806 else
3807 slope->FDOWN = TAS_NOFRONT ;
3808 }
3809
3810 tlc_setminfactor() ;
3811
3812 /* calcul du front min */
3813 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y')
3814 {
3815 TAS_PATH_TYPE = 'm' ;
3816 if(cone->BREXT == NULL) pathext = NULL ;
3817 else
3818 {
3819 for(pathext = cone->BREXT ; pathext->NEXT != NULL ; pathext = pathext->NEXT)
3820 {
3821 if((pathext->NEXT->TYPE & CNS_NOT_FUNCTIONAL) == CNS_NOT_FUNCTIONAL)
3822 break ;
3823 }
3824 if((pathext->TYPE & CNS_NOT_FUNCTIONAL)== CNS_NOT_FUNCTIONAL)
3825 pathext = NULL ;
3826 }
3827
3828 if(cone->BRVDD == NULL) pathvdd = NULL ;
3829 else
3830 {
3831 for(pathvdd = cone->BRVDD ; pathvdd->NEXT != NULL ; pathvdd = pathvdd->NEXT)
3832 {
3833 if((pathvdd->NEXT->TYPE & CNS_NOT_FUNCTIONAL) == CNS_NOT_FUNCTIONAL)
3834 break ;
3835 }
3836 if((pathvdd->TYPE & CNS_NOT_FUNCTIONAL)== CNS_NOT_FUNCTIONAL)
3837 pathvdd = NULL ;
3838 }
3839
3840 if(cone->BRVSS == NULL) pathvss = NULL ;
3841 else
3842 {
3843 for(pathvss = cone->BRVSS ; pathvss->NEXT != NULL ; pathvss = pathvss->NEXT)
3844 {
3845 if((pathvss->NEXT->TYPE & CNS_NOT_FUNCTIONAL) == CNS_NOT_FUNCTIONAL)
3846 break ;
3847 }
3848 if((pathvss->TYPE & CNS_NOT_FUNCTIONAL)== CNS_NOT_FUNCTIONAL)
3849 pathvss = NULL ;
3850 }
3851
3852 slope = (front_list *)getptype(cone->USER,TAS_SLOPE_MIN)->DATA ;
3853
3854 if((cone->TYPE & (CNS_VDD | CNS_VSS)) != 0)
3855 {
3856 slope->FUP = TAS_NOFRONT ;
3857 slope->FDOWN = TAS_NOFRONT ;
3858 }
3859 else if(pathext == NULL)
3860 {
3861 if((cone->TYPE & TAS_NORISING) != TAS_NORISING)
3862 slope->FUP = valfupfdown(pathvdd, 'U') ;
3863 else
3864 slope->FUP = TAS_NOFRONT ;
3865 if((cone->TYPE & TAS_NOFALLING) != TAS_NOFALLING)
3866 slope->FDOWN = valfupfdown(pathvss, 'D') ;
3867 else
3868 slope->FDOWN = TAS_NOFRONT ;
3869 }
3870 else
3871 {
3872 if(pathvdd == NULL)
3873 {
3874 if((cone->TYPE & TAS_NORISING) != TAS_NORISING)
3875 slope->FUP = valfupfdown(pathext, 'U') ;
3876 else
3877 slope->FUP = TAS_NOFRONT ;
3878 }
3879 else
3880 {
3881 if((cone->TYPE & TAS_NORISING) != TAS_NORISING)
3882 slope->FUP = valfupfdown((((long)getptype(pathext->USER,TAS_RESIST)->DATA >
3883 (long)getptype(pathvdd->USER,TAS_RESIST)->DATA) ? pathext : pathvdd), 'U') ;
3884 else
3885 slope->FUP = TAS_NOFRONT ;
3886 }
3887 if(pathvss == NULL)
3888 {
3889 if((cone->TYPE & TAS_NOFALLING) != TAS_NOFALLING)
3890 slope->FDOWN = valfupfdown(pathext, 'D') ;
3891 else
3892 slope->FDOWN = TAS_NOFRONT ;
3893 }
3894 else
3895 {
3896 if((cone->TYPE & TAS_NOFALLING) != TAS_NOFALLING)
3897 slope->FDOWN = valfupfdown((((long)getptype(pathext->USER,TAS_RESIST)->DATA >
3898 (long)getptype(pathvss->USER,TAS_RESIST)->DATA) ? pathext : pathvss), 'D') ;
3899 else
3900 slope->FDOWN = TAS_NOFRONT ;
3901 }
3902 }
3903 TAS_PATH_TYPE = 'M' ;
3904 }
3905
3906 avt_log (LOGTAS, 4, " front: ") ;
3907 if(((cone->BREXT)==NULL && (cone->BRVDD)==NULL && (cone->BRVSS)==NULL))
3908 avt_log (LOGTAS, 4, "no path\n") ;
3909 else
3910 {
3911 avt_log (LOGTAS, 4, "types of pathes are ") ;
3912 if(cone->BREXT != NULL) avt_log (LOGTAS, 4, "extern ") ;
3913 if(cone->BRVDD != NULL) avt_log (LOGTAS, 4, "VDD ") ;
3914 if(cone->BRVSS != NULL) avt_log (LOGTAS, 4, "VSS") ;
3915 avt_log (LOGTAS, 4, "\n") ;
3916 }
3917
3918 return(0) ;
3919 }
3920
3921 /*****************************************************************************
3922 * fonction interface() *
3923 * calcule les capacites devant etre donnees pour chaque connecteur. *
3924 *****************************************************************************/
3925 void interface_locon (locons)
3926 locon_list *locons ;
3927
3928 {
3929 locon_list *locon ;
3930 ptype_list *ptuser ;
3931 ptype_list *ptype ;
3932 caraccon_list *carac ;
3933 chain_list *hchain , *chain ;
3934 double capa, capaup, capaupmax, capadn, capadnmax, clo ;
3935 elpcapaswitch_list *elpcsw;
3936 char flag;
3937 float outcapa;
3938
3939
3940 /*-------------------------------------------------------------------*/
3941 /* les resistances du fichier '.prf', je crois qu'elles ne servent a */
3942 /* rien. Alors je ne calcule rien du tout jusqu'a avis contraire. */
3943 /* Ici on ne calcule que des capacites. */
3944 /*-------------------------------------------------------------------*/
3945 for(locon = locons ; locon != NULL ; locon = locon->NEXT){
3946 if((locon->DIRECTION != 'X') && (locon->DIRECTION != CNS_VDDC) &&
3947 (locon->DIRECTION != TAS_ALIM) &&
3948 (locon->DIRECTION != CNS_VSSC))
3949 {
3950 ptuser = getptype(locon->USER,CNS_CONE);
3951 capa = 0.0;
3952 capaup = 0.0;
3953 capaupmax = 0.0;
3954 capadn = 0.0;
3955 capadnmax = 0.0;
3956 clo = 0.0;
3957 flag = 0;
3958
3959 if(ptuser != NULL)
3960 {
3961 hchain = (chain_list *)ptuser->DATA;
3962 for(chain = hchain ; chain != NULL ; chain = chain->NEXT)
3963 {
3964 branch_list *path = ((cone_list *)chain->DATA)->BREXT ;
3965
3966 for( /* initialise */ ; path != NULL ; path = path->NEXT)
3967 {
3968 link_list *link ;
3969
3970 /* recherche de la branche contenant le connecteur */
3971 for(link = (link_list *)path->LINK ; link->NEXT != NULL ;
3972 link = link->NEXT) ;
3973
3974 /* si dernier maillon pas connecteur => avertissement */
3975 if((link->TYPE & (CNS_IN | CNS_INOUT)) == 0)
3976 tas_error(34,(char *)chain->DATA,TAS_WARNING) ;
3977
3978 if(link->ULINK.LOCON == locon)
3979 {
3980 clo = tas_getcapalink(NULL, link,TAS_UNKNOWN_EVENT) ;
3981
3982 if(TAS_CONTEXT->TAS_CAPASWITCH != 0.0)
3983 for(link = (link_list *)path->LINK ; link->NEXT != NULL ;
3984 link = link->NEXT)
3985 {
3986 chain_list *chainx ;
3987
3988 /* gere les capas ramenees pour les switchs */
3989 if((ptype = getptype(link->ULINK.LOTRS->USER, TAS_TRANS_SWITCH)) != NULL){
3990 if((ptype = getptype(((lotrs_list*)ptype->DATA)->USER,TAS_CAPA_PASS)) != NULL){
3991 continue ;
3992 }
3993 }
3994
3995 ptype = getptype(link->ULINK.LOTRS->USER,TAS_CAPA_PASS) ;
3996 if(ptype != NULL)
3997 chainx = (chain_list *)ptype->DATA ;
3998 else chainx = NULL ;
3999 if(chainx != hchain)
4000 {
4001 flag = 1;
4002 capa += tas_getcapalink(NULL, link,TAS_UNKNOWN_EVENT) ;
4003 if(link->ULINK.LOTRS->TRNAME){
4004 avt_log (LOGTAS, 1, "Capacitance value of %.2f fF (%.1f%%) added on locon %s via transistor %s\n", tas_getcapalink(NULL, link,TAS_UNKNOWN_EVENT)*TAS_CONTEXT->TAS_CAPASWITCH, TAS_CONTEXT->TAS_CAPASWITCH*100.0, locon->NAME, link->ULINK.LOTRS->TRNAME);
4005 }else{
4006 avt_log (LOGTAS, 1, "Capacitance value of %.2f fF (%.1f%%) added on locon %s via transistor ???\n", tas_getcapalink(NULL, link,TAS_UNKNOWN_EVENT)*TAS_CONTEXT->TAS_CAPASWITCH, TAS_CONTEXT->TAS_CAPASWITCH*100.0, locon->NAME);
4007 }
4008 switch(V_INT_TAB[__ELP_CAPA_LEVEL].VALUE){
4009 case ELP_CAPA_LEVEL0:
4010 capaup = capaupmax = capadn = capadnmax = capa;
4011 break;
4012 case ELP_CAPA_LEVEL1:
4013 capaup += tas_gettotalcapa(NULL, link->SIG, ELP_CAPA_UP);
4014 capaupmax = capaup;
4015 capadn += tas_gettotalcapa(NULL, link->SIG, ELP_CAPA_DN);
4016 capadnmax = capadn;
4017 break;
4018 case ELP_CAPA_LEVEL2:
4019 capaup += tas_gettotalcapa(NULL, link->SIG, ELP_CAPA_UP);
4020 capaupmax += tas_gettotalcapa(NULL, link->SIG, ELP_CAPA_UP_MAX);
4021 capadn += tas_gettotalcapa(NULL, link->SIG, ELP_CAPA_DN);
4022 capadnmax += tas_gettotalcapa(NULL, link->SIG, ELP_CAPA_DN_MAX);
4023 }
4024 /*---------------------------------------------------*/
4025 /* on tag pour ne pas prendre la meme capa plusieurs */
4026 /* fois. */
4027 /*---------------------------------------------------*/
4028 link->ULINK.LOTRS->USER = addptype(
4029 link->ULINK.LOTRS->USER,TAS_CAPA_PASS,(void *)hchain) ;
4030 }
4031 }
4032 else break ;
4033 }
4034 } /* fin des branches */
4035
4036 if(path != NULL) break ;
4037 } /* fin des chains */
4038 }
4039 else
4040 {
4041 cone_list *conex ;
4042 ptype = getptype(locon->USER,CNS_EXT) ;
4043 if(ptype != NULL) conex = (cone_list *)ptype->DATA;
4044
4045 if(ptype == NULL)
4046 {
4047 ptype = getptype(locon->SIG->USER,LOFIGCHAIN) ;
4048 if(ptype != NULL)
4049 for(chain = (chain_list*)ptype->DATA ; chain != NULL ;
4050 chain = chain->NEXT)
4051 if(((locon_list *)chain->DATA)->TYPE == INTERNAL)
4052 break ;
4053 if(chain == NULL)
4054 tas_error(4,locon->NAME,TAS_WARNING) ;
4055 }
4056
4057 else
4058 if(conex->BREXT != NULL)
4059 clo = tas_getcapalink(NULL, conex->BREXT->LINK,TAS_UNKNOWN_EVENT) ;
4060 else if(conex->BRVDD != NULL)
4061 clo = tas_getcapalink(NULL, conex->BRVDD->LINK,TAS_UNKNOWN_EVENT) ;
4062 else if(conex->BRVSS != NULL)
4063 clo = tas_getcapalink(NULL, conex->BRVSS->LINK,TAS_UNKNOWN_EVENT) ;
4064 }
4065
4066 carac = (caraccon_list *)getptype(locon->USER,TAS_CON_CARAC)->DATA ;
4067 carac->C = (float)(clo + capa*TAS_CONTEXT->TAS_CAPASWITCH) ;
4068 if(flag){
4069 elpcsw = (elpcapaswitch_list*)mbkalloc( sizeof( elpcapaswitch_list ) );
4070 elpcsw->CUP = (float)(clo + capaup*TAS_CONTEXT->TAS_CAPASWITCH)/1000.0 ;
4071 elpcsw->CUPMAX = (float)(clo + capaupmax)/1000.0 ;
4072 elpcsw->CUPMIN = (float)(clo)/1000.0 ;
4073 elpcsw->CDN = (float)(clo + capadn*TAS_CONTEXT->TAS_CAPASWITCH)/1000.0 ;
4074 elpcsw->CDNMAX = (float)(clo + capadnmax)/1000.0 ;
4075 elpcsw->CDNMIN = (float)(clo)/1000.0 ;
4076 locon->SIG->USER = addptype(locon->SIG->USER, ELP_CAPASWITCH, elpcsw) ;
4077 }
4078
4079 if((locon->DIRECTION == CNS_O) || (locon->DIRECTION == CNS_B) ||
4080 (locon->DIRECTION == CNS_T) || (locon->DIRECTION == CNS_Z))
4081 {
4082 cone_list *cone ;
4083 branch_list *pathvdd ;
4084 branch_list *pathvss ;
4085
4086
4087 if((ptuser = getptype(locon->USER,CNS_EXT)) == NULL)
4088 {
4089 if(TAS_CONTEXT->TAS_CAPAOUT != 0.0)
4090 carac->C -= (float)(1000.0 * TAS_CONTEXT->TAS_CAPAOUT) ;
4091 continue ;
4092 }
4093
4094 cone = ptuser->DATA ;
4095
4096 outcapa=tas_get_cone_output_capacitance(cone);
4097 if (outcapa!=0.0)
4098 carac->C -= (float)(1000.0 * outcapa) ;
4099
4100
4101 if(cone->BRVDD != NULL)
4102 {
4103 if((cone->BRVDD->TYPE & CNS_NOT_FUNCTIONAL)!= CNS_NOT_FUNCTIONAL)
4104 {
4105 carac->RUPMAX = (long)getptype(cone->BRVDD->USER,TAS_RESIST)->DATA ;
4106 if(carac->RUPMAX == 0)
4107 carac->RUPMAX++ ;
4108 }
4109 }
4110 else carac->RUPMAX = TAS_NORES ;
4111 if(cone->BRVSS != NULL)
4112 {
4113 if((cone->BRVSS->TYPE & CNS_NOT_FUNCTIONAL)!= CNS_NOT_FUNCTIONAL)
4114 {
4115 carac->RDOWNMAX = (long)getptype(cone->BRVSS->USER,TAS_RESIST)->DATA ;
4116 if(carac->RDOWNMAX == 0)
4117 carac->RDOWNMAX++ ;
4118 }
4119 }
4120 else carac->RDOWNMAX = TAS_NORES ;
4121
4122 if(cone->BRVDD != NULL)
4123 {
4124 for(pathvdd = cone->BRVDD;pathvdd->NEXT != NULL;pathvdd = pathvdd->NEXT)
4125 {
4126 if((pathvdd->NEXT->TYPE & CNS_NOT_FUNCTIONAL) == CNS_NOT_FUNCTIONAL)
4127 break ;
4128 }
4129 if((pathvdd->TYPE & CNS_NOT_FUNCTIONAL)== CNS_NOT_FUNCTIONAL)
4130 pathvdd = NULL ;
4131 }
4132 else pathvdd = NULL ;
4133
4134 if(cone->BRVSS != NULL)
4135 {
4136 for(pathvss = cone->BRVSS;pathvss->NEXT != NULL;pathvss = pathvss->NEXT)
4137 {
4138 if((pathvss->NEXT->TYPE & CNS_NOT_FUNCTIONAL) == CNS_NOT_FUNCTIONAL)
4139 break ;
4140 }
4141 if((pathvss->TYPE & CNS_NOT_FUNCTIONAL)== CNS_NOT_FUNCTIONAL)
4142 pathvss = NULL ;
4143 }
4144 else pathvss = NULL ;
4145
4146 if(pathvdd != NULL)
4147 {
4148 carac->RUPMIN = (long)getptype(pathvdd->USER,TAS_RESIST)->DATA ;
4149 if(carac->RUPMIN == 0)
4150 carac->RUPMIN++ ;
4151 }
4152
4153 if(pathvss != NULL)
4154 {
4155 carac->RDOWNMIN = (long)getptype(pathvss->USER,TAS_RESIST)->DATA ;
4156 if(carac->RDOWNMIN == 0)
4157 carac->RDOWNMIN++ ;
4158 }
4159 }
4160 } /* fin du parcours des connecteurs */
4161 if((locon->DIRECTION == 'X') &&
4162 ((ptype=getptype(locon->USER,TAS_CON_CARAC))!=NULL) &&
4163 (TAS_CONTEXT->TAS_CNS_LOAD == 'N'))
4164 {
4165 caraccon_list *carac = (caraccon_list *)ptype->DATA ;
4166 clo = tas_gettotalcapa(NULL, locon->SIG, ELP_CAPA_TYPICAL);
4167 carac->C = (float)clo ;
4168 }
4169
4170 }
4171
4172 for(locon = locons ; locon != NULL ; locon = locon->NEXT)
4173 if((locon->DIRECTION != 'X') && (locon->DIRECTION != CNS_VDDC) &&
4174 (locon->DIRECTION != TAS_ALIM) &&
4175 (locon->DIRECTION != TAS_ALIM) &&
4176 (locon->DIRECTION != CNS_VSSC))
4177 {
4178 ptuser = getptype(locon->USER,CNS_CONE);
4179
4180 if(ptuser != NULL)
4181 {
4182 hchain = (chain_list *)ptuser->DATA;
4183 for(chain = hchain ; chain != NULL ; chain = chain->NEXT)
4184 {
4185 branch_list *path = ((cone_list *)chain->DATA)->BREXT ;
4186
4187 for( ; path != NULL ; path = path->NEXT)
4188 {
4189 link_list *link ;
4190
4191 for(link = (link_list *)path->LINK ; link->NEXT != NULL ;
4192 link = link->NEXT)
4193 {
4194 ptype = getptype(link->ULINK.LOTRS->USER,TAS_CAPA_PASS) ;
4195 if(ptype != NULL)
4196 link->ULINK.LOTRS->USER = delptype(
4197 link->ULINK.LOTRS->USER,TAS_CAPA_PASS) ;
4198 }
4199 }
4200 }
4201 }
4202 }
4203
4204 }
4205
4206 /*****************************************************************************
4207 * fonction interface() *
4208 * calcule les capacites devant etre donnees pour chaque connecteur. *
4209 *****************************************************************************/
4210
4211 int interface (cnsfig_list *cnsfig)
4212 {
4213 interface_locon (cnsfig->LOCON);
4214 interface_locon (cnsfig->INTCON);
4215
4216 return 0;
4217 }
4218
4219 /*****************************************************************************
4220 * fonction tas_findbufdelay() *
4221 * calcul les delay des buffers jusqu'au premier nom buffer qu'il renvoie *
4222 *****************************************************************************/
4223 cone_list *tas_findbufdelay(cone,delayup,delaydown,sens)
4224 cone_list *cone ;
4225 long *delayup ;
4226 long *delaydown ;
4227 char sens ;
4228 {
4229 cone_list *coneend ;
4230 delay_list *delay ;
4231
4232
4233
4234 if((cone->TYPE & (TAS_CONE_INV|TAS_CONE_BUF)) == 0)
4235 return(cone) ;
4236
4237 if (getptype(cone->USER, TAS_CONE_MARQUE)!=NULL) return (cone) ;
4238 cone->USER = addptype(cone->USER, TAS_CONE_MARQUE, NULL) ;
4239
4240 if((cone->TYPE & TAS_CONE_BUF) == TAS_CONE_BUF)
4241 {
4242 if(tas_buftoinv(cone) == 0)
4243 {
4244 cone->USER = testanddelptype(cone->USER, TAS_CONE_MARQUE) ;
4245 return(cone) ;
4246 }
4247 }
4248
4249 if(sens == 'D')
4250 {
4251 coneend = tas_findbufdelay(cone->INCONE->UEDGE.CONE,delayup,delaydown,'I') ;
4252 delay = (delay_list *)getptype(cone->INCONE->USER,TAS_DELAY_MAX)->DATA ;
4253 *delayup += delay->TPLH ;
4254 if(delay->RCLL != TAS_NOTIME)
4255 *delayup += delay->RCLL ;
4256 *delaydown += delay->TPHL ;
4257 if(delay->RCHH != TAS_NOTIME)
4258 *delaydown += delay->RCHH ;
4259 }
4260 else
4261 {
4262 coneend = tas_findbufdelay(cone->INCONE->UEDGE.CONE,delayup,delaydown,'D') ;
4263 delay = (delay_list *)getptype(cone->INCONE->USER,TAS_DELAY_MAX)->DATA ;
4264 *delayup += delay->TPHL ;
4265 if(delay->RCHH != TAS_NOTIME)
4266 *delayup += delay->RCHH ;
4267 *delaydown += delay->TPLH ;
4268 if(delay->RCLL != TAS_NOTIME)
4269 *delaydown += delay->RCLL ;
4270 }
4271 cone->USER = testanddelptype(cone->USER, TAS_CONE_MARQUE) ;
4272 return(coneend) ;
4273 }
4274
4275 /*****************************************************************************
4276 * fonction tas_buftoinv() *
4277 * transforme les buffers en inverseurs *
4278 *****************************************************************************/
4279 int tas_buftoinv(cone)
4280 cone_list *cone ;
4281 {
4282 cone_list *conext = NULL ;
4283 cone_list *conex ;
4284 edge_list *incone ;
4285 branch_list *branch[2] ;
4286 front_list *slope ;
4287
4288 front_list *frontin ;
4289 long delayup ;
4290 long delaydown ;
4291 long delayrefup ;
4292 long delayrefdown ;
4293 long frefup ;
4294 long frefdown ;
4295 long err ;
4296 long ferr ;
4297 long res ;
4298 int i ;
4299
4300 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
4301 {
4302 if((incone->TYPE & CNS_CONE) == CNS_CONE)
4303 {
4304 delayup = (long)0 ;
4305 delaydown = (long)0 ;
4306 conex = tas_findbufdelay(incone->UEDGE.CONE,&delayup,&delaydown,'D') ;
4307 frontin = (front_list *)((getptype(incone->UEDGE.CONE->USER,
4308 TAS_SLOPE_MAX))->DATA);
4309 }
4310 else continue ;
4311 if(conext == NULL)
4312 {
4313 delayrefup = delayup ;
4314 delayrefdown = delaydown ;
4315 conext = conex ;
4316 frefup = frontin->FUP ;
4317 frefdown = frontin->FDOWN ;
4318 }
4319 else
4320 {
4321 if(conex != conext)
4322 return(0) ;
4323 if(delayup > delayrefup)
4324 err = delayup - delayrefup ;
4325 else
4326 err = delayrefup - delayup ;
4327 if(frontin->FUP > frefup)
4328 ferr = frontin->FUP - frefup ;
4329 else
4330 ferr = frefup - frontin->FUP ;
4331 if((err > (frefup/(long)10)) || (ferr > (frefup/(long)10)))
4332 return(0) ;
4333 if(delaydown > delayrefdown)
4334 err = delaydown - delayrefdown ;
4335 else
4336 err = delayrefdown - delaydown ;
4337 if(frontin->FDOWN > frefdown)
4338 ferr = frontin->FDOWN - frefdown ;
4339 else
4340 ferr = frefdown - frontin->FDOWN ;
4341 if((err > (frefdown/(long)10)) || (ferr > (frefdown/(long)10)))
4342 return(0) ;
4343 }
4344 }
4345
4346 branch[0] = cone->BRVSS ;
4347 branch[1] = cone->BRVDD ;
4348
4349 for(i = 0 ; i < 2 ; i++)
4350 {
4351 branch_list *branchx ;
4352 res = (long)0 ;
4353 for(branchx = branch[i] ; branchx != NULL ; branchx = branchx->NEXT)
4354 {
4355 res += (long)(((double)TAS_GETWIDTH(branchx->LINK)/
4356 (double)TAS_GETLENGTH(branchx->LINK)));
4357 }
4358 for(branchx = branch[i] ; branchx != NULL ; branchx = branchx->NEXT)
4359 {
4360 TAS_GETCLINK(branchx->LINK)->WIDTH = res *
4361 TAS_GETLENGTH(branchx->LINK) ;
4362 }
4363 }
4364
4365 cone->TYPE &= ~(TAS_CONE_BUF) ;
4366 cone->TYPE |= TAS_CONE_INV ;
4367
4368 avt_log (LOGTAS, 3, "\n\n buftoinv: cone %ld '%s'\n\n",cone->INDEX, cone->NAME);
4369 res_branche(cone) ;
4370 clas_branche(cone) ;
4371
4372 if((cone->TYPE & CNS_EXT) == CNS_EXT)
4373 {
4374 chain_list *cl;
4375 cl=cns_get_cone_external_connectors(cone);
4376 while (cl!=NULL)
4377 {
4378 locon_list *locon = (locon_list *)cl->DATA; //getptype(cone->USER,CNS_EXT)->DATA ;
4379 caraccon_list *carac = (caraccon_list *)getptype(locon->USER,
4380 TAS_CON_CARAC)->DATA ;
4381 branch_list *pathvdd ;
4382 branch_list *pathvss ;
4383 if(cone->BRVDD != NULL)
4384 {
4385 if((cone->BRVDD->TYPE & CNS_NOT_FUNCTIONAL)!= CNS_NOT_FUNCTIONAL)
4386 {
4387 carac->RUPMAX = (long)getptype(cone->BRVDD->USER,TAS_RESIST)->DATA ;
4388 if(carac->RUPMAX == 0)
4389 carac->RUPMAX++ ;
4390 }
4391 }
4392 else carac->RUPMAX = TAS_NORES ;
4393 if(cone->BRVSS != NULL)
4394 {
4395 if((cone->BRVSS->TYPE & CNS_NOT_FUNCTIONAL)!= CNS_NOT_FUNCTIONAL)
4396 {
4397 carac->RDOWNMAX = (long)getptype(cone->BRVSS->USER,TAS_RESIST)->DATA ;
4398 if(carac->RDOWNMAX == 0)
4399 carac->RDOWNMAX++ ;
4400 }
4401 }
4402 else carac->RDOWNMAX = TAS_NORES ;
4403
4404 if(cone->BRVDD != NULL)
4405 {
4406 for(pathvdd = cone->BRVDD;pathvdd->NEXT != NULL;pathvdd = pathvdd->NEXT)
4407 {
4408 if((pathvdd->NEXT->TYPE & CNS_NOT_FUNCTIONAL) == CNS_NOT_FUNCTIONAL)
4409 break ;
4410 }
4411 if((pathvdd->TYPE & CNS_NOT_FUNCTIONAL)== CNS_NOT_FUNCTIONAL)
4412 pathvdd = NULL ;
4413 }
4414 else pathvdd = NULL ;
4415
4416 if(cone->BRVSS != NULL)
4417 {
4418 for(pathvss = cone->BRVSS;pathvss->NEXT != NULL;pathvss = pathvss->NEXT)
4419 {
4420 if((pathvss->NEXT->TYPE & CNS_NOT_FUNCTIONAL) == CNS_NOT_FUNCTIONAL)
4421 break ;
4422 }
4423 if((pathvss->TYPE & CNS_NOT_FUNCTIONAL)== CNS_NOT_FUNCTIONAL)
4424 pathvss = NULL ;
4425 }
4426 else pathvss = NULL ;
4427
4428 if(pathvdd != NULL)
4429 {
4430 carac->RUPMIN = (long)getptype(pathvdd->USER,TAS_RESIST)->DATA ;
4431 if(carac->RUPMIN == 0)
4432 carac->RUPMIN++ ;
4433 }
4434
4435 if(pathvss != NULL)
4436 {
4437 carac->RDOWNMIN = (long)getptype(pathvss->USER,TAS_RESIST)->DATA ;
4438 if(carac->RDOWNMIN == 0)
4439 carac->RDOWNMIN++ ;
4440 }
4441 cl=delchain(cl,cl);
4442 }
4443 }
4444
4445 slope = (front_list *)((getptype(cone->USER, TAS_SLOPE_MAX))->DATA) ;
4446 avt_log (LOGTAS, 4, " buftoinv: cone %ld '%s' FUP = ",cone->INDEX,
4447 cone->NAME) ;
4448 if(slope->FUP == TAS_NOFRONT) avt_log (LOGTAS, 3, "NOFRONT ") ;
4449 else avt_log (LOGTAS, 4, "%ld ",slope->FUP) ;
4450 avt_log (LOGTAS, 4, "FDOWN = ") ;
4451 if(slope->FDOWN == TAS_NOFRONT) avt_log (LOGTAS, 4, "NOFRONT\n\n") ;
4452 else avt_log (LOGTAS, 4, "%ld\n\n",slope->FDOWN) ;
4453 tas_tpd(cone) ;
4454
4455 TAS_PATH_TYPE = 'M' ;
4456
4457 return(0);
4458 }
4459 /*****************************************************************************
4460 * fonction tas_modelmemsym() *
4461 *****************************************************************************/
4462 int tas_ismemsym (cone_list *cone)
4463 {
4464 return (((cone->TYPE & (CNS_MEMSYM|CNS_LATCH)) == (CNS_MEMSYM|CNS_LATCH)) ||
4465 ((cone->TYPE & (CNS_MEMSYM|CNS_FLIP_FLOP)) == (CNS_MEMSYM|CNS_FLIP_FLOP)));
4466 }
4467
4468 void tas_modelmemsym(cnsfig_list *cnsfig)
4469 {
4470 cone_list *mem;
4471 cone_list *memsym;
4472 edge_list *cmd;
4473 edge_list *incone;
4474 edge_list *inmemsym;
4475 delay_list *delay_cmd_mem;
4476 delay_list *delay_memsym_mem;
4477 delay_list *delay_cmd_memsym;
4478 delay_list *delaymax_cmd_mem;
4479 delay_list *delaymax_memsym_mem;
4480 delay_list *delaymax_cmd_memsym;
4481 delay_list *delaymin_cmd_mem;
4482 delay_list *delaymin_memsym_mem;
4483 delay_list *delaymin_cmd_memsym;
4484 int i;
4485 float csttab[2];
4486 char type;
4487 char *name;
4488 char *modname;
4489 char *cmd_name;
4490 timing_model *tmodel;
4491 timing_cell *cell = stm_getcell(CELL);
4492
4493 for(mem = cnsfig->CONE ; mem ; mem = mem->NEXT) {
4494 if (tas_ismemsym (mem)) {
4495 memsym = NULL;
4496 delaymax_memsym_mem = NULL;
4497 delaymin_memsym_mem = NULL;
4498 for(incone= mem->INCONE ; incone ; incone = incone->NEXT){
4499 if((incone->TYPE & CNS_EXT) != CNS_EXT){
4500 if (tas_ismemsym (incone->UEDGE.CONE)) {
4501 for(inmemsym = incone->UEDGE.CONE->INCONE ; inmemsym ; inmemsym = inmemsym->NEXT){
4502 if((inmemsym->TYPE & CNS_EXT) != CNS_EXT){
4503 if(inmemsym->UEDGE.CONE == mem) {
4504 memsym = incone->UEDGE.CONE;
4505 delaymax_memsym_mem = (delay_list *)getptype(incone->USER,TAS_DELAY_MAX)->DATA ;
4506 delaymin_memsym_mem = (delay_list *)getptype(incone->USER,TAS_DELAY_MIN)->DATA ;
4507 break;
4508 }
4509 }
4510 }
4511 }
4512 }
4513 if (memsym) break;
4514 }
4515
4516 if (!memsym) continue;
4517 for(incone= mem->INCONE ; incone ; incone = incone->NEXT){
4518 delaymax_cmd_mem = NULL;
4519 delaymax_cmd_memsym = NULL;
4520 delaymin_cmd_mem = NULL;
4521 delaymin_cmd_memsym = NULL;
4522 if((incone->TYPE & CNS_COMMAND) == CNS_COMMAND) {
4523 delaymax_cmd_mem = (delay_list *)getptype(incone->USER,TAS_DELAY_MAX)->DATA ;
4524 delaymin_cmd_mem = (delay_list *)getptype(incone->USER,TAS_DELAY_MIN)->DATA ;
4525 cmd = incone;
4526
4527 if ((cmd->TYPE & CNS_CONE) == CNS_CONE) cmd_name = cmd->UEDGE.CONE->NAME;
4528 else cmd_name = cmd->UEDGE.LOCON->NAME;
4529
4530 for(inmemsym = memsym->INCONE ; inmemsym ; inmemsym = inmemsym->NEXT) {
4531 if (inmemsym->UEDGE.PTR == cmd->UEDGE.PTR){
4532 delaymax_cmd_memsym = (delay_list *)getptype(inmemsym->USER,TAS_DELAY_MAX)->DATA ;
4533 delaymin_cmd_memsym = (delay_list *)getptype(inmemsym->USER,TAS_DELAY_MIN)->DATA ;
4534 }
4535 }
4536 } else {
4537 continue;
4538 }
4539 for(i = 0; i < 2; i++){
4540 if(!i){
4541 delay_cmd_mem = delaymax_cmd_mem;
4542 delay_cmd_memsym = delaymax_cmd_memsym;
4543 delay_memsym_mem = delaymax_memsym_mem;
4544 type = 'M';
4545 } else {
4546 delay_cmd_mem = delaymin_cmd_mem;
4547 delay_cmd_memsym = delaymin_cmd_memsym;
4548 delay_memsym_mem = delaymin_memsym_mem;
4549 type = 'm';
4550 }
4551
4552 if (delay_cmd_mem && delay_cmd_memsym && delay_memsym_mem) {
4553 if ((delay_cmd_mem->TPHL != TAS_NOTIME) && (delay_cmd_memsym->TPHL != TAS_NOTIME)
4554 && (delay_memsym_mem->TPLH != TAS_NOTIME)) {
4555 delay_cmd_mem->TPHH = delay_cmd_memsym->TPHL + delay_memsym_mem->TPLH;
4556 delay_cmd_mem->FHH = delay_memsym_mem->FLH ;
4557 modname = stm_mod_name (cmd_name, 'U', mem->NAME, 'U', STM_DELAY|STM_SLEW, type, 0);
4558 delay_cmd_mem->TMHH = stm_mod_create (modname);
4559 tmodel = delay_cmd_mem->TMHH;
4560 stm_mod_update (tmodel, tmodel->VTH, tmodel->VDD, tmodel->VT, tmodel->VDD);
4561 stm_mod_update_transition (tmodel, STM_HH);
4562 delay_cmd_mem->TMHH->UTYPE = STM_MOD_MODSCM;
4563 csttab[0] = delay_cmd_mem->TPHH / TTV_UNIT;
4564 csttab[1] = delay_cmd_mem->FHH / TTV_UNIT;
4565 delay_cmd_mem->TMHH->UMODEL.SCM = stm_modscm_cst_create(csttab);
4566 name = stm_storemodel(CELL, NULL, delay_cmd_mem->TMHH, 0);
4567 if (name == delay_cmd_mem->TMHH->NAME)
4568 DETAILED_MODELS = addchain (DETAILED_MODELS, name);
4569 else {
4570 stm_mod_destroy(delay_cmd_mem->TMHH);
4571 delay_cmd_mem->TMHH = stm_getmodel(CELL, name);
4572 }
4573 #ifdef USEOLDTEMP
4574 delay_cmd_mem->RHH = delay_memsym_mem->RLH ;
4575 #endif
4576 #ifdef USEOLDTEMP
4577 delay_cmd_mem->SHH = delay_memsym_mem->SLH ;
4578 #endif
4579 delay_cmd_mem->FMHH = delay_cmd_mem->TMHH;
4580 delay_memsym_mem->TPHL = TAS_NOTIME;
4581 delay_memsym_mem->FHL = TAS_NOFRONT;
4582 if(delay_memsym_mem->TMHL) stm_cell_delmodel (cell, delay_memsym_mem->TMHL, 0);
4583 delay_memsym_mem->TMHL = NULL;
4584 }
4585 if ((delay_cmd_mem->TPLL != TAS_NOTIME) && (delay_cmd_memsym->TPLH != TAS_NOTIME)
4586 && (delay_memsym_mem->TPHL != TAS_NOTIME)) {
4587 delay_cmd_mem->TPLL = delay_cmd_memsym->TPLH + delay_memsym_mem->TPHL;
4588 delay_cmd_mem->FLL = delay_memsym_mem->FHL ;
4589 modname = stm_mod_name (cmd_name, 'D', mem->NAME, 'D', STM_DELAY|STM_SLEW, type, 0);
4590 delay_cmd_mem->TMLL = stm_mod_create (modname);
4591 tmodel = delay_cmd_mem->TMLL;
4592 stm_mod_update (tmodel, tmodel->VTH, tmodel->VDD, tmodel->VT, 0.0);
4593 stm_mod_update_transition (tmodel, STM_LL);
4594 delay_cmd_mem->TMLL->UTYPE = STM_MOD_MODSCM;
4595 csttab[0] = delay_cmd_mem->TPLL / TTV_UNIT;
4596 csttab[1] = delay_cmd_mem->FLL / TTV_UNIT;
4597 delay_cmd_mem->TMLL->UMODEL.SCM = stm_modscm_cst_create(csttab);
4598 name = stm_storemodel(CELL, NULL, delay_cmd_mem->TMLL, 0);
4599 if (name == delay_cmd_mem->TMLL->NAME)
4600 DETAILED_MODELS = addchain (DETAILED_MODELS, name);
4601 else {
4602 stm_mod_destroy(delay_cmd_mem->TMLL);
4603 delay_cmd_mem->TMLL = stm_getmodel(CELL, name);
4604 }
4605 #ifdef USEOLDTEMP
4606 delay_cmd_mem->RLL = delay_memsym_mem->RHL ;
4607 #endif
4608 #ifdef USEOLDTEMP
4609 delay_cmd_mem->SLL = delay_memsym_mem->SHL ;
4610 #endif
4611 delay_cmd_mem->FMLL = delay_cmd_mem->TMLL;
4612 delay_memsym_mem->TPLH = TAS_NOTIME;
4613 delay_memsym_mem->FLH = TAS_NOFRONT;
4614 if(delay_memsym_mem->TMLH) stm_cell_delmodel (cell, delay_memsym_mem->TMLH, 0);
4615 delay_memsym_mem->TMLH = NULL;
4616 }
4617 }
4618 if (delay_memsym_mem){
4619 if ((delay_memsym_mem->TPHL != TAS_NOTIME) && (delay_memsym_mem->TPLH != TAS_NOTIME)){
4620 delay_memsym_mem->TPHL = TAS_NOTIME;
4621 delay_memsym_mem->FHL = TAS_NOFRONT;
4622 if(delay_memsym_mem->TMHL) stm_cell_delmodel (cell, delay_memsym_mem->TMHL, 0);
4623 delay_memsym_mem->TMHL = NULL;
4624 delay_memsym_mem->TPLH = TAS_NOTIME;
4625 delay_memsym_mem->FLH = TAS_NOFRONT;
4626 if(delay_memsym_mem->TMLH) stm_cell_delmodel (cell, delay_memsym_mem->TMLH, 0);
4627 delay_memsym_mem->TMLH = NULL;
4628 }
4629 }
4630 }
4631 }
4632 }
4633 }
4634 }
4635
4636 /*****************************************************************************
4637 * fonction tas_detectmemsym() *
4638 * detect les latch symetriques et adapte les entrees *
4639 *****************************************************************************/
4640 void tas_detectmemsym(cnsfig)
4641 cnsfig_list *cnsfig ;
4642 {
4643 cone_list *cone ;
4644 cone_list *conein ;
4645 edge_list *incone ;
4646 edge_list *inconein ;
4647 edge_list *inconemem ;
4648 edge_list *inconemsym ;
4649 delay_list *delay ;
4650 delay_list *delayin ;
4651 delay_list *delaymem ;
4652 delay_list *delaymsym ;
4653 float csttab[2];
4654 char *name;
4655 char *modname;
4656 char *input_name;
4657 timing_model *tmodel;
4658
4659 for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT)
4660 {
4661 if(((cone->TYPE & (CNS_MEMSYM|CNS_LATCH)) != (CNS_MEMSYM|CNS_LATCH)) &&
4662 ((cone->TYPE & (CNS_MEMSYM|CNS_FLIP_FLOP)) != (CNS_MEMSYM|CNS_FLIP_FLOP)))
4663 continue ;
4664
4665 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
4666 {
4667
4668 if((incone->TYPE&CNS_CONE)==CNS_CONE){
4669 if(incone->UEDGE.CONE->NAME)
4670 input_name = incone->UEDGE.CONE->NAME;
4671 }else if(incone->UEDGE.LOCON->NAME){
4672 input_name = incone->UEDGE.LOCON->NAME;
4673 }
4674
4675
4676 if((incone->TYPE & TAS_IN_MEMSYM) != TAS_IN_MEMSYM) continue ;
4677 conein = (cone_list *)getptype(incone->USER,TAS_IN_CONESYM)->DATA ;
4678 for(inconemsym = cone->INCONE ; inconemsym != NULL ;
4679 inconemsym = inconemsym->NEXT)
4680 if((inconemsym->TYPE & CNS_EXT) != CNS_EXT)
4681 if(inconemsym->UEDGE.CONE == conein) break ;
4682 for(inconemem = conein->INCONE ; inconemem != NULL ;
4683 inconemem = inconemem->NEXT)
4684 if((inconemem->TYPE & CNS_EXT) != CNS_EXT)
4685 if(inconemem->UEDGE.CONE == cone) break ;
4686 for(inconein = conein->INCONE ; inconein != NULL ;
4687 inconein = inconein->NEXT)
4688 if(inconein->UEDGE.PTR == incone->UEDGE.PTR) break ;
4689 inconein->TYPE |= CNS_FEEDBACK ;
4690 delay = (delay_list *)getptype(incone->USER,TAS_DELAY_MAX)->DATA ;
4691 delayin = (delay_list *)getptype(inconein->USER,TAS_DELAY_MAX)->DATA ;
4692 delaymem = (delay_list *)getptype(inconemem->USER,TAS_DELAY_MAX)->DATA ;
4693 delaymsym = (delay_list *)getptype(inconemsym->USER,TAS_DELAY_MAX)->DATA ;
4694 if(delayin->TPHL != TAS_NOTIME)
4695 {
4696 delay->TPHH = delayin->TPHL + delaymsym->TPLH ;
4697 delay->FHH = delaymsym->FLH ;
4698 modname = stm_mod_name(input_name, 'U', cone->NAME, 'U', STM_DELAY|STM_SLEW, 'M', 0);
4699 delay->TMHH = stm_mod_create(modname);
4700 tmodel = delay->TMHH;
4701 stm_mod_update(tmodel, tmodel->VTH, tmodel->VDD, tmodel->VT, tmodel->VDD);
4702 stm_mod_update_transition(tmodel, STM_HH);
4703 delay->TMHH->UTYPE = STM_MOD_MODSCM;
4704 csttab[0] = delay->TPHH / TTV_UNIT;
4705 csttab[1] = delay->FHH / TTV_UNIT;
4706 delay->TMHH->UMODEL.SCM = stm_modscm_cst_create(csttab);
4707 name = stm_storemodel(CELL, NULL, delay->TMHH, 0);
4708 if (name == delay->TMHH->NAME)
4709 DETAILED_MODELS = addchain (DETAILED_MODELS, name);
4710 else {
4711 stm_mod_destroy(delay->TMHH);
4712 delay->TMHH = stm_getmodel(CELL, name);
4713 }
4714 #ifdef USEOLDTEMP
4715 delay->RHH = delaymsym->RLH ;
4716 #endif
4717 #ifdef USEOLDTEMP
4718 delay->SHH = delayin->SHL ;
4719 #endif
4720 delay->FMHH = delay->TMHH ;
4721 #ifdef USEOLDTEMP
4722 delaymem->RHL = delayin->RHL ;
4723 #endif
4724 #ifdef USEOLDTEMP
4725 delaymem->SHL = delayin->SHL ;
4726 #endif
4727 delaymem->TMHL = delayin->TMHL ;
4728 delaymem->FHL = delayin->FHL ;
4729 delaymem->TPHL = delayin->TPHL ;
4730 }
4731 if(delayin->TPLH != TAS_NOTIME)
4732 {
4733 delay->TPLL = delayin->TPLH + delaymsym->TPHL ;
4734 delay->FLL = delaymsym->FHL ;
4735 modname = stm_mod_name(input_name, 'D', cone->NAME, 'D', STM_DELAY|STM_SLEW, 'M', 0);
4736 delay->TMLL = stm_mod_create(modname);
4737 tmodel = delay->TMLL;
4738 stm_mod_update(tmodel, tmodel->VTH, tmodel->VDD, tmodel->VT, 0.0);
4739 stm_mod_update_transition(tmodel, STM_LL);
4740 delay->TMLL->UTYPE = STM_MOD_MODSCM;
4741 csttab[0] = delay->TPLL / TTV_UNIT;
4742 csttab[1] = delay->FLL / TTV_UNIT;
4743 delay->TMLL->UMODEL.SCM = stm_modscm_cst_create(csttab);
4744 name = stm_storemodel(CELL, NULL, delay->TMLL, 0);
4745 if (name == delay->TMLL->NAME)
4746 DETAILED_MODELS = addchain (DETAILED_MODELS, name);
4747 else {
4748 stm_mod_destroy(delay->TMLL);
4749 delay->TMLL = stm_getmodel(CELL, name);
4750 }
4751 #ifdef USEOLDTEMP
4752 delay->RLL = delaymsym->RHL ;
4753 #endif
4754 #ifdef USEOLDTEMP
4755 delay->SLL = delayin->SLH ;
4756 #endif
4757 delay->FMLL = delay->TMLL ;
4758 delaymem->TPLH = delayin->TPLH ;
4759 delaymem->TMLH = delayin->TMLH ;
4760 delaymem->FLH = delayin->FLH ;
4761 #ifdef USEOLDTEMP
4762 delaymem->RLH = delayin->RLH ;
4763 #endif
4764 #ifdef USEOLDTEMP
4765 delaymem->SLH = delayin->SLH ;
4766 #endif
4767 }
4768 if(delayin->TPLL != TAS_NOTIME)
4769 {
4770 delay->TPLH = delayin->TPLL + delaymsym->TPLH ;
4771 delay->FLH = delaymsym->FLH ;
4772 modname = stm_mod_name(input_name, 'D', cone->NAME, 'U', STM_DELAY|STM_SLEW, 'M', 0);
4773 delay->TMLH = stm_mod_create(modname);
4774 tmodel = delay->TMLH;
4775 stm_mod_update(tmodel, tmodel->VTH, tmodel->VDD, tmodel->VT, tmodel->VDD);
4776 stm_mod_update_transition(tmodel, STM_LH);
4777 delay->TMLH->UTYPE = STM_MOD_MODSCM;
4778 csttab[0] = delay->TPLH / TTV_UNIT;
4779 csttab[1] = delay->FLH / TTV_UNIT;
4780 delay->TMLH->UMODEL.SCM = stm_modscm_cst_create(csttab);
4781 name = stm_storemodel(CELL, NULL, delay->TMLH, 0);
4782 if (name == delay->TMLH->NAME)
4783 DETAILED_MODELS = addchain (DETAILED_MODELS, name);
4784 else {
4785 stm_mod_destroy(delay->TMLH);
4786 delay->TMLH = stm_getmodel(CELL, name);
4787 }
4788 #ifdef USEOLDTEMP
4789 delay->RLH = delaymsym->RLH ;
4790 #endif
4791 #ifdef USEOLDTEMP
4792 delay->SLH = delayin->SLL ;
4793 #endif
4794 delay->FMLH = delay->TMLH ;
4795 delaymem->TPHL = delayin->TPLL ;
4796 delaymem->TMHL = delayin->TMLL ;
4797 delaymem->FHL = delayin->FLL ;
4798 #ifdef USEOLDTEMP
4799 delaymem->RHL = delayin->RLL ;
4800 #endif
4801 #ifdef USEOLDTEMP
4802 delaymem->SHL = delayin->SLL ;
4803 #endif
4804 }
4805 if(delayin->TPHH != TAS_NOTIME)
4806 {
4807 delay->TPHL = delayin->TPHH + delaymsym->TPHL ;
4808 delay->FHL = delaymsym->FHL ;
4809 modname = stm_mod_name(input_name, 'U', cone->NAME, 'D', STM_DELAY|STM_SLEW, 'M', 0);
4810 delay->TMHL = stm_mod_create(modname);
4811 tmodel = delay->TMHL;
4812 stm_mod_update(tmodel, tmodel->VTH, tmodel->VDD, tmodel->VT, 0.0);
4813 stm_mod_update_transition(tmodel, STM_HL);
4814 delay->TMHL->UTYPE = STM_MOD_MODSCM;
4815 csttab[0] = delay->TPHL / TTV_UNIT;
4816 csttab[1] = delay->FHL / TTV_UNIT;
4817 delay->TMHL->UMODEL.SCM = stm_modscm_cst_create(csttab);
4818 name = stm_storemodel(CELL, NULL, delay->TMHL, 0);
4819 if (name == delay->TMHL->NAME)
4820 DETAILED_MODELS = addchain (DETAILED_MODELS, name);
4821 else {
4822 stm_mod_destroy(delay->TMHL);
4823 delay->TMHL = stm_getmodel(CELL, name);
4824 }
4825 #ifdef USEOLDTEMP
4826 delay->RHL = delaymsym->RHL ;
4827 #endif
4828 #ifdef USEOLDTEMP
4829 delay->SHL = delayin->SHH ;
4830 #endif
4831 delay->FMHL = delay->TMHL ;
4832 delaymem->TPLH = delayin->TPHH ;
4833 delaymem->TMLH = delayin->TMHH ;
4834 delaymem->FLH = delayin->FHH ;
4835 #ifdef USEOLDTEMP
4836 delaymem->RLH = delayin->RHH ;
4837 #endif
4838 #ifdef USEOLDTEMP
4839 delaymem->SLH = delayin->SHH ;
4840 #endif
4841 }
4842 delay = (delay_list *)getptype(incone->USER,TAS_DELAY_MIN)->DATA ;
4843 delayin = (delay_list *)getptype(inconein->USER,TAS_DELAY_MIN)->DATA ;
4844 delaymem = (delay_list *)getptype(inconemem->USER,TAS_DELAY_MIN)->DATA ;
4845 delaymsym = (delay_list *)getptype(inconemsym->USER,TAS_DELAY_MIN)->DATA ;
4846 if(delayin->TPHL != TAS_NOTIME)
4847 {
4848 delay->TPHH = delayin->TPHL + delaymsym->TPLH ;
4849 delay->FHH = delaymsym->FLH ;
4850 modname = stm_mod_name(input_name, 'U', cone->NAME, 'U', STM_DELAY|STM_SLEW, 'm', 0);
4851 delay->TMHH = stm_mod_create(modname);
4852 tmodel = delay->TMHH;
4853 stm_mod_update(tmodel, tmodel->VTH, tmodel->VDD, tmodel->VT, tmodel->VDD);
4854 stm_mod_update_transition(tmodel, STM_HH);
4855 delay->TMHH->UTYPE = STM_MOD_MODSCM;
4856 csttab[0] = delay->TPHH / TTV_UNIT;
4857 csttab[1] = delay->FHH / TTV_UNIT;
4858 delay->TMHH->UMODEL.SCM = stm_modscm_cst_create(csttab);
4859 name = stm_storemodel(CELL, NULL, delay->TMHH, 0);
4860 if (name == delay->TMHH->NAME)
4861 DETAILED_MODELS = addchain (DETAILED_MODELS, name);
4862 else {
4863 stm_mod_destroy(delay->TMHH);
4864 delay->TMHH = stm_getmodel(CELL, name);
4865 }
4866 #ifdef USEOLDTEMP
4867 delay->RHH = delaymsym->RLH ;
4868 #endif
4869 #ifdef USEOLDTEMP
4870 delay->SHH = delayin->SHL ;
4871 #endif
4872 delay->FMHH = delay->TMHH ;
4873 delaymem->TPHL = delayin->TPHL ;
4874 delaymem->TMHL = delayin->TMHL ;
4875 delaymem->FHL = delayin->FHL ;
4876 #ifdef USEOLDTEMP
4877 delaymem->RHL = delayin->RHL ;
4878 #endif
4879 #ifdef USEOLDTEMP
4880 delaymem->SHL = delayin->SHL ;
4881 #endif
4882 }
4883 if(delayin->TPLH != TAS_NOTIME)
4884 {
4885 delay->TPLL = delayin->TPLH + delaymsym->TPHL ;
4886 delay->FLL = delaymsym->FHL ;
4887 modname = stm_mod_name(input_name, 'D', cone->NAME, 'D', STM_DELAY|STM_SLEW, 'm', 0);
4888 delay->TMLL = stm_mod_create(modname);
4889 tmodel = delay->TMLL;
4890 stm_mod_update(tmodel, tmodel->VTH, tmodel->VDD, tmodel->VT, 0.0);
4891 stm_mod_update_transition(tmodel, STM_LL);
4892 delay->TMLL->UTYPE = STM_MOD_MODSCM;
4893 csttab[0] = delay->TPLL / TTV_UNIT;
4894 csttab[1] = delay->FLL / TTV_UNIT;
4895 delay->TMLL->UMODEL.SCM = stm_modscm_cst_create(csttab);
4896 name = stm_storemodel(CELL, NULL, delay->TMLL, 0);
4897 if (name == delay->TMLL->NAME)
4898 DETAILED_MODELS = addchain (DETAILED_MODELS, name);
4899 else {
4900 stm_mod_destroy(delay->TMLL);
4901 delay->TMLL = stm_getmodel(CELL, name);
4902 }
4903 #ifdef USEOLDTEMP
4904 delay->RLL = delaymsym->RHL ;
4905 #endif
4906 #ifdef USEOLDTEMP
4907 delay->SLL = delayin->SLH ;
4908 #endif
4909 delay->FMLL = delay->TMLL ;
4910 delaymem->TPLH = delayin->TPLH ;
4911 delaymem->TMLH = delayin->TMLH ;
4912 delaymem->FLH = delayin->FLH ;
4913 #ifdef USEOLDTEMP
4914 delaymem->RLH = delayin->RLH ;
4915 #endif
4916 #ifdef USEOLDTEMP
4917 delaymem->SLH = delayin->SLH ;
4918 #endif
4919 }
4920 if(delayin->TPLL != TAS_NOTIME)
4921 {
4922 delay->TPLH = delayin->TPLL + delaymsym->TPLH ;
4923 delay->FLH = delaymsym->FLH ;
4924 modname = stm_mod_name(input_name, 'D', cone->NAME, 'U', STM_DELAY|STM_SLEW, 'm', 0);
4925 delay->TMLH = stm_mod_create(modname);
4926 tmodel = delay->TMLH;
4927 stm_mod_update(tmodel, tmodel->VTH, tmodel->VDD, tmodel->VT, tmodel->VDD);
4928 stm_mod_update_transition(tmodel, STM_LH);
4929 delay->TMLH->UTYPE = STM_MOD_MODSCM;
4930 csttab[0] = delay->TPLH / TTV_UNIT;
4931 csttab[1] = delay->FLH / TTV_UNIT;
4932 delay->TMLH->UMODEL.SCM = stm_modscm_cst_create(csttab);
4933 name = stm_storemodel(CELL, NULL, delay->TMLH, 0);
4934 if (name == delay->TMLH->NAME)
4935 DETAILED_MODELS = addchain (DETAILED_MODELS, name);
4936 else {
4937 stm_mod_destroy(delay->TMLH);
4938 delay->TMLH = stm_getmodel(CELL, name);
4939 }
4940 #ifdef USEOLDTEMP
4941 delay->RLH = delaymsym->RLH ;
4942 #endif
4943 #ifdef USEOLDTEMP
4944 delay->SLH = delayin->SLL ;
4945 #endif
4946 delay->FMLH = delay->TMLH ;
4947 delaymem->TPHL = delayin->TPLL ;
4948 delaymem->TMHL = delayin->TMLL ;
4949 delaymem->FHL = delayin->FLL ;
4950 #ifdef USEOLDTEMP
4951 delaymem->RHL = delayin->RLL ;
4952 #endif
4953 #ifdef USEOLDTEMP
4954 delaymem->SHL = delayin->SLL ;
4955 #endif
4956 }
4957 if(delayin->TPHH != TAS_NOTIME)
4958 {
4959 delay->TPHL = delayin->TPHH + delaymsym->TPHL ;
4960 delay->FHL = delaymsym->FHL ;
4961 modname = stm_mod_name(input_name, 'U', cone->NAME, 'D', STM_DELAY|STM_SLEW, 'm', 0);
4962 delay->TMHL = stm_mod_create(modname);
4963 tmodel = delay->TMHL;
4964 stm_mod_update(tmodel, tmodel->VTH, tmodel->VDD, tmodel->VT, 0.0);
4965 stm_mod_update_transition(tmodel, STM_HL);
4966 delay->TMHL->UTYPE = STM_MOD_MODSCM;
4967 csttab[0] = delay->TPHL / TTV_UNIT;
4968 csttab[1] = delay->FHL / TTV_UNIT;
4969 delay->TMHL->UMODEL.SCM = stm_modscm_cst_create(csttab);
4970 name = stm_storemodel(CELL, NULL, delay->TMHL, 0);
4971 if (name == delay->TMHL->NAME)
4972 DETAILED_MODELS = addchain (DETAILED_MODELS, name);
4973 else {
4974 stm_mod_destroy(delay->TMHL);
4975 delay->TMHL = stm_getmodel(CELL, name);
4976 }
4977 #ifdef USEOLDTEMP
4978 delay->RHL = delaymsym->RHL ;
4979 #endif
4980 #ifdef USEOLDTEMP
4981 delay->SHL = delayin->SHH ;
4982 #endif
4983 delay->FMHL = delay->TMHL ;
4984 delaymem->TPLH = delayin->TPHH ;
4985 delaymem->TMLH = delayin->TMHH ;
4986 delaymem->FLH = delayin->FHH ;
4987 #ifdef USEOLDTEMP
4988 delaymem->RLH = delayin->RHH ;
4989 #endif
4990 #ifdef USEOLDTEMP
4991 delaymem->SLH = delayin->SHH ;
4992 #endif
4993 }
4994 }
4995 }
4996 }
4997
4998 /*****************************************************************************
4999 * fonction tas_detectbuf() *
5000 * detect les buffers en parralleles dans les circuits *
5001 *****************************************************************************/
5002 void tas_detectbuf(cnsfig)
5003 cnsfig_list *cnsfig ;
5004 {
5005 cone_list *cone ;
5006 edge_list *incone ;
5007 branch_list *branch[2] ;
5008 int nbr[2] ;
5009 int nbincone ;
5010 int i ;
5011
5012 for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT)
5013 {
5014 cone->TYPE &= ~(TAS_CONE_INV | TAS_CONE_BUF) ;
5015 if(((cone->TECTYPE & CNS_CMOS) != CNS_CMOS) ||
5016 ((cone->TYPE & (CNS_CONFLICT|CNS_TRI|
5017 CNS_MEMSYM|CNS_FLIP_FLOP|CNS_LATCH|CNS_RS|
5018 CNS_MASTER|CNS_SLAVE)) != 0) ||
5019 ((cone->TECTYPE & (CNS_VDD_DEGRADED|CNS_VSS_DEGRADED|
5020 CNS_ZERO|CNS_ONE)) != 0))
5021 continue ;
5022 if(cone->BREXT != NULL)
5023 {
5024 if(cone->BREXT->LINK->NEXT != NULL)
5025 continue ;
5026 }
5027 if(((branch[0] = cone->BRVDD) != NULL) &&
5028 ((branch[1] = cone->BRVSS) != NULL))
5029 {
5030 if((branch[0]->NEXT == NULL) && (branch[1]->NEXT == NULL))
5031 {
5032 if((incone = cone->INCONE) != NULL)
5033 {
5034 if((incone->NEXT == NULL) && ((incone->TYPE & CNS_CONE) == CNS_CONE))
5035 {
5036 cone->TYPE |= TAS_CONE_INV ;
5037 }
5038 }
5039 }
5040 else
5041 {
5042 for(i = 0 ; i < 2 ; i++)
5043 {
5044 nbr[i] = 0 ;
5045 for(; branch[i] != NULL ; branch[i] = branch[i]->NEXT)
5046 {
5047 if(branch[i]->LINK == NULL) break ;
5048 if(branch[i]->LINK->NEXT != NULL) break ;
5049 nbr[i]++ ;
5050 }
5051 if(branch[i] != NULL)
5052 break ;
5053 }
5054 if((i == 2) && (nbr[0] == nbr[1]))
5055 {
5056 nbincone = 0 ;
5057 for(incone = cone->INCONE ; incone != NULL ; incone = incone->NEXT)
5058 if((incone->TYPE & CNS_CONE) == CNS_CONE)
5059 nbincone++ ;
5060 else
5061 break ;
5062 if(nbincone == nbr[0])
5063 {
5064 cone->TYPE |= TAS_CONE_BUF ;
5065 }
5066 }
5067 }
5068 }
5069 }
5070 }
5071
5072 /*****************************************************************************
5073 * fonction tas_updateslope() *
5074 * mise a jour de la structure front *
5075 *****************************************************************************/
5076 void tas_updateslope(cone)
5077 cone_list *cone ;
5078 {
5079 front_list *slope;
5080 edge_list *edge;
5081 delay_list *delay;
5082 int rcfup=1;
5083 int rcfdown=1;
5084 output_carac *carac;
5085 ptype_list *ptl;
5086
5087 slope = (front_list *)getptype(cone->USER,TAS_SLOPE_MAX)->DATA;
5088 for(edge = cone->INCONE ; edge != NULL ; edge = edge->NEXT){
5089 delay = (delay_list *)getptype(edge->USER,TAS_DELAY_MAX)->DATA;
5090 ptl = getptype( cone->USER, TAS_OUT_CARAC_MAX );
5091 if( ptl )
5092 carac = ( output_carac* ) ptl->DATA ;
5093 else {
5094 carac = tas_alloc_output_carac();
5095 cone->USER = addptype( cone->USER, TAS_OUT_CARAC_MAX, carac );
5096 }
5097 if(slope && delay){
5098 if((delay->FLH != TAS_NOFRONT) && (delay->FLH != 0)){
5099 if(rcfup){
5100 #ifdef USEOLDTEMP
5101 slope->PWLUP = delay->PWLTPLH;
5102 #endif
5103 slope->FUP = delay->FLH;
5104 if( delay->CARAC )
5105 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5106 rcfup = 0;
5107 }else if(slope->FUP < delay->FLH) {
5108 #ifdef USEOLDTEMP
5109 slope->PWLUP = delay->PWLTPLH;
5110 #endif
5111 slope->FUP = delay->FLH;
5112 if( delay->CARAC )
5113 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5114 }
5115 }
5116 if((delay->FHH != TAS_NOFRONT) && (delay->FHH != 0)){
5117 if(rcfup){
5118 slope->PWLUP = NULL ;
5119 slope->FUP = delay->FHH;
5120 if( delay->CARAC )
5121 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5122 rcfup = 0;
5123 }else if(slope->FUP < delay->FHH) {
5124 slope->PWLUP = NULL ;
5125 slope->FUP = delay->FHH;
5126 if( delay->CARAC )
5127 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5128 }
5129 }
5130 if((delay->FHL != TAS_NOFRONT) && (delay->FHL != 0)){
5131 if(rcfdown){
5132 #ifdef USEOLDTEMP
5133 slope->PWLDN = delay->PWLTPHL;
5134 #endif
5135 slope->FDOWN = delay->FHL;
5136 if( delay->CARAC )
5137 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5138 rcfdown = 0;
5139 }else if(slope->FDOWN < delay->FHL) {
5140 #ifdef USEOLDTEMP
5141 slope->PWLDN = delay->PWLTPHL;
5142 #endif
5143 slope->FDOWN = delay->FHL;
5144 if( delay->CARAC )
5145 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5146 }
5147 }
5148 if((delay->FLL != TAS_NOFRONT) && (delay->FLL != 0)){
5149 if(rcfdown){
5150 slope->PWLDN = NULL;
5151 slope->FDOWN = delay->FLL;
5152 if( delay->CARAC )
5153 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5154 rcfdown = 0;
5155 }else if(slope->FDOWN < delay->FLL) {
5156 slope->PWLDN = NULL;
5157 slope->FDOWN = delay->FLL;
5158 if( delay->CARAC )
5159 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5160 }
5161 }
5162 }
5163 }
5164 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y'){
5165 rcfup = 1;
5166 rcfdown = 1;
5167 slope = (front_list *)getptype(cone->USER,TAS_SLOPE_MIN)->DATA;
5168 for(edge = cone->INCONE ; edge != NULL ; edge = edge->NEXT){
5169 delay = (delay_list *)getptype(edge->USER,TAS_DELAY_MIN)->DATA;
5170 ptl = getptype( cone->USER, TAS_OUT_CARAC_MIN );
5171 if( ptl )
5172 carac = ( output_carac* ) ptl->DATA ;
5173 else {
5174 carac = tas_alloc_output_carac();
5175 cone->USER = addptype( cone->USER, TAS_OUT_CARAC_MIN, carac );
5176 }
5177 if(slope && delay){
5178 if((delay->FLH != TAS_NOFRONT) && (delay->FLH != 0)){
5179 if(rcfup){
5180 #ifdef USEOLDTEMP
5181 slope->PWLUP = delay->PWLTPLH;
5182 #endif
5183 slope->FUP = delay->FLH;
5184 if( delay->CARAC )
5185 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5186 rcfup = 0;
5187 }else if(slope->FUP > delay->FLH) {
5188 #ifdef USEOLDTEMP
5189 slope->PWLUP = delay->PWLTPLH;
5190 #endif
5191 slope->FUP = delay->FLH;
5192 if( delay->CARAC )
5193 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5194 }
5195 }
5196 if((delay->FHH != TAS_NOFRONT) && (delay->FHH != 0)){
5197 if(rcfup){
5198 slope->FUP = delay->FHH;
5199 slope->PWLUP = NULL;
5200 if( delay->CARAC )
5201 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5202 rcfup = 0;
5203 }else if(slope->FUP > delay->FHH) {
5204 slope->FUP = delay->FHH;
5205 slope->PWLUP = NULL;
5206 if( delay->CARAC )
5207 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5208 }
5209 }
5210 if((delay->FHL != TAS_NOFRONT) && (delay->FHL != 0)){
5211 if(rcfdown){
5212 #ifdef USEOLDTEMP
5213 slope->PWLDN = delay->PWLTPHL;
5214 #endif
5215 slope->FDOWN = delay->FHL;
5216 if( delay->CARAC )
5217 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5218 rcfdown = 0;
5219 }else if(slope->FDOWN > delay->FHL) {
5220 #ifdef USEOLDTEMP
5221 slope->PWLDN = delay->PWLTPHL;
5222 #endif
5223 slope->FDOWN = delay->FHL;
5224 if( delay->CARAC )
5225 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5226 }
5227 }
5228 if((delay->FLL != TAS_NOFRONT) && (delay->FLL != 0)){
5229 if(rcfdown){
5230 slope->PWLDN = NULL;
5231 slope->FDOWN = delay->FLL;
5232 if( delay->CARAC )
5233 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5234 rcfdown = 0;
5235 }else if(slope->FDOWN > delay->FLL) {
5236 slope->PWLDN = NULL;
5237 slope->FDOWN = delay->FLL;
5238 if( delay->CARAC )
5239 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5240 }
5241 }
5242 }
5243 }
5244 }
5245 }
5246
5247 /*****************************************************************************
5248 * fonction tas_mark_links_unused_switch_command() *
5249 *****************************************************************************/
5250 void tas_mark_links_unused_switch_command(cone, lotrs, level)
5251 cone_list *cone;
5252 lotrs_list *lotrs;
5253 long level;
5254 {
5255 branch_list *path[3];
5256 link_list *link;
5257 short i;
5258
5259 path[0] = cone->BREXT;
5260 path[1] = cone->BRVDD;
5261 path[2] = cone->BRVSS;
5262
5263 for(i = 0 ; i < 3 ; i++)
5264 for(; path[i] != NULL ; path[i] = path[i]->NEXT)
5265 if((path[i]->TYPE & CNS_NOT_FUNCTIONAL) != CNS_NOT_FUNCTIONAL)
5266 if(((path[i]->TYPE & CNS_EXT) == CNS_EXT) ||
5267 ((path[i]->TYPE & level) == level)){
5268 for(link = (link_list *)path[i]->LINK ; link != NULL ; link = link->NEXT){
5269 if(link->ULINK.LOTRS == lotrs){
5270 if(!getptype(link->USER, TAS_LINK_UNUSED_SWITCH_COMMAND)){
5271 link->USER = addptype(link->USER, TAS_LINK_UNUSED_SWITCH_COMMAND, (void*)1);
5272 }
5273 }
5274 }
5275 }
5276 }
5277
5278 /*****************************************************************************
5279 * fonction tas_choose_min_delay_switch() *
5280 *****************************************************************************/
5281 void tas_choose_min_delay_switch(cone, edge, delay, d_in_down, d_in_up, type)
5282 cone_list *cone;
5283 edge_list *edge;
5284 delay_list *delay;
5285 long d_in_down;
5286 long d_in_up;
5287 char type;
5288 {
5289 link_list *link;
5290 lotrs_list *lotrs_other;
5291 ptype_list *ptype;
5292 cone_list *cone_avant;
5293 edge_list *edgeother;
5294 delay_list *delayother;
5295 timing_cell *cell = stm_getcell(CELL);
5296 long d_down = 0;
5297 long d_up = 0;
5298 delay_list *delaymin = NULL;
5299 delay_list *delayothermin = NULL;
5300
5301 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y')
5302 delaymin = (delay_list *)getptype(edge->USER,TAS_DELAY_MIN)->DATA;
5303
5304 if(existe_tpd (cone, edge->UEDGE.CONE, CNS_VDD, CNS_TP, &link)){
5305 delayother = NULL ;
5306 delayothermin = NULL ;
5307 if((link->TYPE & CNS_SWITCH) == CNS_SWITCH){
5308 if((ptype = getptype(link->ULINK.LOTRS->USER, TAS_TRANS_SWITCH)) != NULL){
5309 lotrs_other = (lotrs_list*)ptype->DATA;
5310 cone_avant = (cone_list *) getptype (((lotrs_list*)ptype->DATA)->USER, CNS_DRIVINGCONE)->DATA;
5311 if(cone_avant){
5312 for(edgeother = cone->INCONE ; edgeother != NULL ; edgeother = edgeother->NEXT){
5313 if((edgeother->TYPE & CNS_CONE) == CNS_CONE){
5314 if(edgeother->UEDGE.CONE == cone_avant){
5315 if(type == 'M'){
5316 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_UP_MAX)) != NULL)
5317 d_up = (long)ptype->DATA;
5318 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_DOWN_MAX)) != NULL)
5319 d_down = (long)ptype->DATA;
5320 }else{
5321 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_UP_MIN)) != NULL)
5322 d_up = (long)ptype->DATA;
5323 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_DOWN_MIN)) != NULL)
5324 d_down = (long)ptype->DATA;
5325 }
5326 if(type == 'M') delayother = (delay_list *)getptype(edgeother->USER,TAS_DELAY_MAX)->DATA;
5327 else delayother = (delay_list *)getptype(edgeother->USER,TAS_DELAY_MIN)->DATA;
5328 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y')
5329 delayothermin = (delay_list *)getptype(edgeother->USER,TAS_DELAY_MIN)->DATA;
5330 break;
5331 }
5332 }
5333 }
5334 if(delayother){
5335 if((delay->TPLH != TAS_NOTIME) && (delayother->TPHH != TAS_NOTIME)){
5336 if((d_in_down + delay->TPLH) < (d_up + delayother->TPHH)){
5337 delayother->TPHH = TAS_NOTIME;
5338 delayother->FHH = TAS_NOFRONT;
5339 if(delayother->TMHH) stm_cell_delmodel (cell, delayother->TMHH, 0);
5340 delayother->TMHH = NULL;
5341 tas_mark_links_unused_switch_command(cone, lotrs_other, CNS_VDD);
5342 if(delayothermin){
5343 delayothermin->TPHH = TAS_NOTIME;
5344 delayothermin->FHH = TAS_NOFRONT;
5345 if(delayothermin->TMHH) stm_cell_delmodel (cell, delayothermin->TMHH, 0);
5346 delayothermin->TMHH = NULL;
5347 }
5348 }else{
5349 delay->TPLH = TAS_NOTIME;
5350 delay->FLH = TAS_NOFRONT;
5351 if(delay->TMLH) stm_cell_delmodel (cell, delay->TMLH, 0);
5352 delay->TMLH = NULL;
5353 tas_mark_links_unused_switch_command(cone, link->ULINK.LOTRS, CNS_VDD);
5354 if(delaymin){
5355 delaymin->TPLH = TAS_NOTIME;
5356 delaymin->FLH = TAS_NOFRONT;
5357 if(delaymin->TMLH) stm_cell_delmodel (cell, delaymin->TMLH, 0);
5358 delaymin->TMLH = NULL;
5359 }
5360 }
5361 }
5362 if((delay->TPHL != TAS_NOTIME) && (delay->FHL == 0) && (delayother->TPLL != TAS_NOTIME) && (delayother->FLL == 0)){
5363 if((d_in_up + delay->TPHL) < (d_down + delayother->TPLL)){
5364 delayother->TPLL = TAS_NOTIME;
5365 delayother->FLL = TAS_NOFRONT;
5366 if(delayother->TMLL) stm_cell_delmodel (cell, delayother->TMLL, 0);
5367 delayother->TMLL = NULL;
5368 tas_mark_links_unused_switch_command(cone, lotrs_other, CNS_VSS);
5369 if(delayothermin){
5370 delayothermin->TPLL = TAS_NOTIME;
5371 delayothermin->FLL = TAS_NOFRONT;
5372 if(delayothermin->TMLL) stm_cell_delmodel (cell, delayothermin->TMLL, 0);
5373 delayothermin->TMLL = NULL;
5374 }
5375 }else{
5376 delay->TPHL = TAS_NOTIME;
5377 delay->FHL = TAS_NOFRONT;
5378 if(delay->TMHL) stm_cell_delmodel (cell, delay->TMHL, 0);
5379 delay->TMHL = NULL;
5380 tas_mark_links_unused_switch_command(cone, link->ULINK.LOTRS, CNS_VSS);
5381 if(delaymin){
5382 delaymin->TPHL = TAS_NOTIME;
5383 delaymin->FHL = TAS_NOFRONT;
5384 if(delaymin->TMHL) stm_cell_delmodel (cell, delaymin->TMHL, 0);
5385 delaymin->TMHL = NULL;
5386 }
5387 }
5388 }
5389 }
5390 }
5391 }
5392 }
5393 }
5394 if(existe_tpd (cone, edge->UEDGE.CONE, CNS_VDD, CNS_TN, &link)){
5395 delayother = NULL ;
5396 delayothermin = NULL ;
5397 if((link->TYPE & CNS_SWITCH) == CNS_SWITCH){
5398 if((ptype = getptype(link->ULINK.LOTRS->USER, TAS_TRANS_SWITCH)) != NULL){
5399 lotrs_other = (lotrs_list*)ptype->DATA;
5400 cone_avant = (cone_list *) getptype (((lotrs_list*)ptype->DATA)->USER, CNS_DRIVINGCONE)->DATA;
5401 if(cone_avant){
5402 for(edgeother = cone->INCONE ; edgeother != NULL ; edgeother = edgeother->NEXT){
5403 if((edgeother->TYPE & CNS_CONE) == CNS_CONE){
5404 if(edgeother->UEDGE.CONE == cone_avant){
5405 if(type == 'M'){
5406 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_UP_MAX)) != NULL)
5407 d_up = (long)ptype->DATA;
5408 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_DOWN_MAX)) != NULL)
5409 d_down = (long)ptype->DATA;
5410 }else{
5411 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_UP_MIN)) != NULL)
5412 d_up = (long)ptype->DATA;
5413 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_DOWN_MIN)) != NULL)
5414 d_down = (long)ptype->DATA;
5415 }
5416 if(type == 'M') delayother = (delay_list *)getptype(edgeother->USER,TAS_DELAY_MAX)->DATA;
5417 else delayother = (delay_list *)getptype(edgeother->USER,TAS_DELAY_MIN)->DATA;
5418 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y')
5419 delayothermin = (delay_list *)getptype(edgeother->USER,TAS_DELAY_MIN)->DATA;
5420 break;
5421 }
5422 }
5423 }
5424 if(delayother){
5425 if((delay->TPHH != TAS_NOTIME) && (delayother->TPLH != TAS_NOTIME)){
5426 if((d_in_up + delay->TPHH) < (d_down + delayother->TPLH)){
5427 delayother->TPLH = TAS_NOTIME;
5428 delayother->FLH = TAS_NOFRONT;
5429 if(delayother->TMLH) stm_cell_delmodel (cell, delayother->TMLH, 0);
5430 delayother->TMLH = NULL;
5431 tas_mark_links_unused_switch_command(cone, lotrs_other, CNS_VDD);
5432 if(delayothermin){
5433 delayothermin->TPLH = TAS_NOTIME;
5434 delayothermin->FLH = TAS_NOFRONT;
5435 if(delayothermin->TMLH) stm_cell_delmodel (cell, delayothermin->TMLH, 0);
5436 delayothermin->TMLH = NULL;
5437 }
5438 }else{
5439 delay->TPHH = TAS_NOTIME;
5440 delay->FHH = TAS_NOFRONT;
5441 if(delay->TMHH) stm_cell_delmodel (cell, delay->TMHH, 0);
5442 delay->TMHH = NULL;
5443 tas_mark_links_unused_switch_command(cone, link->ULINK.LOTRS, CNS_VDD);
5444 if(delaymin){
5445 delaymin->TPHH = TAS_NOTIME;
5446 delaymin->FHH = TAS_NOFRONT;
5447 if(delaymin->TMHH) stm_cell_delmodel (cell, delaymin->TMHH, 0);
5448 delaymin->TMHH = NULL;
5449 }
5450 }
5451 }
5452 if((delay->TPLL != TAS_NOTIME) && (delay->FLL == 0) && (delayother->TPHL != TAS_NOTIME) && (delayother->FHL == 0)){
5453 if((d_in_down + delay->TPLL) < (d_up + delayother->TPHL)){
5454 delayother->TPHL = TAS_NOTIME;
5455 delayother->FHL = TAS_NOFRONT;
5456 if(delayother->TMHL) stm_cell_delmodel (cell, delayother->TMHL, 0);
5457 delayother->TMHL = NULL;
5458 tas_mark_links_unused_switch_command(cone, lotrs_other, CNS_VSS);
5459 if(delayothermin){
5460 delayothermin->TPHL = TAS_NOTIME;
5461 delayothermin->FHL = TAS_NOFRONT;
5462 if(delayothermin->TMHL) stm_cell_delmodel (cell, delayothermin->TMHL, 0);
5463 delayothermin->TMHL = NULL;
5464 }
5465 }else{
5466 delay->TPLL = TAS_NOTIME;
5467 delay->FLL = TAS_NOFRONT;
5468 if(delay->TMLL) stm_cell_delmodel (cell, delay->TMLL, 0);
5469 delay->TMLL = NULL;
5470 tas_mark_links_unused_switch_command(cone, link->ULINK.LOTRS, CNS_VSS);
5471 if(delaymin){
5472 delaymin->TPLL = TAS_NOTIME;
5473 delaymin->FLL = TAS_NOFRONT;
5474 if(delaymin->TMLL) stm_cell_delmodel (cell, delaymin->TMLL, 0);
5475 delaymin->TMLL = NULL;
5476 }
5477 }
5478 }
5479 }
5480 }
5481 }
5482 }
5483 }
5484 if(existe_tpd (cone, edge->UEDGE.CONE, CNS_VSS, CNS_TP, &link)){
5485 delayother = NULL ;
5486 delayothermin = NULL ;
5487 if((link->TYPE & CNS_SWITCH) == CNS_SWITCH){
5488 if((ptype = getptype(link->ULINK.LOTRS->USER, TAS_TRANS_SWITCH)) != NULL){
5489 lotrs_other = (lotrs_list*)ptype->DATA;
5490 cone_avant = (cone_list *) getptype (((lotrs_list*)ptype->DATA)->USER, CNS_DRIVINGCONE)->DATA;
5491 if(cone_avant){
5492 for(edgeother = cone->INCONE ; edgeother != NULL ; edgeother = edgeother->NEXT){
5493 if((edgeother->TYPE & CNS_CONE) == CNS_CONE){
5494 if(edgeother->UEDGE.CONE == cone_avant){
5495 if(type == 'M'){
5496 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_UP_MAX)) != NULL)
5497 d_up = (long)ptype->DATA;
5498 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_DOWN_MAX)) != NULL)
5499 d_down = (long)ptype->DATA;
5500 }else{
5501 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_UP_MIN)) != NULL)
5502 d_up = (long)ptype->DATA;
5503 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_DOWN_MIN)) != NULL)
5504 d_down = (long)ptype->DATA;
5505 }
5506 if(type == 'M') delayother = (delay_list *)getptype(edgeother->USER,TAS_DELAY_MAX)->DATA;
5507 else delayother = (delay_list *)getptype(edgeother->USER,TAS_DELAY_MIN)->DATA;
5508 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y')
5509 delayothermin = (delay_list *)getptype(edgeother->USER,TAS_DELAY_MIN)->DATA;
5510 break;
5511 }
5512 }
5513 }
5514 if(delayother){
5515 if((delay->TPLL != TAS_NOTIME) && (delayother->TPHL != TAS_NOTIME)){
5516 if((d_in_down + delay->TPLL) < (d_up + delayother->TPHL)){
5517 delayother->TPHL = TAS_NOTIME;
5518 delayother->FHL = TAS_NOFRONT;
5519 if(delayother->TMHL) stm_cell_delmodel (cell, delayother->TMHL, 0);
5520 delayother->TMHL = NULL;
5521 tas_mark_links_unused_switch_command(cone, lotrs_other, CNS_VSS);
5522 if(delayothermin){
5523 delayothermin->TPHL = TAS_NOTIME;
5524 delayothermin->FHL = TAS_NOFRONT;
5525 if(delayothermin->TMHL) stm_cell_delmodel (cell, delayothermin->TMHL, 0);
5526 delayothermin->TMHL = NULL;
5527 }
5528 }else{
5529 delay->TPLL = TAS_NOTIME;
5530 delay->FLL = TAS_NOFRONT;
5531 if(delay->TMLL) stm_cell_delmodel (cell, delay->TMLL, 0);
5532 delay->TMLL = NULL;
5533 tas_mark_links_unused_switch_command(cone, link->ULINK.LOTRS, CNS_VSS);
5534 if(delaymin){
5535 delaymin->TPLL = TAS_NOTIME;
5536 delaymin->FLL = TAS_NOFRONT;
5537 if(delaymin->TMLL) stm_cell_delmodel (cell, delaymin->TMLL, 0);
5538 delaymin->TMLL = NULL;
5539 }
5540 }
5541 }
5542 if((delay->TPHH != TAS_NOTIME) && (delay->FHH == 0) && (delayother->TPLH != TAS_NOTIME) && (delayother->FLH == 0)){
5543 if((d_in_up + delay->TPHH) < (d_down + delayother->TPLH)){
5544 delayother->TPLH = TAS_NOTIME;
5545 delayother->FLH = TAS_NOFRONT;
5546 if(delayother->TMLH) stm_cell_delmodel (cell, delayother->TMLH, 0);
5547 delayother->TMLH = NULL;
5548 tas_mark_links_unused_switch_command(cone, lotrs_other, CNS_VDD);
5549 if(delayothermin){
5550 delayothermin->TPLH = TAS_NOTIME;
5551 delayothermin->FLH = TAS_NOFRONT;
5552 if(delayothermin->TMLH) stm_cell_delmodel (cell, delayothermin->TMLH, 0);
5553 delayothermin->TMLH = NULL;
5554 }
5555 }else{
5556 delay->TPHH = TAS_NOTIME;
5557 delay->FHH = TAS_NOFRONT;
5558 if(delay->TMHH) stm_cell_delmodel (cell, delay->TMHH, 0);
5559 delay->TMHH = NULL;
5560 tas_mark_links_unused_switch_command(cone, link->ULINK.LOTRS, CNS_VDD);
5561 if(delaymin){
5562 delaymin->TPHH = TAS_NOTIME;
5563 delaymin->FHH = TAS_NOFRONT;
5564 if(delaymin->TMHH) stm_cell_delmodel (cell, delaymin->TMHH, 0);
5565 delaymin->TMHH = NULL;
5566 }
5567 }
5568 }
5569 }
5570 }
5571 }
5572 }
5573 }
5574 if(existe_tpd (cone, edge->UEDGE.CONE, CNS_VSS, CNS_TN, &link)){
5575 delayother = NULL ;
5576 delayothermin = NULL ;
5577 if((link->TYPE & CNS_SWITCH) == CNS_SWITCH){
5578 if((ptype = getptype(link->ULINK.LOTRS->USER, TAS_TRANS_SWITCH)) != NULL){
5579 lotrs_other = (lotrs_list*)ptype->DATA;
5580 cone_avant = (cone_list *) getptype (((lotrs_list*)ptype->DATA)->USER, CNS_DRIVINGCONE)->DATA;
5581 if(cone_avant){
5582 for(edgeother = cone->INCONE ; edgeother != NULL ; edgeother = edgeother->NEXT){
5583 if((edgeother->TYPE & CNS_CONE) == CNS_CONE){
5584 if(edgeother->UEDGE.CONE == cone_avant){
5585 if(type == 'M'){
5586 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_UP_MAX)) != NULL)
5587 d_up = (long)ptype->DATA;
5588 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_DOWN_MAX)) != NULL)
5589 d_down = (long)ptype->DATA;
5590 }else{
5591 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_UP_MIN)) != NULL)
5592 d_up = (long)ptype->DATA;
5593 if((ptype = getptype(edgeother->UEDGE.CONE->USER, TAS_DELAY_DOWN_MIN)) != NULL)
5594 d_down = (long)ptype->DATA;
5595 }
5596 if(type == 'M') delayother = (delay_list *)getptype(edgeother->USER,TAS_DELAY_MAX)->DATA;
5597 else delayother = (delay_list *)getptype(edgeother->USER,TAS_DELAY_MIN)->DATA;
5598 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y')
5599 delayothermin = (delay_list *)getptype(edgeother->USER,TAS_DELAY_MIN)->DATA;
5600 break;
5601 }
5602 }
5603 }
5604 if(delayother){
5605 if((delay->TPHL != TAS_NOTIME) && (delayother->TPLL != TAS_NOTIME)){
5606 if((d_in_up + delay->TPHL) < (d_down + delayother->TPLL)){
5607 delayother->TPLL = TAS_NOTIME;
5608 delayother->FLL = TAS_NOFRONT;
5609 if(delayother->TMLL) stm_cell_delmodel (cell, delayother->TMLL, 0);
5610 delayother->TMLL = NULL;
5611 tas_mark_links_unused_switch_command(cone, lotrs_other, CNS_VSS);
5612 if(delayothermin){
5613 delayothermin->TPLL = TAS_NOTIME;
5614 delayothermin->FLL = TAS_NOFRONT;
5615 if(delayothermin->TMLL) stm_cell_delmodel (cell, delayothermin->TMLL, 0);
5616 delayothermin->TMLL = NULL;
5617 }
5618 }else{
5619 delay->TPHL = TAS_NOTIME;
5620 delay->FHL = TAS_NOFRONT;
5621 if(delay->TMHL) stm_cell_delmodel (cell, delay->TMHL, 0);
5622 delay->TMHL = NULL;
5623 tas_mark_links_unused_switch_command(cone, link->ULINK.LOTRS, CNS_VSS);
5624 if(delaymin){
5625 delaymin->TPHL = TAS_NOTIME;
5626 delaymin->FHL = TAS_NOFRONT;
5627 if(delaymin->TMHL) stm_cell_delmodel (cell, delaymin->TMHL, 0);
5628 delaymin->TMHL = NULL;
5629 }
5630 }
5631 }
5632 if((delay->TPLH != TAS_NOTIME) && (delay->FLH == 0) && (delayother->TPHH != TAS_NOTIME) && (delayother->FHH == 0)){
5633 if((d_in_down + delay->TPLH) < (d_up + delayother->TPHH)){
5634 delayother->TPHH = TAS_NOTIME;
5635 delayother->FHH = TAS_NOFRONT;
5636 if(delayother->TMHH) stm_cell_delmodel (cell, delayother->TMHH, 0);
5637 delayother->TMHH = NULL;
5638 tas_mark_links_unused_switch_command(cone, lotrs_other, CNS_VDD);
5639 if(delayothermin){
5640 delayothermin->TPHH = TAS_NOTIME;
5641 delayothermin->FHH = TAS_NOFRONT;
5642 if(delayothermin->TMHH) stm_cell_delmodel (cell, delayothermin->TMHH, 0);
5643 delayothermin->TMHH = NULL;
5644 }
5645 }else{
5646 delay->TPLH = TAS_NOTIME;
5647 delay->FLH = TAS_NOFRONT;
5648 if(delay->TMLH) stm_cell_delmodel (cell, delay->TMLH, 0);
5649 delay->TMLH = NULL;
5650 tas_mark_links_unused_switch_command(cone, link->ULINK.LOTRS, CNS_VDD);
5651 if(delaymin){
5652 delaymin->TPLH = TAS_NOTIME;
5653 delaymin->FLH = TAS_NOFRONT;
5654 if(delaymin->TMLH) stm_cell_delmodel (cell, delaymin->TMLH, 0);
5655 delaymin->TMLH = NULL;
5656 }
5657 }
5658 }
5659 }
5660 }
5661 }
5662 }
5663 }
5664 }
5665 /*****************************************************************************
5666 * fonction tas_updatedelay() *
5667 * mise a jour de la structure front *
5668 *****************************************************************************/
5669 void tas_updatedelay(cone)
5670 cone_list *cone ;
5671 {
5672 front_list *slope;
5673 edge_list *edge;
5674 delay_list *delay;
5675 int rcfup=1;
5676 int rcfdown=1;
5677 long d_in_up = 0;
5678 long d_in_down = 0;
5679 long rchh = 0;
5680 long rcll = 0;
5681 long delay_up_max = 0;
5682 long delay_down_max = 0;
5683 long delay_up_min = 0;
5684 long delay_down_min = 0;
5685 output_carac *carac ;
5686 ptype_list *ptl ;
5687
5688 slope = (front_list *)getptype(cone->USER,TAS_SLOPE_MAX)->DATA;
5689 if((TAS_CONTEXT->TAS_DELAY_SWITCH == 'P') && (getptype(cone->USER,CNS_SWITCH))){
5690 for(edge = cone->INCONE ; edge != NULL ; edge = edge->NEXT){
5691 d_in_up = 0;
5692 d_in_down = 0;
5693 delay = (delay_list *)getptype(edge->USER,TAS_DELAY_MAX)->DATA;
5694 if(((edge->TYPE & CNS_CONE) == CNS_CONE) && (slope && delay)){
5695 if(getptype(edge->UEDGE.CONE->USER, TAS_DELAY_UP_MAX))
5696 d_in_up = (long)getptype(edge->UEDGE.CONE->USER, TAS_DELAY_UP_MAX)->DATA;
5697 if(getptype(edge->UEDGE.CONE->USER, TAS_DELAY_DOWN_MAX))
5698 d_in_down = (long)getptype(edge->UEDGE.CONE->USER, TAS_DELAY_DOWN_MAX)->DATA;
5699 tas_choose_min_delay_switch(cone, edge, delay, d_in_down, d_in_up, 'M');
5700 }
5701 }
5702 }
5703 for(edge = cone->INCONE ; edge != NULL ; edge = edge->NEXT){
5704 d_in_up = 0;
5705 d_in_down = 0;
5706 delay = (delay_list *)getptype(edge->USER,TAS_DELAY_MAX)->DATA;
5707 ptl = getptype( cone->USER, TAS_OUT_CARAC_MAX );
5708 if( ptl )
5709 carac = ( output_carac* ) ptl->DATA ;
5710 else {
5711 carac = tas_alloc_output_carac();
5712 cone->USER = addptype( cone->USER, TAS_OUT_CARAC_MAX, carac );
5713 }
5714 if((edge->TYPE & CNS_CONE) == CNS_CONE){
5715 if(getptype(edge->UEDGE.CONE->USER, TAS_DELAY_UP_MAX))
5716 d_in_up = (long)getptype(edge->UEDGE.CONE->USER, TAS_DELAY_UP_MAX)->DATA;
5717 if(getptype(edge->UEDGE.CONE->USER, TAS_DELAY_DOWN_MAX))
5718 d_in_down = (long)getptype(edge->UEDGE.CONE->USER, TAS_DELAY_DOWN_MAX)->DATA;
5719 }
5720 if(delay->RCLL != TAS_NOTIME)
5721 rcll = delay->RCLL;
5722 else
5723 rcll = 0;
5724 if(delay->RCHH != TAS_NOTIME)
5725 rchh = delay->RCHH;
5726 else
5727 rchh = 0;
5728 if(slope && delay){
5729 if((delay->TPLH != TAS_NOTIME) && (delay->FLH != TAS_NOFRONT) && (delay->FLH != 0)){
5730 if(rcfup){
5731 slope->FUP = delay->FLH;
5732 #ifdef USEOLDTEMP
5733 slope->PWLUP = delay->PWLTPLH;
5734 #endif
5735 stm_mod_driver( delay->FMLH, &slope->DRIVERUP.R, &slope->DRIVERUP.V );
5736 delay_up_max = delay->TPLH + d_in_down + rcll;
5737 if( delay->CARAC )
5738 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5739 rcfup = 0;
5740 }else if(delay_up_max < delay->TPLH + d_in_down + rcll){
5741 slope->FUP = delay->FLH;
5742 #ifdef USEOLDTEMP
5743 slope->PWLUP = delay->PWLTPLH;
5744 #endif
5745 stm_mod_driver( delay->FMLH, &slope->DRIVERUP.R, &slope->DRIVERUP.V );
5746 delay_up_max = delay->TPLH + d_in_down + rcll;
5747 if( delay->CARAC )
5748 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5749 }
5750 }
5751 if((delay->TPHH != TAS_NOTIME) && (delay->FHH != TAS_NOFRONT) && (delay->FHH != 0)){
5752 if(rcfup){
5753 slope->FUP = delay->FHH;
5754 slope->PWLUP = NULL ;
5755 stm_mod_driver( delay->FMHH, &slope->DRIVERUP.R, &slope->DRIVERUP.V );
5756 delay_up_max = delay->TPHH + d_in_up + rchh;
5757 if( delay->CARAC )
5758 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5759 rcfup = 0;
5760 }else if(delay_up_max < delay->TPHH + d_in_up + rchh){
5761 slope->FUP = delay->FHH;
5762 slope->PWLUP = NULL ;
5763 stm_mod_driver( delay->FMHH, &slope->DRIVERUP.R, &slope->DRIVERUP.V );
5764 delay_up_max = delay->TPHH + d_in_up + rchh;
5765 if( delay->CARAC )
5766 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5767 }
5768 }
5769 if((delay->TPHL != TAS_NOTIME) && (delay->FHL != TAS_NOFRONT) && (delay->FHL != 0)){
5770 if(rcfdown){
5771 slope->FDOWN = delay->FHL;
5772 #ifdef USEOLDTEMP
5773 slope->PWLDN = delay->PWLTPHL;
5774 #endif
5775 stm_mod_driver( delay->FMHL, &slope->DRIVERDN.R, &slope->DRIVERDN.V );
5776 delay_down_max = delay->TPHL + d_in_up + rchh;
5777 if( delay->CARAC )
5778 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5779 rcfdown = 0;
5780 }else if(delay_down_max < delay->TPHL + d_in_up + rchh){
5781 slope->FDOWN = delay->FHL;
5782 #ifdef USEOLDTEMP
5783 slope->PWLDN = delay->PWLTPHL;
5784 #endif
5785 stm_mod_driver( delay->FMHL, &slope->DRIVERDN.R, &slope->DRIVERDN.V );
5786 delay_down_max = delay->TPHL + d_in_up + rchh;
5787 if( delay->CARAC )
5788 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5789 }
5790 }
5791 if((delay->TPLL != TAS_NOTIME) && (delay->FLL != TAS_NOFRONT) && (delay->FLL != 0)){
5792 if(rcfdown){
5793 slope->FDOWN = delay->FLL;
5794 slope->PWLDN = NULL;
5795 stm_mod_driver( delay->FMLL, &slope->DRIVERDN.R, &slope->DRIVERDN.V );
5796 delay_down_max = delay->TPLL + d_in_down + rcll;
5797 if( delay->CARAC )
5798 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5799 rcfdown = 0;
5800 }else if(delay_down_max < delay->TPLL + d_in_down + rcll){
5801 slope->FDOWN = delay->FLL;
5802 slope->PWLDN = NULL;
5803 stm_mod_driver( delay->FMLL, &slope->DRIVERDN.R, &slope->DRIVERDN.V );
5804 delay_down_max = delay->TPLL + d_in_down + rcll;
5805 if( delay->CARAC )
5806 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5807 }
5808 }
5809 }
5810 }
5811 cone->USER = addptype(cone->USER, TAS_DELAY_UP_MAX, (void*)delay_up_max);
5812 cone->USER = addptype(cone->USER, TAS_DELAY_DOWN_MAX, (void*)delay_down_max);
5813
5814 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y'){
5815 rcfup = 1;
5816 rcfdown = 1;
5817 slope = (front_list *)getptype(cone->USER,TAS_SLOPE_MIN)->DATA;
5818 /* if((TAS_CONTEXT->TAS_DELAY_SWITCH == 'P') && (getptype(cone->USER,CNS_SWITCH))){
5819 for(edge = cone->INCONE ; edge != NULL ; edge = edge->NEXT){
5820 d_in_up = 0;
5821 d_in_down = 0;
5822 delay = (delay_list *)getptype(edge->USER,TAS_DELAY_MIN)->DATA;
5823 if(((edge->TYPE & CNS_CONE) == CNS_CONE) && (slope && delay)){
5824 if(getptype(edge->UEDGE.CONE->USER, TAS_DELAY_UP_MIN))
5825 d_in_up = (long)getptype(edge->UEDGE.CONE->USER, TAS_DELAY_UP_MIN)->DATA;
5826 if(getptype(edge->UEDGE.CONE->USER, TAS_DELAY_DOWN_MIN))
5827 d_in_down = (long)getptype(edge->UEDGE.CONE->USER, TAS_DELAY_DOWN_MIN)->DATA;
5828 tas_choose_min_delay_switch(cone, edge, delay, d_in_down, d_in_up, 'm');
5829 }
5830 }
5831 }*/
5832 for(edge = cone->INCONE ; edge != NULL ; edge = edge->NEXT){
5833 d_in_up = 0;
5834 d_in_down = 0;
5835 delay = (delay_list *)getptype(edge->USER,TAS_DELAY_MIN)->DATA;
5836 ptl = getptype( cone->USER, TAS_OUT_CARAC_MIN );
5837 if( ptl )
5838 carac = ( output_carac* ) ptl->DATA ;
5839 else {
5840 carac = tas_alloc_output_carac();
5841 cone->USER = addptype( cone->USER, TAS_OUT_CARAC_MIN, carac );
5842 }
5843 if((edge->TYPE & CNS_CONE) == CNS_CONE){
5844 if(getptype(edge->UEDGE.CONE->USER, TAS_DELAY_UP_MIN))
5845 d_in_up = (long)getptype(edge->UEDGE.CONE->USER, TAS_DELAY_UP_MIN)->DATA;
5846 if(getptype(edge->UEDGE.CONE->USER, TAS_DELAY_DOWN_MIN))
5847 d_in_down = (long)getptype(edge->UEDGE.CONE->USER, TAS_DELAY_DOWN_MIN)->DATA;
5848 }
5849 if(delay->RCLL != TAS_NOTIME)
5850 rcll = delay->RCLL;
5851 else
5852 rcll = 0;
5853 if(delay->RCHH != TAS_NOTIME)
5854 rchh = delay->RCHH;
5855 else
5856 rchh = 0;
5857 if(slope && delay){
5858 if((delay->TPLH != TAS_NOTIME) && (delay->FLH != TAS_NOFRONT) && (delay->FLH != 0)){
5859 if(rcfup){
5860 slope->FUP = delay->FLH;
5861 #ifdef USEOLDTEMP
5862 slope->PWLUP = delay->PWLTPLH;
5863 #endif
5864 stm_mod_driver( delay->FMLH, &slope->DRIVERUP.R, &slope->DRIVERUP.V );
5865 delay_up_min = delay->TPLH + d_in_down + rcll;
5866 if( delay->CARAC )
5867 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5868 rcfup = 0;
5869 }else if(delay_up_min > delay->TPLH + d_in_down + rcll){
5870 slope->FUP = delay->FLH;
5871 #ifdef USEOLDTEMP
5872 slope->PWLUP = delay->PWLTPLH;
5873 #endif
5874 stm_mod_driver( delay->FMLH, &slope->DRIVERUP.R, &slope->DRIVERUP.V );
5875 delay_up_min = delay->TPLH + d_in_down + rcll;
5876 if( delay->CARAC )
5877 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5878 }
5879 }
5880 if((delay->TPHH != TAS_NOTIME) && (delay->FHH != TAS_NOFRONT) && (delay->FHH != 0)){
5881 if(rcfup){
5882 slope->FUP = delay->FHH;
5883 slope->PWLUP = NULL ;
5884 stm_mod_driver( delay->FMHH, &slope->DRIVERUP.R, &slope->DRIVERUP.V );
5885 delay_up_min = delay->TPHH + d_in_up + rchh;
5886 if( delay->CARAC )
5887 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5888 rcfup = 0;
5889 }else if(delay_up_min > delay->TPHH + d_in_up + rchh){
5890 slope->FUP = delay->FHH;
5891 slope->PWLUP = NULL ;
5892 stm_mod_driver( delay->FMHH, &slope->DRIVERUP.R, &slope->DRIVERUP.V );
5893 delay_up_min = delay->TPHH + d_in_up + rchh;
5894 if( delay->CARAC )
5895 memcpy( &(carac->UP), &(delay->CARAC->UP), sizeof( output_carac_trans ) );
5896 }
5897 }
5898 if((delay->TPHL != TAS_NOTIME) && (delay->FHL != TAS_NOFRONT) && (delay->FHL != 0)){
5899 if(rcfdown){
5900 slope->FDOWN = delay->FHL;
5901 #ifdef USEOLDTEMP
5902 slope->PWLDN = delay->PWLTPHL;
5903 #endif
5904 stm_mod_driver( delay->FMHL, &slope->DRIVERDN.R, &slope->DRIVERDN.V );
5905 delay_down_min = delay->TPHL + d_in_up + rchh;
5906 if( delay->CARAC )
5907 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5908 rcfdown = 0;
5909 }else if(delay_down_min > delay->TPHL + d_in_up + rchh){
5910 slope->FDOWN = delay->FHL;
5911 #ifdef USEOLDTEMP
5912 slope->PWLDN = delay->PWLTPHL;
5913 #endif
5914 stm_mod_driver( delay->FMHL, &slope->DRIVERDN.R, &slope->DRIVERDN.V );
5915 delay_down_min = delay->TPHL + d_in_up + rchh;
5916 if( delay->CARAC )
5917 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5918 }
5919 }
5920 if((delay->TPLL != TAS_NOTIME) && (delay->FLL != TAS_NOFRONT) && (delay->FLL != 0)){
5921 if(rcfdown){
5922 slope->FDOWN = delay->FLL;
5923 slope->PWLDN = NULL;
5924 stm_mod_driver( delay->FMLL, &slope->DRIVERDN.R, &slope->DRIVERDN.V );
5925 delay_down_min = delay->TPLL + d_in_down + rcll;
5926 if( delay->CARAC )
5927 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5928 rcfdown = 0;
5929 }else if(delay_down_min > delay->TPLL + d_in_down + rcll){
5930 slope->FDOWN = delay->FLL;
5931 slope->PWLDN = NULL;
5932 stm_mod_driver( delay->FMLL, &slope->DRIVERDN.R, &slope->DRIVERDN.V );
5933 delay_down_min = delay->TPLL + d_in_down + rcll;
5934 if( delay->CARAC )
5935 memcpy( &(carac->DW), &(delay->CARAC->DW), sizeof( output_carac_trans ) );
5936 }
5937 }
5938 }
5939 }
5940 cone->USER = addptype(cone->USER, TAS_DELAY_UP_MIN, (void*)delay_up_min);
5941 cone->USER = addptype(cone->USER, TAS_DELAY_DOWN_MIN, (void*)delay_down_min);
5942 }
5943 // printf("\ncone=%s delayupmax=%ld delaydownmax=%ld\n", cone->NAME, delay_up_max, delay_down_max);
5944 // printf("cone=%s delayupmin=%ld delaydownmin=%ld\n", cone->NAME, delay_up_min, delay_down_min);
5945 }
5946
5947 /*****************************************************************************
5948 * fonction tas_delaycone() *
5949 * fonction recursive de propagation des fronts *
5950 *****************************************************************************/
5951 #ifdef DELAY_DEBUG_STAT
5952 static int nbtot, nbcur;
5953 static long TM;
5954 #endif
5955 long tas_delaycone(ifl,cone,nbfront,counter)
5956 inffig_list *ifl;
5957 cone_list *cone ;
5958 long nbfront;
5959 long counter;
5960 {
5961 edge_list *edge ;
5962 ptype_list *ptype ;
5963
5964 if((cone->TYPE & (CNS_VSS|CNS_VDD|TAS_MARQUE)) != 0)
5965 return (nbfront);
5966
5967 if(((cone->TYPE & (CNS_LATCH|CNS_FLIP_FLOP|CNS_PRECHARGE)) != 0) && (counter > 10000))
5968 return (nbfront);
5969
5970 if(/*((cone->TYPE & (CNS_LATCH|CNS_FLIP_FLOP)) == 0) &&*/ !(getptype(cone->USER, TAS_CONE_MARQUE)))
5971 {
5972 for(edge = cone->INCONE ; edge != NULL ; edge = edge->NEXT)
5973 {
5974 if((edge->TYPE & (CNS_EXT | CNS_FEEDBACK | CNS_VDD | CNS_VSS | /*CNS_LOOP |*/
5975 /*CNS_COMMAND |*/ TAS_PATH_INOUT | CNS_BLEEDER)) == 0)
5976 {
5977 cone->USER = addptype(cone->USER, TAS_CONE_MARQUE, (void*)1) ;
5978 nbfront = tas_delaycone(ifl,edge->UEDGE.CONE,nbfront,counter+1) ;
5979 cone->USER = delptype(cone->USER,TAS_CONE_MARQUE) ;
5980 }
5981 else if((edge->TYPE & CNS_EXT) == CNS_EXT)
5982 {
5983 if((ptype = getptype(edge->UEDGE.LOCON->USER,CNS_EXT)) != NULL)
5984 {
5985 if(cone != (cone_list *)ptype->DATA){
5986 cone->USER = addptype(cone->USER, TAS_CONE_MARQUE, (void*)1) ;
5987 nbfront = tas_delaycone(ifl,(cone_list *)ptype->DATA,nbfront,counter+1) ;
5988 cone->USER = delptype(cone->USER,TAS_CONE_MARQUE) ;
5989 }
5990 }
5991 }
5992 }
5993 }
5994 /* else
5995 return (nbfront) ;*//* pour ne pas calculer 2 fois le meme cone */
5996
5997 if(TAS_CONTEXT->TAS_CALCRCX == 'Y')
5998 nbfront = tas_tprc_ext(ifl,cone,nbfront);
5999 tas_tpd(cone) ;
6000 if((cone->TYPE & TAS_CONE_BUF) == TAS_CONE_BUF)
6001 tas_buftoinv(cone) ;
6002 if((TAS_CONTEXT->TAS_DELAY_PROP == 'N') && (TAS_CONTEXT->TAS_NO_PROP == 'N') && ((cone->TYPE & (TAS_BYPASSIN|TAS_BYPASSOUT)) == 0))
6003 tas_updateslope(cone);
6004 else if((TAS_CONTEXT->TAS_NO_PROP == 'N') && ((cone->TYPE & (TAS_BYPASSIN|TAS_BYPASSOUT)) == 0))
6005 tas_updatedelay(cone);
6006 if(TAS_CONTEXT->TAS_CALCRCX == 'Y')
6007 nbfront = tas_tprc_cone(ifl,cone, nbfront);
6008 cone->TYPE |= TAS_MARQUE;
6009
6010 tas_clean_carac_cone( cone );
6011 #ifdef DELAY_DEBUG_STAT
6012 nbcur++;
6013 mbk_DisplayProgress(&TM, "delaycone:", nbcur, nbtot, ' ');
6014 #endif
6015 return(nbfront) ;
6016 }
6017
6018 /*****************************************************************************
6019 * fonction tas_scm2tables() *
6020 *****************************************************************************/
6021 void tas_scm2tables(timing_cell *cell, edge_list *input, ht *htd, ht *hts, delay_list *delay, front_list *slope, float capa)
6022 {
6023 timing_model *tmodels, *tmodeld, *tmodelscm;
6024 char *scmname;
6025 float slew;
6026
6027 if(delay->TMHL){
6028 if(!slope) slew = -1.0;
6029 else slew = slope->FUP/TTV_UNIT;
6030 tmodeld = (timing_model*)gethtitem(htd, delay->TMHL->NAME);
6031 tmodels = (timing_model*)gethtitem(hts, delay->FMHL->NAME);
6032 if((long)tmodeld != EMPTYHT)
6033 delay->TMHL = tmodeld;
6034 else{
6035 scmname = delay->TMHL->NAME;
6036 tmodelscm = delay->TMHL;
6037 tmodels = stm_mod_duplicate(tmodelscm->NAME, tmodelscm);
6038 stm_mod_defaultstm2tbl_slew (tmodels, STM_NOTYPE, STM_NOTYPE, slew, capa);
6039 stm_storemodel(cell->NAME, NULL, tmodels, 0);
6040 stm_addreferences(cell->NAME, tmodels->NAME, stm_getreferences(cell->NAME, tmodelscm->NAME) - 1);
6041 tmodeld = stm_mod_duplicate(tmodelscm->NAME, tmodelscm);
6042 stm_mod_defaultstm2tbl_delay (tmodeld, STM_NOTYPE, STM_NOTYPE, slew, capa);
6043 stm_storemodel(cell->NAME, NULL, tmodeld, 0);
6044 stm_addreferences(cell->NAME, tmodeld->NAME, stm_getreferences(cell->NAME, tmodelscm->NAME) - 1);
6045 addhtitem(htd, scmname, (long)tmodeld);
6046 addhtitem(hts, scmname, (long)tmodels);
6047 delay->TMHL = tmodeld;
6048 }
6049 delay->FMHL = tmodels;
6050 }
6051 if(delay->TMLH){
6052 if(!slope) slew = -1.0;
6053 else slew = slope->FDOWN/TTV_UNIT;
6054 tmodeld = (timing_model*)gethtitem(htd, delay->TMLH->NAME);
6055 tmodels = (timing_model*)gethtitem(hts, delay->FMLH->NAME);
6056 if((long)tmodeld != EMPTYHT)
6057 delay->TMLH = tmodeld;
6058 else{
6059 scmname = delay->TMLH->NAME;
6060 tmodelscm = delay->TMLH;
6061 tmodels = stm_mod_duplicate(tmodelscm->NAME, tmodelscm);
6062 stm_mod_defaultstm2tbl_slew (tmodels, STM_NOTYPE, STM_NOTYPE, slew, capa);
6063 stm_storemodel(cell->NAME, NULL, tmodels, 0);
6064 stm_addreferences(cell->NAME, tmodels->NAME, stm_getreferences(cell->NAME, tmodelscm->NAME) - 1);
6065 tmodeld = stm_mod_duplicate(tmodelscm->NAME, tmodelscm);
6066 stm_mod_defaultstm2tbl_delay (tmodeld, STM_NOTYPE, STM_NOTYPE, slew, capa);
6067 stm_storemodel(cell->NAME, NULL, tmodeld, 0);
6068 stm_addreferences(cell->NAME, tmodeld->NAME, stm_getreferences(cell->NAME, tmodelscm->NAME) - 1);
6069 addhtitem(htd, scmname, (long)tmodeld);
6070 addhtitem(hts, scmname, (long)tmodels);
6071 delay->TMLH = tmodeld;
6072 }
6073 delay->FMLH = tmodels;
6074 }
6075 if(delay->TMLL){
6076 if(!slope) slew = -1.0;
6077 else slew = slope->FDOWN/TTV_UNIT;
6078 tmodeld = (timing_model*)gethtitem(htd, delay->TMLL->NAME);
6079 tmodels = (timing_model*)gethtitem(hts, delay->FMLL->NAME);
6080 if((long)tmodeld != EMPTYHT)
6081 delay->TMLL = tmodeld;
6082 else{
6083 scmname = delay->TMLL->NAME;
6084 tmodelscm = delay->TMLL;
6085 tmodels = stm_mod_duplicate(tmodelscm->NAME, tmodelscm);
6086 stm_mod_defaultstm2tbl_slew (tmodels, STM_NOTYPE, STM_NOTYPE, slew, capa);
6087 stm_storemodel(cell->NAME, NULL, tmodels, 0);
6088 stm_addreferences(cell->NAME, tmodels->NAME, stm_getreferences(cell->NAME, tmodelscm->NAME) - 1);
6089 tmodeld = stm_mod_duplicate(tmodelscm->NAME, tmodelscm);
6090 stm_mod_defaultstm2tbl_delay (tmodeld, STM_NOTYPE, STM_NOTYPE, slew, capa);
6091 stm_storemodel(cell->NAME, NULL, tmodeld, 0);
6092 stm_addreferences(cell->NAME, tmodeld->NAME, stm_getreferences(cell->NAME, tmodelscm->NAME) - 1);
6093 addhtitem(htd, scmname, (long)tmodeld);
6094 addhtitem(hts, scmname, (long)tmodels);
6095 delay->TMLL = tmodeld;
6096 }
6097 delay->FMLL = tmodels;
6098 }
6099 if(delay->TMHH){
6100 if(!slope) slew = -1.0;
6101 else slew = slope->FUP/TTV_UNIT;
6102 tmodeld = (timing_model*)gethtitem(htd, delay->TMHH->NAME);
6103 tmodels = (timing_model*)gethtitem(hts, delay->FMHH->NAME);
6104 if((long)tmodeld != EMPTYHT)
6105 delay->TMHH = tmodeld;
6106 else{
6107 scmname = delay->TMHH->NAME;
6108 tmodelscm = delay->TMHH;
6109 tmodels = stm_mod_duplicate(tmodelscm->NAME, tmodelscm);
6110 stm_mod_defaultstm2tbl_slew (tmodels, STM_NOTYPE, STM_NOTYPE, slew, capa);
6111 stm_storemodel(cell->NAME, NULL, tmodels, 0);
6112 stm_addreferences(cell->NAME, tmodels->NAME, stm_getreferences(cell->NAME, tmodelscm->NAME) - 1);
6113 tmodeld = stm_mod_duplicate(tmodelscm->NAME, tmodelscm);
6114 stm_mod_defaultstm2tbl_delay (tmodeld, STM_NOTYPE, STM_NOTYPE, slew, capa);
6115 stm_storemodel(cell->NAME, NULL, tmodeld, 0);
6116 stm_addreferences(cell->NAME, tmodeld->NAME, stm_getreferences(cell->NAME, tmodelscm->NAME) - 1);
6117 addhtitem(htd, scmname, (long)tmodeld);
6118 addhtitem(hts, scmname, (long)tmodels);
6119 delay->TMHH = tmodeld;
6120 }
6121 delay->FMHH = tmodels;
6122 }
6123 #ifndef __ALL__WARNING__
6124 input = NULL;
6125 #endif
6126 }
6127
6128 /*****************************************************************************
6129 * fonction tas_timing() *
6130 * depart du calcul des fronts et des temps elementaires *
6131 *****************************************************************************/
6132 int tas_timing(cnsfig,lofig,ttvfig)
6133 cnsfig_list *cnsfig ;
6134 lofig_list *lofig ;
6135 ttvfig_list *ttvfig ;
6136 {
6137 front_list *slope ;
6138 cone_list *cone ;
6139 chain_list *modelchain;
6140 timing_cell *cell;
6141 ht *htd, *hts;
6142 edge_list *input;
6143 timing_model *tmodel;
6144 delay_list *delay;
6145 ptype_list *ptype;
6146 long nbfront ;
6147 inffig_list *ifl;
6148 //long nbcone = 0, n_cone = 0 ;
6149
6150 mbk_comcheck( 0, cns_signcns(cnsfig), 0 );
6151
6152 if( V_BOOL_TAB[ __AVT_NEW_SWITCH_MODEL ].VALUE && TAS_CONTEXT->TAS_DELAY_SWITCH != 'N' ) {
6153 avt_errmsg( TAS_ERRMSG, "026", AVT_WARNING );
6154 }
6155
6156 if( V_BOOL_TAB[ __AVT_HACK_NETLIST ].VALUE ) {
6157
6158 printf( "starting the hack of the netlist %s\n", TAS_CONTEXT->TAS_LOFIG->NAME );
6159 mccHackNetlist( TAS_CONTEXT->TAS_LOFIG );
6160 printf( "hacked netlist drived !\n" );
6161 }
6162
6163 #ifdef DELAY_DEBUG_STAT
6164 mbk_debugstat(NULL,1);
6165 #endif
6166
6167 tas_newname(NULL,1);
6168 CELL = cnsfig->NAME ;
6169 if(TAS_CONTEXT->TAS_VALID_SCM != 'Y')
6170 stm_addcell (CELL) ;
6171
6172 ifl=getloadedinffig(cnsfig->NAME);
6173
6174 tas_DetectConeConnect(cnsfig) ;
6175 tas_prelink(cnsfig) ;
6176
6177 tas_add_disable_gate_delay(cnsfig);
6178
6179 if(TAS_CONTEXT->TAS_CAPARAPREC != 0.0) {
6180 tas_capara(cnsfig);
6181 }
6182
6183 if(TAS_CONTEXT->TAS_DIF_LATCH != 'Y')
6184 tas_StuckAt(cnsfig) ;
6185
6186 if(TAS_CONTEXT->TAS_DIF_LATCH == 'Y')
6187 tas_DifLatch(cnsfig) ;
6188
6189 avt_log (LOGTAS, 2, "TIMING FOR SLOPE AND TPxx\n");
6190 avt_log (LOGTAS, 2, "1ST STEP PRE-TREATMENT & SLOPE\n");
6191
6192 #ifdef DELAY_DEBUG_STAT
6193 mbk_debugstat(" pre(detect+prelk+capara+stuck+difl):",0);
6194 #endif
6195
6196 tas_flatrcx(lofig,cnsfig,ttvfig) ;
6197
6198 #ifdef DELAY_DEBUG_STAT
6199 mbk_debugstat(" flatrcx:",0);
6200 #endif
6201
6202 //for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT) nbcone++;
6203 tas_AffectConnectorsInputSlew (ifl, cnsfig);
6204
6205 for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT)
6206 {
6207 //if (!((nbcone / ++n_cone) % 10)) fprintf (stdout, "%ld p.cent done\n", nbcone / n_cone);
6208
6209 if((getptype(cone->USER,CNS_PARALLEL)) != NULL) tas_para(cone) ;
6210 if((getptype(cone->USER,CNS_SWITCH)) != NULL) tas_switch_cmos(cone) ;
6211 if((getptype(cone->USER,CNS_SWITCH)) != NULL) tas_addptype_switch_cmos(cone) ;
6212
6213 res_branche(cone) ;
6214
6215 clas_branche(cone) ;
6216
6217 front(cone) ;
6218
6219 slope = (front_list *)((getptype(cone->USER, TAS_SLOPE_MAX))->DATA) ;
6220
6221 avt_log (LOGTAS, 3, " Slope for cone %ld '%s' FUP = ", cone->INDEX, cone->NAME) ;
6222 if(slope->FUP == TAS_NOFRONT)
6223 avt_log (LOGTAS, 3, "NOFRONT ") ;
6224 else
6225 avt_log (LOGTAS, 3, "%ld ",slope->FUP) ;
6226 avt_log (LOGTAS, 3, "FDOWN = ") ;
6227 if(slope->FDOWN == TAS_NOFRONT)
6228 avt_log (LOGTAS, 3, "NOFRONT\n") ;
6229 else
6230 avt_log (LOGTAS, 3, "%ld\n",slope->FDOWN) ;
6231 }
6232
6233 #ifdef DELAY_DEBUG_STAT
6234 mbk_debugstat(" cone loop:",0);
6235 #endif
6236
6237 if(TAS_CONTEXT->TAS_CAPARAPREC != 0.0)
6238 for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT)
6239 tas_caparabl(cone) ;
6240
6241 #ifdef DELAY_DEBUG_STAT
6242 mbk_debugstat(" caparabl:",0);
6243 #endif
6244
6245 interface(cnsfig) ;
6246
6247 if (TAS_CONTEXT->TAS_CARAC == 'Y')
6248 tas_AffectCaracCon (cnsfig) ;
6249
6250 if(TAS_CONTEXT->TAS_CALCRCX == 'Y')
6251 tas_calc_not_func(cnsfig) ;
6252
6253 avt_log (LOGTAS, 2, "2ND STEP TPxx\n") ;
6254 avt_log (LOGTAS, 2, "\n") ;
6255
6256 tas_detectbuf(cnsfig) ;
6257
6258 #ifdef DELAY_DEBUG_STAT
6259 mbk_debugstat(" interf+affec+notfunc+detect:",0);
6260 #endif
6261
6262 for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT)
6263 cone->TYPE &= ~(TAS_MARQUE) ;
6264
6265 #ifdef DELAY_DEBUG_STAT
6266 nbtot=countchain((chain_list *)cnsfig->CONE);
6267 nbcur=0;
6268 TM=0;
6269 #endif
6270
6271 nbfront = 0 ;
6272 for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT)
6273 {
6274 if((cone->TYPE & TAS_MARQUE) == TAS_MARQUE)
6275 continue ;
6276 nbfront = tas_delaycone(ifl, cone,nbfront,0) ;
6277 }
6278
6279 #ifdef DELAY_DEBUG_STAT
6280 mbk_DisplayProgress(&TM, "delaycone:", nbcur, nbtot, 'e');
6281 #endif
6282
6283 for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT){
6284 cone->TYPE &= ~(TAS_MARQUE);
6285 if(getptype(cone->USER, TAS_DELAY_UP_MAX))
6286 cone->USER = delptype(cone->USER, TAS_DELAY_UP_MAX);
6287 if(getptype(cone->USER, TAS_DELAY_DOWN_MAX))
6288 cone->USER = delptype(cone->USER, TAS_DELAY_DOWN_MAX);
6289 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y'){
6290 if(getptype(cone->USER, TAS_DELAY_UP_MIN))
6291 cone->USER = delptype(cone->USER, TAS_DELAY_UP_MIN);
6292 if(getptype(cone->USER, TAS_DELAY_DOWN_MIN))
6293 cone->USER = delptype(cone->USER, TAS_DELAY_DOWN_MIN);
6294 }
6295 }
6296
6297 if( V_BOOL_TAB[__TAS_MODEL_MEMSYM].VALUE )
6298 tas_modelmemsym(cnsfig) ;
6299
6300 #ifdef DELAY_DEBUG_STAT
6301 mbk_debugstat(" delaycone+loop2+detectmemsym:",0);
6302 #endif
6303
6304 if((TAS_CONTEXT->TAS_MERGERCN == 'Y') && (TAS_CONTEXT->TAS_CALCRCX == 'Y'))
6305 tas_mergercdelay(cnsfig) ;
6306
6307 tas_cleanloconin(cnsfig) ;
6308
6309 #ifdef DELAY_DEBUG_STAT
6310 mbk_debugstat(" mergerc+cleancon:",0);
6311 #endif
6312
6313 tasdebuglotrs();
6314
6315 if(TAS_CONTEXT->TAS_CARACMODE == TAS_LUT_CPL){
6316 htd = addht(100);
6317 hts = addht(100);
6318 cell = stm_getcell(cnsfig->NAME) ;
6319 for(cone = cnsfig->CONE ; cone != NULL ; cone = cone->NEXT){
6320 input = cone->INCONE;
6321 while (input){
6322 char *namein = NULL;
6323 char *nameout = NULL;
6324 float capa;
6325 front_list *slope = NULL;
6326
6327 if((input->TYPE & CNS_CONE)==CNS_CONE){
6328 if((input->UEDGE.CONE->TYPE & CNS_EXT)==CNS_EXT){
6329 namein = input->UEDGE.CONE->NAME;
6330 }
6331 }else if((input->TYPE & CNS_EXT)==CNS_EXT){
6332 namein = input->UEDGE.LOCON->NAME;
6333 }
6334 if((cone->TYPE & CNS_EXT)==CNS_EXT){
6335 nameout = cone->NAME;
6336 capa = -1.0;
6337 }else{
6338 capa = tas_getcapai(cone);
6339 }
6340 /* if(namein || nameout)
6341 stm_addaxisvalues(TTV_HTSLOPE_AXIS, TTV_HTCAPA_AXIS, namein, nameout);
6342 */
6343 ptype = getptype(input->USER, TAS_DELAY_MAX);
6344 if(ptype){
6345 delay = (delay_list*)ptype->DATA;
6346 if(!namein){
6347 if((input->TYPE & CNS_CONE)==CNS_CONE){
6348 slope = (front_list *)getptype(input->UEDGE.CONE->USER,TAS_SLOPE_MAX)->DATA;
6349 }
6350 }
6351 tas_scm2tables(cell, input, htd, hts, delay, slope, capa);
6352 }
6353 if(TAS_CONTEXT->TAS_FIND_MIN == 'Y'){
6354 ptype = getptype(input->USER, TAS_DELAY_MIN);
6355 if(ptype){
6356 delay = (delay_list*)ptype->DATA;
6357 if(!namein){
6358 if((input->TYPE & CNS_CONE)==CNS_CONE){
6359 slope = (front_list *)getptype(input->UEDGE.CONE->USER,TAS_SLOPE_MIN)->DATA;
6360 }
6361 }
6362 tas_scm2tables(cell, input, htd, hts, delay, slope, capa);
6363 }
6364 }
6365 input = input->NEXT;
6366 /* if(namein || nameout)
6367 stm_delaxisvalues();*/
6368 }
6369 }
6370 delht(htd);
6371 delht(hts);
6372 if(cell->MODEL_LIST != NULL){
6373 for(modelchain = dupchainlst(cell->MODEL_LIST); modelchain; modelchain = modelchain->NEXT){
6374 tmodel = (timing_model*)modelchain->DATA;
6375 if(tmodel->UTYPE == STM_MOD_MODSCM)
6376 stm_cell_delmodel (cell, tmodel, 1);
6377 }
6378 }
6379 }
6380
6381 #ifdef DELAY_DEBUG_STAT
6382 mbk_debugstat(" lutcpl:",0);
6383 #endif
6384
6385 tas_rssfig( cnsfig );
6386
6387 #ifdef DELAY_DEBUG_STAT
6388 mbk_debugstat(" rssfig:",0);
6389 #endif
6390
6391 if((TAS_CONTEXT->TAS_RC_FILE != NULL))
6392 tas_drivrcfile(cnsfig) ;
6393
6394 #ifdef DELAY_DEBUG_STAT
6395 mbk_debugstat(" drive:",0);
6396 #endif
6397
6398 return(0);
6399 }
6400
6401 void tasdebuglotrs()
6402 {
6403 lotrs_list *lotrs ;
6404 char *ptname ;
6405 float vb, vs ;
6406 float vddmax ;
6407 int vb_valid ;
6408
6409 if( V_STR_TAB[ __TAS_DEBUG_LOTRS ].VALUE ) {
6410 ptname = namefind(V_STR_TAB[ __TAS_DEBUG_LOTRS ].VALUE) ;
6411
6412 if( ptname ) {
6413
6414 for( lotrs = TAS_CONTEXT->TAS_LOFIG->LOTRS ; lotrs ; lotrs = lotrs->NEXT ) {
6415
6416 if( lotrs->TRNAME == ptname ) {
6417
6418 vddmax = tas_getparam( lotrs, TAS_CASE, TP_VDDmax);
6419
6420 vb_valid = 0 ;
6421 if( lotrs->BULK && lotrs->BULK->SIG) {
6422 if( getlosigalim( lotrs->BULK->SIG, &vb) )
6423 vb_valid=1;
6424 }
6425 if( !vb_valid ) {
6426 if( (lotrs->TYPE & CNS_TP) == CNS_TP)
6427 vb = vddmax ;
6428 else
6429 vb = 0.0;
6430 }
6431 if( (lotrs->TYPE & CNS_TP) == CNS_TP)
6432 vs = vddmax ;
6433 else
6434 vs = 0.0 ;
6435
6436 tpiv_carac_static( lotrs, vddmax, vddmax, vddmax, vb, vs );
6437 }
6438 }
6439 }
6440 }
6441 }
6442
6443 /*****************************************************************************
6444 * Fonctions de mémorisation temporaire des caractéristiques de sortie *
6445 * d'une porte. *
6446 *****************************************************************************/
6447
6448 int TAS_NB_OUTPUT_CARAC = 0;
6449
6450 void tas_set_output_carac( output_carac **ptcarac,
6451 timing_model *tmodel,
6452 char transition,
6453 char lmodel,
6454 double r,
6455 double c1,
6456 double c2,
6457 double slope
6458 )
6459 {
6460 output_carac *carac ;
6461
6462 if( *ptcarac )
6463 carac = *ptcarac ;
6464 else {
6465 carac = tas_alloc_output_carac();
6466 *ptcarac = carac ;
6467 }
6468
6469
6470 if( transition == 'U' ) {
6471 carac->UP.VALID = 1 ;
6472 carac->UP.R = r ;
6473 carac->UP.C1 = c1 ;
6474 carac->UP.C2 = c2 ;
6475 carac->UP.MODEL = lmodel ;
6476 carac->UP.VT = stm_mod_vt(tmodel);
6477 carac->UP.VF = stm_mod_vf(tmodel);
6478 carac->UP.VDD = stm_mod_vdd(tmodel);
6479 carac->UP.VSAT = stm_mod_vsat(tmodel);
6480 carac->UP.RLIN = stm_mod_rlin(tmodel);
6481 carac->UP.VTH = stm_mod_vth(tmodel);
6482 carac->UP.SLOPE = slope;
6483 }
6484 else {
6485 carac->DW.VALID = 1 ;
6486 carac->DW.R = r ;
6487 carac->DW.C1 = c1 ;
6488 carac->DW.C2 = c2 ;
6489 carac->DW.MODEL = lmodel ;
6490 carac->DW.VT = stm_mod_vt(tmodel);
6491 carac->DW.VF = stm_mod_vf(tmodel);
6492 carac->DW.VDD = stm_mod_vdd(tmodel);
6493 carac->DW.VSAT = stm_mod_vsat(tmodel);
6494 carac->DW.RLIN = stm_mod_rlin(tmodel);
6495 carac->DW.VTH = stm_mod_vth(tmodel);
6496 carac->DW.SLOPE = slope;
6497 }
6498
6499 }
6500
6501 int tas_get_output_carac( cone_list *cone,
6502 char type,
6503 char trans,
6504 output_carac_trans *infos
6505 )
6506 {
6507 ptype_list *ptl = NULL ;
6508 output_carac_trans *r = NULL ;
6509 int ret ;
6510 output_carac *carac ;
6511
6512 if( cone ) {
6513 if( type == 'm' )
6514 ptl = getptype( cone->USER, TAS_OUT_CARAC_MIN ) ;
6515
6516 if( type == 'M' )
6517 ptl = getptype( cone->USER, TAS_OUT_CARAC_MAX ) ;
6518 }
6519
6520 if( ptl ) {
6521
6522 carac = (output_carac*)ptl->DATA ;
6523
6524 if( trans == 'U' ) {
6525 if( carac->UP.VALID ) {
6526 r = &(carac->UP);
6527 }
6528 }
6529
6530 if( trans == 'D' ) {
6531 if( carac->DW.VALID ) {
6532 r = &(carac->DW);
6533 }
6534 }
6535
6536 }
6537
6538 if( r ) {
6539 memcpy( infos, r, sizeof( output_carac_trans ) );
6540 ret = 1 ;
6541 }
6542 else {
6543 if( trans == 'U' ) {
6544 infos->VT = STM_DEFAULT_VTN ;
6545 infos->VF = V_FLOAT_TAB[__SIM_POWER_SUPPLY].VALUE ;
6546 }
6547 else {
6548 infos->VT = STM_DEFAULT_VTP ;
6549 infos->VF = 0.0 ;
6550 }
6551 infos->VTH = V_FLOAT_TAB[__SIM_VTH].VALUE * V_FLOAT_TAB[__SIM_POWER_SUPPLY].VALUE;
6552 infos->VDD = V_FLOAT_TAB[__SIM_POWER_SUPPLY].VALUE ;
6553 infos->VSAT = -1.0 ;
6554 infos->RLIN = -1.0 ;
6555 infos->MODEL = 0 ;
6556 infos->R = -1.0 ;
6557 infos->C1 = -1.0 ;
6558 infos->C2 = -1.0 ;
6559 infos->SLOPE = stm_thr2scm (STM_DEF_SLEW, STM_DEFAULT_SMINR, STM_DEFAULT_SMAXR, STM_DEFAULT_VTN, V_FLOAT_TAB[__SIM_POWER_SUPPLY].VALUE, V_FLOAT_TAB[__SIM_POWER_SUPPLY].VALUE, STM_UP);
6560 infos->VALID = 1 ;
6561 ret = 0 ;
6562
6563 }
6564
6565 return ret ;
6566 }
6567
6568 output_carac* tas_alloc_output_carac()
6569 {
6570 output_carac *carac ;
6571 carac = (output_carac*) mbkalloc( sizeof( output_carac ) );
6572 TAS_NB_OUTPUT_CARAC++;
6573 carac->UP.VALID = 0 ;
6574 carac->DW.VALID = 0 ;
6575 return carac ;
6576 }
6577
6578 void tas_clean_carac_cone( cone_list *cone )
6579 {
6580 edge_list *edge ;
6581 delay_list *delay ;
6582 output_carac *carac ;
6583 ptype_list *ptl ;
6584
6585 for(edge = cone->INCONE ; edge != NULL ; edge = edge->NEXT){
6586 ptl = getptype(edge->USER,TAS_DELAY_MIN);
6587 if( ptl ) {
6588 delay = (delay_list *)ptl->DATA;
6589 if( delay ) {
6590 if( delay->CARAC ) {
6591 mbkfree( delay->CARAC );
6592 delay->CARAC = NULL ;
6593 }
6594 }
6595 }
6596 ptl = getptype(edge->USER,TAS_DELAY_MAX);
6597 if( ptl ) {
6598 delay = (delay_list *)ptl->DATA;
6599 if( delay ) {
6600 if( delay->CARAC ) {
6601 mbkfree( delay->CARAC );
6602 delay->CARAC = NULL ;
6603 }
6604 }
6605 }
6606 }
6607 ptl = getptype( cone->USER, TAS_OUT_CARAC_MIN );
6608 if( ptl ) {
6609 carac = (output_carac*)ptl->DATA ;
6610 mbkfree(carac);
6611 cone->USER = delptype( cone->USER, TAS_OUT_CARAC_MIN );
6612 }
6613 ptl = getptype( cone->USER, TAS_OUT_CARAC_MAX );
6614 if( ptl ) {
6615 carac = (output_carac*)ptl->DATA ;
6616 mbkfree(carac);
6617 cone->USER = delptype( cone->USER, TAS_OUT_CARAC_MAX );
6618 }
6619 }