/*****************************************************/
/*****  Fonction permettant de creer une Befig.  *****/
/*** Ce fichier est genere par le ~luc/luc/GEN/gen ***/
/**** qui prend en entree un .vbe et qui le parse ****/
/****            batch macrogenere                ****/
/***       fichier compile : bd.vbe    ***/
/**********************************************/

#include <stdio.h>
#include MUT_H
#include LOG_H
#include BEH_H

befig_list *bd()
{
befig_list *befigAux;
chain_list *abl;
begen_list *genAux = NULL;
int *pentier;
biabl_list *biabl = NULL;
chain_list *cndabl = NULL;
chain_list *valabl = NULL;
befigAux = beh_addbefig(NULL,namealloc("bd"));
befigAux->BERIN = beh_addberin(befigAux->BERIN,namealloc("dff_s"));
befigAux->BERIN = beh_addberin(befigAux->BERIN,namealloc("vss"));
befigAux->BERIN = beh_addberin(befigAux->BERIN,namealloc("vdd"));
befigAux->BERIN = beh_addberin(befigAux->BERIN,namealloc("l"));
befigAux->BERIN = beh_addberin(befigAux->BERIN,namealloc("i"));
befigAux->BEPOR = beh_addbepor(befigAux->BEPOR,namealloc("vss"),'I','B');
befigAux->BEPOR = beh_addbepor(befigAux->BEPOR,namealloc("vdd"),'I','B');
befigAux->BEPOR = beh_addbepor(befigAux->BEPOR,namealloc("t"),'O','B');
befigAux->BEPOR = beh_addbepor(befigAux->BEPOR,namealloc("l"),'I','B');
befigAux->BEPOR = beh_addbepor(befigAux->BEPOR,namealloc("i"),'I','B');
befigAux->BEPOR = (bepor_list *)reverse((chain_list *)befigAux->BEPOR);
abl = charToExpr("(not dff_s)");
befigAux->BEOUT = beh_addbeout(befigAux->BEOUT,namealloc("t"),abl,NULL);
valabl = charToExpr("(not i)");
cndabl = charToExpr("l");
biabl = beh_addbiabl(biabl,"label0", cndabl, valabl);
biabl->USER = NULL;
biabl->USER = addptype(biabl->USER,0,0);
befigAux->BEREG = beh_addbereg(befigAux->BEREG,namealloc("dff_s"),biabl,NULL);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 71;
genAux = beh_addbegen(genAux,"cin_l","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 40;
genAux = beh_addbegen(genAux,"cin_i","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 2138;
genAux = beh_addbegen(genAux,"rdown","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 1596;
genAux = beh_addbegen(genAux,"rup","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 3024;
genAux = beh_addbegen(genAux,"area","natural",(void *)pentier);
befigAux->BEGEN = genAux;
befigAux->CIRCUI = NULL;
befigAux->NEXT = NULL;
abl = charToExpr("(and vdd (not vss))");
befigAux->BEMSG = beh_addbemsg(befigAux->BEMSG,NULL,'W',"power supply is missing on bd",abl,NULL);

return befigAux;
}
