Changeset 44 for vis_dev/vis-2.3/src/debug/debugAbnormal.c
- Timestamp:
- Jan 24, 2012, 3:41:23 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vis_dev/vis-2.3/src/debug/debugAbnormal.c
r42 r44 19 19 char * nodeName = util_strsav(Ntk_NodeReadName(node)); 20 20 //Create var Name 21 char * newVarName = (char *) malloc(strlen(nodeName) + strlen(varName) +1); 22 sprintf(newVarName,"%s_%s",nodeName,varName); 21 //char * newVarName = (char *) malloc(strlen(nodeName) + strlen(varName) +1); 22 //sprintf(newVarName,"%s_%s",nodeName,varName); 23 char * newVarName = util_strcat3(nodeName,varName,""); 23 24 Var_Variable_t * var = Var_VariableAlloc(NIL(Hrc_Node_t),newVarName); 24 25 //Create new Node … … 45 46 For a combinatorial node n is tranformed into (abn_n)?i_n:n 46 47 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.] 48 We assume that the combinatorial gate at on one bit only. 49 The array excludes contains name of submodules which we do not want to add 50 abnormal predicates.] 48 51 49 52 SideEffects [fill the abnormal structure] … … 53 56 ******************************************************************************/ 54 57 55 void Dbg_AddAbnormalPredicatetoNetwork(Dbg_Abnormal_t* abnormal ) /*abnormal struct*/58 void Dbg_AddAbnormalPredicatetoNetwork(Dbg_Abnormal_t* abnormal,array_t* excludes) 56 59 { 57 60 … … 61 64 Ntk_NetworkForEachNode(ntk,gen,node){ 62 65 //For each combinatorial node 63 if(Ntk_NodeTestIsCombinational(node) ){66 if(Ntk_NodeTestIsCombinational(node) && !Ntk_NodeTestIsLatchDataInput(node)){ 64 67 if(Ntk_NodeReadNumFanins(node) > 1 && Ntk_NodeReadNumFanouts(node)> 0) 65 68 { 66 69 char * nodeName = util_strsav(Ntk_NodeReadName(node)); 70 71 72 if(!Dbg_TestNodeInSubs(nodeName,excludes)){ 67 73 printf("%s \n", nodeName); 68 74 … … 125 131 Tbl_TableWriteBlifMvToFile(table,0,vis_stdout); 126 132 } 133 } 127 134 } 128 135 } … … 132 139 (void *) abnormal); 133 140 } 141 134 142 /**Function******************************************************************** 135 143 … … 289 297 Synopsis [Initialize the abnormal predicate in the clauses array abni =0] 290 298 291 Description [Fill the Dbg data structure, abnAigArray con ains the set of Aig299 Description [Fill the Dbg data structure, abnAigArray contains the set of Aig 292 300 for the set of abnormal perdicate. Each abnormal are set to zero in the clause 293 array.predicabnCnfIndexArray is the cnf index. The correspondance is made by 294 the index in the table, the index of a node in abnArray is the same in 301 array.predicabnCnfIndexArray is the cnf index for each k steps. 302 The correspondance is made by the index in the table, 303 the index of a node in abnArray is the same in 295 304 abnAigArray and in abnIndexArray. If this array were alredy computed nothing 296 is done, if the aig or index information either. ]305 is done, if the aig or index information either. ] 297 306 298 307 SideEffects [Fill abnAigArray and abnCnfIndexArray] … … 304 313 bAig_Manager_t * manager, 305 314 st_table * nodeToMvfAigTable, 315 int k, 306 316 BmcCnfClauses_t *cnfClauses) 307 317 { … … 315 325 int size = array_n(abn->abnormal); 316 326 array_t * abnAigArray = array_alloc(bAigEdge_t *,size); 317 array_t * abnIndexArray = array_alloc(int,size); 327 array_t * abnIndexArray = array_alloc(array_t*,size); 328 int i; 318 329 int aIndex; 319 330 Ntk_Node_t * abnNode; … … 322 333 if (abnMvfAig == NIL(MvfAig_Function_t)){ 323 334 (void) fprintf(vis_stdout, "No multi-valued function for this node %s \ 324 create abnormal predicate firs \n", Ntk_NodeReadName(abnNode));335 create abnormal predicate first \n", Ntk_NodeReadName(abnNode)); 325 336 return ; 326 337 } … … 335 346 } 336 347 array_insert(bAigEdge_t*,abnAigArray,aIndex,abnBAig); 337 int abnIndex = BmcGenerateCnfFormulaForAigFunction(manager,abnBAig[0],0,cnfClauses); 338 array_insert(int,abnIndexArray,aIndex,cnfClauses->nextIndex); 339 // Create clause 340 array_t *abnClause = NIL(array_t); 341 abnClause = array_alloc(int, 0); 342 array_insert_last(int, abnClause, abnIndex); 343 BmcCnfInsertClause(cnfClauses, abnClause); 344 array_free(abnClause); 348 // Cnf Index 349 array_t * indexArray = array_alloc(int,k); 350 for (i = 0; i <= k;i++) 351 { 352 int abnIndex = BmcGenerateCnfFormulaForAigFunction(manager,abnBAig[0],i,cnfClauses); 353 array_insert(int,indexArray,i,cnfClauses->nextIndex); 354 // Create clause 355 array_t *abnClause = NIL(array_t); 356 abnClause = array_alloc(int, 0); 357 array_insert_last(int, abnClause, abnIndex); 358 BmcCnfInsertClause(cnfClauses, abnClause); 359 array_free(abnClause); 360 } 361 array_insert(array_t*,abnIndexArray,aIndex,indexArray); 362 //array_free(indexArray); 345 363 } 346 364 abn->abnAigArray = abnAigArray;
Note: See TracChangeset
for help on using the changeset viewer.