/**Function************************************************************* Synopsis [Prints stats for the AIG.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ void Gia_ManPrintStats( Gia_Man_t * p, int fTents, int fSwitch ) { if ( p->pName ) printf( "%-8s : ", p->pName ); printf( "i/o =%7d/%7d", Gia_ManPiNum(p), Gia_ManPoNum(p) ); if ( Gia_ManConstrNum(p) ) printf( "(c=%d)", Gia_ManConstrNum(p) ); if ( Gia_ManRegNum(p) ) printf( " ff =%7d", Gia_ManRegNum(p) ); printf( " and =%8d", Gia_ManAndNum(p) ); printf( " lev =%5d", Gia_ManLevelNum(p) ); Vec_IntFreeP( &p->vLevels ); printf( " cut =%5d", Gia_ManCrossCut(p) ); // printf( " mem =%5.2f MB", 1.0*(sizeof(Gia_Obj_t)*p->nObjs + sizeof(int)*(Vec_IntSize(p->vCis) + Vec_IntSize(p->vCos)))/(1<<20) ); printf( " mem =%5.2f MB", 1.0*(sizeof(Gia_Obj_t)*p->nObjsAlloc + sizeof(int)*(Vec_IntCap(p->vCis) + Vec_IntCap(p->vCos)))/(1<<20) ); if ( Gia_ManHasDangling(p) ) printf( " ch =%5d", Gia_ManEquivCountClasses(p) ); if ( fSwitch ) { if ( p->pSwitching ) printf( " power =%7.2f", Gia_ManEvaluateSwitching(p) ); else printf( " power =%7.2f", Gia_ManComputeSwitching(p, 48, 16, 0) ); } // printf( "obj =%5d ", Gia_ManObjNum(p) ); printf( "\n" ); // Gia_ManSatExperiment( p ); if ( p->pReprs && p->pNexts ) Gia_ManEquivPrintClasses( p, 0, 0.0 ); if ( p->pMapping ) Gia_ManPrintMappingStats( p ); if ( p->pPlacement ) Gia_ManPrintPlacement( p ); // print register classes Gia_ManPrintFlopClasses( p ); Gia_ManPrintGateClasses( p ); Gia_ManPrintObjClasses( p ); if ( fTents ) { /* int k, Entry, Prev = 1; Vec_Int_t * vLimit = Vec_IntAlloc( 1000 ); Gia_Man_t * pNew = Gia_ManUnrollDup( p, vLimit ); printf( "Tents: " ); Vec_IntForEachEntryStart( vLimit, Entry, k, 1 ) printf( "%d=%d ", k, Entry-Prev ), Prev = Entry; printf( " Unused=%d.", Gia_ManObjNum(p) - Gia_ManObjNum(pNew) ); printf( "\n" ); Vec_IntFree( vLimit ); Gia_ManStop( pNew ); */ Gia_ManPrintTents( p ); } }
Ssc_Man_t * Ssc_ManStart( Gia_Man_t * pAig, Gia_Man_t * pCare, Ssc_Pars_t * pPars ) { Ssc_Man_t * p; p = ABC_CALLOC( Ssc_Man_t, 1 ); p->pPars = pPars; p->pAig = pAig; p->pCare = pCare; p->pFraig = Gia_ManDupDfs( p->pCare ); assert( p->pFraig->pHTable == NULL ); assert( !Gia_ManHasDangling(p->pFraig) ); Gia_ManInvertPos( p->pFraig ); Ssc_ManStartSolver( p ); if ( p->pSat == NULL ) { printf( "Constraints are UNSAT after propagation (likely a bug!).\n" ); Ssc_ManStop( p ); return NULL; } // p->vPivot = Ssc_GiaFindPivotSim( p->pFraig ); // Vec_IntFreeP( &p->vPivot ); p->vPivot = Ssc_ManFindPivotSat( p ); if ( p->vPivot == NULL ) { printf( "Constraints are UNSAT or conflict limit is too low.\n" ); Ssc_ManStop( p ); return NULL; } sat_solver_bookmark( p->pSat ); // Vec_IntPrint( p->vPivot ); Gia_ManSetPhasePattern( p->pAig, p->vPivot ); Gia_ManSetPhasePattern( p->pCare, p->vPivot ); if ( Gia_ManCheckCoPhase(p->pCare) ) { printf( "Computed reference pattern violates %d constraints (this is a bug!).\n", Gia_ManCheckCoPhase(p->pCare) ); Ssc_ManStop( p ); return NULL; } // other things p->vDisPairs = Vec_IntAlloc( 100 ); p->vPattern = Vec_IntAlloc( 100 ); p->vFanins = Vec_IntAlloc( 100 ); p->vFront = Vec_IntAlloc( 100 ); Ssc_GiaClassesInit( pAig ); // now it is ready for refinement using simulation return p; }