1 /******************************************************************************/
3 /* Chaine de CAO & VLSI AVERTEC */
5 /* Produit : TLF Version 1.00 */
8 /* (c) copyright 2000 AVERTEC */
9 /* Tous droits reserves */
11 /* Auteur(s) : Gilles Augustins */
13 /******************************************************************************/
16 #include "tlf_parse.h"
20 /******************************************************************************/
22 /******************************************************************************/
23 static cbhcomb *ptrcbhcomb;
24 static cbhseq *ptrcbhseq;
27 typedef struct minmax {
32 typedef struct loconbus {
38 static chain_list *output;
40 static long losig_index;
41 static lofig_list *ptrlofig;
42 static losig_list *ptrlosig;
43 static locon_list *ptrlocon;
47 static char namebuf[1024];
48 static chain_list *ch, *chp, *xchain, *ychain, *xydatamin, *xydatamax, *ydatamin, *ydatamax;
49 static char xtype, ytype;
50 static char dimension;
53 static timing_model *modelmin;
54 static timing_model *modelmax;
55 static timing_ttable *ttemplate;
56 static char *cname, *pt;
58 static ttvfig_list *fig;
59 static int nbconsig, nbbreaksig, nblatchsig;
60 static chain_list *consigchain, *breaksigchain, *latchsigchain;
61 static ttvevent_list *root, *node;
62 static ttvline_list *line;
63 static ht *modshrinkht;
66 static ht *doublemodels;
67 static chain_list *clocks;
68 static int i, l, m, lsb, msb, flagbus = 0;
69 static ttvsig_list *sigroot, *signode, *sig;
70 static char *pinr, *pinn, *pname, *bname, *vectname;
71 static char *mindlymname, *maxdlymname, *minslwmname, *maxslwmname;
74 static float slwmin, slwmax, dlymin, dlymax, maxcstr;
75 static float *caparray;
76 static float pincapa = TLF_NO_CAPA, buscapa = TLF_NO_CAPA;
78 static timing_model *delaymodelmin, *slewmodelmin;
79 static timing_model *delaymodelmax, *slewmodelmax;
81 static chain_list *flipflops;
82 static chain_list *latchs;
85 static float defbidircapa = 0;
86 static float defincapa = 0;
87 static float defoutcapa = 0;
89 static segment *ptseg;
90 static double fallthmin = 0.1, fallthmax = 0.9;
91 static double risethmin = 0.1, risethmax = 0.9;
92 static double inputfalldth = 0.5, outputfalldth = 0.5;
93 static double inputrisedth = 0.5, outputrisedth = 0.5;
94 static double voltage, temperature;
95 static int itype, otype;
96 static timing_props *properties;
98 typedef struct statevar {
103 statevar *cbhname1=NULL;
104 statevar *cbhname2=NULL;
108 /******************************************************************************/
109 /* function declarations */
110 /******************************************************************************/
120 struct chain *chainlist;
121 struct { struct chain *CHAIN; char TYPE; } axedef;
122 struct { struct chain *CHAIN; char DIM; } datadef;
123 struct { float MIN; float MAX; } valdef;
124 struct { char *MIN; char *MAX; } bitext;
127 struct segment *ssegment;
134 %token TLF4_TOKEN_ARROW "=>"
135 %token TLF4_TOKEN_BUS_ARROW "*>"
136 %token TLF4_TOKEN_ASYNCH
137 %token <text> TLF4_TOKEN_ATTRIBUTE
138 %token TLF4_TOKEN_BIDIR
139 %token TLF4_TOKEN_BUS
140 %token TLF4_TOKEN_CAP_UNIT
141 %token TLF4_TOKEN_CAPACITANCE
142 %token TLF4_TOKEN_CELL
143 %token TLF4_TOKEN_CELLTYPE
144 %token TLF4_TOKEN_CLEAR
145 %token TLF4_TOKEN_CLEAR_PRESET_VAR1
146 %token TLF4_TOKEN_CLEAR_PRESET_VAR2
147 %token TLF4_TOKEN_CLOCK_PIN
148 %token TLF4_TOKEN_CLOCK_REG
149 %token TLF4_TOKEN_CLOCK_SLEW_AXIS
150 %token TLF4_TOKEN_COMB
151 %token TLF4_TOKEN_CONST
152 %token TLF4_TOKEN_CONTROL
153 %token TLF4_TOKEN_DATA
154 %token TLF4_TOKEN_DATE
155 %token TLF4_TOKEN_DEFINE_ATTRIBUTE
156 %token TLF4_TOKEN_DELAY
157 %token TLF4_TOKEN_ENABLE
158 %token TLF4_TOKEN_ENERGY
159 %token <real> TLF4_TOKEN_ENUMBER
160 %token TLF4_TOKEN_ENVIRONMENT
161 %token <text> TLF4_TOKEN_EXPR
162 %token TLF4_TOKEN_FALL
163 %token TLF4_TOKEN_FAST
164 %token TLF4_TOKEN_FOR_BITS
165 %token TLF4_TOKEN_FOR_PIN
166 %token TLF4_TOKEN_FUNCTION
167 %token TLF4_TOKEN_GROUND
168 %token TLF4_TOKEN_SUPPLY
169 %token TLF4_TOKEN_GENMODEL
170 %token TLF4_TOKEN_HEADER
171 %token TLF4_TOKEN_HIGH
172 %token TLF4_TOKEN_HOLD
173 %token <text> TLF4_TOKEN_IDENT
174 %token TLF4_TOKEN_IGNORE
175 %token TLF4_TOKEN_INCELL
176 %token TLF4_TOKEN_INPUT
177 %token TLF4_TOKEN_INPUT_REG
178 %token TLF4_TOKEN_INPUT_SLEW_AXIS
179 %token TLF4_TOKEN_INTERNAL
180 %token TLF4_TOKEN_INVERTED_OUTPUT
181 %token TLF4_TOKEN_LATCH
182 %token TLF4_TOKEN_LIBRARY
183 %token TLF4_TOKEN_LOAD_AXIS
184 %token TLF4_TOKEN_LOAD2_AXIS
185 %token TLF4_TOKEN_LOW
186 %token TLF4_TOKEN_LOWER_THRESHOLD
187 %token TLF4_TOKEN_INPUT_THRESHOLD
188 %token TLF4_TOKEN_OUTPUT_THRESHOLD
189 %token TLF4_TOKEN_MODEL
190 %token TLF4_TOKEN_NEGEDGE
191 %token <real> TLF4_TOKEN_NUMBER
192 %token TLF4_TOKEN_OUTCELL
193 %token TLF4_TOKEN_OUTPUT
194 %token TLF4_TOKEN_PATH
195 %token TLF4_TOKEN_PIN
196 %token TLF4_TOKEN_PINDIR
197 %token TLF4_TOKEN_PINTYPE
198 %token TLF4_TOKEN_POSEDGE
199 %token TLF4_TOKEN_PROPERTIES
200 %token <text> TLF4_TOKEN_QSTRING
201 %token TLF4_TOKEN_REGISTER
202 %token TLF4_TOKEN_RISE
203 %token TLF4_TOKEN_SEQ
204 %token TLF4_TOKEN_SET
205 %token TLF4_TOKEN_SETUP
206 %token TLF4_TOKEN_SLAVE_CLOCK
207 %token TLF4_TOKEN_SLEW
208 %token TLF4_TOKEN_SLOW
209 %token TLF4_TOKEN_SLEW_AXIS
210 %token TLF4_TOKEN_SPLINE
211 %token TLF4_TOKEN_TECHNOLOGY
212 %token TLF4_TOKEN_TIME_UNIT
213 %token TLF4_TOKEN_RES_UNIT
214 %token TLF4_TOKEN_TIMING_PROPS
215 %token TLF4_TOKEN_TLF_VERSION
216 %token TLF4_TOKEN_TRISTATE
217 %token TLF4_TOKEN_UNIT
218 %token TLF4_TOKEN_UPPER_THRESHOLD
219 %token <text> TLF4_TOKEN_VECT
220 %token <text> TLF4_TOKEN_VECT_IDENT
221 %token TLF4_TOKEN_VENDOR
222 %token TLF4_TOKEN_VERSION
225 %token TLF4_TOKEN_VDROP_LIMIT
226 %token TLF4_TOKEN_TRANSITION_START
227 %token TLF4_TOKEN_TRANSITION_END
228 %token TLF4_TOKEN_LINEAR
229 %token TLF4_TOKEN_VALUE
230 %token TLF4_TOKEN_NET_CAP_MODEL
231 %token TLF4_TOKEN_NET_RES_MODEL
232 %token TLF4_TOKEN_NET_CAP
233 %token TLF4_TOKEN_NET_RES
234 %token TLF4_TOKEN_TEMPERATURE
235 %token TLF4_TOKEN_VOLTAGE
240 %type <chainlist> array1D
241 %type <chainlist> array2D
242 %type <chainlist> array1D_list
244 %type <cchar> axetype
245 %type <cchar> bustype
246 %type <text> cellname
247 %type <cchar> celltype
248 %type <cchar> clocktrans
249 %type <valdef> constant
250 %type <valdef> constdelay
251 %type <valdef> constslew
252 %type <bitext> constraint
254 %type <chainlist> cval_list
255 %type <chainlist> segment_list
259 %type <chainlist> ident_list
260 %type <datadef> modeldata
261 %type <text> modelname
262 %type <chainlist> outputs
265 %type <cchar> pintype
268 %type <text> templatename
269 %type <cchar> transition
270 %type <chainlist> val_list
272 %type <real> capacitance
273 %type <ssegment> segment
277 tlf_file : header def_list cell_list
279 if(TLF_TRACE_MODE == 'Y')
280 fprintf (stdout, " <--- done\n");
282 fprintf(stdout,"DONE!\n");*/
301 defattr : TLF4_TOKEN_DEFINE_ATTRIBUTE '(' ident target type ')'
303 set_attribute ($3, $4);
307 target : '(' TLF4_TOKEN_CELL ')'
311 | '(' TLF4_TOKEN_LIBRARY ')'
315 | '(' TLF4_TOKEN_PIN ')'
324 genmod : TLF4_TOKEN_GENMODEL '(' templatename '(' modelbody ')' ')'
326 for (nx = 0, ch = xchain; ch; ch = ch->NEXT) nx++;
327 for (ny = 0, ch = ychain; ch; ch = ch->NEXT) ny++;
328 ttemplate = stm_modtbl_addtemplate ($3, nx, ny, xtype, ytype);
329 if (xtype == STM_INPUT_SLEW || xtype == STM_CLOCK_SLEW) {
330 if (TLF_TIME_UNIT == TLF_NS)
331 stm_modtbl_settemplateXrange (ttemplate, xchain, 1e3);
332 if (TLF_TIME_UNIT == TLF_PS)
333 stm_modtbl_settemplateXrange (ttemplate, xchain, 1);
335 if (xtype == STM_LOAD) {
336 if (TLF_CAPA_UNIT == TLF_PF)
337 stm_modtbl_settemplateXrange (ttemplate, xchain, 1e3);
338 if (TLF_CAPA_UNIT == TLF_FF)
339 stm_modtbl_settemplateXrange (ttemplate, xchain, 1);
341 if (ytype == STM_INPUT_SLEW || ytype == STM_CLOCK_SLEW) {
342 if (TLF_TIME_UNIT == TLF_NS)
343 stm_modtbl_settemplateYrange (ttemplate, ychain, 1e3);
344 if (TLF_TIME_UNIT == TLF_PS)
345 stm_modtbl_settemplateYrange (ttemplate, ychain, 1);
347 if (ytype == STM_LOAD) {
348 if (TLF_CAPA_UNIT == TLF_PF)
349 stm_modtbl_settemplateYrange (ttemplate, ychain, 1e3);
350 if (TLF_CAPA_UNIT == TLF_FF)
351 stm_modtbl_settemplateYrange (ttemplate, ychain, 1);
353 for (ch = xchain; ch; ch = ch->NEXT)
356 for (ch = ychain; ch; ch = ch->NEXT)
362 gentprop : TLF4_TOKEN_TIMING_PROPS '(' ')'
365 properties : TLF4_TOKEN_PROPERTIES '(' prop_list ')'
369 if(properties->RESMODEL){
370 if(TLF_RES_UNIT == TLF_KOHM)
372 else if(TLF_RES_UNIT == TLF_OHM)
374 stm_scale_loadmodel(properties->RESMODEL,scale);
376 if(properties->CAPMODEL){
377 if(TLF_CAPA_UNIT == TLF_PF)
379 else if(TLF_CAPA_UNIT == TLF_FF)
381 stm_scale_loadmodel(properties->CAPMODEL,scale);
391 prop : TLF4_TOKEN_UNIT '(' unit_list ')'
392 | TLF4_TOKEN_FOR_PIN '(' TLF4_TOKEN_INPUT capacitance ')'
396 | TLF4_TOKEN_FOR_PIN '(' TLF4_TOKEN_OUTPUT capacitance ')'
400 | TLF4_TOKEN_FOR_PIN '(' TLF4_TOKEN_BIDIR capacitance ')'
404 | TLF4_TOKEN_TEMPERATURE '(' val ')'
408 | TLF4_TOKEN_VOLTAGE '(' val ')'
414 if((inputrisedth != inputfalldth) || (inputrisedth != inputfalldth) || (inputrisedth != inputfalldth))
415 fprintf (stderr, "***tlf warning: input and output thresholds are not the same***\n");
419 if((risethmin != fallthmin) || (risethmax != fallthmax))
420 fprintf (stderr, "***tlf warning: slew thresholds are not the same for rising and falling***\n");
422 | TLF4_TOKEN_NET_CAP '(' ident ')'
425 properties = stm_prop_create (NULL, NULL);
427 properties = STM_PROPERTIES;
428 if(!properties->CAPMODEL)
429 stm_addcapmodel(properties, stm_getmodel(cname, $3));
431 | TLF4_TOKEN_NET_RES '(' ident ')'
434 properties = stm_prop_create (NULL, NULL);
436 properties = STM_PROPERTIES;
437 if(!properties->RESMODEL)
438 stm_addresmodel(properties, stm_getmodel(cname, $3));
442 delay_th : TLF4_TOKEN_INPUT_THRESHOLD '(' TLF4_TOKEN_RISE '(' val ')' TLF4_TOKEN_FALL '(' val ')' ')'
444 inputrisedth = $5 / 100;
445 inputfalldth = $9 / 100;
447 | TLF4_TOKEN_OUTPUT_THRESHOLD '(' TLF4_TOKEN_RISE '(' val ')' TLF4_TOKEN_FALL '(' val ')' ')'
449 outputrisedth = $5 / 100;
450 outputfalldth = $9 / 100;
454 threshold : TLF4_TOKEN_LOWER_THRESHOLD '(' TLF4_TOKEN_RISE '(' val ')' TLF4_TOKEN_FALL '(' val ')' ')'
456 risethmin = $5 / 100;
457 fallthmin = $9 / 100;
459 | TLF4_TOKEN_UPPER_THRESHOLD '(' TLF4_TOKEN_RISE '(' val ')' TLF4_TOKEN_FALL '(' val ')' ')'
461 risethmax = $5 / 100;
462 fallthmax = $9 / 100;
464 | TLF4_TOKEN_TRANSITION_START '(' val ')'
469 | TLF4_TOKEN_TRANSITION_END '(' val ')'
477 capacitance : TLF4_TOKEN_CAPACITANCE '(' val ')'
487 unit : TLF4_TOKEN_CAP_UNIT '(' val TLF4_TOKEN_IDENT ')'
489 if (!strcasecmp ($4, "pf"))
490 TLF_CAPA_UNIT = TLF_PF;
491 if (!strcasecmp ($4, "ff"))
492 TLF_CAPA_UNIT = TLF_FF;
494 | TLF4_TOKEN_TIME_UNIT '(' val TLF4_TOKEN_IDENT ')'
496 if (!strcasecmp ($4, "ps"))
497 TLF_TIME_UNIT = TLF_PS;
498 if (!strcasecmp ($4, "ns"))
499 TLF_TIME_UNIT = TLF_NS;
501 | TLF4_TOKEN_RES_UNIT '(' val TLF4_TOKEN_IDENT ')'
503 if (!strcasecmp ($4, "kohm"))
504 TLF_RES_UNIT = TLF_KOHM;
505 if (!strcasecmp ($4, "ohm"))
506 TLF_RES_UNIT = TLF_OHM;
510 attribute : TLF4_TOKEN_ATTRIBUTE '(' arg ')'
514 if((!strcasecmp($1,"state_variable_map")) && (ptrcbhcomb != NULL)){
515 if(cbhname1 == NULL){
516 cbhname1 = (statevar*)mbkalloc(sizeof(struct statevar));
517 cbhname1->PINNAME = mbkstrdup(pname);
518 cbhname1->VAR = mbkstrdup($3);
519 if(ptrcbhcomb->FUNCTION == NULL) {
520 str = eqt_ConvertStr($3);
521 ptrcbhcomb->FUNCTION = eqt_StrToAbl(tlfEqtCtx,str);
526 if(strcasecmp(cbhname1->VAR,$3)) {
527 cbhname2 = (statevar*)mbkalloc(sizeof(struct statevar));
528 cbhname2->PINNAME = mbkstrdup(pname);
529 cbhname2->VAR = mbkstrdup($3);
530 if(ptrcbhcomb->FUNCTION == NULL) {
531 str = eqt_ConvertStr($3);
532 ptrcbhcomb->FUNCTION = eqt_StrToAbl(tlfEqtCtx,str);
537 mout = tlf_multout(&ptrlofig,&ptrcbhcomb,&ptrcbhseq,cname);
543 callback_attribute ($1, $3);
547 arg : TLF4_TOKEN_QSTRING
549 $$ = stm_unquote ($1);
558 char buf[TLF_BUFSIZE];
559 sprintf(buf,"%g",$1);
565 header : TLF4_TOKEN_HEADER '(' helem_list ')'
567 /* if(TLF_TRACE_MODE != 'Y') {
568 fprintf(stdout,"\nLOADING LIBRARY %s TLF4... ", LIBRARY_TLF_NAME);
579 pincapa = TLF_NO_CAPA;
580 buscapa = TLF_NO_CAPA;
610 library : TLF4_TOKEN_LIBRARY '(' TLF4_TOKEN_QSTRING ')'
616 breaksigchain = NULL;
617 latchsigchain = NULL;
621 LIBRARY_TLF_NAME = tlf_treatname($3);
622 stm_addcell (LIBRARY_TLF_NAME);
623 cname = LIBRARY_TLF_NAME;
628 technology : TLF4_TOKEN_TECHNOLOGY '(' TLF4_TOKEN_QSTRING ')'
634 date : TLF4_TOKEN_DATE '(' TLF4_TOKEN_QSTRING ')'
640 vendor : TLF4_TOKEN_VENDOR '(' TLF4_TOKEN_QSTRING ')'
646 environment : TLF4_TOKEN_ENVIRONMENT '(' TLF4_TOKEN_QSTRING ')'
652 version : TLF4_TOKEN_VERSION '(' TLF4_TOKEN_QSTRING ')'
658 tlf_version : TLF4_TOKEN_TLF_VERSION '(' TLF4_TOKEN_QSTRING ')'
668 cell : TLF4_TOKEN_CELL '(' celldef cellelms arcs ')'
676 if((ptrcbhseq != NULL) && (!mout)){
677 if(cbhname1 != NULL){
678 if(!strcasecmp(cbhname1->PINNAME,ptrcbhseq->PIN))
679 ptrcbhseq->NAME = namealloc(cbhname1->VAR);
680 else if(!strcasecmp(cbhname1->PINNAME,ptrcbhseq->NEGPIN))
681 ptrcbhseq->NEGNAME = namealloc(cbhname1->VAR);
683 if(cbhname2 != NULL){
684 if(!strcasecmp(cbhname2->PINNAME,ptrcbhseq->PIN))
685 ptrcbhseq->NAME = namealloc(cbhname2->VAR);
686 else if(!strcasecmp(cbhname2->PINNAME,ptrcbhseq->NEGPIN))
687 ptrcbhseq->NEGNAME = namealloc(cbhname2->VAR);
690 if((ptrcbhseq->NAME == NULL) && (ptrcbhseq->PIN !=NULL)) {
691 sprintf(buf,"I%s",ptrcbhseq->PIN);
692 ptrcbhseq->NAME = namealloc(buf);
695 if((ptrcbhseq->NEGNAME == NULL) && (ptrcbhseq->NEGPIN != NULL)){
696 sprintf(buf,"I%s",ptrcbhseq->NEGPIN);
697 ptrcbhseq->NEGNAME = namealloc(buf);
700 if(ptrcbhseq->PIN != NULL) {
701 p = getlocon(ptrlofig, ptrcbhseq->PIN);
702 c = cbh_getcombfromlocon(p);
704 str = eqt_ConvertStr(ptrcbhseq->NAME);
705 c->FUNCTION = eqt_StrToAbl(tlfEqtCtx,str);
708 if((ptrcbhseq->DATA != NULL) && (tlf_lookingForExpr(ptrcbhseq->DATA, ptrcbhseq->PIN) == 1))
709 ptrcbhseq->DATA = tlf_replaceInAbl(ptrcbhseq->DATA, ptrcbhseq->PIN, ptrcbhseq->NAME);
712 if(ptrcbhseq->NEGPIN != NULL) {
713 p = getlocon(ptrlofig, ptrcbhseq->NEGPIN);
714 c = cbh_getcombfromlocon(p);
716 str = eqt_ConvertStr(ptrcbhseq->NEGNAME);
717 c->FUNCTION = eqt_StrToAbl(tlfEqtCtx,str);
720 if((ptrcbhseq->DATA != NULL) && (tlf_lookingForExpr(ptrcbhseq->DATA, ptrcbhseq->NEGPIN) == 1))
721 ptrcbhseq->DATA = tlf_replaceInAbl(ptrcbhseq->DATA, ptrcbhseq->NEGPIN, ptrcbhseq->NEGNAME);
724 cbh_addseqtolofig(ptrlofig, ptrcbhseq);
728 cbh_classlofig(ptrlofig);
731 for (i = 0; i < fig->NBCONSIG; i++) {
732 sig = fig->CONSIG[i];
733 if ((sig->TYPE & TTV_SIG_B) == TTV_SIG_B) {
734 breaksigchain = addchain(breaksigchain,sig);
737 if ((sig->TYPE & TTV_SIG_L) == TTV_SIG_L) {
738 latchsigchain = addchain(latchsigchain,sig);
743 fig->NBEBREAKSIG = nbbreaksig;
744 fig->EBREAKSIG = ttv_allocreflist (breaksigchain, nbbreaksig);
745 fig->NBELATCHSIG = nblatchsig;
746 fig->ELATCHSIG = ttv_allocreflist (latchsigchain, nblatchsig);
748 for (i = 0; i < fig->NBCONSIG; i++) {
749 capa = gethtitem (pincapht, namealloc (fig->CONSIG[i]->NAME));
751 mbkfree((float*)capa);
760 delht (doublemodels);
762 freechain (flipflops);
768 latchsigchain = NULL;
770 breaksigchain = NULL;
771 fig->STATUS |= TTV_STS_DTX;
772 fig->STATUS |= TTV_STS_TTX;
776 cellelms : cellelm_list
778 fig->CONSIG = ttv_allocreflist (consigchain, nbconsig);
779 fig->NBCONSIG = nbconsig;
780 for (i = 0; i < fig->NBCONSIG; i++)
781 addhtitem (pinht, namealloc (fig->CONSIG[i]->NAME), (long)fig->CONSIG[i]);
788 | cellelm_list cellelm
799 registers : TLF4_TOKEN_REGISTER '('
801 if(ptrcbhseq != NULL) {
802 mout = tlf_multout(&ptrlofig,&ptrcbhcomb,&ptrcbhseq,cname);
805 ptrcbhseq = cbh_newseq();
806 ptrcbhseq->SEQTYPE = CBH_FLIPFLOP;
811 if(ptrcbhseq != NULL)
812 flipflops = append (flipflops, output);
815 | TLF4_TOKEN_LATCH '('
817 if(ptrcbhseq != NULL) {
818 mout = tlf_multout(&ptrlofig,&ptrcbhcomb,&ptrcbhseq,cname);
822 ptrcbhseq = cbh_newseq();
823 ptrcbhseq->SEQTYPE = CBH_LATCH;
828 if(ptrcbhseq != NULL)
829 latchs = append (latchs, output);
836 | reg_list reg_elem {}
839 reg_elem : TLF4_TOKEN_CLEAR TLF4_TOKEN_EXPR
842 if(ptrcbhseq != NULL) {
843 str = eqt_ConvertStr($2);
844 ptrcbhseq->RESET = eqt_StrToAbl(tlfEqtCtx,str);
848 | TLF4_TOKEN_CLOCK_REG TLF4_TOKEN_EXPR
851 if(ptrcbhseq != NULL) {
852 str = eqt_ConvertStr($2);
853 ptrcbhseq->CLOCK = eqt_StrToAbl(tlfEqtCtx,str);
857 | TLF4_TOKEN_SLAVE_CLOCK TLF4_TOKEN_EXPR
860 if(ptrcbhseq != NULL) {
861 str = eqt_ConvertStr($2);
862 ptrcbhseq->SLAVECLOCK = eqt_StrToAbl(tlfEqtCtx,str);
866 | TLF4_TOKEN_SET TLF4_TOKEN_EXPR
869 if(ptrcbhseq != NULL) {
870 str = eqt_ConvertStr($2);
871 ptrcbhseq->SET = eqt_StrToAbl(tlfEqtCtx,str);
875 | TLF4_TOKEN_INPUT_REG TLF4_TOKEN_EXPR
878 if(ptrcbhseq != NULL) {
879 str = eqt_ConvertStr($2);
880 ptrcbhseq->DATA = eqt_StrToAbl(tlfEqtCtx,str);
884 | TLF4_TOKEN_CLEAR_PRESET_VAR1 TLF4_TOKEN_EXPR
887 if(ptrcbhseq != NULL) {
888 str = eqt_ConvertStr($2);
889 ptrcbhseq->RSCONF = eqt_StrToAbl(tlfEqtCtx,str);
893 | TLF4_TOKEN_CLEAR_PRESET_VAR2 TLF4_TOKEN_EXPR
896 if(ptrcbhseq != NULL) {
897 str = eqt_ConvertStr($2);
898 ptrcbhseq->RSCONFNEG = eqt_StrToAbl(tlfEqtCtx,str);
904 outputs : TLF4_TOKEN_OUTPUT '(' ident_list ')'
907 mout = tlf_multout(&ptrlofig,&ptrcbhcomb,&ptrcbhseq,cname);
909 if(ptrcbhseq != NULL)
910 ptrcbhseq->PIN = namealloc(tlf_chainlistToStr($3));
915 output = append(output,$3);
917 | TLF4_TOKEN_INVERTED_OUTPUT '(' ident_list ')'
920 mout = tlf_multout(&ptrlofig,&ptrcbhcomb,&ptrcbhseq,cname);
922 if(ptrcbhseq != NULL)
923 ptrcbhseq->NEGPIN = namealloc(tlf_chainlistToStr($3));
928 output = append(output,$3);
934 $$ = addchain (NULL, $1);
938 $$ = addchain ($2, $1);
942 celldef : cellname celltype
948 if(TLF_TRACE_MODE == 'Y')
949 fprintf (stdout, " ---> processing cell %s\n", cname);
951 /* nouvelle cellule --> lofig a creer */
953 if((p=getloadedlofig(cname)) == NULL) {
954 ptrlofig = addlofig(cname);
955 ptrlofig->MODE = 'P';
956 addcatalog(ptrlofig->NAME);
962 version = (char*) mbkalloc (TLF_BUFSIZE * sizeof (char));
963 sprintf (version, "%.2f", elpTechnoVersion);
965 fig = ttv_givehead ($1, $1, NULL);
967 ttv_setttvlevel (fig);
968 TLF_TTVFIG_LIST = addchain (TLF_TTVFIG_LIST, fig);
969 fig->INFO->TOOLNAME = TLF_TOOLNAME;
970 fig->INFO->TOOLVERSION = TLF_TOOLVERSION;
971 fig->INFO->TECHNONAME = elpTechnoName;
972 fig->INFO->TECHNOVERSION = version;
973 fig->INFO->SLOPE = STM_DEF_SLEW;
974 fig->INFO->CAPAOUT = STM_DEF_LOAD;
975 fig->INFO->STHHIGH = risethmax;
976 fig->INFO->STHLOW = risethmin;
977 fig->INFO->DTH = outputrisedth;
978 fig->INFO->TEMP = temperature;
979 fig->INFO->VDD = voltage;
980 ttv_setttvdate (fig, TTV_DATE_LOCAL);
981 modshrinkht = addht (100);
983 pincapht = addht (100);
984 doublemodels = addht (100);
993 celltype : TLF4_TOKEN_CELLTYPE '(' TLF4_TOKEN_IGNORE ')'
997 | TLF4_TOKEN_CELLTYPE '(' TLF4_TOKEN_OUTCELL ')'
1001 | TLF4_TOKEN_CELLTYPE '(' TLF4_TOKEN_INCELL ')'
1005 | TLF4_TOKEN_CELLTYPE '(' TLF4_TOKEN_INCELL TLF4_TOKEN_OUTCELL ')'
1009 | TLF4_TOKEN_CELLTYPE '(' TLF4_TOKEN_SEQ ')'
1013 | TLF4_TOKEN_CELLTYPE '(' TLF4_TOKEN_COMB ')'
1023 celltprops : TLF4_TOKEN_TIMING_PROPS '(' ')'
1029 for (i = 0; i < fig->NBCONSIG; i++) {
1030 sig = fig->CONSIG[i];
1032 /* typer B, LL (latch), LF (flip-flop) */
1034 for (line = sig->NODE[0].INLINE; line; line = line->NEXT) {
1036 if ((line->TYPE & TTV_LINE_A) == TTV_LINE_A) {
1037 switch (getoutputtype (sig->NAME, flipflops, latchs)) {
1039 sig->TYPE |= TTV_SIG_B;
1042 sig->TYPE |= TTV_SIG_LL;
1045 sig->TYPE |= TTV_SIG_LF;
1048 line->NODE->ROOT->TYPE |= TTV_SIG_B;
1052 if (((line->TYPE & TTV_LINE_O) == TTV_LINE_O) || ((line->TYPE & TTV_LINE_U) == TTV_LINE_U)) {
1053 sig->TYPE |= TTV_SIG_B;
1054 line->NODE->ROOT->TYPE |= TTV_SIG_B;
1058 for (line = sig->NODE[1].INLINE; line; line = line->NEXT) {
1060 if ((line->TYPE & TTV_LINE_A) == TTV_LINE_A) {
1061 switch (getoutputtype (sig->NAME, flipflops, latchs)) {
1063 sig->TYPE |= TTV_SIG_B;
1066 sig->TYPE |= TTV_SIG_LL;
1069 sig->TYPE |= TTV_SIG_LF;
1072 line->NODE->ROOT->TYPE |= TTV_SIG_B;
1076 if (((line->TYPE & TTV_LINE_O) == TTV_LINE_O) || ((line->TYPE & TTV_LINE_U) == TTV_LINE_U)) {
1077 sig->TYPE |= TTV_SIG_B;
1078 line->NODE->ROOT->TYPE |= TTV_SIG_B;
1086 netcapmodel : TLF4_TOKEN_NET_CAP_MODEL '(' modelname '(' modelbody ')' ')'
1089 for (nx = 0, ch = xchain; ch; ch = ch->NEXT) nx++;
1090 if (xydatamax && !xydatamin) {
1091 sprintf (namebuf, "%s", $3);
1092 modelmax = stm_addtblmodel (cname, namebuf, nx, 0, xtype, STM_NOTYPE);
1093 stm_storemodel (cname, namebuf, modelmax, 0);
1095 if (xtype == STM_LOAD) {
1096 stm_modtbl_setXrange (modelmax->UMODEL.TABLE, xchain, 1);
1098 switch (dimension) {
1100 stm_modtbl_set1Dset (modelmax->UMODEL.TABLE, xydatamax, 1);
1101 for (ch = xydatamax; ch; ch = ch->NEXT)
1104 freechain (xydatamax);
1108 for (ch = xchain; ch; ch = ch->NEXT){
1115 | TLF4_TOKEN_NET_CAP_MODEL '(' modelname '(' TLF4_TOKEN_LINEAR TLF4_TOKEN_VALUE '(' segment_list ')' ')' ')'
1117 modelmax = stm_addmodel(cname, $3);
1118 modelmax->UTYPE = STM_MOD_MODTBL;
1119 modelmax->UMODEL.TABLE = stm_prop_seg2tbl ($8, STM_LOAD);
1120 stm_storemodel (cname, $3, modelmax, 0);
1124 netresmodel : TLF4_TOKEN_NET_RES_MODEL '(' modelname '(' modelbody ')' ')'
1127 for (nx = 0, ch = xchain; ch; ch = ch->NEXT) nx++;
1128 if (xydatamax && !xydatamin) {
1129 sprintf (namebuf, "%s", $3);
1130 modelmax = stm_addtblmodel (cname, namebuf, nx, 0, xtype, STM_NOTYPE);
1131 stm_storemodel (cname, namebuf, modelmax, 0);
1133 if (xtype == STM_LOAD) {
1134 stm_modtbl_setXrange (modelmax->UMODEL.TABLE, xchain, 1);
1136 switch (dimension) {
1138 stm_modtbl_set1Dset (modelmax->UMODEL.TABLE, xydatamax, 1);
1139 for (ch = xydatamax; ch; ch = ch->NEXT)
1142 freechain (xydatamax);
1146 for (ch = xchain; ch; ch = ch->NEXT){
1153 | TLF4_TOKEN_NET_RES_MODEL '(' modelname '(' TLF4_TOKEN_LINEAR TLF4_TOKEN_VALUE '(' segment_list ')' ')' ')'
1155 modelmax = stm_addmodel(cname, $3);
1156 modelmax->UTYPE = STM_MOD_MODTBL;
1157 modelmax->UMODEL.TABLE = stm_prop_seg2tbl ($8, STM_LOAD);
1158 stm_storemodel (cname, $3, modelmax, 0);
1163 model : TLF4_TOKEN_MODEL '(' modelname templatename '(' modelbody ')' ')'
1165 if (!xydatamin && !xydatamax) {
1166 for (nx = 0, ch = xchain; ch; ch = ch->NEXT) nx++;
1167 for (ny = 0, ch = ychain; ch; ch = ch->NEXT) ny++;
1168 ttemplate = stm_modtbl_addtemplate ($3, nx, ny, xtype, ytype);
1169 if (xtype == STM_INPUT_SLEW || xtype == STM_CLOCK_SLEW) {
1170 if (TLF_TIME_UNIT == TLF_NS)
1171 stm_modtbl_settemplateXrange (ttemplate, xchain, 1e3);
1172 if (TLF_TIME_UNIT == TLF_PS)
1173 stm_modtbl_settemplateXrange (ttemplate, xchain, 1);
1175 if (xtype == STM_LOAD) {
1176 if (TLF_CAPA_UNIT == TLF_PF)
1177 stm_modtbl_settemplateXrange (ttemplate, xchain, 1e3);
1178 if (TLF_CAPA_UNIT == TLF_FF)
1179 stm_modtbl_settemplateXrange (ttemplate, xchain, 1);
1181 if (ytype == STM_INPUT_SLEW || ytype == STM_CLOCK_SLEW) {
1182 if (TLF_TIME_UNIT == TLF_NS)
1183 stm_modtbl_settemplateYrange (ttemplate, ychain, 1e3);
1184 if (TLF_TIME_UNIT == TLF_PS)
1185 stm_modtbl_settemplateYrange (ttemplate, ychain, 1);
1187 if (ytype == STM_LOAD) {
1188 if (TLF_CAPA_UNIT == TLF_PF)
1189 stm_modtbl_settemplateYrange (ttemplate, ychain, 1e3);
1190 if (TLF_CAPA_UNIT == TLF_FF)
1191 stm_modtbl_settemplateYrange (ttemplate, ychain, 1);
1197 ttemplate = stm_modtbl_gettemplate ($4);
1199 sprintf (namebuf, "%s_min", $3);
1200 modelmin = stm_addmodel (cname, namebuf);
1201 modelmin->UMODEL.TABLE = stm_modtbl_create_ftemplate (ttemplate);
1202 modelmin->UTYPE = STM_MOD_MODTBL;
1203 stm_storemodel (cname, namebuf, modelmin, 0);
1204 addhtitem (doublemodels, namealloc ($3), 1);
1206 if (xydatamax && xydatamin) {
1207 sprintf (namebuf, "%s_max", $3);
1208 modelmax = stm_addmodel (cname, namebuf);
1209 modelmax->UMODEL.TABLE = stm_modtbl_create_ftemplate (ttemplate);
1210 modelmax->UTYPE = STM_MOD_MODTBL;
1211 stm_storemodel (cname, namebuf, modelmax, 0);
1213 if (xydatamax && !xydatamin) {
1214 sprintf (namebuf, "%s", $3);
1215 modelmax = stm_addmodel (cname, namebuf);
1216 modelmax->UMODEL.TABLE = stm_modtbl_create_ftemplate (ttemplate);
1217 modelmax->UTYPE = STM_MOD_MODTBL;
1218 stm_storemodel (cname, namebuf, modelmax, 0);
1221 for (nx = 0, ch = xchain; ch; ch = ch->NEXT) nx++;
1222 for (ny = 0, ch = ychain; ch; ch = ch->NEXT) ny++;
1224 addhtitem (doublemodels, namealloc ($3), 1);
1225 sprintf (namebuf, "%s_min", $3);
1226 modelmin = stm_addtblmodel (cname, namebuf, nx, ny, xtype, ytype);
1228 if (xydatamax && xydatamin) {
1229 sprintf (namebuf, "%s_max", $3);
1230 modelmax = stm_addtblmodel (cname, namebuf, nx, ny, xtype, ytype);
1232 if (xydatamax && !xydatamin) {
1233 sprintf (namebuf, "%s", $3);
1234 modelmax = stm_addtblmodel (cname, namebuf, nx, ny, xtype, ytype);
1237 if (xtype == STM_INPUT_SLEW || xtype == STM_CLOCK_SLEW) {
1238 if (TLF_TIME_UNIT == TLF_NS) {
1240 stm_modtbl_setXrange (modelmin->UMODEL.TABLE, xchain, 1e3);
1241 stm_modtbl_setXrange (modelmax->UMODEL.TABLE, xchain, 1e3);
1243 if (TLF_TIME_UNIT == TLF_PS) {
1245 stm_modtbl_setXrange (modelmin->UMODEL.TABLE, xchain, 1);
1246 stm_modtbl_setXrange (modelmax->UMODEL.TABLE, xchain, 1);
1249 if (xtype == STM_LOAD) {
1250 if (TLF_CAPA_UNIT == TLF_PF) {
1252 stm_modtbl_setXrange (modelmin->UMODEL.TABLE, xchain, 1e3);
1253 stm_modtbl_setXrange (modelmax->UMODEL.TABLE, xchain, 1e3);
1255 if (TLF_CAPA_UNIT == TLF_FF) {
1257 stm_modtbl_setXrange (modelmin->UMODEL.TABLE, xchain, 1);
1258 stm_modtbl_setXrange (modelmax->UMODEL.TABLE, xchain, 1);
1261 if (ytype == STM_INPUT_SLEW || ytype == STM_CLOCK_SLEW) {
1262 if (TLF_TIME_UNIT == TLF_NS) {
1264 stm_modtbl_setYrange (modelmin->UMODEL.TABLE, ychain, 1e3);
1265 stm_modtbl_setYrange (modelmax->UMODEL.TABLE, ychain, 1e3);
1267 if (TLF_TIME_UNIT == TLF_PS) {
1269 stm_modtbl_setYrange (modelmin->UMODEL.TABLE, ychain, 1);
1270 stm_modtbl_setYrange (modelmax->UMODEL.TABLE, ychain, 1);
1273 if (ytype == STM_LOAD) {
1274 if (TLF_CAPA_UNIT == TLF_PF) {
1276 stm_modtbl_setYrange (modelmin->UMODEL.TABLE, ychain, 1e3);
1277 stm_modtbl_setYrange (modelmax->UMODEL.TABLE, ychain, 1e3);
1279 if (TLF_CAPA_UNIT == TLF_FF) {
1281 stm_modtbl_setYrange (modelmin->UMODEL.TABLE, ychain, 1);
1282 stm_modtbl_setYrange (modelmax->UMODEL.TABLE, ychain, 1);
1285 switch (dimension) {
1287 if (nx > 0 || ny > 0)
1288 avt_errmsg (STM_ERRMSG, "000", AVT_ERROR, $3);
1290 if (TLF_TIME_UNIT == TLF_NS) {
1292 stm_modtbl_setconst (modelmin->UMODEL.TABLE, *(float*)xydatamin->DATA * 1e3);
1294 stm_modtbl_setconst (modelmax->UMODEL.TABLE, *(float*)xydatamax->DATA * 1e3);
1296 if (TLF_TIME_UNIT == TLF_PS) {
1298 stm_modtbl_setconst (modelmin->UMODEL.TABLE, *(float*)xydatamin->DATA);
1300 stm_modtbl_setconst (modelmax->UMODEL.TABLE, *(float*)xydatamax->DATA);
1303 if (xydatamin->DATA) {
1304 mbkfree(xydatamin->DATA);
1306 freechain (xydatamin);
1309 if (xydatamax->DATA) {
1310 mbkfree(xydatamax->DATA);
1312 freechain (xydatamax);
1317 if (nx > 0 && ny > 0)
1318 avt_errmsg (STM_ERRMSG, "000", AVT_ERROR, $3);
1320 if (TLF_TIME_UNIT == TLF_NS) {
1322 stm_modtbl_set1Dset (modelmin->UMODEL.TABLE, xydatamin, 1e3);
1323 stm_modtbl_set1Dset (modelmax->UMODEL.TABLE, xydatamax, 1e3);
1325 if (TLF_TIME_UNIT == TLF_PS) {
1327 stm_modtbl_set1Dset (modelmin->UMODEL.TABLE, xydatamin, 1);
1328 stm_modtbl_set1Dset (modelmax->UMODEL.TABLE, xydatamax, 1);
1331 for (ch = xydatamin; ch; ch = ch->NEXT)
1334 freechain (xydatamin);
1336 for (ch = xydatamax; ch; ch = ch->NEXT)
1339 freechain (xydatamax);
1343 if (nx == 0 || ny == 0)
1344 avt_errmsg (STM_ERRMSG, "000", AVT_ERROR, $3);
1346 if (TLF_TIME_UNIT == TLF_NS) {
1348 stm_modtbl_set2Dset (modelmin->UMODEL.TABLE, xydatamin, 1e3);
1349 stm_modtbl_set2Dset (modelmax->UMODEL.TABLE, xydatamax, 1e3);
1351 if (TLF_TIME_UNIT == TLF_PS) {
1353 stm_modtbl_set2Dset (modelmin->UMODEL.TABLE, xydatamin, 1);
1354 stm_modtbl_set2Dset (modelmax->UMODEL.TABLE, xydatamax, 1);
1356 for (ch = xydatamin; ch; ch = ch->NEXT) {
1357 for (chp = (chain_list*)ch->DATA; chp; chp = chp->NEXT)
1359 freechain (ch->DATA);
1362 freechain (xydatamin);
1363 for (ch = xydatamax; ch; ch = ch->NEXT) {
1364 for (chp = (chain_list*)ch->DATA; chp; chp = chp->NEXT)
1366 freechain (ch->DATA);
1369 freechain (xydatamax);
1375 for (ch = xchain; ch; ch = ch->NEXT){
1382 for (ch = ychain; ch; ch = ch->NEXT){
1391 modelbody : modeltype axe axe axe data
1398 for (ch = $5.CHAIN; ch; ch = ch->NEXT) {
1400 for (chp = (chain_list*)ch->DATA; chp; chp = chp->NEXT) {
1401 ptfl = (float*)mbkalloc (sizeof (float));
1402 *ptfl = ((minmax*)chp->DATA)->MAX;
1403 ydatamax = addchain (ydatamax, ptfl);
1405 ydatamax = reverse (ydatamax);
1406 xydatamax = addchain (xydatamax, ydatamax);
1409 xydatamax = reverse (xydatamax);
1413 if (((minmax*)(((chain_list*)($5.CHAIN->DATA))->DATA))->MIN != STM_NOVALUE) {
1414 for (ch = $5.CHAIN; ch; ch = ch->NEXT) {
1416 for (chp = (chain_list*)ch->DATA; chp; chp = chp->NEXT) {
1417 ptfl = (float*)mbkalloc (sizeof (float));
1418 *ptfl = ((minmax*)chp->DATA)->MIN;
1419 ydatamin = addchain (ydatamin, ptfl);
1421 ydatamin = reverse (ydatamin);
1422 xydatamin = addchain (xydatamin, ydatamin);
1424 xydatamin = reverse (xydatamin);
1426 for (ch = $5.CHAIN; ch; ch = ch->NEXT) {
1427 for (chp = (chain_list*)ch->DATA; chp; chp = chp->NEXT)
1428 mbkfree ((minmax*)chp->DATA);
1429 freechain ((chain_list*)ch->DATA);
1431 //freechain ($5.CHAIN);
1435 | modeltype axe axe data
1442 for (ch = $4.CHAIN; ch; ch = ch->NEXT) {
1444 for (chp = (chain_list*)ch->DATA; chp; chp = chp->NEXT) {
1445 ptfl = (float*)mbkalloc (sizeof (float));
1446 *ptfl = ((minmax*)chp->DATA)->MAX;
1447 ydatamax = addchain (ydatamax, ptfl);
1449 ydatamax = reverse (ydatamax);
1450 xydatamax = addchain (xydatamax, ydatamax);
1453 xydatamax = reverse (xydatamax);
1457 if (((minmax*)(((chain_list*)($4.CHAIN->DATA))->DATA))->MIN != STM_NOVALUE) {
1458 for (ch = $4.CHAIN; ch; ch = ch->NEXT) {
1460 for (chp = (chain_list*)ch->DATA; chp; chp = chp->NEXT) {
1461 ptfl = (float*)mbkalloc (sizeof (float));
1462 *ptfl = ((minmax*)chp->DATA)->MIN;
1463 ydatamin = addchain (ydatamin, ptfl);
1465 ydatamin = reverse (ydatamin);
1466 xydatamin = addchain (xydatamin, ydatamin);
1468 xydatamin = reverse (xydatamin);
1470 for (ch = $4.CHAIN; ch; ch = ch->NEXT) {
1471 for (chp = (chain_list*)ch->DATA; chp; chp = chp->NEXT)
1472 mbkfree ((minmax*)chp->DATA);
1473 freechain ((chain_list*)ch->DATA);
1475 //freechain ($4.CHAIN);
1479 | modeltype axe data
1486 for (ch = $3.CHAIN; ch; ch = ch->NEXT) {
1487 ptfl = (float*)mbkalloc (sizeof (float));
1488 *ptfl = ((minmax*)ch->DATA)->MAX;
1489 xydatamax = addchain (xydatamax, ptfl);
1492 xydatamax = reverse (xydatamax);
1495 if (((minmax*)$3.CHAIN->DATA)->MIN != STM_NOVALUE) {
1496 for (ch = $3.CHAIN; ch; ch = ch->NEXT) {
1497 ptfl = (float*)mbkalloc (sizeof (float));
1498 *ptfl = ((minmax*)ch->DATA)->MIN;
1499 xydatamin = addchain (xydatamin, ptfl);
1501 xydatamin = reverse (xydatamin);
1503 for (ch = $3.CHAIN; ch; ch = ch->NEXT)
1504 mbkfree ((minmax*)ch->DATA);
1521 for (ch = $2.CHAIN; ch; ch = ch->NEXT) {
1522 ptfl = (float*)mbkalloc (sizeof (float));
1523 *ptfl = ((minmax*)ch->DATA)->MAX;
1524 xydatamax = addchain (xydatamax, ptfl);
1527 xydatamax = reverse (xydatamax);
1530 if (((minmax*)$2.CHAIN->DATA)->MIN != STM_NOVALUE) {
1531 for (ch = $2.CHAIN; ch; ch = ch->NEXT) {
1532 ptfl = (float*)mbkalloc (sizeof (float));
1533 *ptfl = ((minmax*)ch->DATA)->MIN;
1534 xydatamin = addchain (xydatamin, ptfl);
1536 xydatamin = reverse (xydatamin);
1538 for (ch = $2.CHAIN; ch; ch = ch->NEXT)
1539 mbkfree ((minmax*)ch->DATA);
1544 for (ch = $2.CHAIN; ch; ch = ch->NEXT) {
1546 for (chp = (chain_list*)ch->DATA; chp; chp = chp->NEXT) {
1547 ptfl = (float*)mbkalloc (sizeof (float));
1548 *ptfl = ((minmax*)chp->DATA)->MAX;
1549 ydatamax = addchain (ydatamax, ptfl);
1551 ydatamax = reverse (ydatamax);
1552 xydatamax = addchain (xydatamax, ydatamax);
1555 xydatamax = reverse (xydatamax);
1559 if (((minmax*)(((chain_list*)($2.CHAIN->DATA))->DATA))->MIN != STM_NOVALUE) {
1560 for (ch = $2.CHAIN; ch; ch = ch->NEXT) {
1562 for (chp = (chain_list*)ch->DATA; chp; chp = chp->NEXT) {
1563 ptfl = (float*)mbkalloc (sizeof (float));
1564 *ptfl = ((minmax*)chp->DATA)->MIN;
1565 ydatamin = addchain (ydatamin, ptfl);
1567 ydatamin = reverse (ydatamin);
1568 xydatamin = addchain (xydatamin, ydatamin);
1570 xydatamin = reverse (xydatamin);
1572 for (ch = $2.CHAIN; ch; ch = ch->NEXT) {
1573 for (chp = (chain_list*)ch->DATA; chp; chp = chp->NEXT)
1574 mbkfree ((minmax*)chp->DATA);
1575 freechain ((chain_list*)ch->DATA);
1577 //freechain ($2.CHAIN);
1584 segment_list : empty
1588 | segment segment_list
1591 $$ = addchain ($2, ptseg);
1595 segment : val ':' val ':' val ':' val
1597 ptseg = (segment*)mbkalloc (sizeof (struct segment));
1606 modeltype : TLF4_TOKEN_SPLINE
1610 axe : '(' axetype val val_list ')'
1612 ptfl = (float*)mbkalloc (sizeof (float));
1614 $$.CHAIN = addchain ($4, ptfl);
1620 axetype : TLF4_TOKEN_INPUT_SLEW_AXIS
1622 $$ = STM_INPUT_SLEW;
1624 | TLF4_TOKEN_CLOCK_SLEW_AXIS
1626 $$ = STM_CLOCK_SLEW;
1628 | TLF4_TOKEN_SLEW_AXIS
1630 $$ = STM_INPUT_SLEW;
1632 | TLF4_TOKEN_LOAD_AXIS
1636 | TLF4_TOKEN_LOAD2_AXIS
1648 ptmm = (minmax*)mbkalloc (sizeof (struct minmax));
1651 $$ = addchain ($2, ptmm);
1661 ptfl = (float*)mbkalloc (sizeof (float));
1663 $$ = addchain ($2, ptfl);
1667 data : TLF4_TOKEN_DATA '(' modeldata ')'
1675 | TLF4_TOKEN_DATA modeldata
1687 ptmm = (minmax*)mbkalloc (sizeof (struct minmax));
1690 $$.CHAIN = addchain (NULL, ptmm);
1711 array2D : array1D array1D array1D_list
1713 $$ = addchain ($3, $2);
1714 $$ = addchain ($$, $1);
1718 array1D : '(' cval cval cval_list ')'
1720 ptmm = (minmax*)mbkalloc (sizeof (struct minmax));
1723 $$ = addchain ($4, ptmm);
1724 ptmm = (minmax*)mbkalloc (sizeof (struct minmax));
1727 $$ = addchain ($$, ptmm);
1731 array1D_list : empty
1735 | array1D array1D_list
1737 $$ = addchain ($2, $1);
1741 pin : TLF4_TOKEN_PIN '(' pinname
1751 ptfl = (float*)mbkalloc (sizeof (float));
1752 if (pincapa == TLF_NO_CAPA) {
1753 if (buscapa != TLF_NO_CAPA)
1764 *ptfl = defbidircapa;
1770 addhtitem (pincapht, pname, (long)ptfl);
1773 addhtitem (pincapht, pname, (long)ptfl);
1781 if((ptrcbhcomb->HZFUNC) != NULL) {
1792 if((ptrcbhcomb->HZFUNC) != NULL) {
1804 if((pindir != 'A') && !isglobalvdd(pname) && !isglobalvss(pname)){
1805 consigchain = ttv_addrefsig (fig, pname, pname, *ptfl, dir, consigchain);
1808 clocks = addchain (clocks, pname);
1810 if((pindir != 'X') && (!flagbus)){
1811 /* nouveau connecteur --> LOCON et LOSIG a creer */
1812 for(c=ptrlofig->LOCON; ((c != NULL) && (c->NAME != ttv_devect(pname))); c=c->NEXT);
1813 if(c == NULL) { /* connecteur inexistant, on ajoute signal et connecteur */
1814 for(s=ptrlofig->LOSIG; (s != NULL); s=s->NEXT) {/* recherche du 1er index de libre */
1818 losig_index = i + 1;
1819 ptrlosig = addlosig(ptrlofig, losig_index, addchain(NULL, ttv_devect(pname)), 'E');
1821 ptrlocon = addlocon(ptrlofig, ttv_devect(pname), ptrlosig, pindir);
1823 // ptloconbus = (loconbus*)mbkalloc (sizeof (struct loconbus));
1824 // ptloconbus->NAME = ttv_devect(pname);
1825 // ptloconbus->LOSIG = ptrlosig;
1826 // ptloconbus->DIREC = pindir;
1827 // buschain = addchain(buschain, ptloconbus);
1830 else { /* connecteur et signal existants, on redirige le connecteur */
1832 ptrlocon->DIRECTION = pindir;
1835 if(/*!flagbus && */ptrcbhcomb)
1836 cbh_addcombtolocon(ptrlocon, ptrcbhcomb);
1843 pincapa = TLF_NO_CAPA;
1847 | TLF4_TOKEN_BUS '(' busname bustype busprops {/* buschain = NULL;*/ flagbus = 1;} pin_list ')'
1855 for(i = l; i >= m; i--){
1856 sprintf(buf, "%s %d", bname, i);
1857 for(c=ptrlofig->LOCON; ((c != NULL) && (c->NAME != namealloc(buf))); c=c->NEXT);
1858 if(c == NULL) { /* connecteur inexistant, on ajoute signal et connecteur */
1859 for(s=ptrlofig->LOSIG; (s != NULL); s=s->NEXT) {/* recherche du 1er index de libre */
1863 losig_index = n + 1;
1864 ptrlosig = addlosig(ptrlofig, losig_index, addchain(NULL, namealloc(buf)), 'E');
1865 ptrlocon = addlocon(ptrlofig, namealloc(buf), ptrlosig, pindir);
1869 for(i = l; i <= m; i++){
1870 sprintf(buf, "%s %d", bname, i);
1871 for(c=ptrlofig->LOCON; ((c != NULL) && (c->NAME != namealloc(buf))); c=c->NEXT);
1872 if(c == NULL) { /* connecteur inexistant, on ajoute signal et connecteur */
1873 for(s=ptrlofig->LOSIG; (s != NULL); s=s->NEXT) {/* recherche du 1er index de libre */
1877 losig_index = n + 1;
1878 ptrlosig = addlosig(ptrlofig, losig_index, addchain(NULL, namealloc(buf)), 'E');
1879 ptrlocon = addlocon(ptrlofig, namealloc(buf), ptrlosig, pindir);
1884 // if(l != vectorindex(((loconbus*)buschain->DATA)->NAME))
1885 // reverse(buschain);
1886 // for(chain=buschain; chain; chain=chain->NEXT){
1887 // ptloconbus = (loconbus*)chain->DATA;
1888 // ptrlocon = addlocon(ptrlofig, ptloconbus->NAME, ptloconbus->LOSIG, ptloconbus->DIREC);
1889 // cbh_addcombtolocon(ptrlocon, ptrcbhcomb);
1890 // mbkfree(chain->DATA) ;
1893 // freechain(buschain);
1894 for (i = lsb; i <= msb; i++) {
1895 pt = stm_vect (bname, i);
1896 vectname = namealloc (pt);
1900 for(ch = consigchain; ch; ch = ch->NEXT)
1901 if(!strcmp(vectname, ((ttvsig_list*)ch->DATA)->NAME)){
1906 ptfl = (float*)mbkalloc (sizeof (float));
1907 if (buscapa != TLF_NO_CAPA)
1910 if (caparray[i - lsb] != TLF_NO_CAPA)
1911 *ptfl = caparray[i - lsb];
1921 *ptfl = defbidircapa;
1926 addhtitem (pincapht, vectname, (long)ptfl);
1940 consigchain = ttv_addrefsig (fig, vectname, vectname, *ptfl, dir, consigchain);
1943 clocks = addchain (clocks, vectname);
1946 buscapa = TLF_NO_CAPA;
1950 | TLF4_TOKEN_PIN '(' busname pintype busprops ')'
1952 for (i = lsb; i <= msb; i++) {
1953 pt = stm_vect (bname, i);
1954 vectname = namealloc (pt);
1958 ptfl = (float*)mbkalloc (sizeof (float));
1960 if (pincapa == TLF_NO_CAPA) {
1961 if (buscapa != TLF_NO_CAPA)
1972 *ptfl = defbidircapa;
1978 addhtitem (pincapht, vectname, (long)ptfl);
1980 *ptfl = caparray[i - lsb];
1981 addhtitem (pincapht, vectname, (long)ptfl);
1996 consigchain = ttv_addrefsig (fig, vectname, vectname, *ptfl, dir, consigchain);
1999 clocks = addchain (clocks, vectname);
2013 pintype : TLF4_TOKEN_PINTYPE '(' TLF4_TOKEN_BIDIR ')'
2017 | TLF4_TOKEN_PINTYPE '(' TLF4_TOKEN_INPUT ')'
2021 | TLF4_TOKEN_PINTYPE '(' TLF4_TOKEN_SUPPLY ')'
2025 | TLF4_TOKEN_PINTYPE '(' TLF4_TOKEN_GROUND ')'
2029 | TLF4_TOKEN_PINTYPE '(' TLF4_TOKEN_INTERNAL ')'
2033 | TLF4_TOKEN_PINTYPE '(' TLF4_TOKEN_OUTPUT ')'
2039 pinprop_list : empty
2040 | pinprop_list pinprop
2056 if((pindir == 'O') || (pindir == 'B')){
2057 ptrcbhcomb = cbh_newcomb();
2058 ptrcbhcomb->NAME = namealloc(pname);
2061 | TLF4_TOKEN_CLOCK_PIN
2079 pinenable : TLF4_TOKEN_ENABLE TLF4_TOKEN_EXPR
2082 if(ptrcbhcomb != NULL) {
2083 str = eqt_ConvertStr($2);
2084 ptrcbhcomb->HZFUNC = notExpr(eqt_StrToAbl(tlfEqtCtx,str));
2090 pinfunc : TLF4_TOKEN_FUNCTION TLF4_TOKEN_EXPR
2093 if(ptrcbhcomb != NULL) {
2094 str = eqt_ConvertStr($2);
2095 ptrcbhcomb->FUNCTION = eqt_StrToAbl(tlfEqtCtx,str);
2102 rise : TLF4_TOKEN_RISE '(' modelname ')'
2103 | TLF4_TOKEN_RISE '(' modelbody ')'
2107 fall : TLF4_TOKEN_FALL '(' modelname ')'
2108 | TLF4_TOKEN_FALL '(' modelbody ')'
2120 | TLF4_TOKEN_CLOCK_PIN
2130 forbits_list : forbits
2131 | forbits_list forbits
2134 forbits : TLF4_TOKEN_FOR_BITS '(' TLF4_TOKEN_VECT pincap ')'
2136 v = atoi (stm_unquote ($3));
2138 if (v <= msb && v >= lsb)
2139 caparray[v - lsb] = $4;
2143 pincap : TLF4_TOKEN_CAPACITANCE '(' val ')'
2145 if (TLF_CAPA_UNIT == TLF_PF)
2147 if (TLF_CAPA_UNIT == TLF_FF)
2161 speed : TLF4_TOKEN_FAST
2166 path : TLF4_TOKEN_PATH '(' pinname "=>" pinname speed transition transition delay slew energy_list ')'
2168 if ($7 != 'X' && $8 != 'X') {
2171 mindlymname = $9.MIN ? $9.MIN : $9.MAX;
2172 minslwmname = $10.MIN ? $10.MIN : $10.MAX;
2173 maxdlymname = $9.MAX;
2174 maxslwmname = $10.MAX;
2175 signode = (ttvsig_list*)gethtitem (pinht, pinn);
2176 sigroot = (ttvsig_list*)gethtitem (pinht, pinr);
2177 if ((long)sigroot != EMPTYHT && (long)signode != EMPTYHT) {
2178 if (isclockpin (clocks, pinn))
2179 linetype = TTV_LINE_A;
2183 node = &signode->NODE[1];
2186 else if ($7 == 'D') {
2187 node = &signode->NODE[0];
2191 root = &sigroot->NODE[1];
2194 else if ($8 == 'D') {
2195 root = &sigroot->NODE[0];
2198 else if ($8 == 'u') {
2199 root = &sigroot->NODE[1];
2201 linetype |= TTV_LINE_HZ;
2203 else if ($8 == 'd') {
2204 root = &sigroot->NODE[0];
2206 linetype |= TTV_LINE_HZ;
2209 delaymodelmax = stm_getmodel (cname, maxdlymname);
2210 if(gethtitem(modshrinkht, maxdlymname) == EMPTYHT){
2211 if (itype == elpRISE)
2212 stm_mod_shrinkslewaxis (delaymodelmax, risethmin, risethmax, itype);
2214 stm_mod_shrinkslewaxis (delaymodelmax, fallthmin, fallthmax, itype);
2215 addhtitem (modshrinkht, maxdlymname, (long)delaymodelmax);
2219 slewmodelmax = stm_getmodel (cname, maxslwmname);
2220 if(gethtitem(modshrinkht, maxslwmname) == EMPTYHT){
2221 if (itype == elpRISE)
2222 stm_mod_shrinkslewaxis (slewmodelmax, risethmin, risethmax, itype);
2224 stm_mod_shrinkslewaxis (slewmodelmax, fallthmin, fallthmax, itype);
2225 if (otype == elpRISE)
2226 stm_mod_shrinkslewdata (slewmodelmax, risethmin, risethmax, otype);
2228 stm_mod_shrinkslewdata (slewmodelmax, fallthmin, fallthmax, otype);
2229 addhtitem (modshrinkht, maxslwmname, (long)slewmodelmax);
2232 delaymodelmin = stm_getmodel (cname, mindlymname);
2233 if(gethtitem(modshrinkht, mindlymname) == EMPTYHT){
2234 if (itype == elpRISE)
2235 stm_mod_shrinkslewaxis (delaymodelmin, risethmin, risethmax, itype);
2237 stm_mod_shrinkslewaxis (delaymodelmin, fallthmin, fallthmax, itype);
2238 addhtitem (modshrinkht, mindlymname, (long)delaymodelmin);
2241 slewmodelmin = stm_getmodel (cname, minslwmname);
2242 if(gethtitem(modshrinkht, minslwmname) == EMPTYHT){
2243 if (itype == elpRISE)
2244 stm_mod_shrinkslewaxis (slewmodelmin, risethmin, risethmax, itype);
2246 stm_mod_shrinkslewaxis (slewmodelmin, fallthmin, fallthmax, itype);
2247 if (otype == elpRISE)
2248 stm_mod_shrinkslewdata (slewmodelmin, risethmin, risethmax, otype);
2250 stm_mod_shrinkslewdata (slewmodelmin, fallthmin, fallthmax, otype);
2251 addhtitem (modshrinkht, minslwmname, (long)slewmodelmin);
2255 stm_mod_update(delaymodelmax, voltage/2.0, voltage, voltage/5.0, 0.0);
2256 stm_mod_update(slewmodelmax, voltage/2.0, voltage, voltage/5.0, 0.0);
2257 stm_mod_update(delaymodelmin, voltage/2.0, voltage, voltage/5.0, 0.0);
2258 stm_mod_update(slewmodelmin, voltage/2.0, voltage, voltage/5.0, 0.0);
2260 stm_mod_update(delaymodelmax, voltage/2.0, voltage, voltage/5.0, voltage);
2261 stm_mod_update(slewmodelmax, voltage/2.0, voltage, voltage/5.0, voltage);
2262 stm_mod_update(delaymodelmin, voltage/2.0, voltage, voltage/5.0, voltage);
2263 stm_mod_update(slewmodelmin, voltage/2.0, voltage, voltage/5.0, voltage);
2266 capa = gethtitem (pincapht, pinr);
2267 if (capa != EMPTYHT) {
2268 slwmin = stm_mod_slew (slewmodelmin, *(float*)capa + STM_DEF_LOAD, STM_DEF_SLEW, NULL, NULL, "unknown");
2269 dlymin = stm_mod_delay (delaymodelmin, *(float*)capa + STM_DEF_LOAD, STM_DEF_SLEW, NULL, "unknown");
2270 slwmax = stm_mod_slew (slewmodelmax, *(float*)capa + STM_DEF_LOAD, STM_DEF_SLEW, NULL, NULL, "unknown");
2271 dlymax = stm_mod_delay (delaymodelmax, *(float*)capa + STM_DEF_LOAD, STM_DEF_SLEW, NULL, "unknown");
2273 slwmin = stm_mod_slew (slewmodelmin, STM_DEF_LOAD, STM_DEF_SLEW, NULL, NULL, "unknown");
2274 dlymin = stm_mod_delay (delaymodelmin, STM_DEF_LOAD, STM_DEF_SLEW, NULL, "unknown");
2275 slwmax = stm_mod_slew (slewmodelmax, STM_DEF_LOAD, STM_DEF_SLEW, NULL, NULL, "unknown");
2276 dlymax = stm_mod_delay (delaymodelmax, STM_DEF_LOAD, STM_DEF_SLEW, NULL, "unknown");
2278 line = ttv_addline (fig, root, node, dlymax*TTV_UNIT, slwmax*TTV_UNIT, dlymin*TTV_UNIT, slwmin*TTV_UNIT, TTV_LINE_T | linetype);
2279 ttv_addcaracline (line, maxdlymname,
2283 line = ttv_addline (fig, root, node, dlymax*TTV_UNIT, slwmax*TTV_UNIT, dlymin*TTV_UNIT, slwmin*TTV_UNIT, TTV_LINE_D | linetype);
2284 ttv_addcaracline (line, maxdlymname,
2291 | TLF4_TOKEN_PATH '(' pinname "*>" busname speed transition transition delay slew energy_list ')'
2293 if ($7 != 'X' && $8 != 'X') {
2294 for(i = lsb; i <= msb; i++){
2296 pt = stm_vect (bname, i);
2297 pinr = namealloc (pt);
2301 mindlymname = $9.MIN ? $9.MIN : $9.MAX;
2302 minslwmname = $10.MIN ? $10.MIN : $10.MAX;
2303 maxdlymname = $9.MAX;
2304 maxslwmname = $10.MAX;
2305 signode = (ttvsig_list*)gethtitem (pinht, pinn);
2306 sigroot = (ttvsig_list*)gethtitem (pinht, pinr);
2307 if ((long)sigroot != EMPTYHT && (long)signode != EMPTYHT) {
2308 if (isclockpin (clocks, pinn))
2309 linetype = TTV_LINE_A;
2313 node = &signode->NODE[1];
2316 else if ($7 == 'D') {
2317 node = &signode->NODE[0];
2321 root = &sigroot->NODE[1];
2324 else if ($8 == 'D') {
2325 root = &sigroot->NODE[0];
2328 else if ($8 == 'u') {
2329 root = &sigroot->NODE[1];
2331 linetype |= TTV_LINE_HZ;
2333 else if ($8 == 'd') {
2334 root = &sigroot->NODE[0];
2336 linetype |= TTV_LINE_HZ;
2339 delaymodelmax = stm_getmodel (cname, maxdlymname);
2340 if(gethtitem(modshrinkht, maxdlymname) == EMPTYHT){
2341 if (itype == elpRISE)
2342 stm_mod_shrinkslewaxis (delaymodelmax, risethmin, risethmax, itype);
2344 stm_mod_shrinkslewaxis (delaymodelmax, fallthmin, fallthmax, itype);
2345 addhtitem (modshrinkht, maxdlymname, (long)delaymodelmax);
2349 slewmodelmax = stm_getmodel (cname, maxslwmname);
2350 if(gethtitem(modshrinkht, maxslwmname) == EMPTYHT){
2351 if (itype == elpRISE)
2352 stm_mod_shrinkslewaxis (slewmodelmax, risethmin, risethmax, itype);
2354 stm_mod_shrinkslewaxis (slewmodelmax, fallthmin, fallthmax, itype);
2355 if (otype == elpRISE)
2356 stm_mod_shrinkslewdata (slewmodelmax, risethmin, risethmax, otype);
2358 stm_mod_shrinkslewdata (slewmodelmax, fallthmin, fallthmax, otype);
2359 addhtitem (modshrinkht, maxslwmname, (long)slewmodelmax);
2362 delaymodelmin = stm_getmodel (cname, mindlymname);
2363 if(gethtitem(modshrinkht, mindlymname) == EMPTYHT){
2364 if (itype == elpRISE)
2365 stm_mod_shrinkslewaxis (delaymodelmin, risethmin, risethmax, itype);
2367 stm_mod_shrinkslewaxis (delaymodelmin, fallthmin, fallthmax, itype);
2368 addhtitem (modshrinkht, mindlymname, (long)delaymodelmin);
2371 slewmodelmin = stm_getmodel (cname, minslwmname);
2372 if(gethtitem(modshrinkht, minslwmname) == EMPTYHT){
2373 if (itype == elpRISE)
2374 stm_mod_shrinkslewaxis (slewmodelmin, risethmin, risethmax, itype);
2376 stm_mod_shrinkslewaxis (slewmodelmin, fallthmin, fallthmax, itype);
2377 if (otype == elpRISE)
2378 stm_mod_shrinkslewdata (slewmodelmin, risethmin, risethmax, otype);
2380 stm_mod_shrinkslewdata (slewmodelmin, fallthmin, fallthmax, otype);
2381 addhtitem (modshrinkht, minslwmname, (long)slewmodelmin);
2385 stm_mod_update(delaymodelmax, voltage/2.0, voltage, voltage/5.0, 0.0);
2386 stm_mod_update(slewmodelmax, voltage/2.0, voltage, voltage/5.0, 0.0);
2387 stm_mod_update(delaymodelmin, voltage/2.0, voltage, voltage/5.0, 0.0);
2388 stm_mod_update(slewmodelmin, voltage/2.0, voltage, voltage/5.0, 0.0);
2390 stm_mod_update(delaymodelmax, voltage/2.0, voltage, voltage/5.0, voltage);
2391 stm_mod_update(slewmodelmax, voltage/2.0, voltage, voltage/5.0, voltage);
2392 stm_mod_update(delaymodelmin, voltage/2.0, voltage, voltage/5.0, voltage);
2393 stm_mod_update(slewmodelmin, voltage/2.0, voltage, voltage/5.0, voltage);
2396 capa = gethtitem (pincapht, pinr);
2397 if (capa != EMPTYHT) {
2398 slwmin = stm_mod_slew (slewmodelmin, *(float*)capa + STM_DEF_LOAD, STM_DEF_SLEW, NULL, NULL, "unknown");
2399 dlymin = stm_mod_delay (delaymodelmin, *(float*)capa + STM_DEF_LOAD, STM_DEF_SLEW, NULL, "unknown");
2400 slwmax = stm_mod_slew (slewmodelmax, *(float*)capa + STM_DEF_LOAD, STM_DEF_SLEW, NULL, NULL, "unknown");
2401 dlymax = stm_mod_delay (delaymodelmax, *(float*)capa + STM_DEF_LOAD, STM_DEF_SLEW, NULL, "unknown");
2403 slwmin = stm_mod_slew (slewmodelmin, STM_DEF_LOAD, STM_DEF_SLEW, NULL, NULL, "unknown");
2404 dlymin = stm_mod_delay (delaymodelmin, STM_DEF_LOAD, STM_DEF_SLEW, NULL, "unknown");
2405 slwmax = stm_mod_slew (slewmodelmax, STM_DEF_LOAD, STM_DEF_SLEW, NULL, NULL, "unknown");
2406 dlymax = stm_mod_delay (delaymodelmax, STM_DEF_LOAD, STM_DEF_SLEW, NULL, "unknown");
2408 line = ttv_addline (fig, root, node, dlymax*TTV_UNIT, slwmax*TTV_UNIT, dlymin*TTV_UNIT, slwmin*TTV_UNIT, TTV_LINE_T | linetype);
2409 ttv_addcaracline (line, maxdlymname,
2413 line = ttv_addline (fig, root, node, dlymax*TTV_UNIT, slwmax*TTV_UNIT, dlymin*TTV_UNIT, slwmin*TTV_UNIT, TTV_LINE_D | linetype);
2414 ttv_addcaracline (line, maxdlymname,
2423 | TLF4_TOKEN_PATH '(' pinname "=>" pinname speed transition transition constdelay constslew energy_list ')'
2425 if ($7 != 'X' && $8 != 'X') {
2428 dlymin = $9.MIN != STM_NOVALUE ? $9.MIN : $9.MAX;
2429 slwmin = $10.MIN != STM_NOVALUE ? $10.MIN : $10.MAX;
2432 signode = (ttvsig_list*)gethtitem (pinht, pinn);
2433 sigroot = (ttvsig_list*)gethtitem (pinht, pinr);
2434 if ((long)sigroot != EMPTYHT && (long)signode != EMPTYHT && (long)sigroot != DELETEHT && (long)signode != DELETEHT) {
2435 if (isclockpin (clocks, pinn))
2436 linetype = TTV_LINE_A;
2440 root = &sigroot->NODE[1];
2441 }else if ($8 == 'D'){
2442 root = &sigroot->NODE[0];
2443 }else if ($8 == 'u'){
2444 root = &sigroot->NODE[1];
2445 linetype |= TTV_LINE_HZ;
2446 }else if ($8 == 'd'){
2447 root = &sigroot->NODE[0];
2448 linetype |= TTV_LINE_HZ;
2451 node = &signode->NODE[1];
2453 node = &signode->NODE[0];
2454 line = ttv_addline (fig, root, node, dlymax*TTV_UNIT, slwmax*TTV_UNIT, dlymin*TTV_UNIT, slwmin*TTV_UNIT, TTV_LINE_T | linetype);
2455 line = ttv_addline (fig, root, node, dlymax*TTV_UNIT, slwmax*TTV_UNIT, dlymin*TTV_UNIT, slwmin*TTV_UNIT, TTV_LINE_D | linetype);
2459 | TLF4_TOKEN_PATH '(' pinname "*>" busname speed transition transition constdelay constslew energy_list ')'
2461 if ($7 != 'X' && $8 != 'X') {
2462 for(i = lsb; i <= msb; i++){
2464 pt = stm_vect (bname, i);
2465 pinr = namealloc (pt);
2469 dlymin = $9.MIN != STM_NOVALUE ? $9.MIN : $9.MAX;
2470 slwmin = $10.MIN != STM_NOVALUE ? $10.MIN : $10.MAX;
2473 signode = (ttvsig_list*)gethtitem (pinht, pinn);
2474 sigroot = (ttvsig_list*)gethtitem (pinht, pinr);
2475 if ((long)sigroot != EMPTYHT && (long)signode != EMPTYHT && (long)sigroot != DELETEHT && (long)signode != DELETEHT) {
2476 if (isclockpin (clocks, pinn))
2477 linetype = TTV_LINE_A;
2481 root = &sigroot->NODE[1];
2482 }else if ($8 == 'D'){
2483 root = &sigroot->NODE[0];
2484 }else if ($8 == 'u'){
2485 root = &sigroot->NODE[1];
2486 linetype |= TTV_LINE_HZ;
2487 }else if ($8 == 'd'){
2488 root = &sigroot->NODE[0];
2489 linetype |= TTV_LINE_HZ;
2492 node = &signode->NODE[1];
2494 node = &signode->NODE[0];
2495 line = ttv_addline (fig, root, node, dlymax*TTV_UNIT, slwmax*TTV_UNIT, dlymin*TTV_UNIT, slwmin*TTV_UNIT, TTV_LINE_T | linetype);
2496 line = ttv_addline (fig, root, node, dlymax*TTV_UNIT, slwmax*TTV_UNIT, dlymin*TTV_UNIT, slwmin*TTV_UNIT, TTV_LINE_D | linetype);
2502 | TLF4_TOKEN_PATH '(' pinname "=>" pinname speed transition transition energy ')'
2505 | TLF4_TOKEN_PATH '(' pinname "*>" busname speed transition transition energy ')'
2511 setup : TLF4_TOKEN_SETUP '(' pinname "=>" pinname transition transition constraint ')'
2513 if ($6 != 'X' && $7 != 'X') {
2516 maxdlymname = $8.MAX;
2517 sigroot = (ttvsig_list*)gethtitem (pinht, pinr);
2518 signode = (ttvsig_list*)gethtitem (pinht, pinn);
2519 if ((long)sigroot != EMPTYHT && (long)signode != EMPTYHT && (long)sigroot != DELETEHT && (long)signode != DELETEHT) {
2521 root = &sigroot->NODE[1];
2523 root = &sigroot->NODE[0];
2525 node = &signode->NODE[1];
2529 node = &signode->NODE[0];
2532 delaymodelmax = stm_getmodel (cname, maxdlymname);
2533 if(gethtitem(modshrinkht, maxdlymname) == EMPTYHT){
2534 if (itype == elpRISE)
2535 stm_mod_shrinkslewaxis (delaymodelmax, risethmin, risethmax, itype);
2537 stm_mod_shrinkslewaxis (delaymodelmax, fallthmin, fallthmax, itype);
2538 addhtitem (modshrinkht, maxdlymname, (long)delaymodelmax);
2541 printf ("no model %s\n", maxdlymname);
2542 maxcstr = stm_mod_constraint (delaymodelmax, STM_DEF_SLEW, STM_DEF_SLEW);
2543 if (itype == elpFALL) {
2544 stm_mod_update(delaymodelmax, voltage/2.0, voltage, voltage/5.0, 0.0);
2546 stm_mod_update(delaymodelmax, voltage/2.0, voltage, voltage/5.0, voltage);
2548 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_T | TTV_LINE_U);
2549 ttv_addcaracline (line, maxdlymname, NULL, NULL, NULL);
2550 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_D | TTV_LINE_U);
2551 ttv_addcaracline (line, maxdlymname, NULL, NULL, NULL);
2555 | TLF4_TOKEN_SETUP '(' busname "*>" pinname transition transition constraint ')'
2557 if ($6 != 'X' && $7 != 'X') {
2558 for(i = lsb; i <= msb; i++){
2559 pt = stm_vect (bname, i);
2560 pinn = namealloc (pt);
2565 maxdlymname = $8.MAX;
2566 sigroot = (ttvsig_list*)gethtitem (pinht, pinr);
2567 signode = (ttvsig_list*)gethtitem (pinht, pinn);
2568 if ((long)sigroot != EMPTYHT && (long)signode != EMPTYHT && (long)sigroot != DELETEHT && (long)signode != DELETEHT) {
2570 root = &sigroot->NODE[1];
2572 root = &sigroot->NODE[0];
2574 node = &signode->NODE[1];
2578 node = &signode->NODE[0];
2581 delaymodelmax = stm_getmodel (cname, maxdlymname);
2582 if(gethtitem(modshrinkht, maxdlymname) == EMPTYHT){
2583 if (itype == elpRISE)
2584 stm_mod_shrinkslewaxis (delaymodelmax, risethmin, risethmax, itype);
2586 stm_mod_shrinkslewaxis (delaymodelmax, fallthmin, fallthmax, itype);
2587 addhtitem (modshrinkht, maxdlymname, (long)delaymodelmax);
2590 printf ("no model %s\n", maxdlymname);
2591 maxcstr = stm_mod_constraint (delaymodelmax, STM_DEF_SLEW, STM_DEF_SLEW);
2592 if (itype == elpFALL) {
2593 stm_mod_update(delaymodelmax, voltage/2.0, voltage, voltage/5.0, 0.0);
2595 stm_mod_update(delaymodelmax, voltage/2.0, voltage, voltage/5.0, voltage);
2597 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_T | TTV_LINE_U);
2598 ttv_addcaracline (line, maxdlymname, NULL, NULL, NULL);
2599 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_D | TTV_LINE_U);
2600 ttv_addcaracline (line, maxdlymname, NULL, NULL, NULL);
2606 | TLF4_TOKEN_SETUP '(' pinname "=>" pinname transition transition constant ')'
2608 if ($6 != 'X' && $7 != 'X') {
2612 sigroot = (ttvsig_list*)gethtitem (pinht, pinr);
2613 signode = (ttvsig_list*)gethtitem (pinht, pinn);
2614 if ((long)sigroot != EMPTYHT && (long)signode != EMPTYHT && (long)sigroot != DELETEHT && (long)signode != DELETEHT) {
2616 root = &sigroot->NODE[1];
2618 root = &sigroot->NODE[0];
2620 node = &signode->NODE[1];
2622 node = &signode->NODE[0];
2623 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_T | TTV_LINE_U);
2624 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_D | TTV_LINE_U);
2628 | TLF4_TOKEN_SETUP '(' busname "*>" pinname transition transition constant ')'
2630 if ($6 != 'X' && $7 != 'X') {
2631 for(i = lsb; i <= msb; i++){
2632 pt = stm_vect (bname, i);
2633 pinn = namealloc (pt);
2639 sigroot = (ttvsig_list*)gethtitem (pinht, pinr);
2640 signode = (ttvsig_list*)gethtitem (pinht, pinn);
2641 if ((long)sigroot != EMPTYHT && (long)signode != EMPTYHT && (long)sigroot != DELETEHT && (long)signode != DELETEHT) {
2643 root = &sigroot->NODE[1];
2645 root = &sigroot->NODE[0];
2647 node = &signode->NODE[1];
2649 node = &signode->NODE[0];
2650 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_T | TTV_LINE_U);
2651 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_D | TTV_LINE_U);
2659 hold : TLF4_TOKEN_HOLD '(' pinname "=>" pinname transition transition constraint ')'
2661 if ($6 != 'X' && $7 != 'X') {
2664 maxdlymname = $8.MAX;
2665 sigroot = (ttvsig_list*)gethtitem (pinht, pinr);
2666 signode = (ttvsig_list*)gethtitem (pinht, pinn);
2667 if ((long)sigroot != EMPTYHT && (long)signode != EMPTYHT && (long)sigroot != DELETEHT && (long)signode != DELETEHT) {
2669 root = &sigroot->NODE[1];
2671 root = &sigroot->NODE[0];
2673 node = &signode->NODE[1];
2677 node = &signode->NODE[0];
2680 delaymodelmax = stm_getmodel (cname, maxdlymname);
2681 if(gethtitem(modshrinkht, maxdlymname) == EMPTYHT){
2682 if (itype == elpRISE)
2683 stm_mod_shrinkslewaxis (delaymodelmax, risethmin, risethmax, itype);
2685 stm_mod_shrinkslewaxis (delaymodelmax, fallthmin, fallthmax, itype);
2686 addhtitem (modshrinkht, maxdlymname, (long)delaymodelmax);
2689 printf ("no model %s\n", maxdlymname);
2690 maxcstr = stm_mod_constraint (delaymodelmax, STM_DEF_SLEW, STM_DEF_SLEW);
2691 if (itype == elpFALL) {
2692 stm_mod_update(delaymodelmax, voltage/2.0, voltage, voltage/5.0, 0.0);
2694 stm_mod_update(delaymodelmax, voltage/2.0, voltage, voltage/5.0, voltage);
2696 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_T | TTV_LINE_O);
2697 ttv_addcaracline (line, maxdlymname, NULL, NULL, NULL);
2698 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_D | TTV_LINE_O);
2699 ttv_addcaracline (line, maxdlymname, NULL, NULL, NULL);
2703 | TLF4_TOKEN_HOLD '(' busname "*>" pinname transition transition constraint ')'
2705 if ($6 != 'X' && $7 != 'X') {
2706 for(i = lsb; i <= msb; i++){
2708 pt = stm_vect (bname, i);
2709 pinn = namealloc(pt);
2713 maxdlymname = $8.MAX;
2714 sigroot = (ttvsig_list*)gethtitem (pinht, pinr);
2715 signode = (ttvsig_list*)gethtitem (pinht, pinn);
2716 if ((long)sigroot != EMPTYHT && (long)signode != EMPTYHT && (long)sigroot != DELETEHT && (long)signode != DELETEHT) {
2718 root = &sigroot->NODE[1];
2720 root = &sigroot->NODE[0];
2722 node = &signode->NODE[1];
2726 node = &signode->NODE[0];
2729 delaymodelmax = stm_getmodel (cname, maxdlymname);
2730 if(gethtitem(modshrinkht, maxdlymname) == EMPTYHT){
2731 if (itype == elpRISE)
2732 stm_mod_shrinkslewaxis (delaymodelmax, risethmin, risethmax, itype);
2734 stm_mod_shrinkslewaxis (delaymodelmax, fallthmin, fallthmax, itype);
2735 addhtitem (modshrinkht, maxdlymname, (long)delaymodelmax);
2738 printf ("no model %s\n", maxdlymname);
2739 maxcstr = stm_mod_constraint (delaymodelmax, STM_DEF_SLEW, STM_DEF_SLEW);
2740 if (itype == elpFALL) {
2741 stm_mod_update(delaymodelmax, voltage/2.0, voltage, voltage/5.0, 0.0);
2743 stm_mod_update(delaymodelmax, voltage/2.0, voltage, voltage/5.0, voltage);
2745 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_T | TTV_LINE_O);
2746 ttv_addcaracline (line, maxdlymname, NULL, NULL, NULL);
2747 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_D | TTV_LINE_O);
2748 ttv_addcaracline (line, maxdlymname, NULL, NULL, NULL);
2754 | TLF4_TOKEN_HOLD '(' pinname "=>" pinname transition transition constant ')'
2756 if ($6 != 'X' && $7 != 'X') {
2760 sigroot = (ttvsig_list*)gethtitem (pinht, pinr);
2761 signode = (ttvsig_list*)gethtitem (pinht, pinn);
2762 if ((long)sigroot != EMPTYHT && (long)signode != EMPTYHT && (long)sigroot != DELETEHT && (long)signode != DELETEHT) {
2764 root = &sigroot->NODE[1];
2766 root = &sigroot->NODE[0];
2768 node = &signode->NODE[1];
2770 node = &signode->NODE[0];
2771 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_T | TTV_LINE_O);
2772 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_D | TTV_LINE_O);
2776 | TLF4_TOKEN_HOLD '(' busname "*>" pinname transition transition constant ')'
2778 if ($6 != 'X' && $7 != 'X') {
2779 for(i = lsb; i <= msb; i++){
2781 pt = stm_vect (bname, i);
2782 pinn = namealloc (pt);
2787 sigroot = (ttvsig_list*)gethtitem (pinht, pinr);
2788 signode = (ttvsig_list*)gethtitem (pinht, pinn);
2789 if ((long)sigroot != EMPTYHT && (long)signode != EMPTYHT && (long)sigroot != DELETEHT && (long)signode != DELETEHT) {
2791 root = &sigroot->NODE[1];
2793 root = &sigroot->NODE[0];
2795 node = &signode->NODE[1];
2797 node = &signode->NODE[0];
2798 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_T | TTV_LINE_O);
2799 line = ttv_addline (fig, root, node, maxcstr*TTV_UNIT, 0, TTV_NOTIME, TTV_NOSLOPE, TTV_LINE_D | TTV_LINE_O);
2807 transition : TLF4_TOKEN_10
2837 clocktrans : TLF4_TOKEN_NEGEDGE
2841 | TLF4_TOKEN_POSEDGE
2855 energy_list : energy
2861 energy : TLF4_TOKEN_ENERGY '(' modelname ')'
2862 | TLF4_TOKEN_ENERGY '(' rise fall ')'
2863 | TLF4_TOKEN_ENERGY constant
2866 vdrop_limit : TLF4_TOKEN_VDROP_LIMIT '(' val ')'
2869 constant : '(' TLF4_TOKEN_CONST '(' cval ')' ')'
2871 if (TLF_TIME_UNIT == TLF_NS) {
2872 if($4.MIN != STM_NOVALUE)
2873 $$.MIN = $4.MIN * 1e3;
2876 if($4.MAX != STM_NOVALUE)
2877 $$.MAX = $4.MAX * 1e3;
2881 if (TLF_TIME_UNIT == TLF_PS)
2885 constdelay : TLF4_TOKEN_DELAY '(' TLF4_TOKEN_CONST '(' cval ')' ')'
2891 constslew : TLF4_TOKEN_SLEW '(' TLF4_TOKEN_CONST '(' cval ')' ')'
2897 constraint : modelname
2899 if (gethtitem (doublemodels, namealloc ($1)) != EMPTYHT) {
2900 sprintf (namebuf, "%s_min", $1);
2901 $$.MIN = namealloc (namebuf);
2902 sprintf (namebuf, "%s_max", $1);
2903 $$.MAX = namealloc (namebuf);
2906 $$.MAX = namealloc ($1);
2911 delay : TLF4_TOKEN_DELAY '(' modelname ')'
2913 if (gethtitem (doublemodels, namealloc ($3)) != EMPTYHT) {
2914 sprintf (namebuf, "%s_min", $3);
2915 $$.MIN = namealloc (namebuf);
2916 sprintf (namebuf, "%s_max", $3);
2917 $$.MAX = namealloc (namebuf);
2920 $$.MAX = namealloc ($3);
2926 slew : TLF4_TOKEN_SLEW '(' modelname ')'
2928 if (gethtitem (doublemodels, namealloc ($3)) != EMPTYHT) {
2929 sprintf (namebuf, "%s_min", $3);
2930 $$.MIN = namealloc (namebuf);
2931 sprintf (namebuf, "%s_max", $3);
2932 $$.MAX = namealloc (namebuf);
2935 $$.MAX = namealloc ($3);
2940 templatename : empty
2950 busname : TLF4_TOKEN_VECT_IDENT
2952 bname = stm_basename ($1);
2956 lsb = l < m ? l : m;
2957 msb = m > l ? m : l;
2958 caparray = (float*)mbkalloc ((msb - lsb + 1) * sizeof (float));
2959 for (i = 0; i < msb - lsb; i++)
2960 caparray[i] = TLF_NO_CAPA;
2982 cval : val ':' val ':' val
2994 $$.MIN = STM_NOVALUE;
2999 val : TLF4_TOKEN_NUMBER
3003 | TLF4_TOKEN_ENUMBER
3017 ident : TLF4_TOKEN_IDENT
3028 extern char stbtext[];
3032 avt_errmsg (STM_ERRMSG, "051", AVT_ERROR, TLF_LINE);