Esempio n. 1
0
/**Function*************************************************************

  Synopsis    []

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Mfs_ManStop( Mfs_Man_t * p )
{
    if ( p->pPars->fVerbose )
        Mfs_ManPrint( p );
    if ( p->vTruth )
        Vec_IntFree( p->vTruth );
    if ( p->pManDec )
        Bdc_ManFree( p->pManDec );
    if ( p->pCare )
        Aig_ManStop( p->pCare );
    if ( p->vSuppsInv )
        Vec_VecFree( (Vec_Vec_t *)p->vSuppsInv );
    if ( p->vProbs )
        Vec_IntFree( p->vProbs );
    Mfs_ManClean( p );
    Int_ManFree( p->pMan );
    Vec_IntFree( p->vMem );
    Vec_VecFree( p->vLevels );
    Vec_PtrFree( p->vMfsFanins );
    Vec_IntFree( p->vProjVarsCnf );
    Vec_IntFree( p->vProjVarsSat );
    Vec_IntFree( p->vDivLits );
    Vec_PtrFree( p->vDivCexes );
    ABC_FREE( p );
}
Esempio n. 2
0
/**Function*************************************************************

  Synopsis    [Free Ptr.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Cba_PtrFreeNtk( Vec_Ptr_t * vNtk )
{
    Vec_PtrFree( (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 1) );
    Vec_PtrFree( (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 2) );
    Vec_VecFree( (Vec_Vec_t *)Vec_PtrEntry(vNtk, 3) );
    Vec_VecFree( (Vec_Vec_t *)Vec_PtrEntry(vNtk, 4) );
    if ( Vec_PtrSize(vNtk) > 5 )
        Vec_FltFree( (Vec_Flt_t *)Vec_PtrEntry(vNtk, 5) );
    if ( Vec_PtrSize(vNtk) > 6 )
        Vec_FltFree( (Vec_Flt_t *)Vec_PtrEntry(vNtk, 6) );
    Vec_PtrFree( vNtk );
}
Esempio n. 3
0
/**Function*************************************************************

  Synopsis    [Stops the simulation manager.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Sym_ManStop( Sym_Man_t * p )
{
    int i;
    Sym_ManPrintStats( p );
    if ( p->vSuppFun )     Sim_UtilInfoFree( p->vSuppFun );   
    if ( p->vSim )         Sim_UtilInfoFree( p->vSim );   
    if ( p->vNodes )       Vec_PtrFree( p->vNodes );
    if ( p->vSupports )    Vec_VecFree( p->vSupports );
    for ( i = 0; i < p->nOutputs; i++ )
    {
        Extra_BitMatrixStop( p->vMatrSymms->pArray[i] );
        Extra_BitMatrixStop( p->vMatrNonSymms->pArray[i] );
    }
    Vec_IntFree( p->vVarsU );
    Vec_IntFree( p->vVarsV );
    Vec_PtrFree( p->vMatrSymms );
    Vec_PtrFree( p->vMatrNonSymms );
    Vec_IntFree( p->vPairsTotal );
    Vec_IntFree( p->vPairsSym );
    Vec_IntFree( p->vPairsNonSym );
    FREE( p->uPatRand );
    FREE( p->uPatCol );
    FREE( p->uPatRow );
    free( p );
}
/**Function*************************************************************

  Synopsis    []

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Abc_FrameDeallocate( Abc_Frame_t * p )
{
    extern void Rwt_ManGlobalStop();
    extern void undefine_cube_size();
//    extern void Ivy_TruthManStop();
//    Abc_HManStop();
//    undefine_cube_size();
    Rwt_ManGlobalStop();
//    Ivy_TruthManStop();
    if ( p->vAbcObjIds)  Vec_IntFree( p->vAbcObjIds );
    if ( p->vCexVec   )  Vec_PtrFreeFree( p->vCexVec );
    if ( p->vPoEquivs )  Vec_VecFree( (Vec_Vec_t *)p->vPoEquivs );
    if ( p->vStatuses )  Vec_IntFree( p->vStatuses );
    if ( p->pLibVer   )  Abc_LibFree( (Abc_Lib_t *)p->pLibVer, NULL );
    if ( p->pManDec   )  Dec_ManStop( (Dec_Man_t *)p->pManDec );
    if ( p->dd        )  Extra_StopManager( p->dd );
    if ( p->vStore    )  Vec_PtrFree( p->vStore );
    if ( p->pSave1    )  Aig_ManStop( (Aig_Man_t *)p->pSave1 );
    if ( p->pSave2    )  Aig_ManStop( (Aig_Man_t *)p->pSave2 );
    if ( p->pSave3    )  Aig_ManStop( (Aig_Man_t *)p->pSave3 );
    if ( p->pSave4    )  Aig_ManStop( (Aig_Man_t *)p->pSave4 );
    if ( p->vPlugInComBinPairs ) 
    {
        char * pTemp;
        int i;
        Vec_PtrForEachEntry( char *, p->vPlugInComBinPairs, pTemp, i )
            ABC_FREE( pTemp );
        Vec_PtrFree( p->vPlugInComBinPairs );
    }
Esempio n. 5
0
/**Function*************************************************************

  Synopsis    [Performs simulation of a word-level network.]

  Description [Returns vRes, a 2D array of simulation information for 
  the output of each bit of each object listed in vNodes. In particular, 
  Vec_Ptr_t * vSimObj = (Vec_Ptr_t *)Vec_PtrEntry(vRes, iObj) and
  Vec_Ptr_t * vSimObjBit = (Vec_Ptr_t *)Vec_PtrEntry(vSimObj, iBit)
  are arrays containing the simulation info for each object (vSimObj) 
  and for each output bit of this object (vSimObjBit). Alternatively,
  Vec_Ptr_t * vSimObjBit = Vec_VecEntryEntry( (Vec_Vec_t *)vRes, iObj, iBit ).
  The output bitwidth of an object is Wlc_ObjRange( Wlc_NtkObj(pNtk, iObj) ).
  Simulation information is binary data constaining the given number (nWords)
  of 64-bit machine words for the given number (nFrames) of consecutive 
  timeframes.  The total number of timeframes is nWords * nFrames for 
  each bit of each object.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Wlc_NtkDeleteSim( Vec_Ptr_t * p )
{
    word * pInfo; int i, k;
    Vec_Vec_t * vVec = (Vec_Vec_t *)p;
    Vec_VecForEachEntry( word *, vVec, pInfo, i, k )
        ABC_FREE( pInfo );
    Vec_VecFree( vVec );
}
/**Function*************************************************************

  Synopsis    [Stops the rewriting manager.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Dar_ManRefStop( Ref_Man_t * p )
{
    if ( p->pPars->fVerbose )
        Dar_ManRefPrintStats( p );
    Vec_VecFree( p->vCuts );
    Vec_PtrFree( p->vTruthElem );
    Vec_PtrFree( p->vTruthStore );
    Vec_PtrFree( p->vLeavesBest );
    Vec_IntFree( p->vMemory );
    Vec_PtrFree( p->vCutNodes );
    free( p );
}
Esempio n. 7
0
/**Function*************************************************************

  Synopsis    [Stops the simulation manager.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Sim_ManStop( Sim_Man_t * p )
{
    Sim_ManPrintStats( p );
    if ( p->vSim0 )        Sim_UtilInfoFree( p->vSim0 );       
    if ( p->vSim1 )        Sim_UtilInfoFree( p->vSim1 );       
    if ( p->vSuppStr )     Sim_UtilInfoFree( p->vSuppStr );    
//    if ( p->vSuppFun )     Sim_UtilInfoFree( p->vSuppFun );    
    if ( p->vSuppTargs )   Vec_VecFree( p->vSuppTargs );
    if ( p->pMmPat )       Extra_MmFixedStop( p->pMmPat );
    if ( p->vFifo )        Vec_PtrFree( p->vFifo );
    if ( p->vDiffs )       Vec_IntFree( p->vDiffs );
    free( p );
}
Esempio n. 8
0
/**Function*************************************************************

  Synopsis    [Partitioning using levelized order.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Vec_Int_t * Aig_ManPartitionLevelized( Aig_Man_t * p, int nPartSize )
{
    Vec_Int_t * vId2Part;
    Vec_Vec_t * vNodes;
    Aig_Obj_t * pObj;
    int i, k, Counter = 0;
    vNodes = Aig_ManLevelize( p );
    vId2Part = Vec_IntStart( Aig_ManObjNumMax(p) );
    Vec_VecForEachEntryReverseReverse( Aig_Obj_t *, vNodes, pObj, i, k )
        Vec_IntWriteEntry( vId2Part, Aig_ObjId(pObj), Counter++/nPartSize );
    Vec_VecFree( vNodes );
    return vId2Part;
}
Esempio n. 9
0
/**Function*************************************************************

  Synopsis    [Deallocs a library.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Amap_LibFree( Amap_Lib_t * p )
{
    if ( p == NULL )
        return;
    if ( p->vSelect )
        Vec_PtrFree( p->vSelect );
    if ( p->vSorted )
        Vec_PtrFree( p->vSorted );
    if ( p->vGates )
        Vec_PtrFree( p->vGates );
    if ( p->vRules )
        Vec_VecFree( (Vec_Vec_t *)p->vRules );
    if ( p->vRulesX )
        Vec_VecFree( (Vec_Vec_t *)p->vRulesX );
    if ( p->vRules3 )
        Vec_IntFree( p->vRules3 );
    Aig_MmFlexStop( p->pMemGates, 0 );
    Aig_MmFlexStop( p->pMemSet, 0 );
    ABC_FREE( p->pRules );
    ABC_FREE( p->pRulesX );
    ABC_FREE( p->pNodes );
    ABC_FREE( p->pName );
    ABC_FREE( p );
}
Esempio n. 10
0
/**Function*************************************************************

  Synopsis    [Stops rewriting manager.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Rwr_ManStop( Rwr_Man_t * p )
{
    if ( p->vClasses )
    {
        Rwr_Node_t * pNode;
        int i, k;
        Vec_VecForEachEntry( p->vClasses, pNode, i, k )
            Dec_GraphFree( (Dec_Graph_t *)pNode->pNext );
    }
    if ( p->vClasses )  Vec_VecFree( p->vClasses );
    Vec_PtrFree( p->vNodesTemp );
    Vec_PtrFree( p->vForest );
    Vec_IntFree( p->vLevNums );
    Vec_PtrFree( p->vFanins );
    Vec_PtrFree( p->vFaninsCur );
    Extra_MmFixedStop( p->pMmNode );
    FREE( p->pMapInv );
    free( p->pTable );
    free( p->pPractical );
    free( p->pPerms4 );
    free( p );
}
Esempio n. 11
0
/**Function*************************************************************

  Synopsis    []

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Sat_ProofChecker( char * pFileName )
{
    FILE * pFile;
    Vec_Vec_t * vClauses;
    int c, i, Num, RetValue, Counter, Counter2, Clause1, Clause2;
    int RetValue;
    // open the file
    pFile = fopen( pFileName, "r" );
    if ( pFile == NULL )
        return;
    // count the number of clauses
    Counter = Counter2 = 0;
    while ( (c = fgetc(pFile)) != EOF )
    {
        Counter += (c == '\n');
        Counter2 += (c == '*');
    }
    vClauses = Vec_VecStart( Counter+1 );
    printf( "The proof contains %d roots and %d resolution steps.\n", Counter-Counter2, Counter2 );
    // read the clauses
    rewind( pFile );
    for ( i = 1 ; ; i++ )
    {
        RetValue = RetValue = fscanf( pFile, "%d", &Num );
        if ( RetValue != 1 )
            break;
        assert( Num == i );
        while ( (c = fgetc( pFile )) == ' ' );
        if ( c == '*' )
        {
            RetValue = fscanf( pFile, "%d %d", &Clause1, &Clause2 );
            assert( RetValue == 2 );
            RetValue = fscanf( pFile, "%d", &Num );
            assert( RetValue == 1 );
            assert( Num == 0 );
            if ( !Sat_ProofResolve( vClauses, i, Clause1, Clause2 ) )
            {
                printf( "Error detected in the resolution proof.\n" );
                Vec_VecFree( vClauses );
                fclose( pFile );
                return;
            }
        }
        else
        {
            ungetc( c, pFile );
            while ( 1 )
            {
                RetValue = fscanf( pFile, "%d", &Num );
                assert( RetValue == 1 );
                if ( Num == 0 )
                    break;
                Vec_VecPush( vClauses, i, (void *)Num );
            }
            RetValue = fscanf( pFile, "%d", &Num );
            assert( RetValue == 1 );
            assert( Num == 0 );
        }
    }
    assert( i-1 == Counter );
    if ( Vec_IntSize( Vec_VecEntry(vClauses, Counter) ) != 0 )
        printf( "The last clause is not empty.\n" );
    else
        printf( "The empty clause is derived.\n" );
    Vec_VecFree( vClauses );
    fclose( pFile );
}