1 /****************************************************************************/
3 /* Chaine de CAO & VLSI Alliance */
5 /* Produit : YAGLE v3.50 */
6 /* Fichier : yag_cellbeh.c */
8 /* (c) copyright 1995 Laboratoire MASI equipe CAO & VLSI */
9 /* Tous droits reserves */
10 /* Support : e-mail alliance-support@asim.lip6.fr */
12 /* Auteur(s) : Anthony LESTER le : 10/11/1995 */
14 /* Modifie par : le : ../../.... */
15 /* Modifie par : le : ../../.... */
16 /* Modifie par : le : ../../.... */
18 /****************************************************************************/
20 #include "yag_headers.h"
23 yagBuildBefigMSSC(name
, D_sig
, D_cone
, D
, CK
, S
, R
, NR
, reg
, Q
, QN
, fall_edge
, conelist
)
27 char *D
, *CK
, *S
, *R
, *NR
;
34 cone_list
*ptdrivecone
;
35 biabl_list
*ptbiabl
= NULL
;
37 chain_list
*condition
;
41 char extname
[YAGBUFSIZE
];
44 cone_list
*regcone
= NULL
;
45 cone_list
*outputcone
= NULL
;
46 chain_list
*delaycones
= NULL
;
48 if (conelist
!= NULL
&& YAG_CONTEXT
->YAG_TAS_TIMING
!= YAG_NO_TIMING
) {
49 regcone
= (cone_list
*)yagGetChainInd(conelist
, 4);
50 outputcone
= (cone_list
*)yagGetChainInd(conelist
, 5);
51 delaycones
= addchain(NULL
, yagGetChainInd(conelist
, 3));
52 delaycones
= addchain(delaycones
, yagGetChainInd(conelist
, 2));
55 ptbefig
= beh_addbefig(NULL
, name
);
58 ptuser
= getptype(D_sig
->USER
, YAG_CONE_PTYPE
);
59 if (ptuser
!= NULL
) ptdrivecone
= (cone_list
*)ptuser
->DATA
;
60 if (ptuser
== NULL
|| (ptdrivecone
->TYPE
& YAG_TEMPCONE
) != 0) {
61 yagAddGlueCone(D_sig
, D_cone
);
65 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, D
, 'I', 'B');
66 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, D
);
68 if (delaycones
!= NULL
) {
69 sprintf(extname
, "%s_tasdelay", D
);
70 drivename
= namealloc(extname
);
71 ptbefig
->BEAUX
= beh_addbeaux(ptbefig
->BEAUX
, drivename
, createAtom(D
), (pNode
)yagMakeBequadConeList(delaycones
), 0);
75 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
76 value
= createAtom(drivename
);
77 condition
= createExpr(AND
);
78 if (fall_edge
) addQExpr(condition
, notExpr(createAtom(CK
)));
79 else addQExpr(condition
, createAtom(CK
));
80 trigger
= createExpr(STABLE
);
81 addQExpr(trigger
, createAtom(CK
));
82 addQExpr(condition
, notExpr(trigger
));
83 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
85 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, CK
, 'I', 'B');
86 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, CK
);
88 sprintf(extname
, "%s'delayed", CK
);
89 lclname
= namealloc(extname
);
90 ptbefig
->BEDLY
= beh_addbeaux(ptbefig
->BEDLY
, lclname
, createAtom(CK
), NULL
, 0);
91 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, lclname
);
94 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, S
, 'I', 'B');
95 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, S
);
96 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
97 value
= createAtom("'0'");
98 condition
= createAtom(S
);
99 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
100 if (ptbiabl
->NEXT
!= NULL
) ptbiabl
->NEXT
->FLAG
|= BEH_CND_PRECEDE
;
103 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, R
, 'I', 'B');
104 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, R
);
105 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
106 value
= createAtom("'1'");
107 condition
= createAtom(R
);
108 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
109 if (ptbiabl
->NEXT
!= NULL
) ptbiabl
->NEXT
->FLAG
|= BEH_CND_PRECEDE
;
112 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, NR
, 'I', 'B');
113 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, NR
);
114 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
115 value
= createAtom("'1'");
116 condition
= notExpr(createAtom(NR
));
117 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
118 if (ptbiabl
->NEXT
!= NULL
) ptbiabl
->NEXT
->FLAG
|= BEH_CND_PRECEDE
;
121 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, Q
, 'O', 'B');
122 ptbefig
->BEOUT
= beh_addbeout(ptbefig
->BEOUT
, Q
, createAtom(reg
), NULL
, 0);
123 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, QN
, 'O', 'B');
124 ptbefig
->BEOUT
= beh_addbeout(ptbefig
->BEOUT
, QN
, notExpr(createAtom(reg
)), (pNode
)yagMakeBequadCone(outputcone
), 0);
125 ptbefig
->BEREG
= beh_addbereg(ptbefig
->BEREG
, reg
, ptbiabl
, yagMakeBinode(ptbiabl
, regcone
),0);
126 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, reg
);
128 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, "vdd", 'I', 'B');
129 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, "vss", 'I', 'B');
135 yagBuildBefigMSDIFF(name
, D
, W
, reg
, Q
, QN
, conelist
)
140 chain_list
*conelist
;
143 biabl_list
*ptbiabl
= NULL
;
144 chain_list
*value
, *condition
, *trigger
;
146 char extname
[YAGBUFSIZE
];
149 cone_list
*regcone
= NULL
;
150 cone_list
*outputcone
= NULL
;
151 chain_list
*delaycones
= NULL
;
153 ptbefig
= beh_addbefig(NULL
, name
);
155 if (conelist
!= NULL
&& YAG_CONTEXT
->YAG_TAS_TIMING
!= YAG_NO_TIMING
) {
156 regcone
= (cone_list
*)yagGetChainInd(conelist
, 5);
157 outputcone
= (cone_list
*)yagGetChainInd(conelist
, 6);
158 delaycones
= addchain(NULL
, yagGetChainInd(conelist
, 4));
159 delaycones
= addchain(delaycones
, yagGetChainInd(conelist
, 3));
162 if (delaycones
!= NULL
) {
163 sprintf(extname
, "%s_tasdelay", D
);
164 drivename
= namealloc(extname
);
165 ptbefig
->BEAUX
= beh_addbeaux(ptbefig
->BEAUX
, drivename
, createAtom(D
), (pNode
)yagMakeBequadConeList(delaycones
), 0);
169 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
170 value
= createAtom(drivename
);
171 condition
= createExpr(AND
);
172 addQExpr(condition
, notExpr(createAtom(W
)));
173 trigger
= createExpr(STABLE
);
174 addQExpr(trigger
, createAtom(W
));
175 addQExpr(condition
, notExpr(trigger
));
176 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
178 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, W
, 'I', 'B');
179 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, W
);
181 sprintf(extname
, "%s'delayed", W
);
182 lclname
= namealloc(extname
);
183 ptbefig
->BEDLY
= beh_addbeaux(ptbefig
->BEDLY
, lclname
, createAtom(W
), NULL
, 0);
184 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, lclname
);
186 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, D
, 'I', 'B');
187 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, D
);
189 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, Q
, 'O', 'B');
190 ptbefig
->BEOUT
= beh_addbeout(ptbefig
->BEOUT
, Q
, createAtom(reg
), NULL
, 0);
191 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, QN
, 'O', 'B');
192 ptbefig
->BEOUT
= beh_addbeout(ptbefig
->BEOUT
, QN
, notExpr(createAtom(reg
)), (pNode
)yagMakeBequadCone(outputcone
), 0);
193 ptbefig
->BEREG
= beh_addbereg(ptbefig
->BEREG
, reg
, ptbiabl
, yagMakeBinode(ptbiabl
, regcone
),0);
194 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, reg
);
196 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, "vdd", 'I', 'B');
197 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, "vss", 'I', 'B');
203 yagBuildBefigMSSX(name
, D
, CK
, reg
, Q
, fall_edge
, conelist
)
209 chain_list
*conelist
;
212 biabl_list
*ptbiabl
= NULL
;
214 chain_list
*condition
;
217 char extname
[YAGBUFSIZE
];
220 cone_list
*regcone
= NULL
;
221 cone_list
*outputcone
= NULL
;
222 chain_list
*delaycones
= NULL
;
224 ptbefig
= beh_addbefig(NULL
, name
);
226 if (conelist
!= NULL
&& YAG_CONTEXT
->YAG_TAS_TIMING
!= YAG_NO_TIMING
) {
227 regcone
= (cone_list
*)yagGetChainInd(conelist
, 4);
228 outputcone
= (cone_list
*)yagGetChainInd(conelist
, 5);
229 delaycones
= addchain(NULL
, yagGetChainInd(conelist
, 2));
232 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, D
, 'I', 'B');
233 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, D
);
235 if (delaycones
!= NULL
) {
236 sprintf(extname
, "%s_tasdelay", D
);
237 drivename
= namealloc(extname
);
238 ptbefig
->BEAUX
= beh_addbeaux(ptbefig
->BEAUX
, drivename
, createAtom(D
), (pNode
)yagMakeBequadConeList(delaycones
), 0);
242 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
243 value
= notExpr(createAtom(drivename
));
244 condition
= createExpr(AND
);
245 if (fall_edge
) addQExpr(condition
, notExpr(createAtom(CK
)));
246 else addQExpr(condition
, createAtom(CK
));
247 trigger
= createExpr(STABLE
);
248 addQExpr(trigger
, createAtom(CK
));
249 addQExpr(condition
, notExpr(trigger
));
250 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
252 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, CK
, 'I', 'B');
253 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, CK
);
255 sprintf(extname
, "%s'delayed", CK
);
256 lclname
= namealloc(extname
);
257 ptbefig
->BEDLY
= beh_addbeaux(ptbefig
->BEDLY
, lclname
, createAtom(CK
), NULL
, 0);
258 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, lclname
);
260 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, Q
, 'O', 'B');
261 ptbefig
->BEOUT
= beh_addbeout(ptbefig
->BEOUT
, Q
, createAtom(reg
), (pNode
)yagMakeBequadCone(outputcone
), 0);
262 ptbefig
->BEREG
= beh_addbereg(ptbefig
->BEREG
, reg
, ptbiabl
, yagMakeBinode(ptbiabl
, regcone
),0);
263 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, reg
);
265 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, "vdd", 'I', 'B');
266 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, "vss", 'I', 'B');
272 yagBuildBefigFFT2(name
, D_sig
, D_cone
, D
, CPN
, LD
, RE
, reg
, Q
, QN
, conelist
)
276 char *D
, *CPN
, *LD
, *RE
;
279 chain_list
*conelist
;
282 cone_list
*ptdrivecone
;
283 biabl_list
*ptbiabl
= NULL
;
284 chain_list
*value
, *condition
, *trigger
;
287 char extname
[YAGBUFSIZE
];
289 cone_list
*regcone
= NULL
;
290 cone_list
*outputcone
= NULL
;
291 chain_list
*delaycones
= NULL
;
293 ptbefig
= beh_addbefig(NULL
, name
);
295 if (conelist
!= NULL
&& YAG_CONTEXT
->YAG_TAS_TIMING
!= YAG_NO_TIMING
) {
296 regcone
= (cone_list
*)yagGetChainInd(conelist
, 7);
297 outputcone
= (cone_list
*)yagGetChainInd(conelist
, 8);
298 delaycones
= addchain(NULL
, yagGetChainInd(conelist
, 5));
302 ptuser
= getptype(D_sig
->USER
, YAG_CONE_PTYPE
);
303 if (ptuser
!= NULL
) ptdrivecone
= (cone_list
*)ptuser
->DATA
;
304 if (ptuser
== NULL
|| (ptdrivecone
->TYPE
& YAG_TEMPCONE
) != 0) {
305 yagAddGlueCone(D_sig
, D_cone
);
309 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, name
, 'I', 'B');
310 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, name
);
312 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
313 value
= createAtom(Q
);
314 condition
= createExpr(AND
);
315 /* addQExpr(condition, notExpr(createAtom(LD)));
316 addQExpr(condition, createAtom(RE));*/
317 addQExpr(condition
, notExpr(createAtom(CPN
)));
318 trigger
= createExpr(STABLE
);
319 addQExpr(trigger
, createAtom(CPN
));
320 addQExpr(condition
, notExpr(trigger
));
321 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
323 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
324 value
= createAtom("'1'");
325 condition
= createExpr(AND
);
326 addQExpr(condition
, notExpr(createAtom(LD
)));
327 addQExpr(condition
, notExpr(createAtom(RE
)));
328 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
329 if (ptbiabl
->NEXT
!= NULL
) ptbiabl
->NEXT
->FLAG
|= BEH_CND_PRECEDE
;
331 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
332 value
= notExpr(createAtom(D
));
333 condition
= createAtom(LD
);
334 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
335 if (ptbiabl
->NEXT
!= NULL
) ptbiabl
->NEXT
->FLAG
|= BEH_CND_PRECEDE
;
337 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, CPN
, 'I', 'B');
338 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, CPN
);
340 sprintf(extname
, "%s'delayed", CPN
);
341 lclname
= namealloc(extname
);
342 ptbefig
->BEDLY
= beh_addbeaux(ptbefig
->BEDLY
, lclname
, createAtom(CPN
), NULL
, 0);
343 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, lclname
);
345 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, LD
, 'I', 'B');
346 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, LD
);
347 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, RE
, 'I', 'B');
348 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, RE
);
349 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, Q
, 'O', 'B');
350 ptbefig
->BEOUT
= beh_addbeout(ptbefig
->BEOUT
, Q
, notExpr(createAtom(reg
)), (pNode
)yagMakeBequadCone(outputcone
), 0);
351 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, QN
, 'O', 'B');
352 ptbefig
->BEOUT
= beh_addbeout(ptbefig
->BEOUT
, QN
, createAtom(reg
), NULL
, 0);
353 ptbefig
->BEREG
= beh_addbereg(ptbefig
->BEREG
, reg
, ptbiabl
, yagMakeBinode(ptbiabl
, regcone
),0);
354 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, reg
);
356 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, "vdd", 'I', 'B');
357 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, "vss", 'I', 'B');
363 yagBuildBefigFD2R(name
, D_sig
, D_cone
, D
, CPN
, RE
, reg
, Q
, QN
, conelist
)
370 chain_list
*conelist
;
373 cone_list
*ptdrivecone
;
374 biabl_list
*ptbiabl
= NULL
;
375 chain_list
*value
, *condition
, *trigger
;
378 char extname
[YAGBUFSIZE
];
380 cone_list
*regcone
= NULL
;
381 cone_list
*outputcone
= NULL
;
382 chain_list
*delaycones
= NULL
;
384 ptbefig
= beh_addbefig(NULL
, name
);
386 if (conelist
!= NULL
&& YAG_CONTEXT
->YAG_TAS_TIMING
!= YAG_NO_TIMING
) {
387 regcone
= (cone_list
*)yagGetChainInd(conelist
, 3);
388 outputcone
= (cone_list
*)yagGetChainInd(conelist
, 4);
389 delaycones
= addchain(NULL
, yagGetChainInd(conelist
, 1));
393 ptuser
= getptype(D_sig
->USER
, YAG_CONE_PTYPE
);
394 if (ptuser
!= NULL
) ptdrivecone
= (cone_list
*)ptuser
->DATA
;
395 if (ptuser
== NULL
|| (ptdrivecone
->TYPE
& YAG_TEMPCONE
) != 0) {
396 yagAddGlueCone(D_sig
, D_cone
);
400 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, D
, 'I', 'B');
401 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, D
);
403 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
404 value
= notExpr(createAtom(D
));
405 condition
= createExpr(AND
);
406 /* addQExpr(condition, createAtom(RE));*/
407 addQExpr(condition
, notExpr(createAtom(CPN
)));
408 trigger
= createExpr(STABLE
);
409 addQExpr(trigger
, createAtom(CPN
));
410 addQExpr(condition
, notExpr(trigger
));
411 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
413 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
414 value
= createAtom("'1'");
415 condition
= notExpr(createAtom(RE
));
416 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
417 if (ptbiabl
->NEXT
!= NULL
) ptbiabl
->NEXT
->FLAG
|= BEH_CND_PRECEDE
;
419 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, CPN
, 'I', 'B');
420 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, CPN
);
422 sprintf(extname
, "%s'delayed", CPN
);
423 lclname
= namealloc(extname
);
424 ptbefig
->BEDLY
= beh_addbeaux(ptbefig
->BEDLY
, lclname
, createAtom(CPN
), NULL
, 0);
425 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, lclname
);
427 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, RE
, 'I', 'B');
428 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, RE
);
429 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, Q
, 'O', 'B');
430 ptbefig
->BEOUT
= beh_addbeout(ptbefig
->BEOUT
, Q
, notExpr(createAtom(reg
)), (pNode
)yagMakeBequadCone(outputcone
), 0);
431 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, QN
, 'O', 'B');
432 ptbefig
->BEOUT
= beh_addbeout(ptbefig
->BEOUT
, QN
, createAtom(reg
), NULL
, 0);
433 ptbefig
->BEREG
= beh_addbereg(ptbefig
->BEREG
, reg
, ptbiabl
, yagMakeBinode(ptbiabl
, regcone
),0);
435 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, "vdd", 'I', 'B');
436 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, "vss", 'I', 'B');
442 yagBuildBefigFD2S(name
, D_sig
, D_cone
, D
, CPN
, RE
, reg
, Q
, QN
, conelist
)
449 chain_list
*conelist
;
452 cone_list
*ptdrivecone
;
453 biabl_list
*ptbiabl
= NULL
;
454 chain_list
*value
, *condition
, *trigger
;
457 char extname
[YAGBUFSIZE
];
459 cone_list
*regcone
= NULL
;
460 cone_list
*outputcone
= NULL
;
461 chain_list
*delaycones
= NULL
;
463 ptbefig
= beh_addbefig(NULL
, name
);
465 if (conelist
!= NULL
&& YAG_CONTEXT
->YAG_TAS_TIMING
!= YAG_NO_TIMING
) {
466 regcone
= (cone_list
*)yagGetChainInd(conelist
, 3);
467 outputcone
= (cone_list
*)yagGetChainInd(conelist
, 4);
468 delaycones
= addchain(NULL
, yagGetChainInd(conelist
, 1));
472 ptuser
= getptype(D_sig
->USER
, YAG_CONE_PTYPE
);
473 if (ptuser
!= NULL
) ptdrivecone
= (cone_list
*)ptuser
->DATA
;
474 if (ptuser
== NULL
|| (ptdrivecone
->TYPE
& YAG_TEMPCONE
) != 0) {
475 yagAddGlueCone(D_sig
, D_cone
);
479 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, D
, 'I', 'B');
480 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, D
);
482 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
483 value
= notExpr(createAtom(D
));
484 condition
= createExpr(AND
);
485 /* addQExpr(condition, createAtom(RE));*/
486 addQExpr(condition
, notExpr(createAtom(CPN
)));
487 trigger
= createExpr(STABLE
);
488 addQExpr(trigger
, createAtom(CPN
));
489 addQExpr(condition
, notExpr(trigger
));
490 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
492 sprintf(label
, "lb%d", YAG_CONTEXT
->YAG_BIABL_INDEX
++);
493 value
= createAtom("'0'");
494 condition
= notExpr(createAtom(RE
));
495 ptbiabl
= beh_addbiabl(ptbiabl
, label
, condition
, value
);
496 if (ptbiabl
->NEXT
!= NULL
) ptbiabl
->NEXT
->FLAG
|= BEH_CND_PRECEDE
;
498 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, CPN
, 'I', 'B');
499 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, CPN
);
501 sprintf(extname
, "%s'delayed", CPN
);
502 lclname
= namealloc(extname
);
503 ptbefig
->BEDLY
= beh_addbeaux(ptbefig
->BEDLY
, lclname
, createAtom(CPN
), NULL
, 0);
504 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, lclname
);
506 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, RE
, 'I', 'B');
507 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, RE
);
508 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, Q
, 'O', 'B');
509 ptbefig
->BEOUT
= beh_addbeout(ptbefig
->BEOUT
, Q
, notExpr(createAtom(reg
)), (pNode
)yagMakeBequadCone(outputcone
), 0);
510 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, QN
, 'O', 'B');
511 ptbefig
->BEOUT
= beh_addbeout(ptbefig
->BEOUT
, QN
, createAtom(reg
), NULL
, 0);
512 ptbefig
->BEREG
= beh_addbereg(ptbefig
->BEREG
, reg
, ptbiabl
, yagMakeBinode(ptbiabl
, regcone
),0);
513 ptbefig
->BERIN
= beh_addberin(ptbefig
->BERIN
, reg
);
515 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, "vdd", 'I', 'B');
516 ptbefig
->BEPOR
= beh_addbepor(ptbefig
->BEPOR
, "vss", 'I', 'B');