Changeset 42 for vis_dev/vis-2.3/src/debug/debug.c
- Timestamp:
- Jan 13, 2012, 6:32:51 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vis_dev/vis-2.3/src/debug/debug.c
r41 r42 191 191 array_t * LTLformulaArray; 192 192 char * ltlFileName = NIL(char); 193 193 array_t * faultNodes = array_alloc(Ntk_Node_t*,0); 194 194 195 195 /* … … 286 286 287 287 288 array_t 288 array_t *objClause = NIL(array_t); 289 289 objClause = array_alloc(int, 0); 290 290 array_insert_last(int, objClause, noLoopIndex); … … 295 295 st_table * nodeToMvfAigTable = NIL(st_table); 296 296 nodeToMvfAigTable = 297 (st_table *) Ntk_NetworkReadApplInfo(network, MVFAIG_NETWORK_APPL_KEY);298 assert(nodeToMvfAigTable != NIL(st_table));297 (st_table *) Ntk_NetworkReadApplInfo(network, MVFAIG_NETWORK_APPL_KEY); 298 assert(nodeToMvfAigTable != NIL(st_table)); 299 299 300 300 Dbg_InitAbn(abn,manager, nodeToMvfAigTable,cnfClauses); 301 301 302 302 //loop abnormal 303 303 int aIndex; 304 304 Ntk_Node_t * abnNode; 305 306 if(aIndex<=0){307 305 Dbg_ForEachAbnormal(abn,aIndex,abnNode){ 306 char * nodeName = Ntk_NodeReadName(abnNode); 307 //set abnormal 308 308 int cnfIndex = array_fetch(int,abn->abnCnfIndexArray, aIndex); 309 309 bAigEdge_t* abnBAig = array_fetch(bAigEdge_t*,abn->abnAigArray, aIndex); 310 310 int abnIndex = BmcGenerateCnfFormulaForAigFunction(manager,abnBAig[1],0,cnfClauses); 311 311 array_insert(int,cnfClauses->clauseArray,cnfIndex,abnIndex); 312 313 312 FILE *cnfFile = Cmd_FileOpen(options->satInFile, "w", NIL(char *), 0); 314 313 BmcWriteClauses(manager, cnfFile, cnfClauses, options); 315 314 fclose(cnfFile); 316 315 317 316 //SAT procedure 318 int res = Dbg_SatCheck("assig",options->cnfFileName); 319 320 array_insert(int,cnfClauses->clauseArray,cnfIndex,-abnIndex); 321 } 322 } 317 //assig assig input from cex 318 //TODO build cex correctly 319 int res = Dbg_SatCheck("assig",options->cnfFileName,options->verbosityLevel); 320 // Build set of FaultCandidates 321 if (res == SAT_SAT) 322 { 323 char * realNodeName = util_strsav(nodeName); 324 realNodeName[strlen(nodeName)-4] = '\0'; 325 Ntk_Node_t * realNode = Ntk_NetworkFindNodeByName(network,realNodeName); 326 array_insert_last(Ntk_Node_t*,faultNodes,realNode); 327 } 328 329 330 array_insert(int,cnfClauses->clauseArray,cnfIndex,-abnIndex); 331 } 323 332 324 333 if(verbose) 325 334 (void) fprintf(vis_stdout, "The _sat_debug generates %d clauses with %d\ 326 latches %d nodetomvf.\n",cnfClauses->noOfClauses,st_count(CoiTable),st_count(nodeToMvfAigTable)); 327 335 latches %d \n",cnfClauses->noOfClauses,st_count(CoiTable)); 336 337 (void) fprintf(vis_stdout,"Number of Fault candidates %d\n", 338 array_n(faultNodes)); 339 (void) fprintf(vis_stdout,"gates : \n"); 340 printNodeArray(faultNodes); 341 342 328 343 Ctlsp_FormulaArrayFree(LTLformulaArray); 329 344 BmcCnfClausesFree(cnfClauses); 330 345 BmcOptionFree(options); 346 array_free(faultNodes); 331 347 return 0; 332 348
Note: See TracChangeset
for help on using the changeset viewer.