4 #define TTV_PROPAGATE_IF_DIFFERENT 1
5 //#define TTV_PROPAGATE_IF_DIFFERENT 2
6 #define SAMESLOPELIMIT 0.01
8 long TTV_PROPAGATE_FORCED_SLOPE
=TTV_NOTIME
;
9 float TTV_PROPAGATE_FORCED_CAPA
=-1;
10 static int TTV_STOP_AFTER_GATE_1
=0, useheap
=0;
12 typedef struct propagate_cache
14 struct propagate_cache
*next
;
17 long res_slope
, res_delay
;
20 static HeapAlloc propagate_heap
;
22 static inline int ttv_get_propagate_cache_delay_slope(ttvline_list
*tl
, long slope
, float capa
, long *res_slope
, long *res_delay
)
28 if ((pt
=getptype(tl
->USER
, TTV_NODE_PROPINFO_CACHE
))==NULL
) return 0;
29 pc
=(propagate_cache
*)pt
->DATA
;
30 while (pc
!=NULL
&& (pc
->slope
!=slope
|| pc
->capa
!=capa
)) pc
=pc
->next
;
33 *res_slope
=pc
->res_slope
;
34 *res_delay
=pc
->res_delay
;
41 static inline void ttv_add_propagate_cache_delay_slope(ttvline_list
*tl
, long slope
, float capa
, long res_slope
, long res_delay
)
47 if ((pt
=getptype(tl
->USER
, TTV_NODE_PROPINFO_CACHE
))==NULL
)
48 pt
=tl
->USER
=addptype(tl
->USER
, TTV_NODE_PROPINFO_CACHE
, NULL
);
50 npc
=(propagate_cache
*)AddHeapItem(&propagate_heap
);
53 npc
->res_slope
=res_slope
;
54 npc
->res_delay
=res_delay
;
55 npc
->next
=(propagate_cache
*)pt
->DATA
;
61 void ttv_experim_setstopaftergate1(int val
)
63 TTV_STOP_AFTER_GATE_1
=val
;
66 ttvline_list
*ttv_CreateContactLine(ttvevent_list
*node
, ttvevent_list
*root
)
69 tvl
=(ttvline_list
*)mbkalloc(sizeof(ttvline_list
));
77 static void initprop(ttvpropinfo_list
*prop
, long slope
)
86 prop
->REF
->SLEW
=slope
;
92 static ttvpropinfo_list
*createpropinfo(ttvevent_list
*a
, int usectk
)
94 ttvpropinfo_list
*prop
;
95 prop
=(ttvpropinfo_list
*)mbkalloc(sizeof(ttvpropinfo_list
)); //<= par heap
97 prop
->CTK
.SLEW
=TTV_NOSLOPE
;
98 prop
->CTK
.DELAY
=TTV_NOTIME
;
102 prop
->CTK
.RDRIVER
=-1;
106 prop
->REF
=(ttv_onepropinfo
*)mbkalloc(sizeof(ttv_onepropinfo
));
108 prop
->REF
->SLEW
=TTV_NOSLOPE
;
109 prop
->REF
->DELAY
=TTV_NOTIME
;
113 prop
->REF
->RDRIVER
=-1;
118 a
->USER
=addptype(a
->USER
, TTV_NODE_PROPINFO
, prop
);
122 ttvpropinfo_list
*ttv_get_prop_info(ttvevent_list
*node
)
125 if ((pt
=getptype(node
->USER
, TTV_NODE_PROPINFO
))!=NULL
)
126 return (ttvpropinfo_list
*)pt
->DATA
;
130 ttvpropinfo_list
*givepropinfo(ttvevent_list
*a
, int usectk
)
132 ttvpropinfo_list
*prop
;
134 if ((prop
=ttv_get_prop_info(a
))!=NULL
)
137 return createpropinfo(a
, usectk
);
140 static void cleanpropinfo(ttvevent_list
*a
)
143 ttvpropinfo_list
*prop
;
145 if ((pt
=getptype(a
->USER
, TTV_NODE_PROPINFO
))!=NULL
)
147 prop
=(ttvpropinfo_list
*)pt
->DATA
;
153 a
->USER
=delptype(a
->USER
, TTV_NODE_PROPINFO
);
157 static int ttv_sameslope(long a
, long b
)
160 if (a
==TTV_NOSLOPE
|| b
==TTV_NOSLOPE
) return 0;
163 if (((float)diff)/b>SAMESLOPELIMIT || ((float)diff)/a>SAMESLOPELIMIT) return 0;
168 void ttv_RecomputeLineDelayAndSlope(ttvfig_list
*tvf
, ttvline_list
*line
, ttvpropinfo_list
*input0
, ttvpropinfo_list
*output0
, float capa
, long type
, int doref
)
170 timing_model
*modelmin
, *modelmax
;
171 float vtmin
=0, vtmax
=0 ;
172 float vfmin
=0, vfmax
=0 ;
173 float vfrcmin
=0, vfrcmax
=0 ;
174 float vddmin
=0, vddmax
=0 ;
175 float vthmin
=0, vthmax
=0 ;
176 long *dmin1
= NULL
, *fmin1
= NULL
, *dmax1
= NULL
, *fmax1
= NULL
;
177 stm_pwl
**fmin1_pwl
= NULL
, **fmax1_pwl
= NULL
;
178 double *rmin
=NULL
, *c1min
=NULL
, *c2min
=NULL
, vsatmin
=-1, rlinmin
=-1 ;
179 double *rmax
=NULL
, *c1max
=NULL
, *c2max
=NULL
, vsatmax
=-1, rlinmax
=-1 ;
180 double r
=0, c1
=0, c2
=0;
183 stm_pwl
*pwlmin
=NULL
, *pwlmax
=NULL
;
185 ttvline_list
*previous_line
=input0
->PREVIOUS_LINE
;
186 ttv_onepropinfo
*input
, *output
;
187 float *nrjmin
= NULL
,*nrjmax
= NULL
;
192 input
=input0
->REF
, output
=output0
->REF
;
196 input
=&input0
->CTK
, output
=&output0
->CTK
;
199 if (type
& TTV_FIND_MIN
)
203 dmin1
=&output
->DELAY
;
205 if (0/*V_BOOL_TAB[__STM_USE_MSC].VALUE*/)
206 fmin1_pwl
=&output
->PWL
;
212 *rmin
= input
->RDRIVER
;
213 *c1min
= 1000.0*input
->CAPA
;
214 nrjmin
= &output
->ENERGY
;
220 dmax1
=&output
->DELAY
;
222 if (0/*V_BOOL_TAB[__STM_USE_MSC].VALUE*/)
223 fmax1_pwl
=&output
->PWL
;
229 *rmax
= input
->RDRIVER
;
230 *c1max
= 1000.0*input
->CAPA
;
231 nrjmax
= &output
->ENERGY
;
237 if((line
->TYPE
& TTV_LINE_RC
) == TTV_LINE_RC
)
239 if (type
& TTV_FIND_MIN
)
242 modelmin
= stm_getmodel(previous_line
->FIG
->INFO
->FIGNAME
,previous_line
->MDMIN
) ;
243 vtmin
= stm_mod_vt(modelmin
);
244 vfmin
= stm_mod_vf(modelmin
);
245 vthmin
= stm_mod_vth(modelmin
);
246 vddmin
= stm_mod_vdd(modelmin
);
249 vsatmin
= stm_mod_vsat(modelmin
);
250 rlinmin
= stm_mod_rlin(modelmin
);
256 modelmax
= stm_getmodel(previous_line
->FIG
->INFO
->FIGNAME
,previous_line
->MDMAX
) ;
257 vtmax
= stm_mod_vt(modelmax
);
258 vfmax
= stm_mod_vf(modelmax
);
259 vthmax
= stm_mod_vth(modelmax
);
260 vddmax
= stm_mod_vdd(modelmax
);
263 vsatmax
= stm_mod_vsat(modelmax
);
264 rlinmax
= stm_mod_rlin(modelmax
);
267 if (modelmax
==NULL
&& modelmin
==NULL
&& (line
->NODE
->ROOT
->TYPE
& TTV_SIG_C
)!=0)
270 ttv_get_signal_swing(tvf
, line
->NODE
->ROOT
, &low
, &high
);
277 r
=input
->R
; c1
=input
->C1
; c2
=input
->C2
;
279 if((line
->ROOT
->TYPE
& TTV_NODE_UP
) == TTV_NODE_UP
)
291 ttv_calclinedelayslope(line
,smin
,smax
,pwlmin
,pwlmax
,vtmin
,vtmax
,vfrcmin
,vfrcmax
,vddmin
,vddmax
,vthmin
,vthmax
,capa
,dmin1
,fmin1
,fmin1_pwl
,dmax1
,fmax1
,fmax1_pwl
,0,vsatmin
,rlinmin
,rmin
,c1min
,c2min
,vsatmax
,rlinmax
,rmax
,c1max
,c2max
,NULL
,NULL
);
294 output
->RDRIVER
= input
->RDRIVER
;
295 output
->CAPA
= input
->CAPA
;
296 output
->ENERGY
= 0.0;
300 if (type
& TTV_FIND_MIN
)
302 modelmin
= stm_getmodel(line
->FIG
->INFO
->FIGNAME
,line
->MDMIN
) ;
303 vtmin
= stm_mod_vt(modelmin
);
304 vfmin
= stm_mod_vf(modelmin
);
305 vthmin
= stm_mod_vth(modelmin
);
306 vddmin
= stm_mod_vdd(modelmin
);
310 modelmax
= stm_getmodel(line
->FIG
->INFO
->FIGNAME
,line
->MDMAX
) ;
311 vtmax
= stm_mod_vt(modelmax
);
312 vfmax
= stm_mod_vf(modelmax
);
313 vthmax
= stm_mod_vth(modelmax
);
314 vddmax
= stm_mod_vdd(modelmax
);
317 lofig
= ttv_getrcxlofig( line
->ROOT
->ROOT
->ROOT
) ;
320 locon
= rcx_gethtrcxcon( NULL
, lofig
, line
->ROOT
->ROOT
->NAME
) ;
323 rcx_rcnload_reset( locon
->SIG
);
327 ttv_calclinedelayslope(line
,smin
,smax
,pwlmin
,pwlmax
,vtmin
,vtmax
,vfrcmin
,vfrcmax
,vddmin
,vddmax
,vthmin
,vthmax
,capa
,dmin1
,fmin1
,fmin1_pwl
,dmax1
,fmax1
,fmax1_pwl
,0,vsatmin
,rlinmin
,rmin
,c1min
,c2min
,vsatmax
,rlinmax
,rmax
,c1max
,c2max
,nrjmin
,nrjmax
);
332 if (type
& TTV_FIND_MIN
)
334 modelmin
= stm_getmodel(line
->FIG
->INFO
->FIGNAME
,line
->MDMIN
) ;
335 output
->RDRIVER
= stm_mod_rlin( modelmin
);
339 modelmax
= stm_getmodel(line
->FIG
->INFO
->FIGNAME
,line
->MDMAX
) ;
340 output
->RDRIVER
= stm_mod_rlin( modelmax
);
344 if( r
> 0.0 && c2
> 0.0 )
345 output
->CAPA
= c1
+c2
;
350 static int mustpropagate_tmalike(ttvline_list
*prevline
, chain_list
*cur
, chain_list
*start
)
352 ttvline_list
*curl
, *nextl
;
353 if (cur
==start
|| (cur
==start
->NEXT
&& (prevline
->TYPE
& TTV_LINE_RC
) == TTV_LINE_RC
)) return 1;
354 curl
=(ttvline_list
*)cur
->DATA
;
355 if (cur
->NEXT
==NULL
&& (curl
->ROOT
->ROOT
->TYPE
& (TTV_SIG_N
|TTV_SIG_C
)) != 0) return 1;
356 if (cur
->NEXT
!=NULL
&& cur
->NEXT
->NEXT
==NULL
)
358 nextl
=(ttvline_list
*)cur
->NEXT
->DATA
;
359 if ((nextl
->TYPE
& TTV_LINE_RC
) == TTV_LINE_RC
&& (nextl
->ROOT
->ROOT
->TYPE
& (TTV_SIG_N
|TTV_SIG_C
)) != 0) return 1;
364 static inline int ttvprop_islastgaterc(chain_list
*cl
)
366 ttvline_list
*curl
, *nextl
;
367 if (cl
->NEXT
==NULL
) return 1;
368 if (cl
->NEXT
->NEXT
!=NULL
) return 0;
369 nextl
=(ttvline_list
*)cl
->NEXT
->DATA
;
370 if ((nextl
->TYPE
& TTV_LINE_RC
) != TTV_LINE_RC
) return 0;
374 long ttv_RecomputeLineChain(ttvfig_list
*tvf
, ttvfig_list
*tvi
, chain_list
*ordered_line_list
, long inputSLEW
, long *outputSLEW
, float *energy
, float capa
, long type
, long mode
, int doref
)
378 ttvpropinfo_list
*res
;
379 ttvevent_list
*startnode
;
381 ttvpropinfo_list
*input
=NULL
;
382 long totaldelay
=0, totaldelayref
=0, outdelay
, oldslope
, justlast
=0, val
;
383 ttvline_list
*prevline
;
384 stbfig_list
*sf
=NULL
;
385 ctk_exchange ctkinfo
;
386 int lastmode
, trig
=0;
388 if ((type
& TTV_FIND_ACCESS
)==0) trig
=1;
392 if (doref
) sf
=stb_getstbfig(tvf
);
394 if (ordered_line_list
==NULL
) { *outputSLEW
=0; return 0; }
396 if ((mode
& TTV_PROPAGATE_IF_DIFFERENT
)!=0) doref
=0;
399 for (cl
=ordered_line_list
; cl
!=NULL
; cl
=cl
->NEXT
)
401 tl
=(ttvline_list
*)cl
->DATA
;
404 input
=givepropinfo(tl
->NODE
, doref
);
405 if ((mode
& TTV_PROPAGATE_IF_DIFFERENT
)!=0 && ttv_sameslope(input
->CTK
.SLEW
, inputSLEW
)) justlast
=1;
406 initprop(input
, inputSLEW
);
409 if (prevline
!=NULL
&& prevline
->FIG
==NULL
) prevline
=NULL
; // contact line
410 input
->PREVIOUS_LINE
=prevline
;
412 res
=givepropinfo(tl
->ROOT
, doref
); //?
416 if (cl
!=ordered_line_list
&& prevline
==NULL
) // pas d'access
418 ttv_getnodeslope(tvf
,tvi
,tl
->ROOT
,&oldslope
,type
);
419 initprop(input
, oldslope
);
421 if((tl
->ROOT
->ROOT
->TYPE
& (TTV_SIG_N
|TTV_SIG_C
)) != 0
422 && (cl
->NEXT
==NULL
|| (cl
->NEXT
->NEXT
==NULL
&& (((ttvline_list
*)cl
->NEXT
->DATA
)->TYPE
& TTV_LINE_RC
)!=0))
428 thiscapa
=ttv_get_signal_output_capacitance(tvf
, tl
->ROOT
->ROOT
);
433 oldslope
=res
->CTK
.SLEW
;
435 if (justlast
==0 || (justlast
==1 && ttvprop_islastgaterc(cl
)))
437 if (doref
&& sf
!=NULL
)
439 lastmode
=rcx_crosstalkactive(RCX_MILLER
); //?
440 if((tl
->TYPE
& TTV_LINE_RC
) == TTV_LINE_RC
)
441 stb_set_ctk_information(sf
, tl
->NODE
, type
, &ctkinfo
);
443 stb_set_ctk_information(sf
, tl
->ROOT
, type
, &ctkinfo
);
445 if (TTV_STOP_AFTER_GATE_1
&& !mustpropagate_tmalike(prevline
, cl
, ordered_line_list
))
447 if ((type
& TTV_FIND_MIN
)!=0)
448 res
->CTK
.DELAY
=tl
->VALMIN
, res
->CTK
.SLEW
=tl
->FMIN
;
450 res
->CTK
.DELAY
=tl
->VALMAX
, res
->CTK
.SLEW
=tl
->FMAX
;
454 if (ttv_get_propagate_cache_delay_slope(tl
, input
->CTK
.SLEW
, thiscapa
, &res
->CTK
.SLEW
, &res
->CTK
.DELAY
)==0)
456 ttv_RecomputeLineDelayAndSlope(tvf
, tl
, input
, res
, thiscapa
, type
, 0);
457 ttv_add_propagate_cache_delay_slope(tl
, input
->CTK
.SLEW
, thiscapa
, res
->CTK
.SLEW
, res
->CTK
.DELAY
);
460 if (doref
&& sf
!=NULL
)
462 stb_release_ctk_information(&ctkinfo
);
463 rcx_crosstalkactive(lastmode
); // ?
468 lastmode
=rcx_crosstalkactive(RCX_NOCROSSTALK
);
469 if (TTV_STOP_AFTER_GATE_1
&& !mustpropagate_tmalike(prevline
, cl
, ordered_line_list
))
471 if ((type
& TTV_FIND_MIN
)!=0)
472 res
->REF
->DELAY
=tl
->VALMIN
, res
->REF
->SLEW
=tl
->FMIN
;
474 res
->REF
->DELAY
=tl
->VALMAX
, res
->REF
->SLEW
=tl
->FMAX
;
476 else ttv_RecomputeLineDelayAndSlope(tvf
, tl
, input
, res
, thiscapa
, type
, 1);
477 rcx_crosstalkactive(lastmode
);
480 if ((mode
& TTV_PROPAGATE_IF_DIFFERENT
)!=0 && ttv_sameslope(oldslope
, res
->CTK
.SLEW
)) justlast
=1;
482 if ((tl
->TYPE
& TTV_LINE_A
) != 0)
484 if ((val
=stb_gettruncatedaccess(tl
->ROOT
, tl
->NODE
, (type
& TTV_FIND_MAX
)==TTV_FIND_MAX
?1:0))!=TTV_NOTIME
)
486 if (res
->CTK
.DELAY
>val
) res
->CTK
.DELAY
=val
;
487 if (doref
&& res
->REF
->DELAY
>val
) res
->REF
->DELAY
=val
;
491 totaldelay
+=res
->CTK
.DELAY
;
492 if (doref
) totaldelayref
+=res
->REF
->DELAY
;
493 if (trig
==0 && (tl
->ROOT
->ROOT
->TYPE
& (TTV_SIG_L
|TTV_SIG_R
))!=0) trig
=1;
495 *energy
+= res
->CTK
.ENERGY
;
504 if ((mode
& TTV_PROPAGATE_IF_DIFFERENT
)==0)
506 if (0/*V_BOOL_TAB[__STM_USE_MSC].VALUE*/)
509 for (cl
=ordered_line_list
; cl
!=NULL
; cl
=cl
->NEXT
)
511 tl
=(ttvline_list
*)cl
->DATA
;
512 input
=givepropinfo(tl
->NODE
, doref
);
513 if (input
->CTK
.PWL
!=NULL
) stm_pwl_destroy(input
->CTK
.PWL
);
514 if (doref
&& input
->REF
->PWL
!=NULL
) stm_pwl_destroy(input
->REF
->PWL
);
516 if (ordered_line_list
!=NULL
&& ((ttvline_list
*)ordered_line_list
->DATA
)->NODE
!=tl
->ROOT
)
518 input
=givepropinfo(tl
->ROOT
, doref
);
519 if (input
->CTK
.PWL
!=NULL
) stm_pwl_destroy(input
->CTK
.PWL
);
520 if (doref
&& input
->REF
->PWL
!=NULL
) stm_pwl_destroy(input
->REF
->PWL
);
524 if ((type
& TTV_FIND_DUAL
)==TTV_FIND_DUAL
)
528 tl
=(ttvline_list
*)ordered_line_list
->DATA
;
529 input
=givepropinfo(tl
->NODE
, doref
);
530 for (cl
=ordered_line_list
; cl
!=NULL
; cl
=cl
->NEXT
)
532 tl
=(ttvline_list
*)cl
->DATA
;
533 input
->CTK
.FIND_DELAY
=totaldelay
;
534 res
=givepropinfo(tl
->ROOT
, doref
);
535 totaldelay
+=res
->CTK
.DELAY
;
538 input
->REF
->FIND_DELAY
=totaldelayref
;
539 totaldelayref
+=res
->REF
->DELAY
;
543 res
->CTK
.FIND_DELAY
=totaldelay
;
544 if (doref
) res
->REF
->FIND_DELAY
=totaldelayref
;
548 tl
=(ttvline_list
*)ordered_line_list
->DATA
;
550 input
=givepropinfo(tl
->NODE
, doref
);
552 for (cl
=ordered_line_list
; cl
!=NULL
; cl
=cl
->NEXT
)
554 tl
=(ttvline_list
*)cl
->DATA
;
555 input
->CTK
.FIND_DELAY
=totaldelay
;
556 res
=givepropinfo(tl
->ROOT
, doref
);
557 totaldelay
-=res
->CTK
.DELAY
;
560 input
->REF
->FIND_DELAY
=totaldelayref
;
561 totaldelayref
-=res
->REF
->DELAY
;
565 if (startnode
!=tl
->ROOT
)
567 res
->CTK
.FIND_DELAY
=totaldelay
; // 0 ?
568 if (doref
) res
->REF
->FIND_DELAY
=totaldelayref
;
572 *outputSLEW
=res
->CTK
.SLEW
;
576 void ttv_RecomputeCleanLineChain(chain_list
*ordered_line_list
)
581 for (cl
=ordered_line_list
; cl
!=NULL
; cl
=cl
->NEXT
)
583 tl
=(ttvline_list
*)cl
->DATA
;
584 cleanpropinfo(tl
->NODE
);
585 if (useheap
) tl
->USER
=testanddelptype(tl
->USER
, TTV_NODE_PROPINFO_CACHE
);
587 if (ordered_line_list
!=NULL
) cleanpropinfo(tl
->ROOT
);
590 void ttv_RecomputeFreeLineChain(chain_list
*ordered_line_list
)
594 for (cl
=ordered_line_list
; cl
!=NULL
; cl
=cl
->NEXT
)
596 tl
=(ttvline_list
*)cl
->DATA
;
597 if (tl
->FIG
==NULL
) mbkfree(tl
);
599 freechain(ordered_line_list
);
602 chain_list
*ttv_BuildLineList(ttvfig_list
*ttvfig
, ttvevent_list
*root
, ttvevent_list
*node
, long type
, int *doref
)
604 ttvevent_list
*nodex
;
606 chain_list
*line_list
;
612 if((type
& TTV_FIND_DUAL
) != TTV_FIND_DUAL
)
614 if((nodex
->FIND
->OUTLINE
== NULL
) &&
615 ((ptype
= getptype(nodex
->USER
,TTV_NODE_LATCH
)) != NULL
))
617 line_list
=addchain(line_list
, ttv_CreateContactLine(nodex
, (ttvevent_list
*)ptype
->DATA
));
618 nodex
= (ttvevent_list
*)ptype
->DATA
;
621 while(nodex
->FIND
->OUTLINE
!= NULL
)
623 line_list
=addchain(line_list
, nodex
->FIND
->OUTLINE
);
624 if (*doref
==0 && ttv_getlinedelay(nodex
->FIND
->OUTLINE
)!=NULL
) *doref
=1;
625 nodex
= nodex
->FIND
->OUTLINE
->ROOT
;
626 if((nodex
->FIND
->OUTLINE
== NULL
) &&
627 ((ptype
= getptype(nodex
->USER
,TTV_NODE_LATCH
)) != NULL
))
629 line_list
=addchain(line_list
, ttv_CreateContactLine(nodex
, (ttvevent_list
*)ptype
->DATA
));
630 nodex
= (ttvevent_list
*)ptype
->DATA
;
632 if(nodex
== root
) break ;
634 line_list
=reverse(line_list
);
638 while(nodex
->FIND
->OUTLINE
!= NULL
)
640 if (*doref
==0 && ttv_getlinedelay(nodex
->FIND
->OUTLINE
)!=NULL
) *doref
=1;
641 line_list
=addchain(line_list
, nodex
->FIND
->OUTLINE
);
642 nodex
= nodex
->FIND
->OUTLINE
->NODE
;
643 if(nodex
== root
) break ;
650 chain_list
*ttv_DoPropagation_PRECISION_LEVEL1(ttvfig_list
*tvf
, ttvfig_list
*tvi
, ttvevent_list
*node
, ttvevent_list
*root
, long type
)
652 chain_list
*line_list
;
657 if ((type
& TTV_FIND_PATH
)==TTV_FIND_PATH
) return NULL
;
659 line_list
=ttv_BuildLineList(tvf
, root
, node
, type
, &doref
);
661 if (TTV_PROPAGATE_FORCED_SLOPE
!=TTV_NOTIME
)
662 inslope
=TTV_PROPAGATE_FORCED_SLOPE
;
665 if ((type
& TTV_FIND_DUAL
)!=TTV_FIND_DUAL
)
666 ttv_getnodeslope(tvf
, tvi
, node
, &inslope
, type
);
668 ttv_getnodeslope(tvf
, tvi
, root
, &inslope
, type
);
671 ttv_RecomputeLineChain(tvf
, tvi
, line_list
, inslope
, &res
, &energy
, TTV_PROPAGATE_FORCED_CAPA
, type
, 0, doref
);
674 ttvpropinfo_list
*input
;
678 // if ((type & TTV_FIND_DUAL)!=TTV_FIND_DUAL)
679 input
=givepropinfo(node
, doref
);
681 input=givepropinfo(root, doref);*/
683 if ((type
& TTV_FIND_DUAL
)!=TTV_FIND_DUAL
)
684 n1
=node
->ROOT
->NAME
, n2
=root
->ROOT
->NAME
;
686 n1
=root
->ROOT
->NAME
, n2
=node
->ROOT
->NAME
;
687 line_list
=reverse(line_list
);
688 if ((type
& TTV_FIND_MIN
)!=0) oslop
=((ttvline_list
*)line_list
->DATA
)->FMIN
;
689 else oslop
=((ttvline_list
*)line_list
->DATA
)->FMAX
;
690 rat
=((float)(input
->CTK
.FIND_DELAY
-node
->FIND
->DELAY
))*100.0/node
->FIND
->DELAY
;
691 avt_fprintf(stderr
,"%s%s %s is:%ld od:%ld os:%ld -> od:%ld os:%ld (%+.1f%%)¤.\n",fabs(rat
)<5?"":fabs(rat
)<10?"¤4":"¤6", n1
, n2
, inslope
,node
->FIND
->DELAY
,oslop
,input
->CTK
.FIND_DELAY
,res
,rat
);
692 line_list
=reverse(line_list
);
698 void ttv_CleanPropagation_PRECISION_LEVEL1(chain_list
*line_list
)
700 ttv_RecomputeCleanLineChain(line_list
);
701 ttv_RecomputeFreeLineChain(line_list
);
704 long ttv_GET_FINDDELAY(ttvevent_list
*node
, int ref
)
706 ttvpropinfo_list
*propinfo
=NULL
;
708 if (V_INT_TAB
[__TTV_PRECISION_LEVEL
].VALUE
!=0)
709 propinfo
= ttv_get_prop_info(node
);
712 if (ref
&& propinfo
->REF
!=NULL
)
713 return(propinfo
->REF
->FIND_DELAY
);
714 return(propinfo
->CTK
.FIND_DELAY
);
716 return node
->FIND
->DELAY
;
719 long ttv_GET_LINE_DELAY(ttvline_list
*line
, long type
, int ref
)
721 ttvpropinfo_list
*propinfo
=NULL
;
724 if (V_INT_TAB
[__TTV_PRECISION_LEVEL
].VALUE
!=0)
725 propinfo
= ttv_get_prop_info(line
->ROOT
);
728 if (ref
&& propinfo
->REF
!=NULL
)
729 ret
=propinfo
->REF
->DELAY
;
731 ret
=propinfo
->CTK
.DELAY
;
734 if ((type
& TTV_FIND_MAX
) == TTV_FIND_MAX
)
739 if ((line
->TYPE
& TTV_LINE_A
) != 0)
741 if ((val
=stb_gettruncatedaccess(line
->ROOT
, line
->NODE
, (type
& TTV_FIND_MAX
)==TTV_FIND_MAX
?1:0))!=TTV_NOTIME
&& ret
>val
) ret
=val
;
746 long ttv_GET_LINE_SLEW(ttvline_list
*line
, long type
, int ref
)
748 ttvpropinfo_list
*propinfo
=NULL
;
750 if (V_INT_TAB
[__TTV_PRECISION_LEVEL
].VALUE
!=0)
751 propinfo
= ttv_get_prop_info(line
->ROOT
);
754 if (ref
&& propinfo
->REF
!=NULL
)
755 return(propinfo
->REF
->SLEW
);
756 return(propinfo
->CTK
.SLEW
);
758 if ((type
& TTV_FIND_MAX
) == TTV_FIND_MAX
)
764 void ttv_DoCharacPropagation(ttvfig_list
*tvf
, ttvfig_list
*tvi
, ttvevent_list
*node
, ttvevent_list
*root
, long type
, chain_list
*slope_list
, chain_list
*capa_list
, chain_list
**resd
, chain_list
**ress
, chain_list
**rese
, chain_list
*inputlinelist
)
766 chain_list
*line_list
;
767 long inslope
, res
, delay
, resen
;
769 chain_list
*slopes
, *capas
;
776 line_list
=inputlinelist
;
778 line_list
=ttv_BuildLineList(tvf
, root
, node
, type
, &doref
);
781 CreateHeap(sizeof(propagate_cache
), 1000, &propagate_heap
);
783 for (slopes
=slope_list
; slopes
!=NULL
; slopes
=slopes
->NEXT
)
785 inslope
=(long)slopes
->DATA
;
786 if (inslope
==TTV_NOTIME
)
788 if ((type
& TTV_FIND_DUAL
)!=TTV_FIND_DUAL
)
789 ttv_getnodeslope(tvf
, tvi
, node
, &inslope
, type
);
791 ttv_getnodeslope(tvf
, tvi
, root
, &inslope
, type
);
794 for (capas
=capa_list
; capas
!=NULL
; capas
=capas
->NEXT
)
796 capa
=*(float *)&capas
->DATA
;
797 delay
=ttv_RecomputeLineChain(tvf
, tvi
, line_list
, inslope
, &res
, (float*)&resen
, capa
, type
, TTV_PROPAGATE_IF_DIFFERENT
, doref
);
798 *resd
=addchain(*resd
, (void *)delay
);
799 *ress
=addchain(*ress
, (void *)res
);
800 if(( V_INT_TAB
[ __AVT_POWER_CALCULATION
].VALUE
== 1 )
801 ||( V_INT_TAB
[ __AVT_POWER_CALCULATION
].VALUE
== 5 )){
802 *rese
=addchain(*rese
, (void *)resen
);
807 DeleteHeap(&propagate_heap
);
808 ttv_RecomputeCleanLineChain(line_list
);
809 ttv_RecomputeFreeLineChain(line_list
);
810 *resd
=reverse(*resd
);
811 *ress
=reverse(*ress
);
812 *rese
=reverse(*rese
);