/**********************************************/
/*** Fonction permettant de creer une Befig ***/
/*** a partir du code genere par la lecture ***/
/*** de la Befig obtenue par le compilateur ***/
/***       fichier compile : nt1_y.vbe ***/
/**********************************************/

#include <stdio.h>
#include "mut312.h"
#include "log120.h"
#include "beh104.h"

befig_list *nt1_y()
{
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("nt1_y"));
befigAux->BERIN = beh_addberin(befigAux->BERIN,namealloc("vss"));
befigAux->BERIN = beh_addberin(befigAux->BERIN,namealloc("vdd"));
befigAux->BERIN = beh_addberin(befigAux->BERIN,namealloc("v2"));
befigAux->BERIN = beh_addberin(befigAux->BERIN,namealloc("v1"));
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("f"),'Z','M');
befigAux->BEPOR = beh_addbepor(befigAux->BEPOR,namealloc("v2"),'I','B');
befigAux->BEPOR = beh_addbepor(befigAux->BEPOR,namealloc("v1"),'I','B');
befigAux->BEPOR = beh_addbepor(befigAux->BEPOR,namealloc("i"),'I','B');
befigAux->BEPOR = (bepor_list *)reverse((chain_list *)befigAux->BEPOR);
valabl = charToExpr("(not i)");
cndabl = charToExpr("(not (xor (not (xor (and (or v2 (not i)) (or (not v1) i)) '1')) '1'))");
biabl = beh_addbiabl(biabl,"label0", cndabl, valabl);
befigAux->BEBUS = beh_addbebus(befigAux->BEBUS,namealloc("f"),biabl,NULL,'M');
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 1248;
genAux = beh_addbegen(genAux,"rup_v1","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 90;
genAux = beh_addbegen(genAux,"tplh_v1","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 58;
genAux = beh_addbegen(genAux,"cin_v1","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 1297;
genAux = beh_addbegen(genAux,"rdown_v2","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 51;
genAux = beh_addbegen(genAux,"tphl_v2","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 38;
genAux = beh_addbegen(genAux,"cin_v2","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 1248;
genAux = beh_addbegen(genAux,"rup_i","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 295;
genAux = beh_addbegen(genAux,"tplh_i","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 1297;
genAux = beh_addbegen(genAux,"rdown_i","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 288;
genAux = beh_addbegen(genAux,"tphl_i","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 88;
genAux = beh_addbegen(genAux,"cin_i","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 263;
genAux = beh_addbegen(genAux,"fanout","natural",(void *)pentier);
pentier = (int *) mbkalloc(sizeof(int));
*pentier = 4;
genAux = beh_addbegen(genAux,"area","natural",(void *)pentier);
befigAux->USER = addptype(NULL,BEH_GENERIC,(void *)genAux);
befigAux->FLAG = 0;
befigAux->CIRCUI = NULL;
befigAux->NEXT = NULL;
abl = charToExpr("(not (xor (not (xor (and (not (xor vdd '1')) (not (xor vss '0'))) '1')) '1'))");
befigAux->BEMSG = beh_addbemsg(befigAux->BEMSG,NULL,'W',"power supply is missing on nt1_y",abl,NULL);

return befigAux;
}

main()
{
vhdlsavebefig(nt1_y());
}
