34#define sat_solver bmcg2_sat_solver
35#define sat_solver_start bmcg2_sat_solver_start
36#define sat_solver_stop bmcg2_sat_solver_stop
37#define sat_solver_addclause bmcg2_sat_solver_addclause
38#define sat_solver_add_and bmcg2_sat_solver_add_and
39#define sat_solver_add_xor bmcg2_sat_solver_add_xor
40#define sat_solver_addvar bmcg2_sat_solver_addvar
41#define sat_solver_read_cex_varvalue bmcg2_sat_solver_read_cex_varvalue
42#define sat_solver_reset bmcg2_sat_solver_reset
43#define sat_solver_set_conflict_budget bmcg2_sat_solver_set_conflict_budget
44#define sat_solver_conflictnum bmcg2_sat_solver_conflictnum
45#define sat_solver_solve bmcg2_sat_solver_solve
46#define sat_solver_read_cex_varvalue bmcg2_sat_solver_read_cex_varvalue
47#define sat_solver_read_cex bmcg2_sat_solver_read_cex
48#define sat_solver_jftr bmcg2_sat_solver_jftr
49#define sat_solver_set_jftr bmcg2_sat_solver_set_jftr
50#define sat_solver_set_var_fanin_lit bmcg2_sat_solver_set_var_fanin_lit
51#define sat_solver_start_new_round bmcg2_sat_solver_start_new_round
52#define sat_solver_mark_cone bmcg2_sat_solver_mark_cone
58#define sat_solver bmcg_sat_solver
59#define sat_solver_start bmcg_sat_solver_start
60#define sat_solver_stop bmcg_sat_solver_stop
61#define sat_solver_addclause bmcg_sat_solver_addclause
62#define sat_solver_add_and bmcg_sat_solver_add_and
63#define sat_solver_add_xor bmcg_sat_solver_add_xor
64#define sat_solver_addvar bmcg_sat_solver_addvar
65#define sat_solver_read_cex_varvalue bmcg_sat_solver_read_cex_varvalue
66#define sat_solver_reset bmcg_sat_solver_reset
67#define sat_solver_set_conflict_budget bmcg_sat_solver_set_conflict_budget
68#define sat_solver_conflictnum bmcg_sat_solver_conflictnum
69#define sat_solver_solve bmcg_sat_solver_solve
70#define sat_solver_read_cex_varvalue bmcg_sat_solver_read_cex_varvalue
71#define sat_solver_read_cex bmcg_sat_solver_read_cex
72#define sat_solver_jftr bmcg_sat_solver_jftr
73#define sat_solver_set_jftr bmcg_sat_solver_set_jftr
74#define sat_solver_set_var_fanin_lit bmcg_sat_solver_set_var_fanin_lit
75#define sat_solver_start_new_round bmcg_sat_solver_start_new_round
76#define sat_solver_mark_cone bmcg_sat_solver_mark_cone
145static inline int Cec4_ObjSatId(
Gia_Man_t *
p,
Gia_Obj_t * pObj ) {
return Gia_ObjCopy2Array(
p, Gia_ObjId(
p, pObj)); }
146static inline int Cec4_ObjSetSatId(
Gia_Man_t *
p,
Gia_Obj_t * pObj,
int Num ) {
assert(Cec4_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; }
147static inline void Cec4_ObjCleanSatId(
Gia_Man_t *
p,
Gia_Obj_t * pObj ) {
assert(Cec4_ObjSatId(
p, pObj) != -1); Gia_ObjSetCopy2Array(
p, Gia_ObjId(
p, pObj), -1); }
168 int i, k, iLit, iPat = 0;
word * pSim;
169 for ( i = 0; i < Vec_IntSize(vPats); i += Vec_IntEntry(vPats, i), iPat++ )
170 for ( k = 1; k < Vec_IntEntry(vPats, i)-1; k++ )
171 if ( (iLit = Vec_IntEntry(vPats, i+k)) )
173 assert( Abc_Lit2Var(iLit) > 0 && Abc_Lit2Var(iLit) <= nInputs );
174 pSim = Vec_WrdEntryP( vSimsPi, (Abc_Lit2Var(iLit)-1)*
nWords );
175 if ( Abc_InfoHasBit( (
unsigned*)pSim, iPat ) != Abc_LitIsCompl(iLit) )
176 Abc_InfoXorBit( (
unsigned*)pSim, iPat );
183 int nWords = Abc_Bit6WordNum(nPats);
186 int i, Count = 0, nErrors = 0;
187 for ( i = 0; i < Gia_ManCoNum(
p); i++ )
189 int CountThis = Abc_TtCountOnesVec( Vec_WrdEntryP(vSimsPo, i*
nWords),
nWords );
190 if ( CountThis == 0 )
192 printf(
"%d ", CountThis );
193 nErrors += CountThis;
196 printf(
"\nDetected %d error POs with %d errors (average %.2f).\n", Count, nErrors, 1.0*nErrors/Abc_MaxInt(1, Count) );
197 Vec_WrdFree( vSimsPi );
198 Vec_WrdFree( vSimsPo );
273 p->timeStart = Abc_Clock();
278 p->vFrontier = Vec_PtrAlloc( 1000 );
279 p->vFanins = Vec_PtrAlloc( 100 );
280 p->vCexMin = Vec_IntAlloc( 100 );
281 p->vClassUpdates = Vec_IntAlloc( 100 );
282 p->vCexStamps = Vec_IntStart( Gia_ManObjNum(pAig) );
283 p->vCands = Vec_IntAlloc( 100 );
284 p->vVisit = Vec_IntAlloc( 100 );
285 p->vPat = Vec_IntAlloc( 100 );
286 p->vDisprPairs = Vec_IntAlloc( 100 );
287 p->vFails = Vec_BitStart( Gia_ManObjNum(pAig) );
288 p->vPairs = pPars->
fUseCones ? Vec_IntAlloc( 100 ) : NULL;
295 p->vCoDrivers = Vec_BitStart( Gia_ManObjNum(pAig) );
297 Vec_BitWriteEntry(
p->vCoDrivers, Driver, 1 );
303 if (
p->pPars->fVerbose )
305 abctime timeTotal = Abc_Clock() -
p->timeStart;
306 abctime timeSat =
p->timeSatSat0 +
p->timeSatSat +
p->timeSatUnsat0 +
p->timeSatUnsat +
p->timeSatUndec;
309 ABC_PRTP(
" sat(easy) ",
p->timeSatSat0, timeTotal );
310 ABC_PRTP(
" sat ",
p->timeSatSat, timeTotal );
311 ABC_PRTP(
" unsat(easy)",
p->timeSatUnsat0, timeTotal );
312 ABC_PRTP(
" unsat ",
p->timeSatUnsat, timeTotal );
313 ABC_PRTP(
" fail ",
p->timeSatUndec, timeTotal );
314 ABC_PRTP(
"Generate CNF ",
p->timeCnf, timeTotal );
315 ABC_PRTP(
"Generate pats",
p->timeGenPats, timeTotal );
316 ABC_PRTP(
"Simulation ",
p->timeSim, timeTotal );
317 ABC_PRTP(
"Refinement ",
p->timeRefine, timeTotal );
318 ABC_PRTP(
"Resim global ",
p->timeResimGlo, timeTotal );
319 ABC_PRTP(
"Resim local ",
p->timeResimLoc, timeTotal );
321 ABC_PRTP(
"TOTAL ", timeTotal, timeTotal );
328 Vec_WrdFreeP( &
p->pAig->vSims );
329 Vec_WrdFreeP( &
p->pAig->vSimsPi );
333 Vec_PtrFreeP( &
p->vFrontier );
334 Vec_PtrFreeP( &
p->vFanins );
335 Vec_IntFreeP( &
p->vCexMin );
336 Vec_IntFreeP( &
p->vClassUpdates );
337 Vec_IntFreeP( &
p->vCexStamps );
338 Vec_IntFreeP( &
p->vCands );
339 Vec_IntFreeP( &
p->vVisit );
340 Vec_IntFreeP( &
p->vPat );
341 Vec_IntFreeP( &
p->vDisprPairs );
342 Vec_BitFreeP( &
p->vFails );
343 Vec_IntFreeP( &
p->vPairs );
344 Vec_BitFreeP( &
p->vCoDrivers );
345 Vec_IntFreeP( &
p->vRefClasses );
346 Vec_IntFreeP( &
p->vRefNodes );
347 Vec_IntFreeP( &
p->vRefBins );
360 Gia_ManConst0(pAig)->Value = 0;
362 pObj->
Value = Gia_ManAppendCi( pNew );
364 Vec_IntFill( &pNew->
vCopies2, Gia_ManObjNum(pAig), -1 );
384 int pLits[4], RetValue, VarF, VarI, VarT, VarE, fCompT, fCompE;
386 assert( !Gia_IsComplement( pNode ) );
391 VarF = Cec4_ObjSatId(
p, pNode);
392 VarI = Cec4_ObjSatId(
p, pNodeI);
393 VarT = Cec4_ObjSatId(
p, Gia_Regular(pNodeT));
394 VarE = Cec4_ObjSatId(
p, Gia_Regular(pNodeE));
396 fCompT = Gia_IsComplement(pNodeT);
397 fCompE = Gia_IsComplement(pNodeE);
407 pLits[0] = Abc_Var2Lit(VarI, 1);
408 pLits[1] = Abc_Var2Lit(VarT, 1^fCompT);
409 pLits[2] = Abc_Var2Lit(VarF, 0);
412 if ( pNodeI->
fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
413 if ( Gia_Regular(pNodeT)->fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
414 if ( pNode->
fPhase ) pLits[2] = Abc_LitNot( pLits[2] );
418 pLits[0] = Abc_Var2Lit(VarI, 1);
419 pLits[1] = Abc_Var2Lit(VarT, 0^fCompT);
420 pLits[2] = Abc_Var2Lit(VarF, 1);
423 if ( pNodeI->
fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
424 if ( Gia_Regular(pNodeT)->fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
425 if ( pNode->
fPhase ) pLits[2] = Abc_LitNot( pLits[2] );
429 pLits[0] = Abc_Var2Lit(VarI, 0);
430 pLits[1] = Abc_Var2Lit(VarE, 1^fCompE);
431 pLits[2] = Abc_Var2Lit(VarF, 0);
434 if ( pNodeI->
fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
435 if ( Gia_Regular(pNodeE)->fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
436 if ( pNode->
fPhase ) pLits[2] = Abc_LitNot( pLits[2] );
440 pLits[0] = Abc_Var2Lit(VarI, 0);
441 pLits[1] = Abc_Var2Lit(VarE, 0^fCompE);
442 pLits[2] = Abc_Var2Lit(VarF, 1);
445 if ( pNodeI->
fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
446 if ( Gia_Regular(pNodeE)->fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
447 if ( pNode->
fPhase ) pLits[2] = Abc_LitNot( pLits[2] );
465 pLits[0] = Abc_Var2Lit(VarT, 0^fCompT);
466 pLits[1] = Abc_Var2Lit(VarE, 0^fCompE);
467 pLits[2] = Abc_Var2Lit(VarF, 1);
470 if ( Gia_Regular(pNodeT)->fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
471 if ( Gia_Regular(pNodeE)->fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
472 if ( pNode->
fPhase ) pLits[2] = Abc_LitNot( pLits[2] );
476 pLits[0] = Abc_Var2Lit(VarT, 1^fCompT);
477 pLits[1] = Abc_Var2Lit(VarE, 1^fCompE);
478 pLits[2] = Abc_Var2Lit(VarF, 0);
481 if ( Gia_Regular(pNodeT)->fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
482 if ( Gia_Regular(pNodeE)->fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
483 if ( pNode->
fPhase ) pLits[2] = Abc_LitNot( pLits[2] );
492 int * pLits, nLits, RetValue, i;
493 assert( !Gia_IsComplement(pNode) );
494 assert( Gia_ObjIsAnd( pNode ) );
496 nLits = Vec_PtrSize(vSuper) + 1;
502 pLits[0] = Abc_Var2Lit(Cec4_ObjSatId(
p, Gia_Regular(pFanin)), Gia_IsComplement(pFanin));
503 pLits[1] = Abc_Var2Lit(Cec4_ObjSatId(
p, pNode), 1);
506 if ( Gia_Regular(pFanin)->fPhase ) pLits[0] = Abc_LitNot( pLits[0] );
507 if ( pNode->
fPhase ) pLits[1] = Abc_LitNot( pLits[1] );
515 pLits[i] = Abc_Var2Lit(Cec4_ObjSatId(
p, Gia_Regular(pFanin)), !Gia_IsComplement(pFanin));
518 if ( Gia_Regular(pFanin)->fPhase ) pLits[i] = Abc_LitNot( pLits[i] );
521 pLits[nLits-1] = Abc_Var2Lit(Cec4_ObjSatId(
p, pNode), 0);
524 if ( pNode->
fPhase ) pLits[nLits-1] = Abc_LitNot( pLits[nLits-1] );
545 if ( Gia_IsComplement(pObj) || Gia_ObjIsCi(pObj) ||
546 (!fFirst && Gia_ObjValue(pObj) > 1) ||
547 (fUseMuxes && pObj->
fMark0) )
549 Vec_PtrPushUnique( vSuper, pObj );
558 assert( !Gia_IsComplement(pObj) );
559 assert( !Gia_ObjIsCi(pObj) );
560 Vec_PtrClear( vSuper );
565 assert( !Gia_IsComplement(pObj) );
566 assert( !Gia_ObjIsConst0(pObj) );
567 if ( Cec4_ObjSatId(
p, pObj) >= 0 )
569 assert( Cec4_ObjSatId(
p, pObj) == -1 );
571 if ( Gia_ObjIsAnd(pObj) )
572 Vec_PtrPush( vFrontier, pObj );
582 if ( Cec4_ObjSatId(
p->pNew,pObj) >= 0 )
583 return Cec4_ObjSatId(
p->pNew,pObj);
585 if ( Gia_ObjIsCi(pObj) )
587 assert( Gia_ObjIsAnd(pObj) );
593 if (
p->pNew->pMuxes == NULL &&
Gia_ObjRecognizeExor(pObj, &pFan0, &pFan1) && Gia_IsComplement(pFan0) == Gia_IsComplement(pFan1) )
598 if (
p->pPars->jType < 2 )
600 if (
p->pPars->jType > 0 )
602 int Lit0 = Abc_Var2Lit( iVar0, 0 );
603 int Lit1 = Abc_Var2Lit( iVar1, 0 );
605 Lit1 ^= Lit0, Lit0 ^= Lit1, Lit1 ^= Lit0;
616 if (
p->pPars->jType < 2 )
618 if ( Gia_ObjIsXor(pObj) )
619 sat_solver_add_xor(
p->pSat, iVar, iVar0, iVar1, Gia_ObjFaninC0(pObj) ^ Gia_ObjFaninC1(pObj) );
621 sat_solver_add_and(
p->pSat, iVar, iVar0, iVar1, Gia_ObjFaninC0(pObj), Gia_ObjFaninC1(pObj), 0 );
623 if (
p->pPars->jType > 0 )
625 int Lit0 = Abc_Var2Lit( iVar0, Gia_ObjFaninC0(pObj) );
626 int Lit1 = Abc_Var2Lit( iVar1, Gia_ObjFaninC1(pObj) );
627 if ( (Lit0 > Lit1) ^ Gia_ObjIsXor(pObj) )
628 Lit1 ^= Lit0, Lit0 ^= Lit1, Lit1 ^= Lit0;
630 p->nGates[Gia_ObjIsXor(pObj)]++;
633 return Cec4_ObjSatId(
p->pNew, pObj );
635 assert( !Gia_ObjIsXor(pObj) );
637 Vec_PtrClear(
p->vFrontier );
643 assert( Cec4_ObjSatId(
p->pNew,pNode) >= 0 );
644 if ( fUseMuxes && pNode->
fMark0 )
646 Vec_PtrClear(
p->vFanins );
647 Vec_PtrPushUnique(
p->vFanins, Gia_ObjFanin0( Gia_ObjFanin0(pNode) ) );
648 Vec_PtrPushUnique(
p->vFanins, Gia_ObjFanin0( Gia_ObjFanin1(pNode) ) );
649 Vec_PtrPushUnique(
p->vFanins, Gia_ObjFanin1( Gia_ObjFanin0(pNode) ) );
650 Vec_PtrPushUnique(
p->vFanins, Gia_ObjFanin1( Gia_ObjFanin1(pNode) ) );
662 assert( Vec_PtrSize(
p->vFanins) > 1 );
664 return Cec4_ObjSatId(
p->pNew,pObj);
681 return Vec_WrdEntryP(
p->vSims,
p->nSimWords * iObj );
683static inline int Cec4_ObjSimEqual(
Gia_Man_t *
p,
int iObj0,
int iObj1 )
686 word * pSim0 = Cec4_ObjSim(
p, iObj0 );
687 word * pSim1 = Cec4_ObjSim(
p, iObj1 );
688 if ( (pSim0[0] & 1) == (pSim1[0] & 1) )
690 for ( w = 0; w <
p->nSimWords; w++ )
691 if ( pSim0[w] != pSim1[w] )
697 for ( w = 0; w <
p->nSimWords; w++ )
698 if ( pSim0[w] != ~pSim1[w] )
705 static int s_Primes[16] = {
706 1291, 1699, 1999, 2357, 2953, 3313, 3907, 4177,
707 4831, 5147, 5647, 6343, 6899, 7103, 7873, 8147 };
708 unsigned uHash = 0, * pSimU = (
unsigned *)pSim;
709 int i, nSimsU = 2 * nSims;
711 for ( i = 0; i < nSimsU; i++ )
712 uHash ^= ~pSimU[i] * s_Primes[i & 0xf];
714 for ( i = 0; i < nSimsU; i++ )
715 uHash ^= pSimU[i] * s_Primes[i & 0xf];
716 return (
int)(uHash % nTableSize);
721 int iObj, iPrev = iRepr, iPrev2, iRepr2;
723 assert( Gia_ObjNext(
p, iRepr) > 0 );
725 if ( Cec4_ObjSimEqual(
p, iRepr, iRepr2) )
736 for ( iObj = Gia_ObjNext(
p, iRepr2); iObj > 0; iObj = Gia_ObjNext(
p, iObj) )
738 if ( Cec4_ObjSimEqual(
p, iRepr, iObj) )
740 Gia_ObjSetNext(
p, iPrev, iObj );
745 Gia_ObjSetRepr(
p, iObj, iRepr2 );
746 Gia_ObjSetNext(
p, iPrev2, iObj );
750 Gia_ObjSetNext(
p, iPrev, -1 );
751 Gia_ObjSetNext(
p, iPrev2, -1 );
753 if ( Gia_ObjNext(
p, iRepr2) > 0 )
759 Vec_IntClear( pMan->vRefBins );
763 assert( Key >= 0 && Key < pMan->nTableSize );
764 if ( pMan->pTable[Key] == -1 )
765 Vec_IntPush( pMan->vRefBins, Key );
766 p->pNexts[iObj] = pMan->pTable[Key];
767 pMan->pTable[Key] = iObj;
771 int iRepr = pMan->pTable[Bin];
772 pMan->pTable[Bin] = -1;
774 assert(
p->pNexts[iRepr] != 0 );
775 if (
p->pNexts[iRepr] == -1 )
777 for ( iObj =
p->pNexts[iRepr]; iObj > 0; iObj =
p->pNexts[iObj] )
778 p->pReprs[iObj].iRepr = iRepr;
781 Vec_IntClear( pMan->vRefBins );
785 if ( Vec_IntSize(pMan->vRefClasses) == 0 )
787 if ( Vec_IntSize(pMan->vRefNodes) > 0 )
791 int i, k, iObj, iRepr;
794 assert(
p->pReprs[iRepr].fColorA );
795 p->pReprs[iRepr].fColorA = 0;
796 Vec_IntClear( pMan->vRefNodes );
797 Vec_IntPush( pMan->vRefNodes, iRepr );
799 Vec_IntPush( pMan->vRefNodes, k );
803 p->pNexts[iObj] = -1;
808 Vec_IntClear( pMan->vRefClasses );
809 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) );
824 if ( !Gia_ObjIsCo(pObj) && (!pMan->pPars->nLevelMax || Gia_ObjLevel(
p, pObj) <= pMan->pPars->nLevelMax) )
825 Vec_IntPush( pMan->vRefNodes, i );
827 pMan->vRefBins = Vec_IntAlloc( Gia_ManObjNum(
p)/2 );
828 pMan->vRefClasses = Vec_IntAlloc( Gia_ManObjNum(
p)/2 );
829 Vec_IntPush( pMan->vRefClasses, 0 );
844static inline void Cec4_ObjSimSetInputBit(
Gia_Man_t *
p,
int iObj,
int Bit )
846 word * pSim = Cec4_ObjSim(
p, iObj );
847 if ( Abc_InfoHasBit( (
unsigned*)pSim,
p->iPatsPi ) != Bit )
848 Abc_InfoXorBit( (
unsigned*)pSim,
p->iPatsPi );
850static inline int Cec4_ObjSimGetInputBit(
Gia_Man_t *
p,
int iObj )
852 word * pSim = Cec4_ObjSim(
p, iObj );
853 return Abc_InfoHasBit( (
unsigned*)pSim,
p->iPatsPi );
855static inline void Cec4_ObjSimRo(
Gia_Man_t *
p,
int iObj )
858 word * pSimRo = Cec4_ObjSim(
p, iObj );
859 word * pSimRi = Cec4_ObjSim(
p, Gia_ObjRoToRiId(
p, iObj) );
860 for ( w = 0; w <
p->nSimWords; w++ )
861 pSimRo[w] = pSimRi[w];
863static inline void Cec4_ObjSimCo(
Gia_Man_t *
p,
int iObj )
867 word * pSimCo = Cec4_ObjSim(
p, iObj );
868 word * pSimDri = Cec4_ObjSim(
p, Gia_ObjFaninId0(pObj, iObj) );
869 if ( Gia_ObjFaninC0(pObj) )
870 for ( w = 0; w <
p->nSimWords; w++ )
871 pSimCo[w] = ~pSimDri[w];
873 for ( w = 0; w <
p->nSimWords; w++ )
874 pSimCo[w] = pSimDri[w];
876static inline void Cec4_ObjSimAnd(
Gia_Man_t *
p,
int iObj )
880 word * pSim = Cec4_ObjSim(
p, iObj );
881 word * pSim0 = Cec4_ObjSim(
p, Gia_ObjFaninId0(pObj, iObj) );
882 word * pSim1 = Cec4_ObjSim(
p, Gia_ObjFaninId1(pObj, iObj) );
883 if ( Gia_ObjFaninC0(pObj) && Gia_ObjFaninC1(pObj) )
884 for ( w = 0; w <
p->nSimWords; w++ )
885 pSim[w] = ~pSim0[w] & ~pSim1[w];
886 else if ( Gia_ObjFaninC0(pObj) && !Gia_ObjFaninC1(pObj) )
887 for ( w = 0; w <
p->nSimWords; w++ )
888 pSim[w] = ~pSim0[w] & pSim1[w];
889 else if ( !Gia_ObjFaninC0(pObj) && Gia_ObjFaninC1(pObj) )
890 for ( w = 0; w <
p->nSimWords; w++ )
891 pSim[w] = pSim0[w] & ~pSim1[w];
893 for ( w = 0; w <
p->nSimWords; w++ )
894 pSim[w] = pSim0[w] & pSim1[w];
896static inline void Cec4_ObjSimXor(
Gia_Man_t *
p,
int iObj )
900 word * pSim = Cec4_ObjSim(
p, iObj );
901 word * pSim0 = Cec4_ObjSim(
p, Gia_ObjFaninId0(pObj, iObj) );
902 word * pSim1 = Cec4_ObjSim(
p, Gia_ObjFaninId1(pObj, iObj) );
903 if ( Gia_ObjFaninC0(pObj) ^ Gia_ObjFaninC1(pObj) )
904 for ( w = 0; w <
p->nSimWords; w++ )
905 pSim[w] = ~pSim0[w] ^ pSim1[w];
907 for ( w = 0; w <
p->nSimWords; w++ )
908 pSim[w] = pSim0[w] ^ pSim1[w];
910static inline void Cec4_ObjSimCi(
Gia_Man_t *
p,
int iObj )
913 word * pSim = Cec4_ObjSim(
p, iObj );
914 for ( w = 0; w <
p->nSimWords; w++ )
918static inline void Cec4_ObjClearSimCi(
Gia_Man_t *
p,
int iObj )
921 word * pSim = Cec4_ObjSim(
p, iObj );
922 for ( w = 0; w <
p->nSimWords; w++ )
929 Cec4_ObjSimCi(
p, Id );
936 Cec4_ObjClearSimCi(
p, Id );
948 if ( Abc_InfoHasBit((
unsigned *)Cec4_ObjSim(
p, Id), iPat) )
949 Abc_InfoSetBit( pCex->pData, i );
958 Cec4_ObjSimCo(
p, Id );
959 if ( Cec4_ObjSimEqual(
p, Id, 0) )
971 if ( pMan->pTable == NULL )
974 assert( Vec_IntSize(pMan->vRefClasses) == 0 );
977 int iRepr = Gia_ObjRepr(
p, i );
978 if ( Gia_ObjIsXor(pObj) )
979 Cec4_ObjSimXor(
p, i );
981 Cec4_ObjSimAnd(
p, i );
982 if ( iRepr ==
GIA_VOID ||
p->pReprs[iRepr].fColorA || Cec4_ObjSimEqual(
p, iRepr, i) )
984 p->pReprs[iRepr].fColorA = 1;
985 Vec_IntPush( pMan->vRefClasses, iRepr );
987 pMan->timeSim += Abc_Clock() - clk;
990 pMan->timeRefine += Abc_Clock() - clk;
995 if ( !iObj || Vec_IntEntry(pMan->vCexStamps, iObj) ==
p->iPatsPi )
997 Vec_IntWriteEntry( pMan->vCexStamps, iObj,
p->iPatsPi );
998 pObj = Gia_ManObj(
p, iObj);
999 if ( Gia_ObjIsCi(pObj) )
1001 assert( Gia_ObjIsAnd(pObj) );
1004 if ( Gia_ObjIsXor(pObj) )
1005 Cec4_ObjSimXor(
p, iObj );
1007 Cec4_ObjSimAnd(
p, iObj );
1011 Vec_WrdFreeP( &
p->vSims );
1012 Vec_WrdFreeP( &
p->vSimsPi );
1013 p->vSims = Vec_WrdStart( Gia_ManObjNum(
p) *
nWords );
1014 p->vSimsPi = Vec_WrdStart( (Gia_ManCiNum(
p) + 1) *
nWords );
1032 Vec_Int_t * vRoots = Vec_IntAlloc( 100 );
1033 Vec_Int_t * vNodes = Vec_IntAlloc( 100 );
1034 Vec_Int_t * vLeaves = Vec_IntAlloc( 100 );
1038 Vec_IntClear( vRoots );
1041 Vec_IntPush( vRoots, i );
1043 Vec_IntPush( vRoots, k );
1045 printf(
"Class %6d : ", i );
1046 printf(
"Roots = %6d ", Vec_IntSize(vRoots) );
1047 printf(
"Nodes = %6d ", Vec_IntSize(vNodes) );
1050 Vec_IntFree( vRoots );
1051 Vec_IntFree( vNodes );
1052 Vec_IntFree( vLeaves );
1058 int i, nLits, Counter = 0, Counter0 = 0, CounterX = 0;
1061 if ( pMan->nItersSim + pMan->nItersSat )
1062 clkThis = Abc_Clock() - clk;
1064 for ( i = 0; i < Gia_ManObjNum(
p); i++ )
1066 if ( Gia_ObjIsHead(
p, i) )
1068 else if ( Gia_ObjIsConst(
p, i) )
1070 else if ( Gia_ObjIsNone(
p, i) )
1073 nLits = Gia_ManObjNum(
p) - Counter - CounterX;
1076 printf(
"Sim %4d : ", pMan->nItersSim++ + pMan->nItersSat );
1077 printf(
"%6.2f %% ", 100.0*nLits/Gia_ManCandNum(
p) );
1081 printf(
"SAT %4d : ", pMan->nItersSim + pMan->nItersSat++ );
1082 printf(
"%6.2f %% ", 100.0*pMan->nAndNodes/Gia_ManAndNum(
p) );
1084 printf(
"P =%7d ", pMan ? pMan->nSatUnsat : 0 );
1085 printf(
"D =%7d ", pMan ? pMan->nSatSat : 0 );
1086 printf(
"F =%8d ", pMan ? pMan->nSatUndec : 0 );
1088 Abc_Print( 1,
"cst =%9d cls =%8d lit =%9d ", Counter0, Counter, nLits );
1089 Abc_PrintTime( 1,
"Time", clkThis );
1096 printf(
"Class %d : ", i );
1107 printf(
"Const0 class has %d entries.\n", Count );
1126 if ( iObj == 0 )
return 0;
1127 if ( Gia_ObjIsTravIdCurrentId(
p, iObj) )
1129 Gia_ObjSetTravIdCurrentId(
p, iObj);
1130 if ( Gia_ObjIsCi(pObj) )
1132 assert( Gia_ObjIsAnd(pObj) );
1133 Value0 =
Cec4_ManVerify_rec(
p, Gia_ObjFaninId0(pObj, iObj), pSat ) ^ Gia_ObjFaninC0(pObj);
1134 Value1 =
Cec4_ManVerify_rec(
p, Gia_ObjFaninId1(pObj, iObj), pSat ) ^ Gia_ObjFaninC1(pObj);
1135 return pObj->
fMark1 = Gia_ObjIsXor(pObj) ? Value0 ^ Value1 : Value0 & Value1;
1143 if ( (Value0 ^ Value1) == fPhase )
1144 printf(
"CEX verification FAILED for obj %d and obj %d.\n", iObj0, iObj1 );
1165 if ( iObj == 0 )
return 0;
1166 if ( Gia_ObjIsTravIdCurrentId(
p, iObj) )
1168 Gia_ObjSetTravIdCurrentId(
p, iObj);
1169 if ( Gia_ObjIsCi(pObj) )
1170 return pObj->
fMark1 = Cec4_ObjSimGetInputBit(
p, iObj);
1171 assert( Gia_ObjIsAnd(pObj) );
1174 return pObj->
fMark1 = Gia_ObjIsXor(pObj) ? Value0 ^ Value1 : Value0 & Value1;
1182 if ( (Value0 ^ Value1) == fPhase )
1183 printf(
"CEX verification FAILED for obj %d and obj %d.\n", iObj0, iObj1 );
1201 int k, Limit = Abc_MinInt( Vec_IntSize(vLits), 64 *
p->nSimWords - 1 );
1202 for ( k = 0; k < Limit; k++ )
1204 int i, Lit, iBitLocal = (iBit + k + 1) % Limit + 1;
1205 assert( iBitLocal > 0 && iBitLocal < 64 * p->nSimWords );
1208 word * pInfo = Vec_WrdEntryP(
p->vSims,
p->nSimWords * Abc_Lit2Var(Lit) );
1209 word * pPres = Vec_WrdEntryP(
p->vSimsPi,
p->nSimWords * Abc_Lit2Var(Lit) );
1210 if ( Abc_InfoHasBit( (
unsigned *)pPres, iBitLocal ) )
1212 if ( Abc_InfoHasBit( (
unsigned *)pInfo, iBitLocal ) != Abc_LitIsCompl(Lit ^ (i == k)) )
1213 Abc_InfoXorBit( (
unsigned *)pInfo, iBitLocal );
1220 assert(
p->iPatsPi > 0 &&
p->iPatsPi < 64 *
p->nSimWords );
1223 word * pInfo = Vec_WrdEntryP(
p->vSims,
p->nSimWords * Abc_Lit2Var(Lit) );
1224 word * pPres = Vec_WrdEntryP(
p->vSimsPi,
p->nSimWords * Abc_Lit2Var(Lit) );
1225 if ( Abc_InfoHasBit( (
unsigned *)pPres, iBit ) &&
1226 Abc_InfoHasBit( (
unsigned *)pInfo, iBit ) != Abc_LitIsCompl(Lit) )
1231 word * pInfo = Vec_WrdEntryP(
p->vSims,
p->nSimWords * Abc_Lit2Var(Lit) );
1232 word * pPres = Vec_WrdEntryP(
p->vSimsPi,
p->nSimWords * Abc_Lit2Var(Lit) );
1233 Abc_InfoSetBit( (
unsigned *)pPres, iBit );
1234 if ( Abc_InfoHasBit( (
unsigned *)pInfo, iBit ) != Abc_LitIsCompl(Lit) )
1235 Abc_InfoXorBit( (
unsigned *)pInfo, iBit );
1242 for ( k = 1; k < 64 *
p->nSimWords - 1; k++ )
1244 if ( ++
p->iPatsPi == 64 *
p->nSimWords - 1 )
1253 if ( k == 64 *
p->nSimWords - 1 )
1257 printf(
"Internal error.\n" );
1260 return 64 *
p->nSimWords;
1276static inline int Cec4_ObjFan0IsAssigned(
Gia_Obj_t * pObj )
1278 return Gia_ObjFanin0(pObj)->fMark0 || Gia_ObjFanin0(pObj)->fMark1;
1280static inline int Cec4_ObjFan1IsAssigned(
Gia_Obj_t * pObj )
1282 return Gia_ObjFanin1(pObj)->fMark0 || Gia_ObjFanin1(pObj)->fMark1;
1284static inline int Cec4_ObjFan0HasValue(
Gia_Obj_t * pObj,
int v )
1286 return (v ^ Gia_ObjFaninC0(pObj)) ? Gia_ObjFanin0(pObj)->fMark1 : Gia_ObjFanin0(pObj)->fMark0;
1288static inline int Cec4_ObjFan1HasValue(
Gia_Obj_t * pObj,
int v )
1290 return (v ^ Gia_ObjFaninC1(pObj)) ? Gia_ObjFanin1(pObj)->fMark1 : Gia_ObjFanin1(pObj)->fMark0;
1292static inline int Cec4_ObjObjIsImpliedValue(
Gia_Obj_t * pObj,
int v )
1296 return Cec4_ObjFan0HasValue(pObj, 1) && Cec4_ObjFan1HasValue(pObj, 1);
1297 return Cec4_ObjFan0HasValue(pObj, 0) || Cec4_ObjFan1HasValue(pObj, 0);
1299static inline int Cec4_ObjFan0IsImpliedValue(
Gia_Obj_t * pObj,
int v )
1301 return Gia_ObjIsAnd(Gia_ObjFanin0(pObj)) && Cec4_ObjObjIsImpliedValue( Gia_ObjFanin0(pObj), v ^ Gia_ObjFaninC0(pObj) );
1303static inline int Cec4_ObjFan1IsImpliedValue(
Gia_Obj_t * pObj,
int v )
1305 return Gia_ObjIsAnd(Gia_ObjFanin1(pObj)) && Cec4_ObjObjIsImpliedValue( Gia_ObjFanin1(pObj), v ^ Gia_ObjFaninC1(pObj) );
1312 Vec_IntPush( vVisit, Gia_ObjId(
p, pObj) );
1313 if ( Gia_ObjIsCi(pObj) )
1315 Vec_IntPush( vPat, Abc_Var2Lit(Gia_ObjId(
p, pObj), Value) );
1318 assert( Gia_ObjIsAnd(pObj) );
1319 pFan0 = Gia_ObjFanin0(pObj);
1320 pFan1 = Gia_ObjFanin1(pObj);
1321 if ( Gia_ObjIsXor(pObj) )
1323 int Ass0 = Cec4_ObjFan0IsAssigned(pObj);
1324 int Ass1 = Cec4_ObjFan1IsAssigned(pObj);
1325 assert( Gia_ObjFaninC0(pObj) == 0 && Gia_ObjFaninC1(pObj) == 0 );
1327 return Value == (Cec4_ObjFan0HasValue(pObj, 1) ^ Cec4_ObjFan1HasValue(pObj, 1));
1330 int ValueInt = Value ^ Cec4_ObjFan0HasValue(pObj, 1);
1336 int ValueInt = Value ^ Cec4_ObjFan1HasValue(pObj, 1);
1344 if ( Cec4_ObjFan1HasValue(pObj, !Value) || (!Cec4_ObjFan1HasValue(pObj, Value) && !
Cec4_ManGeneratePatterns_rec(
p, pFan1, Value, vPat, vVisit)) )
1351 if ( Cec4_ObjFan1HasValue(pObj, Value) || (!Cec4_ObjFan1HasValue(pObj, !Value) && !
Cec4_ManGeneratePatterns_rec(
p, pFan1, !Value, vPat, vVisit)) )
1354 assert( Value == (Cec4_ObjFan0HasValue(pObj, 1) ^ Cec4_ObjFan1HasValue(pObj, 1)) );
1359 if ( Cec4_ObjFan0HasValue(pObj, 0) || Cec4_ObjFan1HasValue(pObj, 0) )
1365 assert( Cec4_ObjFan0HasValue(pObj, 1) && Cec4_ObjFan1HasValue(pObj, 1) );
1370 if ( Cec4_ObjFan0HasValue(pObj, 1) && Cec4_ObjFan1HasValue(pObj, 1) )
1372 if ( Cec4_ObjFan0HasValue(pObj, 0) || Cec4_ObjFan1HasValue(pObj, 0) )
1374 if ( Cec4_ObjFan0HasValue(pObj, 1) )
1379 else if ( Cec4_ObjFan1HasValue(pObj, 1) )
1386 if ( Cec4_ObjFan0IsImpliedValue( pObj, 0 ) )
1391 else if ( Cec4_ObjFan1IsImpliedValue( pObj, 0 ) )
1396 else if ( Cec4_ObjFan0IsImpliedValue( pObj, 1 ) )
1401 else if ( Cec4_ObjFan1IsImpliedValue( pObj, 1 ) )
1417 assert( Cec4_ObjFan0HasValue(pObj, 0) || Cec4_ObjFan1HasValue(pObj, 0) );
1426 if ( !iRepr && iReprVal )
1428 Vec_IntClear( vPat );
1429 Vec_IntClear( vVisit );
1432 Res = (!iRepr ||
Cec4_ManGeneratePatterns_rec(
p, Gia_ManObj(
p, iRepr), iReprVal, vPat, vVisit)) &&
Cec4_ManGeneratePatterns_rec(
p, Gia_ManObj(
p, iCand), iCandVal, vPat, vVisit);
1442 assert( Vec_IntSize(
p->vCands) == 0 );
1443 for ( i = 1; i < Gia_ManObjNum(
p->pAig); i++ )
1444 if ( Gia_ObjRepr(
p->pAig, i) !=
GIA_VOID )
1445 Vec_IntPush(
p->vCands, i );
1446 pArray = Vec_IntArray(
p->vCands );
1447 for ( i = 0; i < Vec_IntSize(
p->vCands); i++ )
1449 int iNew =
Abc_Random(0) % Vec_IntSize(
p->vCands);
1450 ABC_SWAP(
int, pArray[i], pArray[iNew] );
1455 while ( Vec_IntSize(
p->vCands) > 0 )
1457 int fStop, iCand = Vec_IntEntry(
p->vCands,
p->iPosRead );
1458 if ( (fStop = (Gia_ObjRepr(
p->pAig, iCand) !=
GIA_VOID)) )
1459 Vec_IntWriteEntry(
p->vCands,
p->iPosWrite++, iCand );
1460 if ( ++
p->iPosRead == Vec_IntSize(
p->vCands) )
1462 Vec_IntShrink(
p->vCands,
p->iPosWrite );
1474 int i, iCand, nPats = 100 * 64 *
p->pAig->nSimWords, CountPat = 0, Packs = 0;
1482 p->pAig->iPatsPi = 0;
1483 Vec_WrdFill(
p->pAig->vSimsPi, Vec_WrdSize(
p->pAig->vSimsPi), 0 );
1484 for ( i = 0; i < nPats; i++ )
1487 int iRepr = Gia_ObjRepr(
p->pAig, iCand );
1488 int iCandVal = Gia_ManObj(
p->pAig, iCand)->fPhase;
1489 int iReprVal = Gia_ManObj(
p->pAig, iRepr)->fPhase;
1496 if (
p->pAig->vPats )
1498 Vec_IntPush(
p->pAig->vPats, Vec_IntSize(
p->vPat)+2 );
1499 Vec_IntAppend(
p->pAig->vPats,
p->vPat );
1500 Vec_IntPush(
p->pAig->vPats, -1 );
1504 if ( Ret == 64 *
p->pAig->nSimWords )
1506 if ( ++CountPat == 8 * 64 *
p->pAig->nSimWords )
1512 p->timeGenPats += Abc_Clock() - clk;
1513 p->nSatSat += CountPat;
1517 return CountPat >= i /
p->pPars->nItersMax;
1542 Cec4_ObjCleanSatId(
p->pNew, pObj );
1543 Vec_IntClear( &
p->pNew->vSuppVars );
1544 Vec_IntClear( &
p->pNew->vCopiesTwo );
1545 Vec_IntClear( &
p->pNew->vVarMap );
1550 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;
1551 int nConfEnd, nConfBeg, status, iVar0, iVar1, Lits[2];
1552 int UnsatConflicts[3] = {0};
1554 if ( iObj1 < iObj0 )
1555 iObj1 ^= iObj0, iObj0 ^= iObj1, iObj1 ^= iObj0;
1560 if (
p->nCallsSince >
p->pPars->nCallsRecycle &&
1561 Vec_IntSize(&
p->pNew->vSuppVars) >
p->pPars->nSatVarMax &&
p->pPars->nSatVarMax )
1564 if ( !iObj0 && Cec4_ObjSatId(
p->pNew, Gia_ManConst0(
p->pNew)) == -1 )
1569 if(
p->pPars->jType > 0 )
1575 p->timeCnf += Abc_Clock() - clk;
1577 Lits[0] = Abc_Var2Lit(iVar0, 1);
1578 Lits[1] = Abc_Var2Lit(iVar1, fPhase);
1583 assert( nConfEnd >= nConfBeg );
1588 p->nConflicts[0][0] += nConfEnd == nConfBeg;
1589 p->nConflicts[0][1] += nConfEnd - nConfBeg;
1590 p->nConflicts[0][2] = Abc_MaxInt(
p->nConflicts[0][2], nConfEnd - nConfBeg);
1591 *pfEasy = nConfEnd == nConfBeg;
1597 UnsatConflicts[0] = nConfEnd == nConfBeg;
1598 UnsatConflicts[1] = nConfEnd - nConfBeg;
1599 UnsatConflicts[2] = Abc_MaxInt(
p->nConflicts[1][2], nConfEnd - nConfBeg);
1603 p->nConflicts[1][0] += nConfEnd == nConfBeg;
1604 p->nConflicts[1][1] += nConfEnd - nConfBeg;
1605 p->nConflicts[1][2] = Abc_MaxInt(
p->nConflicts[1][2], nConfEnd - nConfBeg);
1606 *pfEasy = nConfEnd == nConfBeg;
1612 Lits[0] = Abc_Var2Lit(iVar0, 0);
1613 Lits[1] = Abc_Var2Lit(iVar1, !fPhase);
1618 assert( nConfEnd >= nConfBeg );
1623 p->nConflicts[0][0] += nConfEnd == nConfBeg;
1624 p->nConflicts[0][1] += nConfEnd - nConfBeg;
1625 p->nConflicts[0][2] = Abc_MaxInt(
p->nConflicts[0][2], nConfEnd - nConfBeg);
1626 *pfEasy = nConfEnd == nConfBeg;
1630 UnsatConflicts[0] &= nConfEnd == nConfBeg;
1631 UnsatConflicts[1] += nConfEnd - nConfBeg;
1632 UnsatConflicts[2] = Abc_MaxInt(
p->nConflicts[1][2], nConfEnd - nConfBeg);
1634 p->nConflicts[1][0] += UnsatConflicts[0];
1635 p->nConflicts[1][1] += UnsatConflicts[1];
1636 p->nConflicts[1][2] = Abc_MaxInt(
p->nConflicts[1][2], UnsatConflicts[2]);
1637 *pfEasy = UnsatConflicts[0];
1648 int i, IdAig, IdSat, status, fEasy, RetValue = 1;
1649 Gia_Obj_t * pObj = Gia_ManObj(
p->pAig, iObj );
1650 Gia_Obj_t * pRepr = Gia_ManObj(
p->pAig, iRepr );
1652 int fEffort =
p->vCoDrivers ? Vec_BitEntry(
p->vCoDrivers, iObj) || Vec_BitEntry(
p->vCoDrivers, iRepr) : 0;
1661 Vec_IntClear(
p->vPat );
1662 if (
p->pPars->jType == 0 )
1670 int * pMap = Vec_IntArray(&
p->pNew->vVarMap);
1671 for ( i = 0; i < pCex[0]; )
1672 Vec_IntPush(
p->vPat, Abc_Lit2LitV(pMap, Abc_LitNot(pCex[++i])) );
1674 assert(
p->pAig->iPatsPi >= 0 &&
p->pAig->iPatsPi < 64 *
p->pAig->nSimWords - 1 );
1677 Cec4_ObjSimSetInputBit(
p->pAig, Abc_Lit2Var(iLit), Abc_LitIsCompl(iLit) );
1678 if (
p->pAig->vPats )
1680 Vec_IntPush(
p->pAig->vPats, Vec_IntSize(
p->vPat)+2 );
1681 Vec_IntAppend(
p->pAig->vPats,
p->vPat );
1682 Vec_IntPush(
p->pAig->vPats, -1 );
1687 p->timeSatSat0 += Abc_Clock() - clk;
1689 p->timeSatSat += Abc_Clock() - clk;
1694 if (
p->pAig->iPatsPi == 64 *
p->pAig->nSimWords - 2 )
1699 p->nFaster[0] =
p->nFaster[1] = 0;
1702 Vec_IntFill(
p->vCexStamps, Gia_ManObjNum(
p->pAig), 0 );
1703 p->pAig->iPatsPi = 0;
1704 Vec_WrdFill(
p->pAig->vSimsPi, Vec_WrdSize(
p->pAig->vSimsPi), 0 );
1705 p->timeResimGlo += Abc_Clock() - clk2;
1712 pObj->
Value = Abc_LitNotCond( pRepr->
Value, fCompl );
1713 Gia_ObjSetProved(
p->pAig, iObj );
1715 p->iLastConst = iObj;
1717 p->timeSatUnsat0 += Abc_Clock() - clk;
1719 p->timeSatUnsat += Abc_Clock() - clk;
1728 Vec_IntPushTwo(
p->vPairs, Abc_Var2Lit(iRepr, 0), Abc_Var2Lit(iObj, fCompl) );
1729 p->timeSatUndec += Abc_Clock() - clk;
1731 pObj->
Value = Abc_LitNotCond( pRepr->
Value, fCompl );
1732 Gia_ObjSetProved(
p->pAig, iObj );
1734 p->iLastConst = iObj;
1739 Gia_ObjSetFailed(
p->pAig, iObj );
1740 Vec_BitWriteEntry(
p->vFails, iObj, 1 );
1743 p->timeSatUndec += Abc_Clock() - clk;
1753 assert( Gia_ObjHasRepr(
p, iObj) );
1754 assert( !Gia_ObjProved(
p, iObj) );
1755 iRepr = Gia_ObjRepr(
p, iObj);
1757 assert( !Gia_ObjProved(
p, iRepr) );
1760 if ( Cec4_ObjSimEqual(
p, iObj, iRepr) )
1762 pMan->timeResimLoc += Abc_Clock() - clk;
1763 return Gia_ManObj(
p, iRepr);
1769 if ( Gia_ObjProved(
p, iMem) || Gia_ObjFailed(
p, iMem) )
1772 if ( Cec4_ObjSimEqual(
p, iObj, iMem) )
1775 pMan->timeResimLoc += Abc_Clock() - clk;
1776 return Gia_ManObj(
p, iMem);
1780 pMan->timeResimLoc += Abc_Clock() - clk;
1785 int i = 0, iObj, iPrev, Counter = 0;
1786 for ( iPrev = i, iObj = Gia_ObjNext(
p, i); -1 < iObj; iObj = Gia_ObjNext(
p, iPrev) )
1789 assert( pRepr == Gia_ManConst0(
p) );
1790 if( !Gia_ObjFailed(
p,iObj) && Abc_Lit2Var(Gia_ManObj(
p,iObj)->Value) == Abc_Lit2Var(pRepr->
Value) )
1796 Gia_ObjSetNext(
p, iPrev, Gia_ObjNext(
p, iObj) );
1797 Gia_ObjSetNext(
p, iObj, 0 );
1802 for ( iPrev = i, iObj = Gia_ObjNext(
p, i); -1 < iObj; iObj = Gia_ObjNext(
p, iPrev) )
1805 if( !Gia_ObjFailed(
p,iObj) && Abc_Lit2Var(Gia_ManObj(
p,iObj)->Value) == Abc_Lit2Var(pRepr->
Value) )
1811 Gia_ObjSetNext(
p, iPrev, Gia_ObjNext(
p, iObj) );
1812 Gia_ObjSetNext(
p, iObj, 0 );
1821 Gia_Obj_t * pObj;
int i, k,
nWords = pMan->pAig->nSimWords, nOuts[2] = {0};
1822 Vec_Wrd_t * vSims = NULL, * vSimsPi = NULL;
1823 FILE * pFile = fopen( pMan->pPars->pDumpName,
"wb" );
1824 if ( pFile == NULL ) {
1825 printf(
"Cannot open file \"%s\" for writing primary output information.\n", pMan->pPars->pDumpName );
1828 vSimsPi = Vec_WrdDup( pMan->pAig->vSimsPi );
1829 memmove( Vec_WrdArray(vSimsPi), Vec_WrdArray(vSimsPi) +
nWords, Gia_ManCiNum(pMan->pAig) *
nWords );
1830 Vec_WrdShrink( vSimsPi, Gia_ManCiNum(pMan->pAig) *
nWords );
1831 if ( Abc_TtIsConst0(Vec_WrdArray(vSimsPi), Gia_ManCiNum(pMan->pAig) *
nWords) ) {
1832 Vec_WrdFree( vSimsPi );
1833 vSimsPi = Vec_WrdStartRandom( Gia_ManCiNum(pMan->pAig) *
nWords );
1836 assert(
nWords * Gia_ManCiNum(pMan->pAig) == Vec_WrdSize(vSimsPi) );
1840 word * pSims = Vec_WrdEntryP( vSims,
nWords*i );
1842 fprintf( pFile,
"%d ", i );
1843 if ( Gia_ObjFaninLit0p(pMan->pNew, Gia_ManCo(pMan->pNew, i)) == 0 )
1845 else if ( Abc_TtIsConst0(pSims,
nWords) )
1846 fprintf( pFile,
"-" );
1848 int iPat = Abc_TtFindFirstBit2(pSims,
nWords);
1849 for ( k = 0; k < Gia_ManPiNum(pMan->pAig); k++ )
1850 fprintf( pFile,
"%d", Abc_TtGetBit(Vec_WrdEntryP(vSimsPi,
nWords*k), iPat) );
1853 fprintf( pFile,
"\n" );
1855 printf(
"Information about %d sat, %d unsat, and %d undecided primary outputs was written into file \"%s\".\n",
1856 nOuts[1], nOuts[0], Gia_ManCoNum(pMan->pAig)-nOuts[1]-nOuts[0], pMan->pPars->pDumpName );
1858 Vec_WrdFree( vSims );
1859 Vec_WrdFree( vSimsPi );
1866 int i, fSimulate = 1, Id;
1868 printf(
"Solver type = %d. Simulate %d words in %d rounds. SAT with %d confs. Recycle after %d SAT calls.\n",
1873 assert( Gia_ObjId(
p, pObj) == i+1 );
1891 if(
p->vSimsPi &&
p->nSimWords > 0){
1893 Vec_WrdFreeP( &
p->vSims );
1894 p->vSims = Vec_WrdStart( Gia_ManObjNum(
p) * pPars->
nWords);
1895 assert( Vec_WrdSize(
p->vSimsPi) == Gia_ManCiNum(
p) *
p->nSimWords );
1897 memmove( Vec_WrdEntryP(
p->vSims, Id*
p->nSimWords), Vec_WrdEntryP(
p->vSimsPi, i*
p->nSimWords),
sizeof(
word)*
p->nSimWords );
1917 for ( i = 0; i < pPars->
nRounds; i++ )
1931 for ( i = 0; fSimulate && i < pPars->
nGenIters; i++ )
1938 if ( i && i % 5 == 0 && pPars->
fVerbose )
1942 if ( i && i % 5 && pPars->
fVerbose )
1946 Vec_WrdFill(
p->vSimsPi, Vec_WrdSize(
p->vSimsPi), 0 );
1953 if ( Gia_ObjIsXor(pObj) )
1956 pObj->
Value =
Gia_ManHashAnd( pMan->pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
1959 pObjNew = Gia_ManObj( pMan->pNew, Abc_Lit2Var(pObj->
Value) );
1960 if ( Gia_ObjIsAnd(pObjNew) )
1961 if ( Vec_BitEntry(pMan->vFails, Gia_ObjFaninId0(pObjNew, Abc_Lit2Var(pObj->
Value))) ||
1962 Vec_BitEntry(pMan->vFails, Gia_ObjFaninId1(pObjNew, Abc_Lit2Var(pObj->
Value))) )
1963 Vec_BitWriteEntry( pMan->vFails, Abc_Lit2Var(pObjNew->
Value), 1 );
1967 pRepr = Gia_ObjReprObj(
p, i );
1968 if ( pRepr == NULL )
1973 if ( pRepr == NULL )
1976 int id_obj = Gia_ObjId(
p, pObj );
1977 int id_repr = Gia_ObjId(
p, pRepr );
1979 if ( Abc_Lit2Var(pObj->
Value) == Abc_Lit2Var(pRepr->
Value) )
1987 Gia_ObjSetProved(
p, i );
1988 if ( Gia_ObjId(
p, pRepr) == 0 )
1989 pMan->iLastConst = i;
2013 if (
p->iPatsPi > 0 )
2018 Vec_IntFill( pMan->vCexStamps, Gia_ManObjNum(
p), 0 );
2019 pMan->timeResimGlo += Abc_Clock() - clk2;
2026 pObj->
Value = Gia_ManAppendCo( pMan->pNew, Gia_ObjFanin0Copy(pObj) );
2031 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",
2032 pMan->nSatUnsat + pMan->nSatSat + pMan->nSatUndec,
2033 pMan->nSatUnsat, pMan->nConflicts[1][0], (
float)pMan->nConflicts[1][1]/Abc_MaxInt(1, pMan->nSatUnsat-pMan->nConflicts[1][0]), pMan->nConflicts[1][2],
2034 pMan->nSatSat, pMan->nConflicts[0][0], (
float)pMan->nConflicts[0][1]/Abc_MaxInt(1, pMan->nSatSat -pMan->nConflicts[0][0]), pMan->nConflicts[0][2],
2036 pMan->nSimulates, pMan->nRecycles, 100.0*pMan->nGates[1]/Abc_MaxInt(1, pMan->nGates[0]+pMan->nGates[1]) );
2037 if ( pMan->vPairs && Vec_IntSize(pMan->vPairs) )
2043 sprintf( pFileName,
"%s_sm.aig", pBase );
2047 printf(
"Dumped miter \"%s\" with %d pairs.\n", pFileName, pMan->vPairs ? Vec_IntSize(pMan->vPairs)/2 : -1 );
2054 if ( ppNew && *ppNew == NULL )
2057 return p->pCexSeq ? 0 : 1;
2075 Abc_PrintTime( 1,
"New choice computation time", Abc_Clock() - clk );
2126 Abc_PrintTime( 1,
"Equivalence detection time", Abc_Clock() - clk );
2135 Gia_ManConst0(
p)->Value = 0;
2138 if ( Gia_ObjIsAnd(pObj) )
2140 else if ( Gia_ObjIsCi(pObj) )
2141 pObj->
Value = Gia_ManAppendCi( pNew );
2142 else if ( Gia_ObjIsCo(pObj) )
2143 pObj->
Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
2149 int iLitNew = Gia_ManObj(pTemp, Abc_Lit2Var(pObj->
Value))->Value;
2150 if ( iLitNew == ~0 )
2151 pObj->
Value = iLitNew;
2153 pObj->
Value = Abc_LitNotCond(iLitNew, Abc_LitIsCompl(pObj->
Value));
2162 Vec_Int_t * vReprs = Vec_IntStartFull( Gia_ManObjNum(
p) );
2163 int * pAig2Abc =
ABC_FALLOC(
int, Gia_ManObjNum(pAig) );
2164 int i, nConsts = 0, nReprs = 0;
2168 int iLitGia = pObj->
Value, iReprGia;
2169 if ( iLitGia == -1 )
2171 iReprGia = Gia_ObjReprSelf( pAig, Abc_Lit2Var(iLitGia) );
2172 if ( pAig2Abc[iReprGia] == -1 )
2173 pAig2Abc[iReprGia] = i;
2176 int iLitGia2 = Gia_ManObj(
p, pAig2Abc[iReprGia] )->Value;
2177 assert( Gia_ObjReprSelf(pAig, Abc_Lit2Var(iLitGia)) == Gia_ObjReprSelf(pAig, Abc_Lit2Var(iLitGia2)) );
2178 assert( i > pAig2Abc[iReprGia] );
2179 Vec_IntWriteEntry( vReprs, i, pAig2Abc[iReprGia] );
2180 if ( pAig2Abc[iReprGia] == 0 )
2188 printf(
"Found %d const reprs and %d other reprs.\n", nConsts, nReprs );
2193 int i, iRepr,
nWords = 4;
word * pSim0, * pSim1;
2195 int nObjs = Vec_WrdShiftOne( vSimsCi,
nWords ), nFails = 0;
2197 assert( Vec_IntSize(vRes) == Gia_ManObjNum(
p) );
2198 assert( nObjs == Gia_ManCiNum(
p) );
2204 pSim0 = Vec_WrdEntryP( vSims,
nWords*i );
2205 pSim1 = Vec_WrdEntryP( vSims,
nWords*iRepr );
2206 if ( (pSim0[0] ^ pSim1[0]) & 1 )
2207 nFails += !Abc_TtOpposite(pSim0, pSim1,
nWords);
2209 nFails += !Abc_TtEqual(pSim0, pSim1,
nWords);
2211 Vec_WrdFree( vSimsCi );
2212 Vec_WrdFree( vSims );
2214 printf(
"Verification failed at %d nodes.\n", nFails );
2215 else if ( fVerbose )
2216 printf(
"Verification succeeded for all (%d) nodes.\n", Gia_ManCandNum(
p) );
2223 if ( (iRepr = Vec_IntEntry(vRes, i)) >= 0 )
2224 Vec_IntWriteEntry( vRes, i, Abc_Var2Lit(iRepr, Gia_ManObj(
p, iRepr)->fPhase ^ pObj->
fPhase) );
2234 Vec_IntDumpBin(
"_temp_.equiv", vRes, fVerbose );
2235 Vec_IntFree( vRes );
2253 assert( Gia_ObjIsLut(pMan, ObjId));
2257 for(k = 0; k < 2; k++ ){
2258 nCubes[k] = *pSopInfo;
2265 pSopInfo += nCubes[k] * 2;
2284 Vec_Str_t * vSop = Vec_StrAlloc( nCubes * 2 );
2285 char pEncodeCube = 0;
2288 while( *pSop !=
'\0'){
2291 if ( *pSop ==
'-' ){
2293 pDCs |= ( 1 << fanin );
2294 }
else if ( *pSop ==
'1' ){
2296 pEncodeCube |= ( 1 << fanin );
2299 if(fanin == nFanins){
2300 Vec_StrPush( vSop, pEncodeCube );
2301 Vec_StrPush( vSop, pDCs );
2325char *
extractSOP( DdManager * dd, DdNode * bFunc,
int nFanins,
int polarity,
int * _nCubes){
2327 extern int Abc_CountZddCubes( DdManager * dd, DdNode * zCover );
2328 extern int Abc_ConvertZddToSop( DdManager * dd, DdNode * zCover,
char * pSop,
int nFanins,
Vec_Str_t * vCube,
int fPhase );
2330 Vec_Str_t * vCube = Vec_StrAlloc( 100 );
2331 int nCubes;
char * pSop;
2332 DdNode * bCover, * zCover;
2334 bCover = Cudd_zddIsop( dd, Cudd_Not(bFunc), Cudd_Not(bFunc), &zCover );
2336 bCover = Cudd_zddIsop( dd, bFunc, bFunc, &zCover );
2340 Cudd_RecursiveDeref( dd, bCover );
2341 nCubes = Abc_CountZddCubes( dd, zCover );
2342 pSop =
ABC_ALLOC(
char, (nFanins + 3) * nCubes + 1 );
2343 pSop[(nFanins + 3) * nCubes] = 0;
2345 Vec_StrFill( vCube, nFanins,
'-' );
2346 Vec_StrPush( vCube,
'\0' );
2347 Abc_ConvertZddToSop( dd, zCover, pSop, nFanins, vCube, polarity );
2348 Cudd_RecursiveDerefZdd( dd, zCover );
2352 printf(
"SOP generation failed.\n");
2355 printf(
"Node has %d fanins but its SOP has support size %d.\n", nFanins,
Abc_SopGetVarNum( pSop ));
2358 Vec_StrFree( vCube );
2362 Vec_StrFree( vCube );
2382 DdManager * dd = (DdManager *)pNtkNew->
pManFunc;
2388 Vec_Int_t * vGuide = Vec_IntAlloc( Abc_NtkObjNumMax(pNtkNew) );
2389 Vec_IntFill( vGuide, Abc_NtkObjNumMax(pNtkNew), -1 );
2391 Vec_Ptr_t * vFuncs = Vec_PtrStart( Abc_NtkObjNumMax(pNtkNew) );
2392 assert( !Cudd_ReorderingStatus(dd, (Cudd_ReorderingType *)&nCubes) );
2394 if ( !Abc_ObjIsBarBuf(pObjNew) )
2395 Vec_PtrWriteEntry( vFuncs, i, pObjNew->
pData );
2398 Vec_PtrFree( vFuncs );
2399 assert( Abc_NtkHasBdd(pNtkNew) );
2401 Cudd_zddVarsFromBddVars( dd, 2 );
2407 if ( Abc_ObjIsBarBuf(pObjNew) )
2410 bFunc = (DdNode *)pObjNew->
pData;
2411 int nFanins = Abc_ObjFaninNum(pObjNew);
2414 if ( Cudd_IsConstant(bFunc) ){
2417 pSop[1] =
'0' + (int)(bFunc == Cudd_ReadOne(dd));
2425 Vec_IntInsert(
p->vTTLut, pObjNew->
iTemp ,
p->vTTISOPs->nSize );
2428 pSop =
extractSOP( dd, bFunc, nFanins, 0 , &nCubes);
2432 encodedSop =
encodeSOP( pSop, nFanins, nCubes );
2433 Vec_StrPush(
p->vTTISOPs, (
char) nCubes );
2435 for (jjj = 0; jjj < nCubes; jjj++){
2436 Vec_StrPush(
p->vTTISOPs, encodedSop->
pArray[jjj*2] ); Vec_StrPush(
p->vTTISOPs, encodedSop->
pArray[jjj*2+1] );
2439 Vec_StrFree( encodedSop );
2443 pSop =
extractSOP( dd, bFunc, nFanins, 1 , &nCubes);
2447 encodedSop =
encodeSOP( pSop, nFanins, nCubes );
2448 Vec_StrPush(
p->vTTISOPs, (
char) nCubes );
2450 for (jjj = 0; jjj < nCubes; jjj++){
2451 Vec_StrPush(
p->vTTISOPs, encodedSop->
pArray[jjj*2] ); Vec_StrPush(
p->vTTISOPs, encodedSop->
pArray[jjj*2+1] );
2454 Vec_StrFree( encodedSop );
2462 Vec_IntFree( vGuide );
2486 p->vTTISOPs = Vec_StrAlloc( nCountLuts * 10);
2487 p->vTTLut = Vec_IntAlloc( Gia_ManObjNum(
p) );
2488 Vec_IntFill(
p->vTTLut, Gia_ManObjNum(
p), -1 );
2492 Abc_Obj_t * pObjNew, * pObjNewLi, * pObjNewLo, * pConst0 = NULL;
2494 Vec_Ptr_t * vReflect = Vec_PtrStart( Gia_ManObjNum(
p) );
2496 assert( Gia_ManHasMapping(
p) );
2504 Gia_ManConst0(
p)->Value = Abc_ObjId(pConst0);
2507 pObj->
Value = Abc_ObjId( Abc_NtkCreatePi( pNtkNew ) );
2510 pObj->
Value = Abc_ObjId( Abc_NtkCreatePo( pNtkNew ) );
2514 pObjNew = Abc_NtkCreateLatch( pNtkNew );
2515 pObjNewLi = Abc_NtkCreateBi( pNtkNew );
2516 pObjNewLo = Abc_NtkCreateBo( pNtkNew );
2519 pObjLi->
Value = Abc_ObjId( pObjNewLi );
2520 pObjLo->
Value = Abc_ObjId( pObjNewLo );
2521 Abc_LatchSetInit0( pObjNew );
2525 pObj = Gia_ManObj(
p, i);
2527 if ( Gia_ObjLutSize(
p, i) == 0 )
2529 pObj->
Value = Abc_ObjId(pConst0);
2532 pObjNew = Abc_NtkCreateNode( pNtkNew );
2534 Abc_ObjAddFanin( pObjNew, Abc_NtkObj(pNtkNew, Gia_ObjValue(Gia_ManObj(
p, iFan))) );
2537 pObj->
Value = Abc_ObjId( pObjNew );
2541 Vec_PtrFree( vReflect );
2567 int quality = 0, jMFFCLeaf;
2568 int nLeaves = Vec_IntSize(vLeaves);
2569 for(jMFFCLeaf = 0; jMFFCLeaf < nLeaves ; jMFFCLeaf++){
2570 int idMFFCLeaf = Vec_IntEntry(vLeaves, jMFFCLeaf);
2571 int level_leaf = Gia_ObjLevelId(
p, idMFFCLeaf) ;
2572 int level_root = Gia_ObjLevelId(
p, fanId) ;
2573 quality += level_root - level_leaf;
2575 if( quality != 0 && nLeaves > 0)
2596 int i, ith_fan, iFan;
2597 Vec_Int_t * vNodes, * vLeaves, * vInners;
2598 vNodes = Vec_IntAlloc( 100 );
2599 vLeaves = Vec_IntAlloc( 10 );
2600 vInners = Vec_IntAlloc( 100 );
2601 Vec_Int_t * vNodesNew, * vLeavesNew, * vInnersNew;
2602 vNodesNew = Vec_IntAlloc( 100 );
2603 vLeavesNew = Vec_IntAlloc( 10 );
2604 vInnersNew = Vec_IntAlloc( 100 );
2605 p->vMFFCsLuts = Vec_IntStartFull( Gia_ManObjNum(
p) );
2613 if ( !Gia_ObjRefNum(
p, pObj) )
2618 Vec_IntInsert(
p->vMFFCsLuts, i , Vec_IntSize(
p->vMFFCsInfo) );
2620 if (Vec_IntFind(vNodes, iFan) != -1){
2621 if(Gia_ObjIsCi(Gia_ManObj(
p, iFan)) == 1){
2622 Vec_IntPush(
p->vMFFCsInfo, Gia_ObjLevelId(
p, i) );
2625 Gia_Obj_t * pObjFanin = Gia_ManObj(
p, iFan );
2626 if ( !Gia_ObjRefNum(
p, pObjFanin) ){
2627 Vec_IntPush(
p->vMFFCsInfo, 0);
2630 if ( !
Gia_ObjCheckMffc(
p, pObjFanin, 10000, vNodesNew, vLeavesNew, vInnersNew)){
2631 Vec_IntPush(
p->vMFFCsInfo, 0);
2634 assert( Vec_IntSize(vLeavesNew) > 0);
2636 Vec_IntPush(
p->vMFFCsInfo, quality);
2639 Vec_IntPush(
p->vMFFCsInfo, 0 );
2644 Vec_IntFree( vNodes );
2645 Vec_IntFree( vLeaves );
2646 Vec_IntFree( vInners );
2647 Vec_IntFree( vNodesNew );
2648 Vec_IntFree( vLeavesNew );
2649 Vec_IntFree( vInnersNew );
2668 if( Vec_IntEntry(
p->vMFFCsLuts, ObjId ) == -1)
2670 assert( Vec_IntEntry(
p->vMFFCsLuts, ObjId ) != -1);
2671 int * pMFFC =
p->vMFFCsInfo->pArray + Vec_IntEntry(
p->vMFFCsLuts, ObjId );
2672 int iFan, ith_fan, quality = 0;
2675 int qualityMFFC = *pMFFC;
2676 if (qualityMFFC == 0 || (pDCs & (1 << ith_fan)) > 0){
2680 quality += qualityMFFC;
2702 int * positions = (
int *)
malloc( n *
sizeof(
int) );
2703 for(i = 0; i < n; i++)
2705 for(i = 0; i < n; i++){
2706 for(j = i+1; j < n; j++){
2707 if(array[i] < array[j]){
2709 array[i] = array[j];
2711 temp = positions[i];
2712 positions[i] = positions[j];
2713 positions[j] = temp;
2723 p->vLutsRankings = Vec_PtrStart( Gia_ManObjNum(
p) );
2725 int LutId, iii, k, jjj;
2726 char * pSop[2];
int nCubes[2];
int nFanins;
2727 int * ranks, * fanins;
2730 nFanins = Gia_ObjLutSize(
p, LutId);
2731 Vec_PtrInsert(
p->vLutsRankings, LutId, vLutsRankingsTmp->pArray + Vec_IntSize(vLutsRankingsTmp) );
2733 ranks = (
int*)
malloc( nFanins *
sizeof(
int) );
2734 fanins = (
int*)
malloc( nFanins *
sizeof(
int) );
2740 nFanins = Gia_ObjLutSize(
p, LutId);
2742 for(k = 0; k < 2; k++){
2743 for(iii = 0; iii < nCubes[k]; iii++){
2745 char pDCs = pSop[k][iii*2+1];
2746 for(jjj = 0; jjj < nFanins; jjj++){
2747 if ( (pDCs & (1 << jjj)) == 0 )
2752 int * positions =
sortArray( ranks, nFanins );
2753 for(jjj = 0; jjj < nFanins; jjj++){
2754 Vec_IntPush( vLutsRankingsTmp, fanins[positions[jjj]] );
2777 Vec_Ptr_t * vWatchList = Vec_PtrStart( Gia_ManObjNum(
p) );
2781 int * ranking = (
int *) Vec_PtrEntry(
p->vLutsRankings, LutId );
2782 int nodeId = ranking[0];
2783 if( Vec_PtrEntry( vWatchList, nodeId ) == NULL ){
2784 Vec_Int_t * vWatchListTmp = Vec_IntAlloc( 5 );
2785 Vec_PtrWriteEntry( vWatchList, nodeId, vWatchListTmp );
2786 Vec_IntPush( vWatchListTmp, LutId );
2789 Vec_IntPush( (
Vec_Int_t *) Vec_PtrEntry( vWatchList, nodeId ), LutId );
2809 int iObj, iFanin, k;
2810 assert( Gia_ManHasMapping(
p) );
2811 Vec_WecFreeP( &
p->vFanouts2 );
2812 p->vFanouts2 = Vec_WecStart( Gia_ManObjNum(
p) );
2817 Vec_WecPush(
p->vFanouts2, iFanin, iObj );
2836 int i, iRepr, kElement, firstLutId, prevLutId;
2837 Vec_Int_t * vLutIds = Vec_IntAlloc( Gia_ManObjNum(
p) );
2841 Vec_IntPush( vLutIds, kElement );
2844 firstLutId = -1; prevLutId = -1;
2845 if( !Gia_ObjIsLut(
p, iRepr) ){
2847 Gia_ObjSetNext(
p, iRepr, 0 );
2854 if( !Gia_ObjIsLut(
p, kElement) ){
2855 Gia_ObjSetRepr(
p, kElement,
GIA_VOID );
2856 Gia_ObjSetNext(
p, kElement, 0 );
2859 if(firstLutId == -1){
2860 Gia_ObjSetRepr(
p, kElement,
GIA_VOID );
2861 firstLutId = kElement;
2862 prevLutId = kElement;
2864 Gia_ObjSetRepr(
p, kElement, firstLutId );
2865 Gia_ObjSetNext(
p, prevLutId , kElement );
2866 prevLutId = kElement;
2869 Vec_IntClear( vLutIds );
2871 if(firstLutId == -1){
2874 Gia_ObjSetNext(
p, prevLutId, 0 );
2877 Vec_IntFree( vLutIds );
2904 printf(
"**Quality = %d\n", quality);
2946 int nWords = bitLength / 64;
2950 word pValuePiJWord = 0;
2952 Vec_WrdPush( pValuesPi, 0 );
2954 pValuePiJWord = Vec_WrdEntry( pValuesPi, jth_word );
2956 word * pSim = Cec4_ObjSim(
p, Id );
2957 pValuePiJWord = (pSim[0] << kth_bit) ^ pValuePiJWord;
2958 Vec_WrdWriteEntry( pValuesPi, jth_word, pValuePiJWord );
2978 int numClass = 100000;
2979 int oldNumClass = 0, iMaxNumber = 200, iNumber = 0;
2981 while (numClass != oldNumClass && iNumber < iMaxNumber)
2983 oldNumClass = numClass;
2988 printf(
"Time elapsed: %f (classes size: %d)\n", (
float)(clock() -
start_time)/CLOCKS_PER_SEC, quality);
2993 word * pSim = Cec4_ObjSim(
p, Id );
2994 for( k = 0; k <
p->nSimWords; k++ ){
2995 Vec_WrdPush( vSimPI, pSim[k] );
3002 for(i = 0; i < nMaxIter; i++){
3008 printf(
"Time elapsed: %f (classes size: %d)\n", (
float)(clock() -
start_time)/CLOCKS_PER_SEC, quality);
3011 word * pSim = Cec4_ObjSim(
p, Id );
3012 for( k = 0; k <
p->nSimWords; k++ ){
3013 Vec_WrdPush( vSimPI, pSim[k] );
3040 fprintf( pFile,
"Class %d: %d ", iii , i);
3042 fprintf( pFile,
" %d ", j );
3044 fprintf(pFile,
"\n");
3068 char * pOutGold = (
char *)
malloc(
sizeof(
char) * Gia_ManObjNum(
p) );
3072 pOutGold[i] = (char) 0;
3075 pOutGold[i] = (char) cnt;
3078 pOutGold[k] = (char) cnt;
3124 Vec_IntPush(vClass, iRepr);
3126 Vec_IntPush(vClass, jLut);
3131 assert(Vec_IntSize(vClass) > 0);
3152 int iRepr, jLut, iii, jjj, kkk;
3154 luts_tmp[ 0 ] = iRepr;
3157 if(reorder_type == 0){
3159 for(jjj = 0; jjj < iii; jjj++){
3160 if(Gia_ObjLevelId(
p, jLut) <= Gia_ObjLevelId(
p, luts_tmp[jjj])){
3161 for (kkk = iii; kkk > jjj; kkk--) {
3162 luts_tmp[kkk] = luts_tmp[kkk - 1];
3164 luts_tmp[jjj] = jLut;
3170 luts_tmp[iii] = jLut;
3173 }
else if(reorder_type == 1) {
3175 for(jjj = 0; jjj < iii; jjj++){
3176 if(Gia_ObjLevelId(
p, jLut) >= Gia_ObjLevelId(
p, luts_tmp[jjj])){
3177 for (kkk = iii; kkk > jjj; kkk--) {
3178 luts_tmp[kkk] = luts_tmp[kkk - 1];
3180 luts_tmp[jjj] = jLut;
3186 luts_tmp[iii] = jLut;
3191 for(kkk = 0; kkk < iii; kkk++)
3192 Vec_IntPush(luts_order, luts_tmp[kkk] );
3214 int FaninId, jth_fanin;
3216 if( Vec_IntEntry( vLutsFaninCones, FaninId ) == 0 ){
3217 Vec_IntWriteEntry( vLutsFaninCones, FaninId, 1 );
3218 if( Gia_ObjIsCi( Gia_ManObj(
p, FaninId) ) == 0 )
3227 Vec_Int_t * vLutsFaninCones = Vec_IntStart(Gia_ManObjNum(
p));
3231 return vLutsFaninCones;
3250 char pCubeOnes = *pCube;
char pDCs = *(pCube+1);
3251 char pCubeGoldOnes = *pCubeGold;
char pCubeNotAssigned = *(pCubeGold+1);
3253 char pSkipBits = pDCs | pCubeNotAssigned;
3254 char pConflictBits = pCubeOnes ^ pCubeGoldOnes;
3255 char isConflict = ~pSkipBits & pConflictBits;
3281 char pDCs = *(pSop);
3282 switch (experimentID){
3290 quality +=
p->nLevels * 5;
3297 quality +=
p->nLevels * 5;
3324 int i, max_int = 0xffffffff;
3327 for ( i = 0; i < numValid; i++ )
3328 totalSum += (
float) Vec_IntEntry(vQualitySops, i);
3331 float randValueNormalized = (float) ((
float)randValue / max_int);
3332 float randomNum = randValueNormalized * totalSum;
3335 float cumulativeProbability = 0.0;
3336 for ( i = 0; i < numValid; i++ ) {
3337 cumulativeProbability += Vec_IntEntry(vQualitySops, i);
3338 if (cumulativeProbability > randomNum) {
3359 assert(experimentID > 0);
3360 int numValid = Vec_IntSize(vQualitySops);
3361 int idSelected = -1;
3362 switch (experimentID){
3370 if(idSelected == -1){
3371 idSelected = ith_max_quality;
3373 assert( idSelected != -1);
3389int check_implication(
Gia_Man_t *
p,
int ObjId ,
int validBit ,
int fanoutValue,
int fanoutNotSet,
char * inputsFaninsValues,
char * networkValues1s,
char * networkValuesNotSet ,
int experimentID){
3391 assert(experimentID > 1);
3393 int nFanins = Gia_ObjLutSize(
p, ObjId);
3394 char * pSopBoth[2];
int nCubesBoth[2];
3397 if (fanoutNotSet == 0){
3399 char * pSop = pSopBoth[fanoutValue];
3400 int nCubes = nCubesBoth[fanoutValue];
3403 for(ith_cube = 0; ith_cube < nCubes; ith_cube++){
3406 lastCube = ith_cube;
3411 if(compatible == 1){
3416 }
else if (compatible == 0){
3426 for(jjj = 0; jjj < 2; jjj++){
3428 char * pSop = pSopBoth[jjj];
3429 int nCubes = nCubesBoth[jjj];
3430 for(ith_cube = 0; ith_cube < nCubes; ith_cube++){
3433 if(compatible[jjj] > 1)
3439 if(compatible[0] > 0 && compatible[1] > 0){
3441 }
else if (compatible[0] == 0 && compatible[1] == 0){
3445 if(experimentID == 2){
3447 if(compatible[0] > 1 || compatible[1] > 1){
3450 char mask = 1 << validBit;
3451 if(compatible[0] == 1){
3452 networkValuesNotSet[ObjId] &= (~mask);
3454 networkValues1s[ObjId] |= (1 << validBit);
3455 networkValuesNotSet[ObjId] &= (~mask);
3458 }
else if (experimentID > 2){
3460 char mask = 1 << validBit;
3461 if(compatible[0] >= 1){
3462 networkValuesNotSet[ObjId] &= (~mask);
3464 networkValues1s[ObjId] |= (1 << validBit);
3465 networkValuesNotSet[ObjId] &= (~mask);
3492 char _valid_vecs = *netValid;
3493 char inputsFaninsValues[2] = {0, 0};
3494 int firstElement = 0;
3495 int iii = -1, FaninId, jjj;
3497 while (_valid_vecs > 0){
3499 if( (_valid_vecs & 1) == 0){
3500 _valid_vecs = _valid_vecs >> 1;
3504 char mask = 1 << iii;
3505 int fanoutValue = (networkValues1s[objId] & mask) >> iii;
3506 int fanoutNotSet = (networkValuesNotSet[objId] & mask) >> iii;
3508 if(fanoutNotSet == 0){
3510 _valid_vecs = _valid_vecs >> 1;
3515 char valueFanin = networkValues1s[FaninId];
3516 char valueFaninNotSet = networkValuesNotSet[FaninId];
3517 inputsFaninsValues[0] |= ( ((valueFanin & mask) >> iii) << jjj);
3518 inputsFaninsValues[1] |= ( ((valueFaninNotSet & mask) >> iii) << jjj);
3522 if(fanoutNotSet == 0 && inputsFaninsValues[1] == 0){
3523 _valid_vecs = _valid_vecs >> 1;
3527 int status =
check_implication(
p, objId, iii, fanoutValue, fanoutNotSet, inputsFaninsValues, networkValues1s, networkValuesNotSet , experimentID);
3529 *netValid = *netValid & ~(1 << iii);
3530 }
else if( status == 1){
3531 if(firstElement == 0){
3533 Vec_IntPush( vLutsValidity, 1 << iii );
3534 Vec_IntPush( vLuts2Imply, objId );
3536 Vec_IntWriteEntry( vLutsValidity, Vec_IntSize(vLutsValidity) - 1, Vec_IntEntry(vLutsValidity, Vec_IntSize(vLutsValidity) - 1) | (1 << iii) );
3540 _valid_vecs = _valid_vecs >> 1;
3543 if( *netValid == 0){
3562int computeLutsToImply(
Gia_Man_t *
p,
Cec_ParSimGen_t * pPars,
char * netValid,
int ObjId,
char * networkValues1s,
char * networkValuesNotSet ,
Vec_Int_t * vLutsFaninCones,
Vec_Int_t * vLuts2Imply,
Vec_Int_t * vLutsValidity ,
Vec_Ptr_t * vNodesWatchlist,
int experimentID){
3564 int i, FanoutId, jth_fanout, LutId, k;
3566 if(vNodesWatchlist == NULL){
3569 if( Vec_IntEntry(vLutsFaninCones, FanoutId) == 0){
3573 int status =
checkCompatibilityImplication(
p, pPars, netValid, FanoutId, networkValues1s, networkValuesNotSet, vLuts2Imply, vLutsValidity, experimentID);
3581 if(vWatchlist == NULL){
3585 if( Vec_IntEntry(vLutsFaninCones, FanoutId) == 0){
3589 int status =
checkCompatibilityImplication(
p, pPars, netValid, FanoutId, networkValues1s, networkValuesNotSet, vLuts2Imply, vLutsValidity, experimentID);
3596 int * ranking = (
int *) Vec_PtrEntry(
p->vLutsRankings, LutId );
3597 int FaninSize = Gia_ObjLutSize(
p, LutId ), newWatchK = -1;
3598 for(k = 0; k < FaninSize ; k++){
3599 if(ranking[k] == ObjId){
3605 if(newWatchK >= FaninSize){
3608 int newWatch = ranking[newWatchK];
3610 if(vNewWatch == NULL){
3611 vNewWatch = Vec_IntAlloc( 10 );
3612 Vec_PtrWriteEntry( vNodesWatchlist, newWatch, vNewWatch );
3613 Vec_IntPush( vNewWatch, LutId );
3615 if(Vec_IntFind(vNewWatch, LutId) == -1){
3616 Vec_IntPush( vNewWatch, LutId );
3642 int iii = -1, FanoutId;
3643 Vec_Int_t * vLuts2Imply = Vec_IntAlloc( 10 );
3644 Vec_Int_t * vLutsValidity = Vec_IntAlloc( 10 );
3647 int status =
computeLutsToImply(
p, pPars, netValid, ObjId, networkValues1s, networkValuesNotSet, vLutsFaninCones, vLuts2Imply, vLutsValidity, vNodesWatchlist , experimentID);
3649 Vec_IntFree( vLuts2Imply );
3650 Vec_IntFree( vLutsValidity );
3657 char validFanoutId = Vec_IntEntry(vLutsValidity, iii);
3658 status =
executeImplications(
p, pPars, &validFanoutId, FanoutId, networkValues1s, networkValuesNotSet, vLutsFaninCones, vNodesWatchlist ,experimentID);
3660 Vec_IntFree( vLuts2Imply );
3661 Vec_IntFree( vLutsValidity );
3667 Vec_IntFree( vLuts2Imply );
3668 Vec_IntFree( vLutsValidity );
3684int computeNetworkValues(
Gia_Man_t *
p,
Cec_ParSimGen_t * pPars,
int ObjId ,
char * netValid,
char lutValues1s,
char * networkValues1s,
char * networkValuesNotSet ,
Vec_Int_t * modifiedLuts ,
Vec_Int_t * vLutsFaninCones ,
Vec_Ptr_t * vNodesWatchlist ,
int experimentID ){
3686 assert(experimentID > 0);
3689 if( Gia_ObjIsCi( Gia_ManObj(
p, ObjId) ) ){
3690 printf(
"[ERROR] It is not possible to call computeNetworkValues for PIs");
3693 char * pSopBoth[2];
int nCubesBoth[2];
3694 char * pSop;
int nCube, ith_cube, jth_fanin, FaninId;
3697 Vec_Int_t * vQualitySops = Vec_IntAlloc( 8 );
3698 Vec_Int_t * vCubeId = Vec_IntAlloc( 8 );
3699 char _valid_vecs = *netValid;
3700 char _desired_values = lutValues1s;
3701 int iii = -1, max_quality, ith_max_quality, validNum =0;
3702 int nFanins = Gia_ObjLutSize(
p, ObjId);
3704 while (_valid_vecs > 0){
3706 if( (_valid_vecs & 1) == 0){
3707 _valid_vecs = _valid_vecs >> 1;
3708 _desired_values = _desired_values >> 1;
3712 if( (_desired_values & 1) == 0){
3715 nCube = nCubesBoth[0];
3719 nCube = nCubesBoth[1];
3721 Vec_IntClear(vQualitySops);
3722 Vec_IntClear(vCubeId);
3723 char valuesFaninsMasked[2] = {0, 0};
3725 char valuesFanin = networkValues1s[FaninId];
3726 char valueFaninNotSet = networkValuesNotSet[FaninId];
3727 char mask = 1 << iii;
3728 valuesFaninsMasked[0] |= ( ((valuesFanin & mask) >> iii) << jth_fanin);
3729 valuesFaninsMasked[1] |= ( ((valueFaninNotSet & mask) >> iii) << jth_fanin);
3732 ith_max_quality = -1;
3733 for(ith_cube = 0; ith_cube < nCube; ith_cube++){
3737 if(quality > max_quality){
3738 max_quality = quality;
3739 ith_max_quality = ith_cube;
3741 Vec_IntPush(vQualitySops, quality);
3742 Vec_IntPush(vCubeId, ith_cube);
3745 if(ith_max_quality == -1){
3748 *netValid = *netValid & ~(1 << iii);
3750 int _idCube =
selectSop(vQualitySops, ith_max_quality, experimentID);
3751 int idSop = Vec_IntEntry(vCubeId, _idCube);
3752 Vec_PtrPush( vSops, pSop + idSop * 2 );
3754 _valid_vecs = _valid_vecs >> 1;
3755 _desired_values = _desired_values >> 1;
3757 Vec_IntFree( vQualitySops );
3758 Vec_IntFree( vCubeId );
3759 assert( validNum == Vec_PtrSize(vSops) );
3760 _valid_vecs = *netValid;
3762 if( _valid_vecs == 0){
3765 Vec_PtrFree( vSops );
3768 Vec_IntPush( modifiedLuts, ObjId );
3774 _valid_vecs = *netValid;
3775 char valuesFanin1s = 0;
3776 char valuesFaninDCs = 0;
3777 while (_valid_vecs > 0){
3779 if( (_valid_vecs & 1) == 0){
3780 _valid_vecs = _valid_vecs >> 1;
3784 char mask_fanin = 1 << jth_fanin;
3786 pSop = (
char *) Vec_PtrEntry(vSops, validNum);
3787 char pSop1s = *pSop;
3789 char pSopDCs = *pSop;
3790 valuesFanin1s |= ( (pSop1s & mask_fanin) >> jth_fanin) << iii;
3791 valuesFaninDCs |= ( (pSopDCs & mask_fanin) >> jth_fanin) << iii;
3792 _valid_vecs = _valid_vecs >> 1;
3796 char prevNetValue = networkValues1s[FaninId];
3797 char prevNetValueNotSet = networkValuesNotSet[FaninId];
3798 char values2propagate = ~valuesFaninDCs & *netValid & prevNetValueNotSet;
3799 networkValues1s[FaninId] |= valuesFanin1s & values2propagate;
3800 networkValuesNotSet[FaninId] &= valuesFaninDCs & *netValid;
3802 if(values2propagate == 0){
3807 char tmp_values2propagate = values2propagate;
3809 char difference_valid;
3810 if(experimentID > 1){
3812 status =
executeImplications(
p, pPars, &values2propagate, FaninId, networkValues1s, networkValuesNotSet , vLutsFaninCones, vNodesWatchlist , experimentID);
3815 networkValues1s[FaninId] = prevNetValue;
3816 networkValuesNotSet[FaninId] = prevNetValueNotSet;
3817 Vec_PtrFree( vSops );
3820 assert( tmp_values2propagate >= values2propagate );
3822 difference_valid = tmp_values2propagate ^ values2propagate;
3823 if( difference_valid ){
3825 networkValuesNotSet[FaninId] &= ~difference_valid;
3826 *netValid &= ~difference_valid;
3828 values2propagate = ~valuesFaninDCs & *netValid & prevNetValueNotSet;
3829 networkValues1s[FaninId] |= valuesFanin1s & values2propagate;
3830 networkValuesNotSet[FaninId] &= valuesFaninDCs & *netValid;
3831 tmp_values2propagate = values2propagate;
3833 values2propagate = tmp_values2propagate;
3834 if(values2propagate == 0){
3839 if( !Gia_ObjIsCi( Gia_ManObj(
p, FaninId) ) ){
3842 status =
computeNetworkValues(
p, pPars, FaninId, &values2propagate, valuesFanin1s, networkValues1s, networkValuesNotSet, modifiedLuts, vLutsFaninCones, vNodesWatchlist , experimentID);
3844 networkValues1s[FaninId] = prevNetValue;
3845 networkValuesNotSet[FaninId] = prevNetValueNotSet;
3846 Vec_PtrFree( vSops );
3849 assert( tmp_values2propagate >= values2propagate );
3850 difference_valid = tmp_values2propagate ^ values2propagate;
3851 if( difference_valid ){
3853 networkValuesNotSet[FaninId] &= ~difference_valid;
3854 *netValid &= ~difference_valid;
3859 Vec_PtrFree( vSops );
3881 word * pSim = Cec4_ObjSim(
p, Id );
3882 for ( w = 0; w <
p->nSimWords; w++ )
3883 pSim[w] = (
word)pValues[ Id ];
3907 word * pSim = Cec4_ObjSim(
p, i );
3908 fprintf( pFile,
"Obj %d ", i );
3909 for(j = 0; j <
p->nSimWords; j++){
3910 fprintf( pFile,
"[%d]: %lu ", j, pSim[j] );
3912 fprintf(pFile,
"\n");
3931 char * networkValues1s, * networkValuesNotSet;
3932 char networkValid = (char) (1 << outGold_bitwidth) - 1;
3933 int jLut, mainLoop_condition, iii, numLuts;
3935 numLuts = Vec_IntSize(vLuts);
3938 networkValues1s = (
char *)
malloc( Gia_ManObjNum(
p));
3939 memset(networkValues1s, 0,
sizeof(
char) * Gia_ManObjNum(
p));
3940 networkValuesNotSet = (
char *)
malloc( Gia_ManObjNum(
p));
3941 memset(networkValuesNotSet, 0xFF,
sizeof(
char) * Gia_ManObjNum(
p));
3942 mainLoop_condition = numLuts > 0;
3944 int success = 0, lastjGold = -1;
3945 while ( mainLoop_condition ){
3946 jLut = Vec_IntEntry(vLuts, iii);
3947 char jLutGold = outGold[jLut];
3952 char lutValueNotSet = networkValuesNotSet[jLut];
3953 char lutValues1s = networkValues1s[jLut];
3954 if( lutValueNotSet & networkValid){
3956 char netValid = networkValid & lutValueNotSet;
3957 char * networkValues1sCopy = (
char *)
malloc( Gia_ManObjNum(
p));
3958 memcpy(networkValues1sCopy, networkValues1s,
sizeof(
char) * Gia_ManObjNum(
p));
3959 char * networkValuesNotSetCopy = (
char *)
malloc( Gia_ManObjNum(
p));
3960 memcpy(networkValuesNotSetCopy, networkValuesNotSet,
sizeof(
char) * Gia_ManObjNum(
p));
3963 Vec_IntPush(modifiedLuts, jLut);
3964 networkValues1sCopy[jLut] |= jLutGold & netValid;
3965 networkValuesNotSetCopy[jLut] &= ~netValid;
3967 int status =
computeNetworkValues(
p, pPars, jLut , &netValid, jLutGold, networkValues1sCopy, networkValuesNotSetCopy, modifiedLuts, vLutsFaninCones, vNodesWatchlist , experimentID);
3969 Vec_IntFree(modifiedLuts);
3970 free(networkValues1sCopy);
3971 free(networkValuesNotSetCopy);
3975 char orig_netValid = networkValid & lutValueNotSet;
3976 char difference_valid = orig_netValid ^ netValid;
3977 if( difference_valid == orig_netValid){
3979 printf(
"FAILED 0 out of %d - node %d (gold = %d valid = %d)\n", outGold_bitwidth, jLut, jLutGold, netValid);
3980 }
else if( difference_valid != 0){
3983 networkValues1sCopy[jLut] = networkValues1s[iLut];
3984 networkValuesNotSetCopy[jLut] = networkValuesNotSet[iLut];
3986 memcpy(networkValues1s, networkValues1sCopy,
sizeof(
char) * Gia_ManObjNum(
p));
3987 memcpy(networkValuesNotSet, networkValuesNotSetCopy,
sizeof(
char) * Gia_ManObjNum(
p));
3990 while (difference_valid != 0) {
3991 if (difference_valid & 1) {
3994 difference_valid >>= 1;
3996 if( outGold_bitwidth - different >= 2){
3997 if(lastjGold != jLutGold){
3999 lastjGold = jLutGold;
4003 printf(
"SUCCESSFUL %d out of %d - node %d (gold = %d valid = %d)\n", outGold_bitwidth - different, outGold_bitwidth, jLut, jLutGold, netValid);
4005 if(lastjGold != jLutGold){
4007 lastjGold = jLutGold;
4009 memcpy(networkValues1s, networkValues1sCopy,
sizeof(
char) * Gia_ManObjNum(
p));
4010 memcpy(networkValuesNotSet, networkValuesNotSetCopy,
sizeof(
char) * Gia_ManObjNum(
p));
4012 printf(
"SUCCESSFUL %d out of %d - node %d (gold = %d valid = %d)\n", outGold_bitwidth, outGold_bitwidth, jLut, jLutGold, netValid);
4016 free(networkValues1sCopy);
4017 free(networkValuesNotSetCopy);
4018 Vec_IntFree(modifiedLuts);
4022 char luts_values = lutValues1s & networkValid;
4023 char out_gold_values = jLutGold & networkValid;
4024 char validAssignments = ~( luts_values ^ out_gold_values ) & networkValid;
4026 if (validAssignments != 0){
4027 while (validAssignments != 0) {
4028 if (validAssignments & 1) {
4031 validAssignments >>= 1;
4034 validAssignments = ~( luts_values ^ out_gold_values ) & networkValid;
4036 printf(
"(1) SUCCESSFUL %d out of %d - node %d (gold = %d valid = %d)\n", numOnes, outGold_bitwidth, jLut, jLutGold, validAssignments);
4040 mainLoop_condition = (iii < numLuts);
4047 int jth_word =
p->iData & 0xFFFF;
4048 int kth_bit = (
p->iData & 0xFFFF0000) >> 16;
4049 if( kth_bit + outGold_bitwidth >= 64 ){
4054 kth_bit += outGold_bitwidth;
4055 p->iData = (kth_bit << 16) | jth_word;
4057 printf(
"**Exporting simulation values in file sim_values.txt\n");
4064 free(networkValues1s);
4065 free(networkValuesNotSet);
4093 int iTrials = 0, outer_loop_condition = iTrials < (numClasses * 1.5);
4094 int nthClass = 0, status, oldNumClasses = numClasses, iter;
4102 printf(
"**Activating watchlist feauture\n");
4106 if( levelOrder != -1 ){
4118 printf(
"FAILED - no valid input vectors found for class %d\n", nthClass);
4122 if (oldNumClasses == numClasses){
4125 oldNumClasses = numClasses;
4130 printf(
"SUCCESSFUL - input vectors found for class %d\n", nthClass);
4134 Vec_IntFree(vLutsFaninCones);
4135 Vec_IntFree(luts_order);
4139 Vec_IntFree(vecTmp);
4141 Vec_PtrFree(vNodesWatchList);
4143 if(nthClass >= numClasses){
4145 if (oldNumClasses == numClasses){
4148 oldNumClasses = numClasses;
4151 outer_loop_condition = iTrials < 3;
4152 clock_t end_time = clock();
4154 printf(
"Timeout of %f sec reached\n", pPars->
timeOutSim);
4159 printf(
"Time elapsed: %f (classes quality: %d)\n", (
float)(clock() -
start_time)/CLOCKS_PER_SEC, quality);
4188 Vec_WrdFill(
p->vSimsPi, Vec_WrdSize(
p->vSimsPi), 0 );
4195 if ( Gia_ObjIsXor(pObj) )
4198 pObj->
Value =
Gia_ManHashAnd( pMan->pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
4201 pObjNew = Gia_ManObj( pMan->pNew, Abc_Lit2Var(pObj->
Value) );
4202 if ( Gia_ObjIsAnd(pObjNew) )
4203 if ( Vec_BitEntry(pMan->vFails, Gia_ObjFaninId0(pObjNew, Abc_Lit2Var(pObj->
Value))) ||
4204 Vec_BitEntry(pMan->vFails, Gia_ObjFaninId1(pObjNew, Abc_Lit2Var(pObj->
Value))) )
4205 Vec_BitWriteEntry( pMan->vFails, Abc_Lit2Var(pObjNew->
Value), 1 );
4209 pRepr= Gia_ObjReprObj(
p, i );
4210 if ( pRepr == NULL )
4215 if ( pRepr == NULL )
4218 int id_obj = Gia_ObjId(
p, pObj );
4219 int id_repr = Gia_ObjId(
p, pRepr );
4221 if ( Abc_Lit2Var(pObj->
Value) == Abc_Lit2Var(pRepr->
Value))
4231 Gia_ObjSetProved(
p, i );
4232 if ( Gia_ObjId(
p, pRepr) == 0 )
4233 pMan->iLastConst = i;
4250 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",
4251 pMan->nSatUnsat + pMan->nSatSat + pMan->nSatUndec,
4252 pMan->nSatUnsat, pMan->nConflicts[1][0], (
float)pMan->nConflicts[1][1]/Abc_MaxInt(1, pMan->nSatUnsat-pMan->nConflicts[1][0]), pMan->nConflicts[1][2],
4253 pMan->nSatSat, pMan->nConflicts[0][0], (
float)pMan->nConflicts[0][1]/Abc_MaxInt(1, pMan->nSatSat -pMan->nConflicts[0][0]), pMan->nConflicts[0][2],
4255 pMan->nSimulates, pMan->nRecycles, 100.0*pMan->nGates[1]/Abc_MaxInt(1, pMan->nGates[0]+pMan->nGates[1]) );
4274 for (i = 0; i < nFanins; i++){
4275 if ( pCube & (1 << i) )
4277 else if ( pDCs & (1 << i) )
4301 while (jth_cube < nCubes){
4302 char pCube = *pSop; pSop++;
4303 char pDCs = *pSop; pSop++;
4324 assert( Gia_ObjIsLut(pMan, ObjId));
4325 char * pSop[2];
int nCubes[2];
4327 printf(
"Negative Polarity\n");
4328 printISOP( pSop[0], nCubes[0], Gia_ObjLutSize(pMan, ObjId) );
4329 printf(
"Positive Polarity\n");
4330 printISOP( pSop[1], nCubes[1], Gia_ObjLutSize(pMan, ObjId) );
4349 int i, k, nWordsPerCi;
4354 if (!Gia_ManHasMapping(
p)){
4356 If_Par_t IfPars, * pIfPars = &IfPars;
4361 printf(
"Performing LUT-mapping\n");
4366 printf(
"Using already mapped network\n");
4370 pManSim->pPars->fVerbose = 0;
4400 vSimPisSave = Vec_PtrAlloc( Gia_ManCiNum(pMapped) );
4401 for ( i = 0; i < Gia_ManCiNum(pMapped); i++ ){
4403 Vec_PtrPush( vSimPisSave, vSim );
4412 printf(
"Invalid number of iterations %d\n", pPars->
nMaxIter);
4417 pMapped->
iData = ((
Vec_Wrd_t *)Vec_PtrEntry( vSimPisSave, 0 ))->nSize;
4426 printf(
"**Printing Class information before running the Sim algos in file pre_classes.txt**\n");
4430 clock_t begin = clock();
4436 printf(
"Time elapsed: %f (implication time %f - %f successful recursions - %f successful checks)\n", (
double)(clock() - begin) / CLOCKS_PER_SEC, pPars->
fImplicationTime, implicationSuccessRate, implicationSuccessCheckRate);
4440 printf(
"**Printing Class information before running the Sim algos in file post_classes.txt**\n");
4446 if(
p->vSimsPi != NULL){
4447 Vec_WrdFree(
p->vSimsPi );
4449 nWordsPerCi = ((
Vec_Wrd_t *)Vec_PtrEntry( vSimPisSave, 0 ))->nSize;
4450 assert( nWordsPerCi > 0 );
4451 p->vSimsPi = Vec_WrdStart( Gia_ManCiNum(
p) * nWordsPerCi );
4454 assert( Gia_ManCiNum(
p) == Vec_PtrSize(vSimPisSave) );
4455 for (i = 0; i < Gia_ManCiNum(
p); i++){
4457 assert( vSim->nSize == nWordsPerCi );
4458 word * pSim = Vec_WrdEntryP(
p->vSimsPi, i * nWordsPerCi );
4459 for ( k = 0; k < nWordsPerCi; k++ )
4460 pSim[k] = Vec_WrdEntry( vSim, k );
4462 p->nSimWords = nWordsPerCi;
4465 Vec_WrdDumpHex( pPars->
pFileName,
p->vSimsPi, nWordsPerCi , 1 );
4469 Vec_IntFree( pMapped->
vTTLut );
#define GLUCOSE_UNSAT
INCLUDES ///.
Hop_Obj_t * Abc_ObjHopFromGia(Hop_Man_t *pHopMan, Gia_Man_t *p, int GiaId, Vec_Ptr_t *vCopies)
struct Abc_Obj_t_ Abc_Obj_t
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst0(Abc_Ntk_t *pNtk)
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL int Abc_NtkAigToBdd(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_SopGetVarNum(char *pSop)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
#define Abc_NtkForEachNode(pNtk, pNode, i)
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)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
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 ///.
struct Vec_Str_t_ Vec_Str_t
int Cec4_ObjGetCnfVar(Cec4_Man_t *p, int iObj)
int Cec4_ManCandIterNext(Cec4_Man_t *p)
#define sat_solver_addclause
void Cec4_ManPrintStats(Gia_Man_t *p, Cec_ParFra_t *pPars, Cec4_Man_t *pMan, int fSim)
void getISOPObjId(Gia_Man_t *pMan, int ObjId, char *pSop[2], int nCubes[2])
int Cec4_ManSimulateCos(Gia_Man_t *p)
void Cec4_CallSATsolver(Gia_Man_t *p, Cec4_Man_t *pMan, Cec_ParFra_t *pPars)
void Cec4_RefineInit(Gia_Man_t *p, Cec4_Man_t *pMan)
Vec_Int_t * Cec4_ManComputeMapping(Gia_Man_t *p, Gia_Man_t *pAig, int fVerbose)
int selectSop(Vec_Int_t *vQualitySops, int ith_max_quality, int experimentID)
void saveSimVectors(Gia_Man_t *p, Vec_Ptr_t *pValues, int bitLength, int jth_word, int kth_bit)
void Cec4_RefineOneClassIter(Gia_Man_t *p, int iRepr)
void Cec4_ManSimulateTest2(Gia_Man_t *p, int nConfs, int fVerbose)
int Cec4_ManSimulateOnlyTest(Gia_Man_t *p, int fVerbose)
void Cec4_ManCexVerify(Gia_Man_t *p, int iObj0, int iObj1, int fPhase)
void executeControlledSim(Gia_Man_t *p, Cec4_Man_t *pMan, Cec_ParSimGen_t *pPars, int levelOrder, Vec_Ptr_t *vSimSave, int experimentID)
int Cec4_ManPackAddPattern(Gia_Man_t *p, Vec_Int_t *vLits, int fExtend)
int compute_quality_sop(Gia_Man_t *p, char *pSop, int ObjId, int nFanins, int experimentID)
#define sat_solver_read_cex
int * sortArray(int *array, int n)
int Cec4_ManSweepNode(Cec4_Man_t *p, int iObj, int iRepr)
#define sat_solver_addvar
int Cec4_ManGeneratePatterns(Cec4_Man_t *p)
void Cec4_ManPrintClasses(Gia_Man_t *p)
#define sat_solver_set_conflict_budget
Gia_Man_t * Cec4_ManSimulateTest(Gia_Man_t *p, Cec_ParFra_t *pPars)
int computeNetworkValues(Gia_Man_t *p, Cec_ParSimGen_t *pPars, int ObjId, char *netValid, char lutValues1s, char *networkValues1s, char *networkValuesNotSet, Vec_Int_t *modifiedLuts, Vec_Int_t *vLutsFaninCones, Vec_Ptr_t *vNodesWatchlist, int experimentID)
Gia_Man_t * Cec4_ManSimulateTest4(Gia_Man_t *p, int nBTLimit, int nBTLimitPo, int fVerbose)
void Cec_DeriveSOPs(Gia_Man_t *p)
void Cec4_ManSatSolverRecycle(Cec4_Man_t *p)
typedefABC_NAMESPACE_IMPL_START struct Cec4_Man_t_ Cec4_Man_t
DECLARATIONS ///.
Vec_Str_t * encodeSOP(char *pSop, int nFanins, int nCubes)
#define sat_solver_mark_cone
int totalNumClasses(Gia_Man_t *p)
void Cec4_ManDestroy(Cec4_Man_t *p)
Vec_Ptr_t * generateWatchList(Gia_Man_t *p)
Gia_Obj_t * Cec4_ManFindRepr(Gia_Man_t *p, Cec4_Man_t *pMan, int iObj)
Vec_Int_t * extractNthClass(Gia_Man_t *p, int nth_class)
void Cec4_ManSimulate_rec(Gia_Man_t *p, Cec4_Man_t *pMan, int iObj)
#define sat_solver_start_new_round
void Cec4_ManSimulateCis(Gia_Man_t *p)
int Cec4_ManVerify_rec(Gia_Man_t *p, int iObj, sat_solver *pSat)
char * extractSOP(DdManager *dd, DdNode *bFunc, int nFanins, int polarity, int *_nCubes)
Vec_Wrd_t * Cec4_EvalCombine(Vec_Int_t *vPats, int nPats, int nInputs, int nWords)
FUNCTION DEFINITIONS ///.
void Cec4_CollectSuper(Gia_Obj_t *pObj, int fUseMuxes, Vec_Ptr_t *vSuper)
int checkCompatibilityImplication(Gia_Man_t *p, Cec_ParSimGen_t *pPars, char *netValid, int objId, char *networkValues1s, char *networkValuesNotSet, Vec_Int_t *vLuts2Imply, Vec_Int_t *vLutsValidity, int experimentID)
void Cec4_ManPackAddPatterns(Gia_Man_t *p, int iBit, Vec_Int_t *vLits)
void computeISOPs(Gia_Man_t *p, Abc_Ntk_t *pNtkNew)
int Cec4_ManSolveTwo(Cec4_Man_t *p, int iObj0, int iObj1, int fPhase, int *pfEasy, int fVerbose, int fEffort)
int computeInputVectors(Gia_Man_t *p, Cec4_Man_t *pMan, Cec_ParSimGen_t *pPars, Vec_Int_t *vLuts, char *outGold, int outGold_bitwidth, Vec_Int_t *vLutsFaninCones, Vec_Ptr_t *vNodesWatchlist, Vec_Ptr_t *vSimSave, int experimentID)
void Cec4_ManVerifyEquivs(Gia_Man_t *p, Vec_Int_t *vRes, int fVerbose)
void printISOPLUT(Gia_Man_t *pMan, int ObjId)
void saveInputVectors(Gia_Man_t *p, Cec4_Man_t *pMan, char *pValues)
Cec4_Man_t * Cec4_ManCreate(Gia_Man_t *pAig, Cec_ParFra_t *pPars)
void Cec4_AddClausesSuper(Gia_Man_t *p, Gia_Obj_t *pNode, Vec_Ptr_t *vSuper, sat_solver *pSat)
void Cec4_ManPrintClasses2(Gia_Man_t *p)
void executeRandomSim(Gia_Man_t *p, Cec4_Man_t *pMan, int dynSim, int nMaxIter, Vec_Ptr_t *vSimSave, int verbose)
void Cec4_ManPrintTfiConeStats(Gia_Man_t *p)
int existsOneClass(Gia_Man_t *p)
void Cec4_RefineOneClass(Gia_Man_t *p, Cec4_Man_t *pMan, Vec_Int_t *vNodes)
int Cec4_ManCexVerify_rec(Gia_Man_t *p, int iObj)
void Cec4_ManSimAlloc(Gia_Man_t *p, int nWords)
void Cec4_ManSimulateTest5(Gia_Man_t *p, int nConfs, int fVerbose)
void Cec4_ManSimulateTest5Int(Gia_Man_t *p, int nConfs, int fVerbose)
#define sat_solver_set_var_fanin_lit
#define sat_solver_read_cex_varvalue
int extract_quality_mffc(Gia_Man_t *p, int ObjId, char pDCs)
void Cec4_EvalPatterns(Gia_Man_t *p, Vec_Int_t *vPats, int nPats)
void printISOP(char *pSop, int nCubes, int nFanins)
int checkCompatibilityCube(Gia_Man_t *pMan, char *pCube, int nFanins, char *pCubeGold)
#define sat_solver_add_and
#define sat_solver_conflictnum
Abc_Cex_t * Cec4_ManDeriveCex(Gia_Man_t *p, int iOut, int iPat)
int rouletteWheel(Vec_Int_t *vQualitySops, int numValid)
void printEncodedCube(char pCube, char pDCs, int nFanins)
void Gia_ManRemoveWrongChoices(Gia_Man_t *p)
int evaluate_equiv_classes(Gia_Man_t *p, int verbose)
void exportSimValues(Gia_Man_t *p, char *filename)
int computeLutsToImply(Gia_Man_t *p, Cec_ParSimGen_t *pPars, char *netValid, int ObjId, char *networkValues1s, char *networkValuesNotSet, Vec_Int_t *vLutsFaninCones, Vec_Int_t *vLuts2Imply, Vec_Int_t *vLutsValidity, Vec_Ptr_t *vNodesWatchlist, int experimentID)
void computeMFFCs(Gia_Man_t *p)
void Cec_RemoveNonLutNodes(Gia_Man_t *p)
int check_implication(Gia_Man_t *p, int ObjId, int validBit, int fanoutValue, int fanoutNotSet, char *inputsFaninsValues, char *networkValues1s, char *networkValuesNotSet, int experimentID)
void Cec4_ManClearCis(Gia_Man_t *p)
Gia_Man_t * Cec_SimGenRun(Gia_Man_t *p, Cec_ParSimGen_t *pPars)
int evaluate_mffc(Gia_Man_t *p, int rootId, int fanId, Vec_Int_t *vLeaves)
Gia_Man_t * Cec4_ManSimulateTest3(Gia_Man_t *p, int nBTLimit, int fVerbose)
void exportEquivClasses(Gia_Man_t *p, char *filename)
Vec_Int_t * computeLutsOrder(Gia_Man_t *p, int reorder_type)
int Cec4_ManPerformSweeping(Gia_Man_t *p, Cec_ParFra_t *pPars, Gia_Man_t **ppNew, int fSimOnly)
void Cec4_ManSetParams(Cec_ParFra_t *pPars)
#define sat_solver_add_xor
int Cec4_ManSimHashKey(word *pSim, int nSims, int nTableSize)
void Cec4_AddClausesMux(Gia_Man_t *p, Gia_Obj_t *pNode, sat_solver *pSat)
void Gia_generateFanoutMapping(Gia_Man_t *p)
void Cec4_ManConvertToLits(Gia_Man_t *p, Vec_Int_t *vRes)
void Cec_SimGenSetParDefault(Cec_ParSimGen_t *pPars)
Gia_Man_t * Gia_ManLocalRehash(Gia_Man_t *p)
void generateLutsRankings(Gia_Man_t *p)
void Cec4_ManSimulate(Gia_Man_t *p, Cec4_Man_t *pMan)
Gia_Man_t * Cec4_ManStartNew(Gia_Man_t *pAig)
void Cec4_ManVerify(Gia_Man_t *p, int iObj0, int iObj1, int fPhase, sat_solver *pSat)
void Cec4_CollectSuper_rec(Gia_Obj_t *pObj, Vec_Ptr_t *vSuper, int fFirst, int fUseMuxes)
char * generateOutGoldValues(Gia_Man_t *p)
Vec_Int_t * computeFaninCones(Gia_Man_t *p, Vec_Int_t *vLuts)
void computeFaninCones_rec(Gia_Man_t *p, int ObjId, Vec_Int_t *vLutsFaninCones)
void Cec4_RefineClasses(Gia_Man_t *p, Cec4_Man_t *pMan, Vec_Int_t *vClasses)
int Cec4_ManGeneratePatterns_rec(Gia_Man_t *p, Gia_Obj_t *pObj, int Value, Vec_Int_t *vPat, Vec_Int_t *vVisit)
void Cec4_ManSimulateDumpInfo(Cec4_Man_t *pMan)
int Cec4_ManPackAddPatternTry(Gia_Man_t *p, int iBit, Vec_Int_t *vLits)
void Cec4_ManCandIterStart(Cec4_Man_t *p)
void Cec4_ObjAddToFrontier(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Ptr_t *vFrontier, sat_solver *pSat)
#define sat_solver_set_jftr
int Cec4_ManGeneratePatternOne(Gia_Man_t *p, int iRepr, int iReprVal, int iCand, int iCandVal, Vec_Int_t *vPat, Vec_Int_t *vVisit)
int executeImplications(Gia_Man_t *p, Cec_ParSimGen_t *pPars, char *netValid, int ObjId, char *networkValues1s, char *networkValuesNotSet, Vec_Int_t *vLutsFaninCones, Vec_Ptr_t *vNodesWatchlist, int experimentID)
struct Cec_ParFra_t_ Cec_ParFra_t
struct Cec_ParSimGen_t_ Cec_ParSimGen_t
Gia_Man_t * Gia_ManDupMiterCones(Gia_Man_t *p, Vec_Int_t *vPairs)
void Gia_ManDupMapping(Gia_Man_t *pNew, Gia_Man_t *p)
struct Gia_Rpr_t_ Gia_Rpr_t
void Gia_ManStop(Gia_Man_t *p)
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
Vec_Wrd_t * Gia_ManSimPatSimOut(Gia_Man_t *pGia, Vec_Wrd_t *vSimsPi, int fOuts)
int Gia_ObjCheckMffc(Gia_Man_t *p, Gia_Obj_t *pRoot, int Limit, Vec_Int_t *vNodes, Vec_Int_t *vLeaves, Vec_Int_t *vInners)
Gia_Obj_t * Gia_ObjRecognizeMux(Gia_Obj_t *pNode, Gia_Obj_t **ppNodeT, Gia_Obj_t **ppNodeE)
#define Gia_ManForEachPo(p, pObj, i)
#define Gia_ManForEachAnd(p, pObj, i)
#define Gia_ManForEachCoId(p, Id, i)
Gia_Man_t * Gia_ManPerformMapping(Gia_Man_t *p, void *pIfPars)
#define Gia_ManForEachCand(p, pObj, 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)
#define Gia_ManForEachPi(p, pObj, i)
#define Gia_ManForEachLut(p, i)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
#define Gia_LutForEachFanin(p, i, iFan, k)
void Gia_ManFillValue(Gia_Man_t *p)
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachObj1(p, pObj, i)
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
#define Gia_ManForEachClass(p, i)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
void Gia_ManSetIfParsDefault(void *pIfPars)
FUNCTION DEFINITIONS ///.
int Gia_ManLutNum(Gia_Man_t *p)
#define Gia_LutForEachFanout2(p, i, iFan, k)
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)
void Gia_ManCreateRefs(Gia_Man_t *p)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
void Gia_ManIncrementTravId(Gia_Man_t *p)
void Bnd_ManFinalizeMappings()
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)
void Bnd_ManMerge(int id1, int id2, int phaseDiff)
#define Gia_ManForEachCi(p, pObj, i)
#define Gia_ManForEachRiRo(p, pObjRi, pObjRo, i)
void Gia_ManSetPhase(Gia_Man_t *p)
void Gia_ManHashStop(Gia_Man_t *p)
void Gia_ManCleanMark01(Gia_Man_t *p)
int Gia_ManLevelNum(Gia_Man_t *p)
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
#define Gia_ManForEachClass0(p, i)
#define Gia_ManForEachCiId(p, Id, i)
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact, int fWriteNewLine)
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
struct Hop_Obj_t_ Hop_Obj_t
struct If_Par_t_ If_Par_t
unsigned __int64 word
DECLARATIONS ///.
ABC_NAMESPACE_IMPL_START long start_time
Vec_Int_t * vClassUpdates
int nImplicationTotalChecks
int nImplicationSuccessChecks
int nImplicationExecution
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 ///.