Changeset 42 for vis_dev/vis-2.3/src/debug/debugAbnormal.c
- Timestamp:
- Jan 13, 2012, 6:32:51 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vis_dev/vis-2.3/src/debug/debugAbnormal.c
r41 r42 44 44 with a new table including the abnormal predicate. 45 45 For a combinatorial node n is tranformed into (abn_n)?i_n:n 46 If the abnormal predicate is activ then n is replaced by a free input] 46 If the abnormal predicate is active then n is replaced by a free input. 47 We assume that the combinatorial gate at on one bit only.] 47 48 48 49 SideEffects [fill the abnormal structure] … … 67 68 68 69 Tbl_Table_t *table = Ntk_NodeReadTable(node); 69 (void) fprintf(vis_stdout, "** old table\n"); 70 Tbl_TableWriteBlifMvToFile(table,2,vis_stdout); 70 if(abnormal->verbose){ 71 (void) fprintf(vis_stdout, "** old table\n"); 72 Tbl_TableWriteBlifMvToFile(table,2,vis_stdout); 73 } 71 74 // Build new variables abnormal and input 72 75 Ntk_Node_t * abnNode = Dbg_CreateNewNode(ntk,node,"abn"); … … 81 84 Tbl_TableAddColumn(table,i,0); 82 85 int iIndex = Tbl_TableReadVarIndex(table, i, 0); 83 84 //For each row already there in the table 86 85 87 int rowNum; 86 88 for(rowNum = 0; rowNum < Tbl_TableReadNumRows(table);rowNum++){ … … 94 96 //the new row 95 97 int r = Tbl_TableAddRow(table); 96 98 97 99 int colNum; 98 100 for (colNum = 0; colNum < Tbl_TableReadNumInputs(table); colNum++) { … … 104 106 Tbl_TableSetEntry(table, entry, r, colNum, 0); 105 107 } 108 int defaultVal = Dbg_GetDefaultValue(table); 109 if(defaultVal == -1) 110 { 111 (void) fprintf(vis_stdout, "Error default value of the table \ 112 of node %s\n", nodeName); 113 return; 114 } 115 int outVal = (defaultVal +1 )% 2; 116 if(abnormal->verbose) 117 (void) fprintf(vis_stdout, "Default value : %d\n",defaultVal); 106 118 for (colNum = 0; colNum < Tbl_TableReadNumOutputs(table); colNum++){ 107 119 Tbl_Entry_t * entry = Tbl_EntryAlloc(Tbl_EntryNormal_c); 108 Tbl_EntrySetValue(entry, 1,1);120 Tbl_EntrySetValue(entry,outVal,outVal); 109 121 Tbl_TableSetEntry(table, entry, r, colNum, 1); 110 122 } 123 if(abnormal->verbose){ 111 124 printf("---------------\n"); 112 125 Tbl_TableWriteBlifMvToFile(table,0,vis_stdout); 126 } 113 127 } 114 128 }
Note: See TracChangeset
for help on using the changeset viewer.