Ignore:
Timestamp:
Jan 13, 2012, 6:32:51 PM (12 years ago)
Author:
cecile
Message:

Fault candidates OK

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vis_dev/vis-2.3/src/debug/debug.c

    r41 r42  
    191191array_t          * LTLformulaArray;
    192192char             * ltlFileName     = NIL(char);
    193 
     193array_t          * faultNodes = array_alloc(Ntk_Node_t*,0);
    194194
    195195/*
     
    286286   
    287287
    288         array_t           *objClause = NIL(array_t);
     288        array_t *objClause = NIL(array_t);
    289289        objClause = array_alloc(int, 0);   
    290290        array_insert_last(int, objClause, noLoopIndex);
     
    295295    st_table * nodeToMvfAigTable =  NIL(st_table);
    296296    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));
    299299
    300300    Dbg_InitAbn(abn,manager, nodeToMvfAigTable,cnfClauses);
    301301
    302       //loop abnormal
     302    //loop abnormal
    303303    int aIndex;
    304304    Ntk_Node_t * abnNode;
    305      Dbg_ForEachAbnormal(abn,aIndex,abnNode){
    306      if(aIndex<=0){
    307      //set abnormal
     305    Dbg_ForEachAbnormal(abn,aIndex,abnNode){
     306      char * nodeName =  Ntk_NodeReadName(abnNode);
     307    //set abnormal
    308308      int cnfIndex = array_fetch(int,abn->abnCnfIndexArray, aIndex);
    309309      bAigEdge_t* abnBAig = array_fetch(bAigEdge_t*,abn->abnAigArray, aIndex);
    310310      int abnIndex = BmcGenerateCnfFormulaForAigFunction(manager,abnBAig[1],0,cnfClauses);
    311311      array_insert(int,cnfClauses->clauseArray,cnfIndex,abnIndex);
    312 
    313312      FILE *cnfFile = Cmd_FileOpen(options->satInFile, "w", NIL(char *), 0);
    314313      BmcWriteClauses(manager, cnfFile, cnfClauses, options);
    315314      fclose(cnfFile);
    316 
     315     
    317316      //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   }
    323332
    324333         if(verbose)
    325334                (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   
    328343Ctlsp_FormulaArrayFree(LTLformulaArray);   
    329344BmcCnfClausesFree(cnfClauses);
    330345BmcOptionFree(options);
     346array_free(faultNodes);
    331347return 0;
    332348 
Note: See TracChangeset for help on using the changeset viewer.