25 #define API_USE_REAL_TYPES
26 #include "../ttv/ttv_API_LOCAL.h"
28 #include "../ttv/ttv_API_display.h"
29 #include "../ttv/ttv_API_util.h"
30 #include "stb_LOCAL.h"
32 #include "../../tas/stb/stb_transfer.h"
33 #include "../../tas/stb/stb_util.h"
34 #define SETUP_SLOPE_INFO 0xfab70124
35 #define SETUP_SLOPE_SOURCE 0xfab70125
42 } setup_slope_info_phase
;
47 setup_slope_info_phase
*ssip
;
50 static setup_slope_info
*stb_get_setup_slope_info(ttvevent_list
*tve
)
53 if ((pt
=getptype(tve
->USER
, SETUP_SLOPE_INFO
))!=NULL
) return (setup_slope_info
*)pt
->DATA
;
57 static setup_slope_info
*stb_give_setup_slope_info(ttvevent_list
*tve
, int nbphase
)
59 setup_slope_info
*ssi
;
61 if ((ssi
=stb_get_setup_slope_info(tve
))!=NULL
) return ssi
;
62 ssi
=(setup_slope_info
*)mbkalloc(sizeof(setup_slope_info
));
63 ssi
->ssip
=(setup_slope_info_phase
*)mbkalloc(sizeof(setup_slope_info_phase
)*nbphase
);
65 for (i
=0; i
<nbphase
; i
++)
67 ssi
->ssip
[i
].setup_slope
=ssi
->ssip
[i
].setup_slope_hz
=TTV_NOTIME
;
70 ssi
->worst_slack
=TTV_NOTIME
;
71 tve
->USER
=addptype(tve
->USER
, SETUP_SLOPE_INFO
, ssi
);
75 static void stb_delete_setup_slope_info(ttvevent_list
*tve
)
77 setup_slope_info
*ssi
;
78 if ((ssi
=stb_get_setup_slope_info(tve
))!=NULL
)
82 tve
->USER
=delptype(tve
->USER
, SETUP_SLOPE_INFO
);
87 void stb_propagate_setup_slope (stbfig_list
*stbfig
, ttvevent_list
*event
)
90 ttvevent_list
*inevent
, *cmdmax
;
98 int hz
, newstartslope
, i
, slopesource
, sourcechanged
;
99 setup_slope_info
*ssi
, *outssi
;
102 if((node
= stb_getstbnode (event
)) == NULL
)
105 if ((stbfig
->STABILITYMODE
& STB_STABILITY_LAST
) == STB_STABILITY_LAST
)
106 level
= stbfig
->FIG
->INFO
->LEVEL
;
108 level
= event
->ROOT
->ROOT
->INFO
->LEVEL
;
110 if (stbfig
->GRAPH
== STB_RED_GRAPH
)
112 ttv_expfigsig (stbfig
->FIG
, event
->ROOT
, level
, stbfig
->FIG
->INFO
->LEVEL
,
113 TTV_STS_CL_PJT
, TTV_FILE_TTX
);
114 line
= event
->INPATH
;
118 ttv_expfigsig (stbfig
->FIG
, event
->ROOT
, level
, stbfig
->FIG
->INFO
->LEVEL
,
119 TTV_STS_CLS_FED
, TTV_FILE_DTX
);
120 line
= event
->INLINE
;
123 if (stb_get_setup_slope_info(event
)!=NULL
) sourcechanged
=1; else sourcechanged
=0;
124 outssi
=stb_give_setup_slope_info(event
, node
->NBINDEX
);
126 for (; line
; line
= line
->NEXT
)
128 if (((line
->TYPE
& TTV_LINE_CONT
) == TTV_LINE_CONT
) ||
129 (((line
->TYPE
& (TTV_LINE_D
| TTV_LINE_T
)) != 0) &&
130 (line
->FIG
!= stbfig
->FIG
)) ||
131 (((line
->TYPE
& (TTV_LINE_P
| TTV_LINE_F
)) != 0) &&
132 (line
->FIG
!= stbfig
->FIG
) &&
133 ((stbfig
->STABILITYMODE
& STB_STABILITY_LAST
) == STB_STABILITY_LAST
)))
136 if ((line
->TYPE
& TTV_LINE_HZ
)!=0) hz
=1; else hz
=0;
138 inevent
= line
->NODE
;
139 delaymin
= ttv_getdelaymin (line
);
140 delaymax
= ttv_getdelaymax (line
);
141 if (delaymin
== TTV_NOTIME
) delaymin
= delaymax
;
142 if (delaymax
== TTV_NOTIME
) delaymax
= delaymin
;
145 ssi
=stb_give_setup_slope_info(inevent
, node
->NBINDEX
);
147 if (getptype(inevent
->USER
, SETUP_SLOPE_SOURCE
)!=NULL
) slopesource
=1; else slopesource
=0;
149 for (ck
=node
->CK
; node
->CK
==NULL
|| ck
!=NULL
; ck
=ck
->NEXT
)
151 if(ck
!= NULL
&& ck
->CMD
!=NULL
)
153 cmdmax
= ttv_getlinecmd(stbfig
->FIG
, line
, TTV_LINE_CMDMAX
) ;
154 if(ck
->CMD
!= cmdmax
) continue ;
156 // if (!stb_checkvalidcommand(event, ck)) continue;
159 slope
=stb_getsetupslope(stbfig
, node
, ck
, hz
, &phase
);
160 if (slope
!=TTV_NOTIME
&& phase
!=STB_NO_INDEX
)
165 for (i
=0; i
<node
->NBINDEX
; i
++) outssi
->ssip
[i
].setup_slope
=ssi
->ssip
[i
].setup_slope_hz
=TTV_NOTIME
;
166 outssi
->worst_slack
=TTV_NOTIME
;
169 if (getptype(event
->USER
, SETUP_SLOPE_SOURCE
)==NULL
)
170 event
->USER
=addptype(event
->USER
, SETUP_SLOPE_SOURCE
, NULL
);
172 if (!hz
) pslope
=&outssi
->ssip
[(int)phase
].setup_slope
; else pslope
=&outssi
->ssip
[(int)phase
].setup_slope_hz
;
173 if (*pslope
==TTV_NOTIME
|| *pslope
>slope
)
176 outssi
->ssip
[(int)phase
].period
=ck
!=NULL
?ck
->PERIOD
:0;
177 outssi
->ssip
[(int)phase
].ck
=ck
;
179 outssi
->worst_slack
=node
->SETUP
!=STB_NO_TIME
?node
->SETUP
:TTV_NOTIME
;
184 if (ssi
->ssip
[(int)phase
].setup_slope
==TTV_NOTIME
|| ssi
->ssip
[(int)phase
].setup_slope
>slope
)
186 ssi
->ssip
[(int)phase
].setup_slope
=slope
;
187 ssi
->ssip
[(int)phase
].period
=ck
!=NULL
?ck
->PERIOD
:0;
188 ssi
->ssip
[(int)phase
].ck
=NULL
;
190 if (ssi
->worst_slack
==TTV_NOTIME
|| ssi
->worst_slack
>outssi
->worst_slack
)
191 ssi
->worst_slack
=outssi
->worst_slack
;
197 if ((slope
=stb_get_directive_setup_slope(stbfig
, node
, &phase
, &period
, 0))!=TTV_NOTIME
)
202 for (i
=0; i
<node
->NBINDEX
; i
++) outssi
->ssip
[i
].setup_slope
=ssi
->ssip
[i
].setup_slope_hz
=TTV_NOTIME
;
205 if (getptype(event
->USER
, SETUP_SLOPE_SOURCE
)==NULL
)
206 event
->USER
=addptype(event
->USER
, SETUP_SLOPE_SOURCE
, NULL
);
207 if (outssi
->ssip
[(int)phase
].setup_slope
==TTV_NOTIME
|| outssi
->ssip
[(int)phase
].setup_slope
>slope
)
209 outssi
->ssip
[(int)phase
].setup_slope
=slope
;
210 outssi
->ssip
[(int)phase
].period
=period
;
211 outssi
->ssip
[(int)phase
].ck
=NULL
;
216 if (slopesource
==0 && (ssi
->ssip
[(int)phase
].setup_slope
==TTV_NOTIME
|| ssi
->ssip
[(int)phase
].setup_slope
>slope
))
218 ssi
->ssip
[(int)phase
].setup_slope
=slope
;
219 ssi
->ssip
[(int)phase
].period
=period
;
220 ssi
->ssip
[(int)phase
].ck
=NULL
;
224 if (!newstartslope
&& !slopesource
)
226 for (i
=0; i
<node
->NBINDEX
; i
++)
228 if (outssi
->ssip
[i
].setup_slope
!=TTV_NOTIME
)
230 slope
=outssi
->ssip
[i
].setup_slope
-delaymax
;
231 if (ssi
->ssip
[i
].setup_slope
==TTV_NOTIME
|| ssi
->ssip
[i
].setup_slope
>slope
)
233 ssi
->ssip
[i
].setup_slope
=slope
;
234 ssi
->ssip
[i
].period
=outssi
->ssip
[i
].period
;
235 ssi
->ssip
[i
].ck
=NULL
;
237 if (ssi
->worst_slack
==TTV_NOTIME
|| ssi
->worst_slack
>outssi
->worst_slack
)
238 ssi
->worst_slack
=outssi
->worst_slack
;
245 static void stb_getstab(stbfig_list
*stbfig
, stbnode
*node
, stbpair_list
**STBTAB
, stbpair_list
**STBHZ
, stbck
*ck
)
249 for (i
=0; i
<node
->NBINDEX
; i
++) STBHZ
[i
]=NULL
, STBTAB
[i
]=NULL
;
251 stb_transferstbline (stbfig
, node
->EVENT
, node
, STBTAB
, STBHZ
, 0, 1, NULL
, ck
, 1, STB_TRANSFERT_NOFILTERING
|STB_TRANSFERT_NOPHASECHANGE
) ;
256 long stb_computelocalmargin(stbfig_list
*stbfig
, ttvevent_list
*tve
, FILE *f
)
259 setup_slope_info
*ssi
;
261 long period
, setup_margin
=TTV_NOTIME
, val
;
262 stbpair_list
*STBTAB
[256], *STBHZ
[256], *pair
, *pairhz
;
263 stbdomain_list
*ptdomain
;
265 if((node
= stb_getstbnode (tve
)) == NULL
) return TTV_NOTIME
;
267 // qq heursistique reportee ici pour coller
268 if ((tve
->ROOT
->TYPE
& TTV_SIG_R
)!=0)
270 if (V_INT_TAB
[__STB__PRECHARGE_DATA_HEURISTIC
].VALUE
==2 && (tve
->TYPE
& TTV_NODE_UP
)!=0)
274 if ((ssi
=stb_get_setup_slope_info(tve
))!=NULL
)
276 for (i
=0; i
<node
->NBINDEX
; i
++)
278 for (j
=0; j
<node
->NBINDEX
; j
++)
280 ptdomain
= stb_getstbdomain(stbfig
->CKDOMAIN
, j
) ;
282 if (i
>=ptdomain
->CKMIN
&& i
<=ptdomain
->CKMAX
)
284 stb_getstab(stbfig
, node
, STBTAB
, STBHZ
, ssi
->ssip
[j
].ck
);
285 for (pair
=STBTAB
[i
]; pair
!=NULL
&& pair
->NEXT
!=NULL
; pair
=pair
->NEXT
) ;
286 for (pairhz
=STBHZ
[i
]; pairhz
!=NULL
&& pairhz
->NEXT
!=NULL
; pairhz
=pairhz
->NEXT
) ;
288 if (stb_cmpphase(stbfig
, i
, j
)>0/*i>j*/)
289 period
=ssi
->ssip
[j
].period
;
292 if((stbfig
->STABILITYMODE
& STB_STABILITY_FF
) != 0)
293 period
=ssi
->ssip
[j
].period
;
294 else if((stbfig
->STABILITYMODE
& STB_STABILITY_LT
) != 0)
297 period
=ssi
->ssip
[j
].period
;
301 if (pair
!=NULL
&& ssi
->ssip
[j
].setup_slope
!=TTV_NOTIME
)
303 val
=ssi
->ssip
[j
].setup_slope
+period
-pair
->U
;
304 if (setup_margin
==TTV_NOTIME
|| val
<setup_margin
) setup_margin
=val
;
305 if (f
!=NULL
) fprintf(f
,"\t\t\t (%d->%d %ld+%ld-%ld=%ld) worst:%ld\n", i
, j
, ssi
->ssip
[j
].setup_slope
, period
, pair
->U
, val
, ssi
->worst_slack
);
307 if (pairhz
!=NULL
&& ssi
->ssip
[j
].setup_slope_hz
!=TTV_NOTIME
)
309 val
=ssi
->ssip
[j
].setup_slope_hz
+period
-pairhz
->U
;
310 if (setup_margin
==TTV_NOTIME
|| val
<setup_margin
) setup_margin
=val
;
311 if (f
!=NULL
) fprintf(f
,"\t\t\t (hz:%d->%d %ld+%ld-%ld=%ld) worst:%ld\n", i
, j
, ssi
->ssip
[j
].setup_slope_hz
, period
, pairhz
->U
, val
, ssi
->worst_slack
);
313 if (setup_margin
!=TTV_NOTIME
&& setup_margin
<ssi
->worst_slack
)
315 setup_margin
=ssi
->worst_slack
;
316 if (f
!=NULL
) fprintf(f
,"\t\t *CAPPED %ld*\n", setup_margin
);
319 stb_freestbtabpair(STBHZ
, node
->NBINDEX
);
320 stb_freestbtabpair(STBTAB
, node
->NBINDEX
);
331 void stb_compute_local_margins(stbfig_list
*stbfig
)
335 setup_slope_info
*ssi
;
336 ttvevent_list
*tve
, *maxtve
=NULL
;
339 long val
, min
=TTV_NOTIME
, max
=TTV_NOTIME
, val1
;
341 if (stbfig
==NULL
) {printf("stb_compute_local_margins: NULL stbfig\n");return;}
342 stbfig
->NODE
= reverse(stbfig
->NODE
);
343 for (cl
=stbfig
->NODE
; cl
!=NULL
; cl
=cl
->NEXT
) stb_delete_setup_slope_info((ttvevent_list
*)cl
->DATA
);
344 for (cl
=stbfig
->NODE
; cl
!=NULL
; cl
=cl
->NEXT
) stb_propagate_setup_slope(stbfig
, (ttvevent_list
*)cl
->DATA
);
346 for (cl
=stbfig
->NODE
; cl
!=NULL
; cl
=cl
->NEXT
)
348 tve
=(ttvevent_list
*)cl
->DATA
;
349 tve
->USER
=testanddelptype(tve
->USER
, SETUP_SLOPE_SOURCE
);
352 f
=fopen("test.log","wt");
353 for (cl
=stbfig
->NODE
; cl
!=NULL
; cl
=cl
->NEXT
)
355 tve
=(ttvevent_list
*)cl
->DATA
;
356 node
=stb_getstbnode(tve
);
357 ssi
=stb_get_setup_slope_info(tve
);
360 if ((tve
->ROOT
->TYPE
& TTV_SIG_L
)!=0)
362 else if ((tve
->ROOT
->TYPE
& TTV_SIG_R
)!=0)
366 fprintf(f
, "%20s %20s (%c) ", tve
->ROOT
->NETNAME
, tve
->ROOT
->NAME
, (tve
->TYPE
& TTV_NODE_UP
)?'R':'F');
367 if (ssi
->worst_slack
!=TTV_NOTIME
) fprintf(f
, " worst=%ld", ssi
->worst_slack
);
369 for (i
=0; i
<node
->NBINDEX
; i
++)
371 if (ssi
->ssip
[i
].setup_slope
!=TTV_NOTIME
)
372 fprintf(f
," (%d: %ld %ld)", i
, ssi
->ssip
[i
].setup_slope
, ssi
->ssip
[i
].period
);
375 val
=stb_computelocalmargin(stbfig
, tve
, f
);
376 if (node
->SETUP
!=STB_NO_TIME
&& val
!=node
->SETUP
)
377 fprintf(f
, " *** FAILED orig: %ld != %ld ***\n", node
->SETUP
,val
);
378 if ((tve
->TYPE
& TTV_NODE_UP
)!=0 && ttv_isgateoutput(stbfig
->FIG
, tve
->ROOT
, TTV_FILE_DTX
))
380 val1
=stb_computelocalmargin(stbfig
, tve
->ROOT
->NODE
, NULL
);
381 if (val1
!=TTV_NOTIME
&& val1
<val
) val
=val1
;
384 if (min
==TTV_NOTIME
|| val
<min
) min
=val
;
385 if (max
==TTV_NOTIME
|| val
>max
)
388 if ((tve
->ROOT
->TYPE
& TTV_SIG_L
)==0)
390 if (ttv_testsigflag(tve
->ROOT
, TTV_SIG_FLAGS_ISSLAVE
)==0
391 && ttv_testsigflag(tve
->ROOT
, TTV_SIG_FLAGS_ISMASTER
)==0)
410 #define NB_CTRL_POINT 7
412 f
=fopen("histo.log","wt");
417 int nbs
, nbm
, nbctrl
;
426 fprintf(f
, "* min=%.1f max=%.1f (%s)\n", min
/TTV_UNIT
, max
/TTV_UNIT
, maxtve
?maxtve
->ROOT
->NAME
:"?");
428 b
=Board_CreateBoard();
429 Board_SetSize(b
, RANGE_MIN
, 7, DISPLAY_number_justify
);
430 Board_SetSize(b
, RANGE_MAX
, 7, DISPLAY_number_justify
);
431 Board_SetSize(b
, SIG_NUMBER
, 7, DISPLAY_number_justify
);
432 Board_SetSize(b
, SIG_POURC
, 7, DISPLAY_number_justify
);
433 Board_SetSize(b
, NB_MASTER
, 7, DISPLAY_number_justify
);
434 Board_SetSize(b
, NB_SLAVE
, 7, DISPLAY_number_justify
);
435 Board_SetSize(b
, NB_CTRL_POINT
, 7, DISPLAY_number_justify
);
438 Board_SetValue(b
, RANGE_MIN
, "éRange");
439 Board_SetValue(b
, RANGE_MAX
, "è");
443 Board_SetValue(b
, RANGE_MIN
, "Min");
444 Board_SetValue(b
, RANGE_MAX
, "Max");
445 Board_SetValue(b
, SIG_NUMBER
, "# Gates");
446 Board_SetValue(b
, SIG_POURC
, "% Gates");
447 Board_SetValue(b
, NB_MASTER
, "# Masters");
448 Board_SetValue(b
, NB_SLAVE
, "# Slaves");
449 Board_SetValue(b
, NB_CTRL_POINT
, "# CTRLPoints");
451 Board_NewSeparation(b
);
453 /* if (abs(min)>abs(max)) min=-abs(min), max=abs(min);
454 else min=-abs(max), max=abs(max);*/
455 step
=(MAX
)/(float)(max
-min
);
456 for (i
=0; i
<MAX
; i
++) nb
[i
].nb
=0, nb
[i
].nbs
=0, nb
[i
].nbm
=0, nb
[i
].nbctrl
=0;
457 for (cl
=stbfig
->NODE
; cl
!=NULL
; cl
=cl
->NEXT
)
459 tve
=(ttvevent_list
*)cl
->DATA
;
460 if ((tve
->TYPE
& TTV_NODE_UP
)!=0 && ttv_isgateoutput(stbfig
->FIG
, tve
->ROOT
, TTV_FILE_DTX
))
462 val
=stb_computelocalmargin(stbfig
, tve
, NULL
);
463 val1
=stb_computelocalmargin(stbfig
, tve
->ROOT
->NODE
, NULL
);
464 if (val1
!=TTV_NOTIME
&& val1
<val
) val
=val1
;
467 idx
=(int)(step
*(float)(val
-min
));
469 if (idx
>=MAX
) idx
=MAX
-1;
473 if (stb_getstbnode(tve
)->SETUP
!=STB_NO_TIME
|| stb_getstbnode(tve
->ROOT
->NODE
)->SETUP
!=STB_NO_TIME
) nb
[idx
].nbctrl
++;
475 if (ttv_testsigflag(tve
->ROOT
, TTV_SIG_FLAGS_ISSLAVE
)!=0) nb
[idx
].nbs
++;
476 if (ttv_testsigflag(tve
->ROOT
, TTV_SIG_FLAGS_ISMASTER
)!=0) nb
[idx
].nbm
++;
480 for (i
=0; i
<MAX
&& nb
[i
].nb
==0; i
++) ;
481 for (j
=MAX
-1; j
>=0 && nb
[i
].nb
==0; j
--) ;
486 Board_SetValue(b
, RANGE_MIN
, FormaT(_LONG_TO_DOUBLE(min
+i
/step
)*DISPLAY_time_unit
, buf
, DISPLAY_time_format
));
487 Board_SetValue(b
, RANGE_MAX
, FormaT(_LONG_TO_DOUBLE(min
+(i
+1)/step
)*DISPLAY_time_unit
, buf
, DISPLAY_time_format
));
488 sprintf(buf
, "%d", nb
[i
].nb
);
489 Board_SetValue(b
, SIG_NUMBER
, buf
);
490 sprintf(buf
, "%.1f%%", nb
[i
].nb
*100.0/tot
);
491 Board_SetValue(b
, SIG_POURC
, buf
);
492 sprintf(buf
, "%d", nb
[i
].nbm
);
493 Board_SetValue(b
, NB_MASTER
, buf
);
494 sprintf(buf
, "%d", nb
[i
].nbs
);
495 Board_SetValue(b
, NB_SLAVE
, buf
);
496 sprintf(buf
, "%d", nb
[i
].nbctrl
);
497 Board_SetValue(b
, NB_CTRL_POINT
, buf
);
499 // fprintf(f, "%.1f - %.1f : %d (%.1f%%) / s=%d m=%d\n", (min+i*(max-min)/MAX)/TTV_UNIT, (min+(i+1)*(max-min)/MAX)/TTV_UNIT, nb[i].nb, nb[i].nb*100.0/tot, nb[i].nbs, nb[i].nbm);
502 Board_Display(f
, b
, "");
508 stbfig
->NODE
= reverse(stbfig
->NODE
);
512 #define TEMPMARK_SOURCE 0xfab70411
514 static void stb_find_stb_path (stbfig_list
*stbfig
, ttvevent_list
*event
, ttvevent_list
*prev
, long time
)
517 ttvevent_list
*inevent
;
522 char phase
=STB_NO_INDEX
;
526 if((node
= stb_getstbnode (event
)) == NULL
)
529 if ((stbfig
->STABILITYMODE
& STB_STABILITY_LAST
) == STB_STABILITY_LAST
)
530 level
= stbfig
->FIG
->INFO
->LEVEL
;
532 level
= event
->ROOT
->ROOT
->INFO
->LEVEL
;
534 if (stbfig
->GRAPH
== STB_RED_GRAPH
)
536 ttv_expfigsig (stbfig
->FIG
, event
->ROOT
, level
, stbfig
->FIG
->INFO
->LEVEL
,
537 TTV_STS_CL_PJT
, TTV_FILE_TTX
);
538 line
= event
->INPATH
;
542 ttv_expfigsig (stbfig
->FIG
, event
->ROOT
, level
, stbfig
->FIG
->INFO
->LEVEL
,
543 TTV_STS_CLS_FED
, TTV_FILE_DTX
);
544 line
= event
->INLINE
;
547 for (i
=0; i
<node
->NBINDEX
; i
++)
549 sp
=stb_globalstbpair (node
->STBTAB
[i
]);
552 if (time
==sp
->U
) { phase
=i
; break; }
557 if (phase
==STB_NO_INDEX
) return;
559 if (event
->ROOT
->TYPE
& TTV_SIG_L
) f
='L';
560 else if (event
->ROOT
->TYPE
& TTV_SIG_R
) f
='P';
562 fprintf(stdout
,"found '%s %s(%c)' (%c) at %ld phase %d\n", event
->ROOT
->NAME
, event
->ROOT
->NETNAME
, event
->TYPE
& TTV_NODE_UP
?'R':'F', f
, time
, phase
);
564 if (prev
!=NULL
&& (event
->ROOT
->TYPE
& (TTV_SIG_L
|TTV_SIG_R
))!=0) return;
565 if (getptype(event
->USER
, TEMPMARK_SOURCE
)!=NULL
) return;
566 event
->USER
=addptype(event
->USER
, TEMPMARK_SOURCE
, NULL
);
567 for (; line
; line
= line
->NEXT
)
569 if (((line
->TYPE
& TTV_LINE_CONT
) == TTV_LINE_CONT
) ||
570 (((line
->TYPE
& (TTV_LINE_D
| TTV_LINE_T
)) != 0) &&
571 (line
->FIG
!= stbfig
->FIG
)) ||
572 (((line
->TYPE
& (TTV_LINE_P
| TTV_LINE_F
)) != 0) &&
573 (line
->FIG
!= stbfig
->FIG
) &&
574 ((stbfig
->STABILITYMODE
& STB_STABILITY_LAST
) == STB_STABILITY_LAST
)))
577 if ((line
->TYPE
& TTV_LINE_HZ
)!=0) continue; //hz=1; else hz=0;
579 inevent
= line
->NODE
;
580 delaymin
= ttv_getdelaymin (line
);
581 delaymax
= ttv_getdelaymax (line
);
582 if (delaymin
== TTV_NOTIME
) delaymin
= delaymax
;
583 if (delaymax
== TTV_NOTIME
) delaymax
= delaymin
;
586 stb_find_stb_path (stbfig
, inevent
, event
, time
-delaymax
);
588 event
->USER
=delptype(event
->USER
, TEMPMARK_SOURCE
);
591 void stb_trackstbpath (stbfig_list
*stbfig
, char *nodename
, char dir
, double timeo
)
599 cl
=addchain(NULL
, namealloc(nodename
));
601 ch
= ttv_getsigbytype_and_netname(stbfig
->FIG
,NULL
,TTV_SIG_TYPEALL
,cl
) ;
604 time
=mbk_long_round(timeo
*1e12
*TTV_UNIT
);
605 if (tolower(dir
)=='r' || tolower(dir
)=='u') num
=1;
606 else if (tolower(dir
)=='f' || tolower(dir
)=='d') num
=0;
607 else {printf("direction %c invalide\n",dir
);return;}
611 tvs
=(ttvsig_list
*)ch
->DATA
;
612 stb_find_stb_path (stbfig
, &tvs
->NODE
[num
], NULL
, time
);
613 fprintf(stdout
,"------------\n");