Ignore:
Timestamp:
Jan 24, 2012, 3:41:23 PM (13 years ago)
Author:
cecile
Message:

abnormal predicate done

File:
1 edited

Legend:

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

    r42 r44  
    1919        char * nodeName = util_strsav(Ntk_NodeReadName(node));
    2020        //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,"");
    2324        Var_Variable_t * var = Var_VariableAlloc(NIL(Hrc_Node_t),newVarName);
    2425        //Create new Node
     
    4546  For a combinatorial node n is tranformed into (abn_n)?i_n:n
    4647  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.]
    4851
    4952  SideEffects [fill the abnormal structure]
     
    5356******************************************************************************/
    5457
    55 void Dbg_AddAbnormalPredicatetoNetwork(Dbg_Abnormal_t* abnormal ) /*abnormal struct*/
     58void Dbg_AddAbnormalPredicatetoNetwork(Dbg_Abnormal_t* abnormal,array_t* excludes)
    5659{
    5760
     
    6164  Ntk_NetworkForEachNode(ntk,gen,node){
    6265  //For each combinatorial node
    63   if(Ntk_NodeTestIsCombinational(node)){
     66  if(Ntk_NodeTestIsCombinational(node) && !Ntk_NodeTestIsLatchDataInput(node)){
    6467        if(Ntk_NodeReadNumFanins(node) > 1 && Ntk_NodeReadNumFanouts(node)> 0)
    6568        {
    6669                char * nodeName = util_strsav(Ntk_NodeReadName(node));
     70
     71
     72      if(!Dbg_TestNodeInSubs(nodeName,excludes)){
    6773        printf("%s \n",  nodeName);
    6874
     
    125131                 Tbl_TableWriteBlifMvToFile(table,0,vis_stdout);
    126132        }
     133      }
    127134          }
    128135        }
     
    132139 (void *) abnormal);
    133140}
     141
    134142/**Function********************************************************************
    135143 
     
    289297  Synopsis    [Initialize the abnormal predicate in the clauses array abni =0]
    290298
    291   Description [Fill the Dbg data structure, abnAigArray conains the set of Aig
     299  Description [Fill the Dbg data structure, abnAigArray contains the set of Aig
    292300  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
    295304  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. ]
    297306
    298307  SideEffects [Fill abnAigArray and abnCnfIndexArray]
     
    304313bAig_Manager_t   * manager,
    305314st_table * nodeToMvfAigTable,
     315int k,
    306316BmcCnfClauses_t *cnfClauses)
    307317{
     
    315325   int size = array_n(abn->abnormal);
    316326   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;
    318329   int aIndex;
    319330   Ntk_Node_t * abnNode;
     
    322333    if (abnMvfAig ==  NIL(MvfAig_Function_t)){
    323334     (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));
    325336     return ;
    326337    }
     
    335346    }
    336347    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);
    345363   }
    346364   abn->abnAigArray = abnAigArray;
Note: See TracChangeset for help on using the changeset viewer.