abc/src/misc/util/utilIsop.c
/**Function*************************************************************

  Synopsis    [Compute CNF assuming it does not exceed the limit.]

  Description [Please note that pCover should have at least 32 extra entries!]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Compute CNF assuming it does not exceed the limit.]

Description [Please note that pCover should have at least 32 extra entries!]




Function Synopsis [ Compute CNF assuming it does not exceed the limit . ] Description [ Please note that pCover should have at least 32 extra entries! ]
int Abc_IsopTest( word * pFunc, int nVars, Vec_Int_t * vCover )
{
    int fVerbose = 0;    
    static word TotalCost[6] = {0};
    static abctime TotalTime[6] = {0};
    static int Counter;
    word pRes[ABC_ISOP_MAX_WORD];
    word Cost;
    abctime clk;
    Counter++;
    if ( Counter == 9999 )
    {
        Abc_PrintTime( 1, "0", TotalTime[0] );
        Abc_PrintTime( 1, "1", TotalTime[1] );
        Abc_PrintTime( 1, "2", TotalTime[2] );
        Abc_PrintTime( 1, "3", TotalTime[3] );
        Abc_PrintTime( 1, "4", TotalTime[4] );
        Abc_PrintTime( 1, "5", TotalTime[5] );
    }
    assert( nVars <= ABC_ISOP_MAX_VAR );
    clk = Abc_Clock();
    Cost = Abc_IsopCheck( pFunc, pFunc, pRes, nVars, Abc_Cube2Cost(ABC_ISOP_MAX_CUBE), Vec_IntArray(vCover) );
    vCover->nSize = Abc_CostCubes(Cost);
    assert( vCover->nSize <= vCover->nCap );
    if ( fVerbose )
    printf( "%5d %7d  ", Abc_CostCubes(Cost), Abc_CostLits(Cost) );
    TotalCost[0] += Abc_CostCubes(Cost);
    TotalTime[0] += Abc_Clock() - clk;
    clk = Abc_Clock();
    Abc_TtNot( pFunc, Abc_TtWordNum(nVars) );
    Cost = Abc_IsopCheck( pFunc, pFunc, pRes, nVars, Abc_Cube2Cost(ABC_ISOP_MAX_CUBE), Vec_IntArray(vCover) );
    Abc_TtNot( pFunc, Abc_TtWordNum(nVars) );
    vCover->nSize = Abc_CostCubes(Cost);
    assert( vCover->nSize <= vCover->nCap );
    if ( fVerbose )
    printf( "%5d %7d  ", Abc_CostCubes(Cost), Abc_CostLits(Cost) );
    TotalCost[1] += Abc_CostCubes(Cost);
    TotalTime[1] += Abc_Clock() - clk;
    clk = Abc_Clock();
    Cost = Abc_Isop( pFunc, nVars, ABC_ISOP_MAX_CUBE, vCover, 1 );
    if ( fVerbose )
    printf( "%5d %7d   ", Vec_IntSize(vCover), Abc_IsopCountLits(vCover, nVars) );
    TotalCost[5] += Vec_IntSize(vCover);
    TotalTime[5] += Abc_Clock() - clk;
    if ( fVerbose )
    printf( "  | %8d %8d %8d %8d %8d %8d", (int)TotalCost[0], (int)TotalCost[1], (int)TotalCost[2], (int)TotalCost[3], (int)TotalCost[4], (int)TotalCost[5] );
    if ( fVerbose )
    printf( "\n" );
    return 1; 
}
int Abc_IsopTest ( word * pFunc , int nVars , Vec_Int_t * vCover ) { int fVerbose = 0 ; static word TotalCost [ 6 ] = { 0 } ; static abctime TotalTime [ 6 ] = { 0 } ; static int Counter ; word pRes [ ABC_ISOP_MAX_WORD ] ; word Cost ; abctime clk ; Counter ++ ; if ( Counter == 9999 ) { Abc_PrintTime ( 1 , " " , TotalTime [ 0 ] ) ; Abc_PrintTime ( 1 , " " , TotalTime [ 1 ] ) ; Abc_PrintTime ( 1 , " " , TotalTime [ 2 ] ) ; Abc_PrintTime ( 1 , " " , TotalTime [ 3 ] ) ; Abc_PrintTime ( 1 , " " , TotalTime [ 4 ] ) ; Abc_PrintTime ( 1 , " " , TotalTime [ 5 ] ) ; } assert ( nVars <= ABC_ISOP_MAX_VAR ) ; clk = Abc_Clock ( ) ; Cost = Abc_IsopCheck ( pFunc , pFunc , pRes , nVars , Abc_Cube2Cost ( ABC_ISOP_MAX_CUBE ) , Vec_IntArray ( vCover ) ) ; vCover -> nSize = Abc_CostCubes ( Cost ) ; assert ( vCover -> nSize <= vCover -> nCap ) ; if ( fVerbose ) printf ( " " , Abc_CostCubes ( Cost ) , Abc_CostLits ( Cost ) ) ; TotalCost [ 0 ] += Abc_CostCubes ( Cost ) ; TotalTime [ 0 ] += Abc_Clock ( ) - clk ; clk = Abc_Clock ( ) ; Abc_TtNot ( pFunc , Abc_TtWordNum ( nVars ) ) ; Cost = Abc_IsopCheck ( pFunc , pFunc , pRes , nVars , Abc_Cube2Cost ( ABC_ISOP_MAX_CUBE ) , Vec_IntArray ( vCover ) ) ; Abc_TtNot ( pFunc , Abc_TtWordNum ( nVars ) ) ; vCover -> nSize = Abc_CostCubes ( Cost ) ; assert ( vCover -> nSize <= vCover -> nCap ) ; if ( fVerbose ) printf ( " " , Abc_CostCubes ( Cost ) , Abc_CostLits ( Cost ) ) ; TotalCost [ 1 ] += Abc_CostCubes ( Cost ) ; TotalTime [ 1 ] += Abc_Clock ( ) - clk ; clk = Abc_Clock ( ) ; Cost = Abc_Isop ( pFunc , nVars , ABC_ISOP_MAX_CUBE , vCover , 1 ) ; if ( fVerbose ) printf ( " " , Vec_IntSize ( vCover ) , Abc_IsopCountLits ( vCover , nVars ) ) ; TotalCost [ 5 ] += Vec_IntSize ( vCover ) ; TotalTime [ 5 ] += Abc_Clock ( ) - clk ; if ( fVerbose ) printf ( " " , ( int ) TotalCost [ 0 ] , ( int ) TotalCost [ 1 ] , ( int ) TotalCost [ 2 ] , ( int ) TotalCost [ 3 ] , ( int ) TotalCost [ 4 ] , ( int ) TotalCost [ 5 ] ) ; if ( fVerbose ) printf ( " \n " ) ; return 1 ; }
Function
Synopsis    [Compute CNF assuming it does not exceed the limit.]
Function Synopsis [ Compute CNF assuming it does not exceed the limit . ]
//    if ( fVerbose ) //    Dau_DsdPrintFromTruth( pFunc, nVars ), printf( "         " ); //    Abc_IsopVerify( pFunc, nVars, pRes, vCover, 0, 0 ); //    Abc_IsopVerify( pFunc, nVars, pRes, vCover, 0, 1 ); /*
    clk = Abc_Clock();
    Cost = Abc_EsopCheck( pFunc, nVars, Abc_Cube2Cost(ABC_ISOP_MAX_CUBE), Vec_IntArray(vCover) );
    vCover->nSize = Abc_CostCubes(Cost);
    assert( vCover->nSize <= vCover->nCap );
    if ( fVerbose )
    printf( "%5d %7d   ", Abc_CostCubes(Cost), Abc_CostLits(Cost) );
//    Abc_IsopVerify( pFunc, nVars, pRes, vCover, 1, 0 );
    TotalCost[2] += Abc_CostCubes(Cost);
    TotalTime[2] += Abc_Clock() - clk;


    clk = Abc_Clock();
    Abc_TtNot( pFunc, Abc_TtWordNum(nVars) );
    Cost = Abc_EsopCheck( pFunc, nVars, Abc_Cube2Cost(ABC_ISOP_MAX_CUBE), Vec_IntArray(vCover) );
    Abc_TtNot( pFunc, Abc_TtWordNum(nVars) );
    vCover->nSize = Abc_CostCubes(Cost);
    assert( vCover->nSize <= vCover->nCap );
    if ( fVerbose )
    printf( "%5d %7d   ", Abc_CostCubes(Cost), Abc_CostLits(Cost) );
//    Abc_IsopVerify( pFunc, nVars, pRes, vCover, 1, 1 );
    TotalCost[3] += Abc_CostCubes(Cost);
    TotalTime[3] += Abc_Clock() - clk;
*/ /*
    // try new computation
    clk = Abc_Clock();
    Cost = Abc_IsopNew( pFunc, pFunc, pRes, nVars, Abc_Cube2Cost(ABC_ISOP_MAX_CUBE), Vec_IntArray(vCover) );
    vCover->nSize = Abc_CostCubes(Cost);
    assert( vCover->nSize <= vCover->nCap );
    if ( fVerbose )
    printf( "%5d %7d   ", Abc_CostCubes(Cost), Abc_CostLits(Cost) );
    Abc_IsopVerify( pFunc, nVars, pRes, vCover, 0, 0 );
    TotalCost[4] += Abc_CostCubes(Cost);
    TotalTime[4] += Abc_Clock() - clk;
*/ /*
    // try old computation
    clk = Abc_Clock();
    Cost = Kit_TruthIsop( (unsigned *)pFunc, nVars, vCover, 1 );
    vCover->nSize = Vec_IntSize(vCover);
    assert( vCover->nSize <= vCover->nCap );
    if ( fVerbose )
    printf( "%5d %7d   ", Vec_IntSize(vCover), Abc_IsopCountLits(vCover, nVars) );
    TotalCost[4] += Vec_IntSize(vCover);
    TotalTime[4] += Abc_Clock() - clk;
*/ //Abc_IsopPrintCover( vCover, nVars, 0 );