[97] | 1 | #include "debugInt.h" |
---|
| 2 | |
---|
| 3 | Ntk_Node_t * createNewLatchNode(Ntk_Network_t * ntk,char * name) |
---|
| 4 | { |
---|
| 5 | Var_Variable_t * var = Var_VariableAlloc(NIL(Hrc_Node_t),name); |
---|
| 6 | char * initName = util_strcat3(name,"$INIT",""); |
---|
| 7 | char * nextName = util_strcat3(name,"$NS",""); |
---|
| 8 | char * dataName = util_strcat3(name,"DATA",""); |
---|
| 9 | Var_Variable_t * initVar = Var_VariableAlloc(NIL(Hrc_Node_t),initName); |
---|
| 10 | Var_Variable_t * nextVar = Var_VariableAlloc(NIL(Hrc_Node_t),nextName); |
---|
| 11 | Var_Variable_t * dataVar = Var_VariableAlloc(NIL(Hrc_Node_t),dataName); |
---|
| 12 | Ntk_Node_t * newLatch = Ntk_NodeCreateInNetwork(ntk, name,var); |
---|
| 13 | Ntk_Node_t * newLatchInit = Ntk_NodeCreateInNetwork(ntk, initName,initVar); |
---|
| 14 | Ntk_Node_t * newLatchNS = Ntk_NodeCreateInNetwork(ntk, nextName,nextVar); |
---|
| 15 | Ntk_Node_t * newLatchData = Ntk_NodeCreateInNetwork(ntk, dataName,dataVar); |
---|
| 16 | |
---|
| 17 | Ntk_NodeDeclareAsLatch(newLatch, dataName,initName); |
---|
| 18 | Ntk_NodeDeclareAsShadow(newLatchNS,newLatch); |
---|
| 19 | |
---|
| 20 | return newLatch; |
---|
| 21 | |
---|
| 22 | } |
---|
| 23 | void addRowValueToTable(Tbl_Table_t * table,int val_i, int val_o) |
---|
| 24 | { |
---|
| 25 | int r = Tbl_TableAddRow(table); |
---|
| 26 | int c = 0; |
---|
| 27 | int val; |
---|
| 28 | Tbl_Entry_t *entry = Tbl_EntryAlloc(Tbl_EntryNormal_c); |
---|
| 29 | val = (val_i&1); |
---|
| 30 | printf("val %d : %d \n",c,val); |
---|
| 31 | Tbl_EntrySetValue(entry,val,val); |
---|
| 32 | Tbl_TableSetEntry(table, entry, r, c++, 0); |
---|
| 33 | entry = Tbl_EntryAlloc(Tbl_EntryNormal_c); |
---|
| 34 | val = ((val_i&2)>>1); |
---|
| 35 | printf("val %d : %d \n",c,val); |
---|
| 36 | Tbl_EntrySetValue(entry,val,val); |
---|
| 37 | Tbl_TableSetEntry(table, entry, r, c++, 0); |
---|
| 38 | entry = Tbl_EntryAlloc(Tbl_EntryNormal_c); |
---|
| 39 | val = ((val_i&4)>>2); |
---|
| 40 | printf("val %d : %d \n",c,val); |
---|
| 41 | Tbl_EntrySetValue(entry,val,val); |
---|
| 42 | Tbl_TableSetEntry(table, entry, r, c++, 0); |
---|
| 43 | val = ((val_i&8)>>3); |
---|
| 44 | printf("val %d : %d \n",c,val); |
---|
| 45 | Tbl_EntrySetValue(entry,val,val); |
---|
| 46 | Tbl_TableSetEntry(table, entry, r, c++, 0); |
---|
| 47 | c = 0; |
---|
| 48 | entry = Tbl_EntryAlloc(Tbl_EntryNormal_c); |
---|
| 49 | //val = (val_0&1); |
---|
| 50 | printf("val O %d : %d \n",c,val); |
---|
| 51 | Tbl_EntrySetValue(entry,val,val); |
---|
| 52 | Tbl_TableSetEntry(table, entry, r, c++, 1); |
---|
| 53 | entry = Tbl_EntryAlloc(Tbl_EntryNormal_c); |
---|
| 54 | val = ((val_o&2)>>1); |
---|
| 55 | printf("val %d : %d \n",c,val); |
---|
| 56 | Tbl_EntrySetValue(entry,val,val); |
---|
| 57 | Tbl_TableSetEntry(table, entry, r, c++, 1); |
---|
| 58 | val = ((val_i&4)>>2); |
---|
| 59 | printf("val %d : %d \n",c,val); |
---|
| 60 | entry = Tbl_EntryAlloc(Tbl_EntryNormal_c); |
---|
| 61 | Tbl_EntrySetValue(entry,val,val); |
---|
| 62 | Tbl_TableSetEntry(table, entry, r, c++, 1); |
---|
| 63 | |
---|
| 64 | } |
---|
| 65 | Tbl_Table_t * createNewTable(char * name) |
---|
| 66 | { |
---|
| 67 | Tbl_Table_t * table = Tbl_TableAlloc(); |
---|
| 68 | char * name1 = util_strcat3(name,"1",""); |
---|
| 69 | Var_Variable_t * var1 = Var_VariableAlloc(NIL(Hrc_Node_t),name1); |
---|
| 70 | char * initName1 = util_strcat3(name,"$INIT",""); |
---|
| 71 | char * nextName1 = util_strcat3(name,"$NS",""); |
---|
| 72 | char * dataName1 = util_strcat3(name,"DATA",""); |
---|
| 73 | Var_Variable_t * initVar1 = Var_VariableAlloc(NIL(Hrc_Node_t),initName1); |
---|
| 74 | Var_Variable_t * nextVar1 = Var_VariableAlloc(NIL(Hrc_Node_t),nextName1); |
---|
| 75 | Var_Variable_t * dataVar1 = Var_VariableAlloc(NIL(Hrc_Node_t),dataName1); |
---|
| 76 | char * name2 = util_strcat3(name,"2",""); |
---|
| 77 | Var_Variable_t * var2 = Var_VariableAlloc(NIL(Hrc_Node_t),name2); |
---|
| 78 | char * initName2 = util_strcat3(name,"$INIT",""); |
---|
| 79 | char * nextName2 = util_strcat3(name,"$NS",""); |
---|
| 80 | char * dataName2 = util_strcat3(name,"DATA",""); |
---|
| 81 | Var_Variable_t * initVar2 = Var_VariableAlloc(NIL(Hrc_Node_t),initName2); |
---|
| 82 | Var_Variable_t * nextVar2 = Var_VariableAlloc(NIL(Hrc_Node_t),nextName2); |
---|
| 83 | Var_Variable_t * dataVar2 = Var_VariableAlloc(NIL(Hrc_Node_t),dataName2); |
---|
| 84 | char * name3 = util_strcat3(name,"3",""); |
---|
| 85 | Var_Variable_t * var3 = Var_VariableAlloc(NIL(Hrc_Node_t),name3); |
---|
| 86 | char * initName3 = util_strcat3(name,"$INIT",""); |
---|
| 87 | char * nextName3 = util_strcat3(name,"$NS",""); |
---|
| 88 | char * dataName3 = util_strcat3(name,"DATA",""); |
---|
| 89 | Var_Variable_t * initVar3 = Var_VariableAlloc(NIL(Hrc_Node_t),initName3); |
---|
| 90 | Var_Variable_t * nextVar3 = Var_VariableAlloc(NIL(Hrc_Node_t),nextName3); |
---|
| 91 | Var_Variable_t * dataVar3 = Var_VariableAlloc(NIL(Hrc_Node_t),dataName3); |
---|
| 92 | |
---|
| 93 | Var_Variable_t * nd = Var_VariableAlloc(NIL(Hrc_Node_t),"ND"); |
---|
| 94 | Var_VariableSetPI(nd); |
---|
| 95 | |
---|
| 96 | Var_VariableSetPS(var1); |
---|
| 97 | Var_VariableSetPS(var2); |
---|
| 98 | Var_VariableSetPS(var3); |
---|
| 99 | Var_VariableSetNS(nextVar1); |
---|
| 100 | Var_VariableSetNS(nextVar2); |
---|
| 101 | Var_VariableSetNS(nextVar3); |
---|
| 102 | |
---|
| 103 | Tbl_TableAddColumn(table,var1,0); |
---|
| 104 | Tbl_TableAddColumn(table,var2,0); |
---|
| 105 | Tbl_TableAddColumn(table,var3,0); |
---|
| 106 | Tbl_TableAddColumn(table,nd,0); |
---|
| 107 | Tbl_TableAddColumn(table,dataVar1,1); |
---|
| 108 | Tbl_TableAddColumn(table,dataVar2,1); |
---|
| 109 | Tbl_TableAddColumn(table,dataVar3,1); |
---|
| 110 | |
---|
| 111 | addRowValueToTable(table,0, 1); |
---|
| 112 | addRowValueToTable(table,1, 2); |
---|
| 113 | addRowValueToTable(table,2, 4); |
---|
| 114 | addRowValueToTable(table,4, 3); |
---|
| 115 | addRowValueToTable(table,6, 4); |
---|
| 116 | addRowValueToTable(table,8, 4); |
---|
| 117 | Tbl_TableWriteBlifMvToFile(table,0,vis_stdout); |
---|
| 118 | |
---|
| 119 | } |
---|
| 120 | mdd_t * buildDummy3(mdd_manager * mddManager,Ntk_Network_t * ntk) |
---|
| 121 | { |
---|
| 122 | //Ntk_Node_t * node = createNewLatchNode(ntk,"E2"); |
---|
| 123 | createNewTable("E"); |
---|
| 124 | return NIL(mdd_t); |
---|
| 125 | } |
---|
| 126 | |
---|