33#define sat_solver bmcg2_sat_solver
34#define sat_solver_start bmcg2_sat_solver_start
35#define sat_solver_stop bmcg2_sat_solver_stop
36#define sat_solver_addclause bmcg2_sat_solver_addclause
37#define sat_solver_add_and bmcg2_sat_solver_add_and
38#define sat_solver_add_xor bmcg2_sat_solver_add_xor
39#define sat_solver_addvar bmcg2_sat_solver_addvar
40#define sat_solver_read_cex_varvalue bmcg2_sat_solver_read_cex_varvalue
41#define sat_solver_reset bmcg2_sat_solver_reset
42#define sat_solver_set_conflict_budget bmcg2_sat_solver_set_conflict_budget
43#define sat_solver_conflictnum bmcg2_sat_solver_conflictnum
44#define sat_solver_solve bmcg2_sat_solver_solve
45#define sat_solver_read_cex_varvalue bmcg2_sat_solver_read_cex_varvalue
46#define sat_solver_read_cex bmcg2_sat_solver_read_cex
47#define sat_solver_jftr bmcg2_sat_solver_jftr
48#define sat_solver_set_jftr bmcg2_sat_solver_set_jftr
49#define sat_solver_set_var_fanin_lit bmcg2_sat_solver_set_var_fanin_lit
50#define sat_solver_start_new_round bmcg2_sat_solver_start_new_round
51#define sat_solver_mark_cone bmcg2_sat_solver_mark_cone
57#define sat_solver bmcg_sat_solver
58#define sat_solver_start bmcg_sat_solver_start
59#define sat_solver_stop bmcg_sat_solver_stop
60#define sat_solver_addclause bmcg_sat_solver_addclause
61#define sat_solver_add_and bmcg_sat_solver_add_and
62#define sat_solver_add_xor bmcg_sat_solver_add_xor
63#define sat_solver_addvar bmcg_sat_solver_addvar
64#define sat_solver_read_cex_varvalue bmcg_sat_solver_read_cex_varvalue
65#define sat_solver_reset bmcg_sat_solver_reset
66#define sat_solver_set_conflict_budget bmcg_sat_solver_set_conflict_budget
67#define sat_solver_conflictnum bmcg_sat_solver_conflictnum
68#define sat_solver_solve bmcg_sat_solver_solve
69#define sat_solver_read_cex_varvalue bmcg_sat_solver_read_cex_varvalue
70#define sat_solver_read_cex bmcg_sat_solver_read_cex
71#define sat_solver_jftr bmcg_sat_solver_jftr
72#define sat_solver_set_jftr bmcg_sat_solver_set_jftr
73#define sat_solver_set_var_fanin_lit bmcg_sat_solver_set_var_fanin_lit
74#define sat_solver_start_new_round bmcg_sat_solver_start_new_round
75#define sat_solver_mark_cone bmcg_sat_solver_mark_cone
155static inline int Cec5_ObjSatId(
Gia_Man_t *
p,
Gia_Obj_t * pObj ) {
return Gia_ObjCopy2Array(
p, Gia_ObjId(
p, pObj)); }
156static inline int Cec5_ObjSetSatId(
Gia_Man_t *
p,
Gia_Obj_t * pObj,
int Num ) {
assert(Cec5_ObjSatId(
p, pObj) == -1); Gia_ObjSetCopy2Array(
p, Gia_ObjId(
p, pObj), Num); Vec_IntPush(&
p->vSuppVars, Gia_ObjId(
p, pObj));
if ( Gia_ObjIsCi(pObj) ) Vec_IntPushTwo(&
p->vCopiesTwo, Gia_ObjId(
p, pObj), Num);
assert(Vec_IntSize(&
p->vVarMap) == Num); Vec_IntPush(&
p->vVarMap, Gia_ObjId(
p, pObj));
return Num; }
157static inline void Cec5_ObjCleanSatId(
Gia_Man_t *
p,
Gia_Obj_t * pObj ) {
assert(Cec5_ObjSatId(
p, pObj) != -1); Gia_ObjSetCopy2Array(
p, Gia_ObjId(
p, pObj), -1); }
178 int i, k, iLit, iPat = 0;
word * pSim;
179 for ( i = 0; i < Vec_IntSize(vPats); i += Vec_IntEntry(vPats, i), iPat++ )
180 for ( k = 1; k < Vec_IntEntry(vPats, i)-1; k++ )
181 if ( (iLit = Vec_IntEntry(vPats, i+k)) )
183 assert( Abc_Lit2Var(iLit) > 0 && Abc_Lit2Var(iLit) <= nInputs );
184 pSim = Vec_WrdEntryP( vSimsPi, (Abc_Lit2Var(iLit)-1)*
nWords );
185 if ( Abc_InfoHasBit( (
unsigned*)pSim, iPat ) != Abc_LitIsCompl(iLit) )
186 Abc_InfoXorBit( (
unsigned*)pSim, iPat );
193 int nWords = Abc_Bit6WordNum(nPats);
196 int i, Count = 0, nErrors = 0;
197 for ( i = 0; i < Gia_ManCoNum(
p); i++ )
199 int CountThis = Abc_TtCountOnesVec( Vec_WrdEntryP(vSimsPo, i*
nWords),
nWords );
200 if ( CountThis == 0 )
202 printf(
"%d ", CountThis );
203 nErrors += CountThis;
206 printf(
"\nDetected %d error POs with %d errors (average %.2f).\n", Count, nErrors, 1.0*nErrors/Abc_MaxInt(1, Count) );
207 Vec_WrdFree( vSimsPi );
208 Vec_WrdFree( vSimsPo );
252 p->timeStart = Abc_Clock();
257 p->vFrontier = Vec_PtrAlloc( 1000 );
258 p->vFanins = Vec_PtrAlloc( 100 );
259 p->vCexMin = Vec_IntAlloc( 100 );
260 p->vClassUpdates = Vec_IntAlloc( 100 );
261 p->vCexStamps = Vec_IntStart( Gia_ManObjNum(pAig) );
262 p->vCands = Vec_IntAlloc( 100 );
263 p->vVisit = Vec_IntAlloc( 100 );
264 p->vPat = Vec_IntAlloc( 100 );
265 p->vDisprPairs = Vec_IntAlloc( 100 );
266 p->vFails = Vec_BitStart( Gia_ManObjNum(pAig) );
271 p->vPiPatsCache = Vec_IntAlloc( 100 );
273 p->LocalBatchSize= 8;
274 p->vCexSite = Vec_BitStart( Gia_ManObjNum(pAig) );
275 Vec_BitFill(
p->vCexSite, Gia_ManObjNum(pAig), 0 );
279 p->simBatchFactor= 1;
285 p->vCoDrivers = Vec_BitStart( Gia_ManObjNum(pAig) );
287 Vec_BitWriteEntry(
p->vCoDrivers, Driver, 1 );
293 if (
p->pPars->fVerbose )
295 abctime timeTotal = Abc_Clock() -
p->timeStart;
296 abctime timeSat =
p->timeSatSat0 +
p->timeSatSat +
p->timeSatUnsat0 +
p->timeSatUnsat +
p->timeSatUndec;
299 ABC_PRTP(
" sat(easy) ",
p->timeSatSat0, timeTotal );
300 ABC_PRTP(
" sat ",
p->timeSatSat, timeTotal );
301 ABC_PRTP(
" unsat(easy)",
p->timeSatUnsat0, timeTotal );
302 ABC_PRTP(
" unsat ",
p->timeSatUnsat, timeTotal );
303 ABC_PRTP(
" fail ",
p->timeSatUndec, timeTotal );
304 ABC_PRTP(
"Generate CNF ",
p->timeCnf, timeTotal );
305 ABC_PRTP(
"Generate pats",
p->timeGenPats, timeTotal );
306 ABC_PRTP(
"Simulation ",
p->timeSim, timeTotal );
307 ABC_PRTP(
"Refinement ",
p->timeRefine, timeTotal );
308 ABC_PRTP(
"Resim global ",
p->timeResimGlo, timeTotal );
309 ABC_PRTP(
"Resim local ",
p->timeResimLoc, timeTotal );
311 ABC_PRTP(
"TOTAL ", timeTotal, timeTotal );
318 Vec_WrdFreeP( &
p->pAig->vSims );
319 Vec_WrdFreeP( &
p->pAig->vSimsPi );
323 Vec_PtrFreeP( &
p->vFrontier );
324 Vec_PtrFreeP( &
p->vFanins );
325 Vec_IntFreeP( &
p->vCexMin );
326 Vec_IntFreeP( &
p->vClassUpdates );
327 Vec_IntFreeP( &
p->vCexStamps );
328 Vec_IntFreeP( &
p->vCands );
329 Vec_IntFreeP( &
p->vVisit );
330 Vec_IntFreeP( &
p->vPat );
331 Vec_IntFreeP( &
p->vDisprPairs );
332 Vec_BitFreeP( &
p->vFails );
333 Vec_BitFreeP( &
p->vCoDrivers );
334 Vec_IntFreeP( &
p->vRefClasses );
335 Vec_IntFreeP( &
p->vRefNodes );
336 Vec_IntFreeP( &
p->vRefBins );
337 Vec_IntFreeP( &
p->vPiPatsCache );
338 Vec_BitFreeP( &
p->vCexSite );
351 Gia_ManConst0(pAig)->Value = 0;
353 pObj->
Value = Gia_ManAppendCi( pNew );
355 Vec_IntFill( &pNew->
vCopies2, Gia_ManObjNum(pAig), -1 );
375 int pLits[4], RetValue, VarF, VarI, VarT, VarE, fCompT, fCompE;
377 assert( !Gia_IsComplement( pNode ) );
382 VarF = Cec5_ObjSatId(
p, pNode);
383 VarI = Cec5_ObjSatId(
p, pNodeI);
384 VarT = Cec5_ObjSatId(
p, Gia_Regular(pNodeT));
385 VarE = Cec5_ObjSatId(
p, Gia_Regular(pNodeE));
387 fCompT = Gia_IsComplement(pNodeT);
388 fCompE = Gia_IsComplement(pNodeE);
398 pLits[0] = Abc_Var2Lit(VarI, 1);
399 pLits[1] = Abc_Var2Lit(VarT, 1^fCompT);
400 pLits[2] = Abc_Var2Lit(VarF, 0);
403 if ( pNodeI->
fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
404 if ( Gia_Regular(pNodeT)->fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
405 if ( pNode->
fPhase ) pLits[2] = Abc_LitNot( pLits[2] );
409 pLits[0] = Abc_Var2Lit(VarI, 1);
410 pLits[1] = Abc_Var2Lit(VarT, 0^fCompT);
411 pLits[2] = Abc_Var2Lit(VarF, 1);
414 if ( pNodeI->
fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
415 if ( Gia_Regular(pNodeT)->fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
416 if ( pNode->
fPhase ) pLits[2] = Abc_LitNot( pLits[2] );
420 pLits[0] = Abc_Var2Lit(VarI, 0);
421 pLits[1] = Abc_Var2Lit(VarE, 1^fCompE);
422 pLits[2] = Abc_Var2Lit(VarF, 0);
425 if ( pNodeI->
fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
426 if ( Gia_Regular(pNodeE)->fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
427 if ( pNode->
fPhase ) pLits[2] = Abc_LitNot( pLits[2] );
431 pLits[0] = Abc_Var2Lit(VarI, 0);
432 pLits[1] = Abc_Var2Lit(VarE, 0^fCompE);
433 pLits[2] = Abc_Var2Lit(VarF, 1);
436 if ( pNodeI->
fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
437 if ( Gia_Regular(pNodeE)->fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
438 if ( pNode->
fPhase ) pLits[2] = Abc_LitNot( pLits[2] );
456 pLits[0] = Abc_Var2Lit(VarT, 0^fCompT);
457 pLits[1] = Abc_Var2Lit(VarE, 0^fCompE);
458 pLits[2] = Abc_Var2Lit(VarF, 1);
461 if ( Gia_Regular(pNodeT)->fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
462 if ( Gia_Regular(pNodeE)->fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
463 if ( pNode->
fPhase ) pLits[2] = Abc_LitNot( pLits[2] );
467 pLits[0] = Abc_Var2Lit(VarT, 1^fCompT);
468 pLits[1] = Abc_Var2Lit(VarE, 1^fCompE);
469 pLits[2] = Abc_Var2Lit(VarF, 0);
472 if ( Gia_Regular(pNodeT)->fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
473 if ( Gia_Regular(pNodeE)->fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
474 if ( pNode->
fPhase ) pLits[2] = Abc_LitNot( pLits[2] );
483 int * pLits, nLits, RetValue, i;
484 assert( !Gia_IsComplement(pNode) );
485 assert( Gia_ObjIsAnd( pNode ) );
487 nLits = Vec_PtrSize(vSuper) + 1;
493 pLits[0] = Abc_Var2Lit(Cec5_ObjSatId(
p, Gia_Regular(pFanin)), Gia_IsComplement(pFanin));
494 pLits[1] = Abc_Var2Lit(Cec5_ObjSatId(
p, pNode), 1);
497 if ( Gia_Regular(pFanin)->fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
498 if ( pNode->
fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
506 pLits[i] = Abc_Var2Lit(Cec5_ObjSatId(
p, Gia_Regular(pFanin)), !Gia_IsComplement(pFanin));
509 if ( Gia_Regular(pFanin)->fPhase ) pLits[i] = Abc_LitNot( pLits[i] );
512 pLits[nLits-1] = Abc_Var2Lit(Cec5_ObjSatId(
p, pNode), 0);
515 if ( pNode->
fPhase ) pLits[nLits-1] = Abc_LitNot( pLits[nLits-1] );
536 if ( Gia_IsComplement(pObj) || Gia_ObjIsCi(pObj) ||
537 (!fFirst && Gia_ObjValue(pObj) > 1) ||
538 (fUseMuxes && pObj->
fMark0) )
540 Vec_PtrPushUnique( vSuper, pObj );
549 assert( !Gia_IsComplement(pObj) );
550 assert( !Gia_ObjIsCi(pObj) );
551 Vec_PtrClear( vSuper );
556 assert( !Gia_IsComplement(pObj) );
557 assert( !Gia_ObjIsConst0(pObj) );
558 if ( Cec5_ObjSatId(
p, pObj) >= 0 )
560 assert( Cec5_ObjSatId(
p, pObj) == -1 );
562 if ( Gia_ObjIsAnd(pObj) )
563 Vec_PtrPush( vFrontier, pObj );
573 if ( Cec5_ObjSatId(
p->pNew,pObj) >= 0 )
574 return Cec5_ObjSatId(
p->pNew,pObj);
577 if ( Gia_ObjIsCi(pObj) )
579 assert( Gia_ObjIsAnd(pObj) );
585 if (
p->pNew->pMuxes == NULL &&
Gia_ObjRecognizeExor(pObj, &pFan0, &pFan1) && Gia_IsComplement(pFan0) == Gia_IsComplement(pFan1) )
590 if (
p->pPars->jType < 2 )
592 if (
p->pPars->jType > 0 )
594 int Lit0 = Abc_Var2Lit( iVar0, 0 );
595 int Lit1 = Abc_Var2Lit( iVar1, 0 );
597 Lit1 ^= Lit0, Lit0 ^= Lit1, Lit1 ^= Lit0;
608 if (
p->pPars->jType < 2 )
610 if ( Gia_ObjIsXor(pObj) )
611 sat_solver_add_xor(
p->pSat, iVar, iVar0, iVar1, Gia_ObjFaninC0(pObj) ^ Gia_ObjFaninC1(pObj) );
613 sat_solver_add_and(
p->pSat, iVar, iVar0, iVar1, Gia_ObjFaninC0(pObj), Gia_ObjFaninC1(pObj), 0 );
615 if (
p->pPars->jType > 0 )
617 int Lit0 = Abc_Var2Lit( iVar0, Gia_ObjFaninC0(pObj) );
618 int Lit1 = Abc_Var2Lit( iVar1, Gia_ObjFaninC1(pObj) );
619 if ( (Lit0 > Lit1) ^ Gia_ObjIsXor(pObj) )
620 Lit1 ^= Lit0, Lit0 ^= Lit1, Lit1 ^= Lit0;
622 p->nGates[Gia_ObjIsXor(pObj)]++;
625 return Cec5_ObjSatId(
p->pNew, pObj );
627 assert( !Gia_ObjIsXor(pObj) );
629 Vec_PtrClear(
p->vFrontier );
635 assert( Cec5_ObjSatId(
p->pNew,pNode) >= 0 );
636 if ( fUseMuxes && pNode->
fMark0 )
638 Vec_PtrClear(
p->vFanins );
639 Vec_PtrPushUnique(
p->vFanins, Gia_ObjFanin0( Gia_ObjFanin0(pNode) ) );
640 Vec_PtrPushUnique(
p->vFanins, Gia_ObjFanin0( Gia_ObjFanin1(pNode) ) );
641 Vec_PtrPushUnique(
p->vFanins, Gia_ObjFanin1( Gia_ObjFanin0(pNode) ) );
642 Vec_PtrPushUnique(
p->vFanins, Gia_ObjFanin1( Gia_ObjFanin1(pNode) ) );
654 assert( Vec_PtrSize(
p->vFanins) > 1 );
656 return Cec5_ObjSatId(
p->pNew,pObj);
673 return Vec_WrdEntryP(
p->vSims,
p->nSimWords * iObj );
675static inline int Cec5_ObjSimEqual(
Gia_Man_t *
p,
int iObj0,
int iObj1 )
678 word * pSim0 = Cec5_ObjSim(
p, iObj0 );
679 word * pSim1 = Cec5_ObjSim(
p, iObj1 );
680 if ( (pSim0[0] & 1) == (pSim1[0] & 1) )
682 for ( w = 0; w <
p->nSimWords; w++ )
683 if ( pSim0[w] != pSim1[w] )
689 for ( w = 0; w <
p->nSimWords; w++ )
690 if ( pSim0[w] != ~pSim1[w] )
697 static int s_Primes[16] = {
698 1291, 1699, 1999, 2357, 2953, 3313, 3907, 4177,
699 4831, 5147, 5647, 6343, 6899, 7103, 7873, 8147 };
700 unsigned uHash = 0, * pSimU = (
unsigned *)pSim;
701 int i, nSimsU = 2 * nSims;
703 for ( i = 0; i < nSimsU; i++ )
704 uHash ^= ~pSimU[i] * s_Primes[i & 0xf];
706 for ( i = 0; i < nSimsU; i++ )
707 uHash ^= pSimU[i] * s_Primes[i & 0xf];
708 return (
int)(uHash % nTableSize);
713 int iObj, iPrev = iRepr, iPrev2, iRepr2;
715 assert( Gia_ObjNext(
p, iRepr) > 0 );
717 if ( Cec5_ObjSimEqual(
p, iRepr, iRepr2) )
727 assert( !Gia_ObjProved(
p,iRepr2) );
729 for ( iObj = Gia_ObjNext(
p, iRepr2); iObj > 0; iObj = Gia_ObjNext(
p, iObj) )
731 if ( Cec5_ObjSimEqual(
p, iRepr, iObj) )
733 Gia_ObjSetNext(
p, iPrev, iObj );
738 Gia_ObjSetRepr(
p, iObj, iRepr2 );
739 Gia_ObjSetNext(
p, iPrev2, iObj );
743 Gia_ObjSetNext(
p, iPrev, -1 );
744 Gia_ObjSetNext(
p, iPrev2, -1 );
746 if ( Gia_ObjNext(
p, iRepr2) > 0 )
752 Vec_IntClear( pMan->vRefBins );
756 assert( Key >= 0 && Key < pMan->nTableSize );
757 if ( pMan->pTable[Key] == -1 )
758 Vec_IntPush( pMan->vRefBins, Key );
759 p->pNexts[iObj] = pMan->pTable[Key];
760 pMan->pTable[Key] = iObj;
764 int iRepr = pMan->pTable[Bin];
765 pMan->pTable[Bin] = -1;
767 assert(
p->pNexts[iRepr] != 0 );
768 assert( !Gia_ObjProved(
p,iRepr) );
769 if (
p->pNexts[iRepr] == -1 )
771 for ( iObj =
p->pNexts[iRepr]; iObj > 0; iObj =
p->pNexts[iObj] )
772 p->pReprs[iObj].iRepr = iRepr;
775 Vec_IntClear( pMan->vRefBins );
779 if ( Vec_IntSize(pMan->vRefClasses) == 0 )
781 if ( Vec_IntSize(pMan->vRefNodes) > 0 )
785 int i, k, iObj, iRepr;
788 assert(
p->pReprs[iRepr].fColorA );
789 p->pReprs[iRepr].fColorA = 0;
790 Vec_IntClear( pMan->vRefNodes );
791 Vec_IntPush( pMan->vRefNodes, iRepr );
793 Vec_IntPush( pMan->vRefNodes, k );
797 p->pNexts[iObj] = -1;
802 Vec_IntClear( pMan->vRefClasses );
803 Vec_IntClear( pMan->vRefNodes );
818 pMan->nTableSize = Abc_PrimeCudd( Gia_ManObjNum(
p) );
819 pMan->pTable =
ABC_FALLOC(
int, pMan->nTableSize );
820 pMan->vRefNodes = Vec_IntAlloc( Gia_ManObjNum(
p) );
822 pMan->vRefBins = Vec_IntAlloc( Gia_ManObjNum(
p)/2 );
823 pMan->vRefClasses = Vec_IntAlloc( Gia_ManObjNum(
p)/2 );
825 if( pMan->fEec )
return;
830 if ( !Gia_ObjIsCo(pObj) && (!pMan->pPars->nLevelMax || Gia_ObjLevel(
p, pObj) <= pMan->pPars->nLevelMax) )
831 Vec_IntPush( pMan->vRefNodes, i );
834 Vec_IntPush( pMan->vRefClasses, 0 );
849static inline void Cec5_ObjSimSetInputBit(
Gia_Man_t *
p,
int iObj,
int Bit )
851 word * pSim = Cec5_ObjSim(
p, iObj );
852 if ( Abc_InfoHasBit( (
unsigned*)pSim,
p->iPatsPi ) != Bit )
853 Abc_InfoXorBit( (
unsigned*)pSim,
p->iPatsPi );
855static inline int Cec5_ObjSimGetInputBit(
Gia_Man_t *
p,
int iObj )
857 word * pSim = Cec5_ObjSim(
p, iObj );
858 return Abc_InfoHasBit( (
unsigned*)pSim,
p->iPatsPi );
860static inline void Cec5_ObjSimRo(
Gia_Man_t *
p,
int iObj )
863 word * pSimRo = Cec5_ObjSim(
p, iObj );
864 word * pSimRi = Cec5_ObjSim(
p, Gia_ObjRoToRiId(
p, iObj) );
865 for ( w = 0; w <
p->nSimWords; w++ )
866 pSimRo[w] = pSimRi[w];
868static inline void Cec5_ObjSimCo(
Gia_Man_t *
p,
int iObj )
872 word * pSimCo = Cec5_ObjSim(
p, iObj );
873 word * pSimDri = Cec5_ObjSim(
p, Gia_ObjFaninId0(pObj, iObj) );
874 if ( Gia_ObjFaninC0(pObj) )
875 for ( w = 0; w <
p->nSimWords; w++ )
876 pSimCo[w] = ~pSimDri[w];
878 for ( w = 0; w <
p->nSimWords; w++ )
879 pSimCo[w] = pSimDri[w];
885 word * pSim = Cec5_ObjSim(
p, iObj );
886 word * pSim0 = Cec5_ObjSim(
p, Gia_ObjFaninId0(pObj, iObj) );
887 word * pSim1 = Cec5_ObjSim(
p, Gia_ObjFaninId1(pObj, iObj) );
888 if ( Gia_ObjFaninC0(pObj) && Gia_ObjFaninC1(pObj) )
889 for ( w = pMan->simStart; w < pMan->simBound; w++ )
890 pSim[w] = ~pSim0[w] & ~pSim1[w];
891 else if ( Gia_ObjFaninC0(pObj) && !Gia_ObjFaninC1(pObj) )
892 for ( w = pMan->simStart; w < pMan->simBound; w++ )
893 pSim[w] = ~pSim0[w] & pSim1[w];
894 else if ( !Gia_ObjFaninC0(pObj) && Gia_ObjFaninC1(pObj) )
895 for ( w = pMan->simStart; w < pMan->simBound; w++ )
896 pSim[w] = pSim0[w] & ~pSim1[w];
898 for ( w = pMan->simStart; w < pMan->simBound; w++ )
899 pSim[w] = pSim0[w] & pSim1[w];
905 word * pSim = Cec5_ObjSim(
p, iObj );
906 word * pSim0 = Cec5_ObjSim(
p, Gia_ObjFaninId0(pObj, iObj) );
907 word * pSim1 = Cec5_ObjSim(
p, Gia_ObjFaninId1(pObj, iObj) );
908 if ( Gia_ObjFaninC0(pObj) ^ Gia_ObjFaninC1(pObj) )
909 for ( w = pMan->simStart; w < pMan->simBound; w++ )
910 pSim[w] = ~pSim0[w] ^ pSim1[w];
912 for ( w = pMan->simStart; w < pMan->simBound; w++ )
913 pSim[w] = pSim0[w] ^ pSim1[w];
915static inline void Cec5_ObjSimCi(
Gia_Man_t *
p,
int iObj )
918 word * pSim = Cec5_ObjSim(
p, iObj );
919 for ( w = 0; w <
p->nSimWords; w++ )
923static inline void Cec5_ObjClearSimCi(
Gia_Man_t *
p,
int iObj )
926 word * pSim = Cec5_ObjSim(
p, iObj );
927 for ( w = 0; w <
p->nSimWords; w++ )
934 Cec5_ObjSimCi(
p, Id );
941 Cec5_ObjClearSimCi(
p, Id );
953 if ( Abc_InfoHasBit((
unsigned *)Cec5_ObjSim(
p, Id), iPat) )
954 Abc_InfoSetBit( pCex->pData, i );
963 Cec5_ObjSimCo(
p, Id );
964 if ( Cec5_ObjSimEqual(
p, Id, 0) )
976 if ( pMan->pTable == NULL )
979 assert( Vec_IntSize(pMan->vRefClasses) == 0 );
981 pMan->simStart = pMan->simGlobalTop;
984 int iRepr = Gia_ObjRepr(
p, i );
985 if ( Gia_ObjIsXor(pObj) )
986 Cec5_ObjSimXor(
p, pMan, i );
988 Cec5_ObjSimAnd(
p, pMan, i );
989 if ( iRepr ==
GIA_VOID ||
p->pReprs[iRepr].fColorA || Cec5_ObjSimEqual(
p, iRepr, i) )
991 p->pReprs[iRepr].fColorA = 1;
992 Vec_IntPush( pMan->vRefClasses, iRepr );
995 pMan->timeSim += Abc_Clock() - clk;
998 pMan->timeRefine += Abc_Clock() - clk;
1004 if ( !iObj || (progress = Vec_IntEntry(pMan->vCexStamps, iObj)) == pMan->simTravId )
1006 Vec_IntWriteEntry( pMan->vCexStamps, iObj, pMan->simTravId );
1007 pObj = Gia_ManObj(
p, iObj);
1008 if ( Gia_ObjIsCi(pObj) )
1010 assert( Gia_ObjIsAnd(pObj) );
1013 pMan->simStart = progress * pMan->LocalBatchSize / (
sizeof(
word)<<3);
1014 if ( Gia_ObjIsXor(pObj) )
1015 Cec5_ObjSimXor(
p, pMan, iObj );
1017 Cec5_ObjSimAnd(
p, pMan, iObj );
1023 Vec_WrdFreeP( &
p->vSimsPi );
1024 p->vSimsPi = Vec_WrdStart( (Gia_ManCiNum(
p) + 1) *
nWords );
1026 Vec_WrdFreeP( &
p->vSims );
1027 p->vSims = Vec_WrdStart( Gia_ManObjNum(
p) *
nWords );
1045 Vec_Int_t * vRoots = Vec_IntAlloc( 100 );
1046 Vec_Int_t * vNodes = Vec_IntAlloc( 100 );
1047 Vec_Int_t * vLeaves = Vec_IntAlloc( 100 );
1051 Vec_IntClear( vRoots );
1054 Vec_IntPush( vRoots, i );
1056 Vec_IntPush( vRoots, k );
1058 printf(
"Class %6d : ", i );
1059 printf(
"Roots = %6d ", Vec_IntSize(vRoots) );
1060 printf(
"Nodes = %6d ", Vec_IntSize(vNodes) );
1063 Vec_IntFree( vRoots );
1064 Vec_IntFree( vNodes );
1065 Vec_IntFree( vLeaves );
1071 int i, nLits, Counter = 0, Counter0 = 0, CounterX = 0;
1074 if ( pMan->nItersSim + pMan->nItersSat )
1075 clkThis = Abc_Clock() - clk;
1077 for ( i = 0; i < Gia_ManObjNum(
p); i++ )
1079 if ( Gia_ObjIsHead(
p, i) )
1081 else if ( Gia_ObjIsConst(
p, i) )
1083 else if ( Gia_ObjIsNone(
p, i) )
1086 nLits = Gia_ManObjNum(
p) - Counter - CounterX;
1089 printf(
"Sim %4d : ", pMan->nItersSim++ + pMan->nItersSat );
1090 printf(
"%6.2f %% ", 100.0*nLits/Gia_ManCandNum(
p) );
1094 printf(
"SAT %4d : ", pMan->nItersSim + pMan->nItersSat++ );
1095 printf(
"%6.2f %% ", 100.0*pMan->nAndNodes/Gia_ManAndNum(
p) );
1097 printf(
"P =%7d ", pMan ? pMan->nSatUnsat : 0 );
1098 printf(
"D =%7d ", pMan ? pMan->nSatSat : 0 );
1099 printf(
"F =%8d ", pMan ? pMan->nSatUndec : 0 );
1101 Abc_Print( 1,
"cst =%9d cls =%8d lit =%9d ", Counter0, Counter, nLits );
1102 Abc_PrintTime( 1,
"Time", clkThis );
1109 printf(
"Class %d : ", i );
1120 printf(
"Const0 class has %d entries.\n", Count );
1139 if ( iObj == 0 )
return 0;
1140 if ( Gia_ObjIsTravIdCurrentId(
p, iObj) )
1142 Gia_ObjSetTravIdCurrentId(
p, iObj);
1143 if ( Gia_ObjIsCi(pObj) )
1145 assert( Gia_ObjIsAnd(pObj) );
1146 Value0 =
Cec5_ManVerify_rec(
p, Gia_ObjFaninId0(pObj, iObj), pSat ) ^ Gia_ObjFaninC0(pObj);
1147 Value1 =
Cec5_ManVerify_rec(
p, Gia_ObjFaninId1(pObj, iObj), pSat ) ^ Gia_ObjFaninC1(pObj);
1148 return pObj->
fMark1 = Gia_ObjIsXor(pObj) ? Value0 ^ Value1 : Value0 & Value1;
1156 if ( (Value0 ^ Value1) == fPhase )
1157 printf(
"CEX verification FAILED for obj %d and obj %d.\n", iObj0, iObj1 );
1178 if ( iObj == 0 )
return 0;
1179 if ( Gia_ObjIsTravIdCurrentId(
p, iObj) )
1181 Gia_ObjSetTravIdCurrentId(
p, iObj);
1182 if ( Gia_ObjIsCi(pObj) )
1183 return pObj->
fMark1 = Cec5_ObjSimGetInputBit(
p, iObj);
1184 assert( Gia_ObjIsAnd(pObj) );
1187 return pObj->
fMark1 = Gia_ObjIsXor(pObj) ? Value0 ^ Value1 : Value0 & Value1;
1195 if ( (Value0 ^ Value1) == fPhase )
1196 printf(
"CEX verification FAILED for obj %d and obj %d.\n", iObj0, iObj1 );
1214 int k, Limit = Abc_MinInt( Vec_IntSize(vLits), 64 *
p->nSimWords - 1 );
1215 for ( k = 0; k < Limit; k++ )
1217 int i, Lit, iBitLocal = (iBit + k + 1) % Limit + 1;
1218 assert( iBitLocal > 0 && iBitLocal < 64 * p->nSimWords );
1221 word * pInfo = Vec_WrdEntryP(
p->vSims,
p->nSimWords * Abc_Lit2Var(Lit) );
1222 word * pPres = Vec_WrdEntryP(
p->vSimsPi,
p->nSimWords * Abc_Lit2Var(Lit) );
1223 if ( Abc_InfoHasBit( (
unsigned *)pPres, iBitLocal ) )
1225 if ( Abc_InfoHasBit( (
unsigned *)pInfo, iBitLocal ) != Abc_LitIsCompl(Lit ^ (i == k)) )
1226 Abc_InfoXorBit( (
unsigned *)pInfo, iBitLocal );
1233 assert(
p->iPatsPi > 0 &&
p->iPatsPi < 64 *
p->nSimWords );
1236 word * pInfo = Vec_WrdEntryP(
p->vSims,
p->nSimWords * Abc_Lit2Var(Lit) );
1237 word * pPres = Vec_WrdEntryP(
p->vSimsPi,
p->nSimWords * Abc_Lit2Var(Lit) );
1238 if ( Abc_InfoHasBit( (
unsigned *)pPres, iBit ) &&
1239 Abc_InfoHasBit( (
unsigned *)pInfo, iBit ) != Abc_LitIsCompl(Lit) )
1244 word * pInfo = Vec_WrdEntryP(
p->vSims,
p->nSimWords * Abc_Lit2Var(Lit) );
1245 word * pPres = Vec_WrdEntryP(
p->vSimsPi,
p->nSimWords * Abc_Lit2Var(Lit) );
1246 Abc_InfoSetBit( (
unsigned *)pPres, iBit );
1247 if ( Abc_InfoHasBit( (
unsigned *)pInfo, iBit ) != Abc_LitIsCompl(Lit) )
1248 Abc_InfoXorBit( (
unsigned *)pInfo, iBit );
1255 for ( k = 1; k < 64 *
p->nSimWords - 1; k++ )
1257 if ( ++
p->iPatsPi == 64 *
p->nSimWords - 1 )
1266 if ( k == 64 *
p->nSimWords - 1 )
1270 printf(
"Internal error.\n" );
1273 return 64 *
p->nSimWords;
1289static inline int Cec5_ObjFan0IsAssigned(
Gia_Obj_t * pObj )
1291 return Gia_ObjFanin0(pObj)->fMark0 || Gia_ObjFanin0(pObj)->fMark1;
1293static inline int Cec5_ObjFan1IsAssigned(
Gia_Obj_t * pObj )
1295 return Gia_ObjFanin1(pObj)->fMark0 || Gia_ObjFanin1(pObj)->fMark1;
1297static inline int Cec5_ObjFan0HasValue(
Gia_Obj_t * pObj,
int v )
1299 return (v ^ Gia_ObjFaninC0(pObj)) ? Gia_ObjFanin0(pObj)->fMark1 : Gia_ObjFanin0(pObj)->fMark0;
1301static inline int Cec5_ObjFan1HasValue(
Gia_Obj_t * pObj,
int v )
1303 return (v ^ Gia_ObjFaninC1(pObj)) ? Gia_ObjFanin1(pObj)->fMark1 : Gia_ObjFanin1(pObj)->fMark0;
1305static inline int Cec5_ObjObjIsImpliedValue(
Gia_Obj_t * pObj,
int v )
1309 return Cec5_ObjFan0HasValue(pObj, 1) && Cec5_ObjFan1HasValue(pObj, 1);
1310 return Cec5_ObjFan0HasValue(pObj, 0) || Cec5_ObjFan1HasValue(pObj, 0);
1312static inline int Cec5_ObjFan0IsImpliedValue(
Gia_Obj_t * pObj,
int v )
1314 return Gia_ObjIsAnd(Gia_ObjFanin0(pObj)) && Cec5_ObjObjIsImpliedValue( Gia_ObjFanin0(pObj), v ^ Gia_ObjFaninC0(pObj) );
1316static inline int Cec5_ObjFan1IsImpliedValue(
Gia_Obj_t * pObj,
int v )
1318 return Gia_ObjIsAnd(Gia_ObjFanin1(pObj)) && Cec5_ObjObjIsImpliedValue( Gia_ObjFanin1(pObj), v ^ Gia_ObjFaninC1(pObj) );
1325 Vec_IntPush( vVisit, Gia_ObjId(
p, pObj) );
1326 if ( Gia_ObjIsCi(pObj) )
1328 Vec_IntPush( vPat, Abc_Var2Lit(Gia_ObjId(
p, pObj), Value) );
1331 assert( Gia_ObjIsAnd(pObj) );
1332 pFan0 = Gia_ObjFanin0(pObj);
1333 pFan1 = Gia_ObjFanin1(pObj);
1334 if ( Gia_ObjIsXor(pObj) )
1336 int Ass0 = Cec5_ObjFan0IsAssigned(pObj);
1337 int Ass1 = Cec5_ObjFan1IsAssigned(pObj);
1338 assert( Gia_ObjFaninC0(pObj) == 0 && Gia_ObjFaninC1(pObj) == 0 );
1340 return Value == (Cec5_ObjFan0HasValue(pObj, 1) ^ Cec5_ObjFan1HasValue(pObj, 1));
1343 int ValueInt = Value ^ Cec5_ObjFan0HasValue(pObj, 1);
1349 int ValueInt = Value ^ Cec5_ObjFan1HasValue(pObj, 1);
1357 if ( Cec5_ObjFan1HasValue(pObj, !Value) || (!Cec5_ObjFan1HasValue(pObj, Value) && !
Cec5_ManGeneratePatterns_rec(
p, pFan1, Value, vPat, vVisit)) )
1364 if ( Cec5_ObjFan1HasValue(pObj, Value) || (!Cec5_ObjFan1HasValue(pObj, !Value) && !
Cec5_ManGeneratePatterns_rec(
p, pFan1, !Value, vPat, vVisit)) )
1367 assert( Value == (Cec5_ObjFan0HasValue(pObj, 1) ^ Cec5_ObjFan1HasValue(pObj, 1)) );
1372 if ( Cec5_ObjFan0HasValue(pObj, 0) || Cec5_ObjFan1HasValue(pObj, 0) )
1378 assert( Cec5_ObjFan0HasValue(pObj, 1) && Cec5_ObjFan1HasValue(pObj, 1) );
1383 if ( Cec5_ObjFan0HasValue(pObj, 1) && Cec5_ObjFan1HasValue(pObj, 1) )
1385 if ( Cec5_ObjFan0HasValue(pObj, 0) || Cec5_ObjFan1HasValue(pObj, 0) )
1387 if ( Cec5_ObjFan0HasValue(pObj, 1) )
1392 else if ( Cec5_ObjFan1HasValue(pObj, 1) )
1399 if ( Cec5_ObjFan0IsImpliedValue( pObj, 0 ) )
1404 else if ( Cec5_ObjFan1IsImpliedValue( pObj, 0 ) )
1409 else if ( Cec5_ObjFan0IsImpliedValue( pObj, 1 ) )
1414 else if ( Cec5_ObjFan1IsImpliedValue( pObj, 1 ) )
1430 assert( Cec5_ObjFan0HasValue(pObj, 0) || Cec5_ObjFan1HasValue(pObj, 0) );
1439 if ( !iRepr && iReprVal )
1441 Vec_IntClear( vPat );
1442 Vec_IntClear( vVisit );
1445 Res = (!iRepr ||
Cec5_ManGeneratePatterns_rec(
p, Gia_ManObj(
p, iRepr), iReprVal, vPat, vVisit)) &&
Cec5_ManGeneratePatterns_rec(
p, Gia_ManObj(
p, iCand), iCandVal, vPat, vVisit);
1455 assert( Vec_IntSize(
p->vCands) == 0 );
1456 for ( i = 1; i < Gia_ManObjNum(
p->pAig); i++ )
1457 if ( Gia_ObjRepr(
p->pAig, i) !=
GIA_VOID )
1458 Vec_IntPush(
p->vCands, i );
1459 pArray = Vec_IntArray(
p->vCands );
1460 for ( i = 0; i < Vec_IntSize(
p->vCands); i++ )
1462 int iNew =
Abc_Random(0) % Vec_IntSize(
p->vCands);
1463 ABC_SWAP(
int, pArray[i], pArray[iNew] );
1468 while ( Vec_IntSize(
p->vCands) > 0 )
1470 int fStop, iCand = Vec_IntEntry(
p->vCands,
p->iPosRead );
1471 if ( (fStop = (Gia_ObjRepr(
p->pAig, iCand) !=
GIA_VOID)) )
1472 Vec_IntWriteEntry(
p->vCands,
p->iPosWrite++, iCand );
1473 if ( ++
p->iPosRead == Vec_IntSize(
p->vCands) )
1475 Vec_IntShrink(
p->vCands,
p->iPosWrite );
1487 int i, iCand, nPats = 100 * 64 *
p->pAig->nSimWords, CountPat = 0, Packs = 0;
1495 p->pAig->iPatsPi = 0;
1496 Vec_WrdFill(
p->pAig->vSimsPi, Vec_WrdSize(
p->pAig->vSimsPi), 0 );
1497 for ( i = 0; i < nPats; i++ )
1500 int iRepr = Gia_ObjRepr(
p->pAig, iCand );
1501 int iCandVal = Gia_ManObj(
p->pAig, iCand)->fPhase;
1502 int iReprVal = Gia_ManObj(
p->pAig, iRepr)->fPhase;
1509 if (
p->pAig->vPats )
1511 Vec_IntPush(
p->pAig->vPats, Vec_IntSize(
p->vPat)+2 );
1512 Vec_IntAppend(
p->pAig->vPats,
p->vPat );
1513 Vec_IntPush(
p->pAig->vPats, -1 );
1517 if ( 0 == (Ret % (64 *
p->pAig->nSimWords /
p->simBatchFactor)) )
1519 if ( ++CountPat == 8 * 64 *
p->pAig->nSimWords )
1525 p->timeGenPats += Abc_Clock() - clk;
1526 p->nSatSat += CountPat;
1530 return CountPat >= i /
p->pPars->nItersMax;
1550 if(
p->adaRecycle &&
p->adaRecycle <
p->nConflicts[2][2] )
1557 Cec5_ObjCleanSatId(
p->pNew, pObj );
1558 Vec_IntClear( &
p->pNew->vSuppVars );
1559 Vec_IntClear( &
p->pNew->vCopiesTwo );
1560 Vec_IntClear( &
p->pNew->vVarMap );
1565 if(
p->pPars->jType > 0 )
1567 int nlim =
p->approxLim;
1578 int nBTLimit = fEffort ?
p->pPars->nBTLimitPo : (Vec_BitEntry(
p->vFails, iObj0) || Vec_BitEntry(
p->vFails, iObj1)) ? Abc_MaxInt(1,
p->pPars->nBTLimit/10) :
p->pPars->nBTLimit;
1579 int nConfEnd, nConfBeg, status, iVar0, iVar1, Lits[2];
1580 int UnsatConflicts[3] = {0};
1582 if ( iObj1 < iObj0 )
1583 iObj1 ^= iObj0, iObj0 ^= iObj1, iObj1 ^= iObj0;
1588 if (
p->nCallsSince >
p->pPars->nCallsRecycle &&
1589 Vec_IntSize(&
p->pNew->vSuppVars) >
p->pPars->nSatVarMax &&
p->pPars->nSatVarMax )
1592 if ( !iObj0 && Cec5_ObjSatId(
p->pNew, Gia_ManConst0(
p->pNew)) == -1 )
1596 p->timeCnf += Abc_Clock() - clk;
1598 Lits[0] = Abc_Var2Lit(iVar0, 1);
1599 Lits[1] = Abc_Var2Lit(iVar1, fPhase);
1604 assert( nConfEnd >= nConfBeg );
1605 p->nConflicts[2][2] = Abc_MaxInt(
p->nConflicts[2][2], nConfEnd - nConfBeg);
1610 p->nConflicts[0][0] += nConfEnd == nConfBeg;
1611 p->nConflicts[0][1] += nConfEnd - nConfBeg;
1612 p->nConflicts[0][2] = Abc_MaxInt(
p->nConflicts[0][2], nConfEnd - nConfBeg);
1613 *pfEasy = nConfEnd == nConfBeg;
1619 UnsatConflicts[0] = nConfEnd == nConfBeg;
1620 UnsatConflicts[1] = nConfEnd - nConfBeg;
1621 UnsatConflicts[2] = Abc_MaxInt(
p->nConflicts[1][2], nConfEnd - nConfBeg);
1622 p->nConflicts[1][2] = Abc_MaxInt(
p->nConflicts[1][2], UnsatConflicts[2]);
1626 p->nConflicts[1][0] += nConfEnd == nConfBeg;
1627 p->nConflicts[1][1] += nConfEnd - nConfBeg;
1628 p->nConflicts[1][2] = Abc_MaxInt(
p->nConflicts[1][2], nConfEnd - nConfBeg);
1629 *pfEasy = nConfEnd == nConfBeg;
1635 Lits[0] = Abc_Var2Lit(iVar0, 0);
1636 Lits[1] = Abc_Var2Lit(iVar1, !fPhase);
1641 assert( nConfEnd >= nConfBeg );
1642 p->nConflicts[2][2] = Abc_MaxInt(
p->nConflicts[2][2], nConfEnd - nConfBeg);
1647 p->nConflicts[0][0] += nConfEnd == nConfBeg;
1648 p->nConflicts[0][1] += nConfEnd - nConfBeg;
1649 p->nConflicts[0][2] = Abc_MaxInt(
p->nConflicts[0][2], nConfEnd - nConfBeg);
1650 *pfEasy = nConfEnd == nConfBeg;
1654 UnsatConflicts[0] &= nConfEnd == nConfBeg;
1655 UnsatConflicts[1] += nConfEnd - nConfBeg;
1656 UnsatConflicts[2] = Abc_MaxInt(
p->nConflicts[1][2], nConfEnd - nConfBeg);
1658 p->nConflicts[1][0] += UnsatConflicts[0];
1659 p->nConflicts[1][1] += UnsatConflicts[1];
1660 p->nConflicts[1][2] = Abc_MaxInt(
p->nConflicts[1][2], UnsatConflicts[2]);
1661 *pfEasy = UnsatConflicts[0];
1670 int j, iLit, nWrite = 0;
1671 int iPatsOld =
p->pAig->iPatsPi;
1673 p->pAig->iPatsPi -- ;
1674 while( j < p->vPiPatsCache->nSize ){
1675 if( -1 < (iLit =
p->vPiPatsCache->pArray[j++]) ){
1676 Cec5_ObjSimSetInputBit(
p->pAig, Abc_Lit2Var(iLit), Abc_LitIsCompl(iLit) );
1679 p->pAig->iPatsPi -- ;
1682 p->pAig->iPatsPi += nWrite+1;
1683 assert( iPatsOld ==
p->pAig->iPatsPi );
1684 p->vPiPatsCache->nSize = 0;
1687 Vec_IntFill(
p->vCexStamps, Gia_ManObjNum(
p->pAig), 0 );
1688 Vec_BitFill(
p->vCexSite , Gia_ManObjNum(
p->pAig), 0 );
1691 int iPatTop =
p->pAig->iPatsPi;
1692 if ( (iPatTop % (
sizeof(
word) * 8 *
p->pAig->nSimWords /
p->simBatchFactor)) == 0
1693 || iPatTop == (
int)
sizeof(
word) * 8 *
p->pAig->nSimWords - 2 )
1698 p->simBound = iPatTop / (
sizeof(
word) * 8) + ((iPatTop % (
sizeof(
word) * 8)) ? 1: 0);
1703 p->simBound =
p->pPars->nWords;
1705 p->nFaster[0] =
p->nFaster[1] = 0;
1709 if( iPatTop == (
int)
sizeof(
word) * 8 *
p->pAig->nSimWords - 2 ){
1711 p->pAig->iPatsPi = 0;
1713 p->simGlobalTop = 0;
1716 p->pAig->iPatsPi = iPatTop;
1717 p->simGlobalTop = iPatTop / (
sizeof(
word) * 8 );
1719 Vec_WrdFill(
p->pAig->vSimsPi, Vec_WrdSize(
p->pAig->vSimsPi), 0 );
1720 p->timeResimGlo += Abc_Clock() - clk2;
1726 int i, IdAig, IdSat, status, fEasy, RetValue = 1;
1727 Gia_Obj_t * pObj = Gia_ManObj(
p->pAig, iObj );
1728 Gia_Obj_t * pRepr = Gia_ManObj(
p->pAig, iRepr );
1730 int fEffort =
p->vCoDrivers ? Vec_BitEntry(
p->vCoDrivers, iObj) || Vec_BitEntry(
p->vCoDrivers, iRepr) : 0;
1735 Vec_BitWriteEntry(
p->vCexSite, iObj, 1 );
1740 Vec_IntClear(
p->vPat );
1741 if (
p->pPars->jType == 0 )
1749 int * pMap = Vec_IntArray(&
p->pNew->vVarMap);
1750 for ( i = 0; i < pCex[0]; )
1751 Vec_IntPush(
p->vPat, Abc_Lit2LitV(pMap, Abc_LitNot(pCex[++i])) );
1753 assert(
p->pAig->iPatsPi >= 0 &&
p->pAig->iPatsPi < 64 *
p->pAig->nSimWords - 1 );
1758 Vec_IntPush(
p->vPiPatsCache, iLit );
1759 Vec_IntPush(
p->vPiPatsCache, -1 );
1760 if (
p->pAig->vPats )
1762 Vec_IntPush(
p->pAig->vPats, Vec_IntSize(
p->vPat)+2 );
1763 Vec_IntAppend(
p->pAig->vPats,
p->vPat );
1764 Vec_IntPush(
p->pAig->vPats, -1 );
1769 p->timeSatSat0 += Abc_Clock() - clk;
1771 p->timeSatSat += Abc_Clock() - clk;
1774 p->simTravId =
p->pAig->iPatsPi /
p->LocalBatchSize;
1775 if( (
p->pAig->iPatsPi %
p->LocalBatchSize) == 0 || 1 ==
p->LocalBatchSize )
1788 pObj->
Value = Abc_LitNotCond( pRepr->
Value, fCompl );
1789 assert( !Gia_ObjProved(
p->pAig, iObj ) );
1790 Gia_ObjSetProved(
p->pAig, iObj );
1792 p->iLastConst = iObj;
1794 p->timeSatUnsat0 += Abc_Clock() - clk;
1796 p->timeSatUnsat += Abc_Clock() - clk;
1803 Gia_ObjSetFailed(
p->pAig, iObj );
1804 Vec_BitWriteEntry(
p->vFails, iObj, 1 );
1807 p->timeSatUndec += Abc_Clock() - clk;
1817 assert( Gia_ObjHasRepr(
p, iObj) );
1818 assert( !Gia_ObjProved(
p, iObj) );
1819 iRepr = Gia_ObjRepr(
p, iObj);
1821 assert( !Gia_ObjProved(
p, iRepr) );
1823 pMan->simBound = pMan->simTravId * pMan->LocalBatchSize / (
sizeof(
word)<<3)+1;
1824 assert( pMan->simBound <= pMan->pPars->nWords );
1826 if( (Vec_BitEntry( pMan->vCexSite, iObj ) | Vec_BitEntry( pMan->vCexSite, iRepr ))
1827 ||(Vec_IntEntry( pMan->vCexStamps, iObj ) != Vec_IntEntry( pMan->vCexStamps, iRepr )) ){
1831 if ( Cec5_ObjSimEqual(
p, iObj, iRepr) )
1833 pMan->timeResimLoc += Abc_Clock() - clk;
1834 pRepr = Gia_ManObj(
p, iRepr);
1842 if ( Gia_ObjProved(
p, iMem) || Gia_ObjFailed(
p, iMem) )
1844 if( Vec_IntEntry( pMan->vCexStamps, iObj ) != Vec_IntEntry( pMan->vCexStamps, iMem ) ){
1848 if ( Cec5_ObjSimEqual(
p, iObj, iMem) )
1851 pMan->timeResimLoc += Abc_Clock() - clk;
1852 pRepr = Gia_ManObj(
p, iMem);
1857 pMan->timeResimLoc += Abc_Clock() - clk;
1859 pMan->simBound = pMan->pPars->nWords;
1863 while( pMan->pNew->vCopies2.nSize < Gia_ManObjNum(pMan->pNew) ){
1864 Vec_IntPush( &pMan->pNew->vCopies2, -1 );
1865 Vec_BitPush( pMan->vFails, 0 );
1867 Vec_IntPush( pCbs->
vValue, ~0 );
1877 int i, fSimulate = 1;
1884 pMan->approxLim = approxLim;
1885 if( pMan->simBatchFactor != subBatchSz ){
1886 printf(
"overwrite default batch size: from %3d to %3d\n", pMan->simBatchFactor, subBatchSz);
1887 pMan->simBatchFactor = subBatchSz;
1889 if( pMan->adaRecycle != adaRecycle ){
1890 printf(
"overwrite default adaptive recycle: from %3d to %3d\n", pMan->adaRecycle, adaRecycle);
1891 pMan->adaRecycle = adaRecycle;
1894 printf(
"Solver type = %d. Simulate %d words in %d rounds. SAT with %d confs. Recycle after %d SAT calls.\n",
1903 assert( Gia_ObjId(
p, pObj) == i+1 );
1931 for ( i = 0; i < pPars->
nRounds; i++ )
1946 for ( i = 0; fSimulate && i < pPars->
nGenIters; i++ )
1953 if ( i && i % 5 == 0 && pPars->
fVerbose )
1955 if( pMan->nSatSat - AccuSat < p->nSimWords * (
int)
sizeof(
word) * 8 )
1958 AccuSat = pMan->nSatSat;
1960 if ( i && i % 5 && pPars->
fVerbose )
1966 Vec_WrdFill(
p->vSimsPi, Vec_WrdSize(
p->vSimsPi), 0 );
1972 pMan->pNew->pRefs =
ABC_CALLOC(
int, Gia_ManObjNum(
p) );
1977 pCbs->
pAig = pMan->pNew;
1978 pCbs->
Pars.nBTLimit = 100;
1979 pCbs->
Pars.nJustLimit = 100;
1980 pCbs->
Pars.nJscanLimit = 100;
1981 pCbs->
Pars.nRscanLimit = 100;
1982 pCbs->
Pars.nPropLimit = 100;
1985 printf(
"cbs: clim = %4d jlim = %4d\n"
1986 , pCbs->
Pars.nBTLimit
1987 , pCbs->
Pars.nJustLimit );
1994 for( ; i < Gia_ManObjNum(
p) && (pObj = Gia_ManObj(
p,i)); i ++ )
1998 if ( !Gia_ObjIsAnd(pObj) )
2001 Vec_BitWriteEntry( pMan->vCexSite, i
2002 , Vec_BitEntry( pMan->vCexSite, Gia_ObjFaninId0(pObj,i) )
2003 | Vec_BitEntry( pMan->vCexSite, Gia_ObjFaninId1(pObj,i) ) );
2005 if ( Gia_ObjFailed(
p,i) )
2008 if ( Gia_ObjProved(
p, i) ){
2009 pRepr = Gia_ManObj(
p, vMerged[i] );
2014 if ( Gia_ObjIsXor(pObj) )
2017 pObj->
Value =
Gia_ManHashAnd( pMan->pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
2024 pObjNew = Gia_ManObj( pMan->pNew, Abc_Lit2Var(pObj->
Value) );
2025 if ( Gia_ObjIsAnd(pObjNew) )
2026 if ( Vec_BitEntry(pMan->vFails, Gia_ObjFaninId0(pObjNew, Abc_Lit2Var(pObj->
Value))) ||
2027 Vec_BitEntry(pMan->vFails, Gia_ObjFaninId1(pObjNew, Abc_Lit2Var(pObj->
Value))) )
2028 Vec_BitWriteEntry( pMan->vFails, Abc_Lit2Var(pObjNew->
Value), 1 );
2032 pRepr = Gia_ObjReprObj(
p, i );
2034 if ( pRepr == NULL )
2040 if ( pRepr == NULL )
2043 if ( Abc_Lit2Var(pObj->
Value) == Abc_Lit2Var(pRepr->
Value) )
2046 vMerged[i] = Gia_ObjId(
p, pRepr);
2047 Gia_ObjSetProved(
p, i );
2048 if ( Gia_ObjId(
p, pRepr) == 0 )
2049 pMan->iLastConst = i;
2054 if ( fCbs && (status =
Cec5_ManSweepNodeCbs(pMan, pCbs, i, Gia_ObjId(
p, pRepr), 0)) && Gia_ObjProved(
p, i) ){
2055 vMerged[i] = Gia_ObjId(
p, pRepr);
2059 if ( 2 == status && (status =
Cec5_ManSweepNode(pMan, i, Gia_ObjId(
p, pRepr))) && Gia_ObjProved(
p, i) ){
2060 vMerged[i] = Gia_ObjId(
p, pRepr);
2064 if( 0 == status && -1 == go_back )
2067 if( 0 == pMan->nPatterns || 0!=status || pMan->nPatterns % (64 *
p->nSimWords-2) )
2072 pMan->nAndNodes -= i-go_back;
2073 i = go_back-1, go_back = -1;
2076 if (
p->iPatsPi > 0 )
2082 pMan->simTravId = 0;
2083 pMan->simGlobalTop = 0;
2085 pMan->timeResimGlo += Abc_Clock() - clk2;
2100 pObj->
Value = Gia_ManAppendCo( pMan->pNew, Gia_ObjFanin0Copy(pObj) );
2112 printf(
"SAT calls = %d: P = %d (0=%d a=%.2f m=%d) D = %d (0=%d a=%.2f m=%d) F = %d Sim = %d Recyc = %d Xor = %.2f %%\n",
2113 pMan->nSatUnsat + pMan->nSatSat + pMan->nSatUndec,
2114 pMan->nSatUnsat, pMan->nConflicts[1][0], (
float)pMan->nConflicts[1][1]/Abc_MaxInt(1, pMan->nSatUnsat-pMan->nConflicts[1][0]), pMan->nConflicts[1][2],
2115 pMan->nSatSat, pMan->nConflicts[0][0], (
float)pMan->nConflicts[0][1]/Abc_MaxInt(1, pMan->nSatSat -pMan->nConflicts[0][0]), pMan->nConflicts[0][2],
2117 pMan->nSimulates, pMan->nRecycles, 100.0*pMan->nGates[1]/Abc_MaxInt(1, pMan->nGates[0]+pMan->nGates[1]) );
2124 return p->pCexSeq ? 0 : 1;
2142 int nConfEnd, nConfBeg, status;
2143 int UnsatConflicts[3] = {0};
2145 if ( iObj1 < iObj0 )
2146 iObj1 ^= iObj0, iObj0 ^= iObj1, iObj1 ^= iObj0;
2148 pRepr = Gia_ManObj(
p->pNew, iObj0 );
2149 pObj = Gia_ManObj(
p->pNew, iObj1 );
2177 if( !Gia_ObjIsConst0(pRepr) )
2178 status =
CbsP_ManSolve2(pCbs,Gia_Not(pObj),Gia_NotCond(pRepr, fPhase));
2181 nConfEnd = pCbs->
Pars.nBTThis;
2182 assert( nConfEnd >= nConfBeg );
2187 p->nConflicts[0][0] += nConfEnd == nConfBeg;
2188 p->nConflicts[0][1] += nConfEnd - nConfBeg;
2189 p->nConflicts[0][2] = Abc_MaxInt(
p->nConflicts[0][2], nConfEnd - nConfBeg);
2190 *pfEasy = nConfEnd == nConfBeg;
2196 UnsatConflicts[0] = nConfEnd == nConfBeg;
2197 UnsatConflicts[1] = nConfEnd - nConfBeg;
2198 UnsatConflicts[2] = Abc_MaxInt(
p->nConflicts[1][2], nConfEnd - nConfBeg);
2202 p->nConflicts[1][0] += nConfEnd == nConfBeg;
2203 p->nConflicts[1][1] += nConfEnd - nConfBeg;
2204 p->nConflicts[1][2] = Abc_MaxInt(
p->nConflicts[1][2], nConfEnd - nConfBeg);
2205 *pfEasy = nConfEnd == nConfBeg;
2219 nConfEnd = pCbs->
Pars.nBTThis;
2220 assert( nConfEnd >= nConfBeg );
2225 p->nConflicts[0][0] += nConfEnd == nConfBeg;
2226 p->nConflicts[0][1] += nConfEnd - nConfBeg;
2227 p->nConflicts[0][2] = Abc_MaxInt(
p->nConflicts[0][2], nConfEnd - nConfBeg);
2228 *pfEasy = nConfEnd == nConfBeg;
2232 UnsatConflicts[0] &= nConfEnd == nConfBeg;
2233 UnsatConflicts[1] += nConfEnd - nConfBeg;
2234 UnsatConflicts[2] = Abc_MaxInt(
p->nConflicts[1][2], nConfEnd - nConfBeg);
2236 p->nConflicts[1][0] += UnsatConflicts[0];
2237 p->nConflicts[1][1] += UnsatConflicts[1];
2238 p->nConflicts[1][2] = Abc_MaxInt(
p->nConflicts[1][2], UnsatConflicts[2]);
2239 *pfEasy = UnsatConflicts[0];
2253 int i, status, fEasy, RetValue = 1;
2254 Gia_Obj_t * pObj = Gia_ManObj(
p->pAig, iObj );
2255 Gia_Obj_t * pRepr = Gia_ManObj(
p->pAig, iRepr );
2258 int fEffort =
p->vCoDrivers ? Vec_BitEntry(
p->vCoDrivers, iObj) || Vec_BitEntry(
p->vCoDrivers, iRepr) : 0;
2266 Vec_BitWriteEntry(
p->vCexSite, iObj, 1 );
2271 Vec_IntClear(
p->vPat );
2273 Vec_IntPush(
p->vPat, Abc_LitNot(iLit) );
2274 assert(
p->pAig->iPatsPi >= 0 &&
p->pAig->iPatsPi < 64 *
p->pAig->nSimWords - 1 );
2277 Vec_IntPush(
p->vPiPatsCache, iLit );
2278 Vec_IntPush(
p->vPiPatsCache, -1 );
2281 p->timeSatSat0 += Abc_Clock() - clk;
2283 p->timeSatSat += Abc_Clock() - clk;
2286 p->simTravId =
p->pAig->iPatsPi /
p->LocalBatchSize;
2287 if( (
p->pAig->iPatsPi %
p->LocalBatchSize) == 0 || 1 ==
p->LocalBatchSize )
2299 pObj->
Value = Abc_LitNotCond( pRepr->
Value, fCompl );
2300 assert( !Gia_ObjProved(
p->pAig, iObj ) );
2301 Gia_ObjSetProved(
p->pAig, iObj );
2303 p->iLastConst = iObj;
2305 p->timeSatUnsat0 += Abc_Clock() - clk;
2307 p->timeSatUnsat += Abc_Clock() - clk;
2315 Gia_ObjSetFailed(
p->pAig, iObj );
2316 Gia_ObjSetFailed(
p->pAig, iRepr );
2317 Vec_BitWriteEntry(
p->vFails, iObj, 1 );
2318 p->timeSatUndec += Abc_Clock() - clk;
2328 int fCbs = 1, approxLim = 600, subBatchSz = 1, adaRecycle = 500;
void bmcg2_sat_solver_markapprox(bmcg2_sat_solver *s, int v0, int v1, int nlim)
#define GLUCOSE_UNSAT
INCLUDES ///.
word Abc_RandomW(int fReset)
#define ABC_SWAP(Type, a, b)
#define ABC_FALLOC(type, num)
#define ABC_ALLOC(type, num)
#define ABC_PRTP(a, t, T)
unsigned Abc_Random(int fReset)
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
#define sat_solver_addvar
void Gia_ManRemoveWrongChoices(Gia_Man_t *p)
void Cec5_ManCandIterStart(Cec5_Man_t *p)
void Cec5_RefineOneClassIter(Gia_Man_t *p, int iRepr)
#define sat_solver_addclause
int Cec5_ManCexVerify_rec(Gia_Man_t *p, int iObj)
void Cec5_ManExtend(Cec5_Man_t *pMan, CbsP_Man_t *pCbs)
int Cec5_ManPackAddPattern(Gia_Man_t *p, Vec_Int_t *vLits, int fExtend)
void Cec5_ManCheckGlobalSim(Cec5_Man_t *p)
void Cec5_ClearCexMarks(Cec5_Man_t *p)
#define sat_solver_read_cex
int Cec5_ObjGetCnfVar(Cec5_Man_t *p, int iObj)
#define sat_solver_addvar
#define sat_solver_set_conflict_budget
void Cec5_ManSimAlloc(Gia_Man_t *p, int nWords, int fPrep)
int Cec5_ManGeneratePatternOne(Gia_Man_t *p, int iRepr, int iReprVal, int iCand, int iCandVal, Vec_Int_t *vPat, Vec_Int_t *vVisit)
int Cec5_ManSweepNode(Cec5_Man_t *p, int iObj, int iRepr)
int Cec5_ManGeneratePatterns_rec(Gia_Man_t *p, Gia_Obj_t *pObj, int Value, Vec_Int_t *vPat, Vec_Int_t *vVisit)
void Cec5_RefineInit(Gia_Man_t *p, Cec5_Man_t *pMan)
void Cec5_ManDestroy(Cec5_Man_t *p)
int Cec5_ManSimHashKey(word *pSim, int nSims, int nTableSize)
void Cec5_ManSetParams(Cec_ParFra_t *pPars)
void Cec5_ManCexVerify(Gia_Man_t *p, int iObj0, int iObj1, int fPhase)
Gia_Man_t * Cec5_ManStartNew(Gia_Man_t *pAig)
void Cec5_ManPrintTfiConeStats(Gia_Man_t *p)
int Cec5_ManPerformSweeping(Gia_Man_t *p, Cec_ParFra_t *pPars, Gia_Man_t **ppNew, int fSimOnly, int fCbs, int approxLim, int subBatchSz, int adaRecycle)
void Cec5_ManPackAddPatterns(Gia_Man_t *p, int iBit, Vec_Int_t *vLits)
void Cec5_ManPrintClasses(Gia_Man_t *p)
void Cec5_ManPrintStats(Gia_Man_t *p, Cec_ParFra_t *pPars, Cec5_Man_t *pMan, int fSim)
void Cec5_ManLoadInstance(Cec5_Man_t *p, int iObj0, int iObj1, int *piVar0, int *piVar1)
void Cec5_ManSimulate(Gia_Man_t *p, Cec5_Man_t *pMan)
int Cec5_ManPackAddPatternTry(Gia_Man_t *p, int iBit, Vec_Int_t *vLits)
int Cec5_ManSolveTwo(Cec5_Man_t *p, int iObj0, int iObj1, int fPhase, int *pfEasy, int fVerbose, int fEffort)
void Cec5_CollectSuper(Gia_Obj_t *pObj, int fUseMuxes, Vec_Ptr_t *vSuper)
void Cec5_AddClausesSuper(Gia_Man_t *p, Gia_Obj_t *pNode, Vec_Ptr_t *vSuper, sat_solver *pSat)
void Cec5_EvalPatterns(Gia_Man_t *p, Vec_Int_t *vPats, int nPats)
int Cec5_ManGeneratePatterns(Cec5_Man_t *p)
#define sat_solver_set_var_fanin_lit
#define sat_solver_read_cex_varvalue
void Cec5_ManVerify(Gia_Man_t *p, int iObj0, int iObj1, int fPhase, sat_solver *pSat)
void Cec5_CollectSuper_rec(Gia_Obj_t *pObj, Vec_Ptr_t *vSuper, int fFirst, int fUseMuxes)
Gia_Obj_t * Cec5_ManFindRepr(Gia_Man_t *p, Cec5_Man_t *pMan, int iObj)
#define sat_solver_add_and
void Cec5_RefineOneClass(Gia_Man_t *p, Cec5_Man_t *pMan, Vec_Int_t *vNodes)
void Cec5_ObjAddToFrontier(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Ptr_t *vFrontier, sat_solver *pSat)
#define sat_solver_conflictnum
void Cec5_FlushCache2Pattern(Cec5_Man_t *p)
Cec5_Man_t * Cec5_ManCreate(Gia_Man_t *pAig, Cec_ParFra_t *pPars)
void Cec5_ManSimulateCis(Gia_Man_t *p)
typedefABC_NAMESPACE_IMPL_START struct Cec5_Man_t_ Cec5_Man_t
DECLARATIONS ///.
#define sat_solver_add_xor
void Cec5_AddClausesMux(Gia_Man_t *p, Gia_Obj_t *pNode, sat_solver *pSat)
void Cec5_RefineClasses(Gia_Man_t *p, Cec5_Man_t *pMan, Vec_Int_t *vClasses)
int Cec5_ManVerify_rec(Gia_Man_t *p, int iObj, sat_solver *pSat)
Gia_Man_t * Cec5_ManSimulateTest(Gia_Man_t *p, Cec_ParFra_t *pPars, int fCbs, int approxLim, int subBatchSz, int adaRecycle)
void Cec5_ManPrintClasses2(Gia_Man_t *p)
int Cec5_ManCandIterNext(Cec5_Man_t *p)
Gia_Man_t * Cec5_ManSimulateTest3(Gia_Man_t *p, int nBTLimit, int fVerbose)
Vec_Wrd_t * Cec5_EvalCombine(Vec_Int_t *vPats, int nPats, int nInputs, int nWords)
FUNCTION DEFINITIONS ///.
void Cec5_ManSimulate_rec(Gia_Man_t *p, Cec5_Man_t *pMan, int iObj)
void Cec5_ManClearCis(Gia_Man_t *p)
int Cec5_ManSweepNodeCbs(Cec5_Man_t *p, CbsP_Man_t *pCbs, int iObj, int iRepr, int fTagFail)
#define sat_solver_set_jftr
int Cec5_ManSimulateCos(Gia_Man_t *p)
int Cec5_ManSolveTwoCbs(Cec5_Man_t *p, CbsP_Man_t *pCbs, int iObj0, int iObj1, int fPhase, int *pfEasy, int fVerbose, int fEffort)
void Cec5_ManSatSolverRecycle(Cec5_Man_t *p)
Abc_Cex_t * Cec5_ManDeriveCex(Gia_Man_t *p, int iOut, int iPat)
struct Cec_ParFra_t_ Cec_ParFra_t
CbsP_Man_t * CbsP_ManAlloc(Gia_Man_t *pGia)
void CbsP_PrintRecord(CbsP_Par_t *pPars)
void CbsP_ManStop(CbsP_Man_t *p)
void CbsP_ManSatPrintStats(CbsP_Man_t *p)
int CbsP_ManSolve2(CbsP_Man_t *p, Gia_Obj_t *pObj, Gia_Obj_t *pObj2)
struct CbsP_Man_t_ CbsP_Man_t
struct Gia_Rpr_t_ Gia_Rpr_t
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
Vec_Wrd_t * Gia_ManSimPatSimOut(Gia_Man_t *pGia, Vec_Wrd_t *vSimsPi, int fOuts)
Gia_Obj_t * Gia_ObjRecognizeMux(Gia_Obj_t *pNode, Gia_Obj_t **ppNodeT, Gia_Obj_t **ppNodeE)
#define Gia_ManForEachAnd(p, pObj, i)
#define Gia_ManForEachCoId(p, Id, i)
void Gia_ManStopP(Gia_Man_t **p)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
#define Gia_ManForEachCoDriverId(p, DriverId, i)
void Gia_ManHashAlloc(Gia_Man_t *p)
#define Gia_ClassForEachObj1(p, i, iObj)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
void Gia_ManFillValue(Gia_Man_t *p)
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
void Gia_ManCleanMark0(Gia_Man_t *p)
void Gia_ManCollectTfi(Gia_Man_t *p, Vec_Int_t *vRoots, Vec_Int_t *vNodes)
int Gia_ObjRecognizeExor(Gia_Obj_t *pObj, Gia_Obj_t **ppFan0, Gia_Obj_t **ppFan1)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
void Gia_ManIncrementTravId(Gia_Man_t *p)
int Gia_ManHashXorReal(Gia_Man_t *p, int iLit0, int iLit1)
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
#define Gia_ManForEachCo(p, pObj, i)
#define Gia_ManForEachCi(p, pObj, i)
void Gia_ManSetPhase(Gia_Man_t *p)
void Gia_ManCleanMark01(Gia_Man_t *p)
int Gia_ManLevelNum(Gia_Man_t *p)
#define Gia_ManForEachClass0(p, i)
#define Gia_ManForEachCiId(p, Id, i)
void Gia_ManCleanMark1(Gia_Man_t *p)
unsigned __int64 word
DECLARATIONS ///.
Vec_Int_t * vClassUpdates
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Bit_t_ Vec_Bit_t
INCLUDES ///.
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
#define Vec_IntForEachEntryReverse(vVec, pEntry, i)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Wrd_t_ Vec_Wrd_t
INCLUDES ///.