/**Function*************************************************************

  Synopsis    []

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Bmc_LoadTest( Gia_Man_t * pGia, int fLoadCnf, int fVerbose )
{
    int nConfLimit = 0;
    Bmc_Load_t * p;
    Gia_Obj_t * pObj;
    int i, status, Lit;
    abctime clk = Abc_Clock();
    // create the loading manager
    p = Bmc_LoadStart( pGia );
    // add callback for CNF loading
    if ( fLoadCnf )
    {
        p->pSat->pCnfMan  = p;
        p->pSat->pCnfFunc = Bmc_LoadAddCnf;
    }
    // solve SAT problem for each PO
    Gia_ManForEachPo( pGia, pObj, i )
    {
        if ( fLoadCnf )
            Lit = Abc_Var2Lit( Bmc_LoadGetSatVar(p, Gia_ObjFaninId0p(pGia, pObj)), Gia_ObjFaninC0(pObj) );
        else
            Lit = Abc_Var2Lit( Bmc_LoadAddCnf_rec(p, Gia_ObjFaninId0p(pGia, pObj)), Gia_ObjFaninC0(pObj) );
        if ( fVerbose )
        {
            printf( "Frame%4d :  ", i );
            printf( "Vars = %6d  ", Vec_IntSize(p->vSat2Id) );
            printf( "Clas = %6d  ", sat_solver_nclauses(p->pSat) );
        }
        status = sat_solver_solve( p->pSat, &Lit, &Lit + 1, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
        if ( fVerbose )
        {
            printf( "Conf = %6d  ", sat_solver_nconflicts(p->pSat) );
            if ( status == l_False )
                printf( "UNSAT  " );
            else if ( status == l_True )
                printf( "SAT    " );
            else // if ( status == l_Undec )
                printf( "UNDEC  " );
            Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
        }
    }
    printf( "Callbacks = %d.  Loadings = %d.\n", p->nCallBacks1, p->nCallBacks2 );
    Bmc_LoadStop( p );
}
Exemple #2
0
void Ssc_ManPrintStats( Ssc_Man_t * p )
{
    Abc_Print( 1, "Parameters: SimWords = %d. SatConfs = %d. SatVarMax = %d. CallsRec = %d. Verbose = %d.\n",
        p->pPars->nWords, p->pPars->nBTLimit, p->pPars->nSatVarMax, p->pPars->nCallsRecycle, p->pPars->fVerbose );
    Abc_Print( 1, "SAT calls : Total = %d. Proof = %d. Cex = %d. Undec = %d.\n",
        p->nSatCalls, p->nSatCallsUnsat, p->nSatCallsSat, p->nSatCallsUndec );
    Abc_Print( 1, "SAT solver: Vars = %d. Clauses = %d. Recycles = %d. Sim rounds = %d.\n",
        sat_solver_nvars(p->pSat), sat_solver_nclauses(p->pSat), p->nRecycles, p->nSimRounds );

    p->timeOther = p->timeTotal - p->timeSimInit - p->timeSimSat - p->timeCnfGen - p->timeSatSat - p->timeSatUnsat - p->timeSatUndec;
    ABC_PRTP( "Initialization ", p->timeSimInit,            p->timeTotal );
    ABC_PRTP( "SAT simulation ", p->timeSimSat,             p->timeTotal );
    ABC_PRTP( "CNF generation ", p->timeSimSat,             p->timeTotal );
    ABC_PRTP( "SAT solving    ", p->timeSat-p->timeCnfGen,  p->timeTotal );
    ABC_PRTP( "  unsat        ", p->timeSatUnsat,           p->timeTotal );
    ABC_PRTP( "  sat          ", p->timeSatSat,             p->timeTotal );
    ABC_PRTP( "  undecided    ", p->timeSatUndec,           p->timeTotal );
    ABC_PRTP( "Other          ", p->timeOther,              p->timeTotal );
    ABC_PRTP( "TOTAL          ", p->timeTotal,              p->timeTotal );
}