45static inline int Gia_ManHashOne(
int iLit0,
int iLit1,
int iLitC,
int TableSize )
47 unsigned Key = iLitC * 2011;
48 Key += Abc_Lit2Var(iLit0) * 7937;
49 Key += Abc_Lit2Var(iLit1) * 2971;
50 Key += Abc_LitIsCompl(iLit0) * 911;
51 Key += Abc_LitIsCompl(iLit1) * 353;
52 return (
int)(Key % TableSize);
54static inline int * Gia_ManHashFind(
Gia_Man_t *
p,
int iLit0,
int iLit1,
int iLitC )
56 int iThis, * pPlace = Vec_IntEntryP( &
p->vHTable, Gia_ManHashOne( iLit0, iLit1, iLitC, Vec_IntSize(&
p->vHTable) ) );
57 assert( Vec_IntSize(&
p->vHash) == Gia_ManObjNum(
p) );
58 assert(
p->pMuxes || iLit0 < iLit1 );
59 assert( iLit0 < iLit1 || (!Abc_LitIsCompl(iLit0) && !Abc_LitIsCompl(iLit1)) );
60 assert( iLitC == -1 || !Abc_LitIsCompl(iLit1) );
61 for ( ; (iThis = *pPlace); pPlace = Vec_IntEntryP(&
p->vHash, iThis) )
64 if ( Gia_ObjFaninLit0(pThis, iThis) == iLit0 && Gia_ObjFaninLit1(pThis, iThis) == iLit1 && (
p->pMuxes == NULL || Gia_ObjFaninLit2p(
p, pThis) == iLitC) )
84 iLit0 ^= iLit1, iLit1 ^= iLit0, iLit0 ^= iLit1;
85 return Abc_Var2Lit( *Gia_ManHashFind(
p, iLit0, iLit1, -1 ), 0 );
89 int iLit0 = Gia_ObjToLit(
p, p0 );
90 int iLit1 = Gia_ObjToLit(
p, p1 );
107 assert( Vec_IntSize(&
p->vHTable) == 0 );
108 Vec_IntFill( &
p->vHTable, Abc_PrimeCudd( Gia_ManAndNum(
p) ? Gia_ManAndNum(
p) + 1000 :
p->nObjsAlloc ), 0 );
109 Vec_IntGrow( &
p->vHash, Abc_MaxInt(Vec_IntSize(&
p->vHTable), Gia_ManObjNum(
p)) );
110 Vec_IntFill( &
p->vHash, Gia_ManObjNum(
p), 0 );
132 pPlace = Gia_ManHashFind(
p, Gia_ObjFaninLit0(pObj, i), Gia_ObjFaninLit1(pObj, i), Gia_ObjFaninLit2(
p, i) );
151 Vec_IntErase( &
p->vHTable );
152 Vec_IntErase( &
p->vHash );
168 int i, iThis, iNext, Counter, Counter2, * pPlace;
170 assert( Vec_IntSize(&vOld) > 0 );
172 Vec_IntZero( &
p->vHTable );
173 Vec_IntFill( &
p->vHTable, Abc_PrimeCudd( 2 * Gia_ManAndNum(
p) ), 0 );
177 for ( iNext = Vec_IntEntry(&
p->vHash, iThis);
178 iThis; iThis = iNext,
179 iNext = Vec_IntEntry(&
p->vHash, iThis) )
182 Vec_IntWriteEntry( &
p->vHash, iThis, 0 );
183 pPlace = Gia_ManHashFind(
p, Gia_ObjFaninLit0(pThis0, iThis), Gia_ObjFaninLit1(pThis0, iThis), Gia_ObjFaninLit2p(
p, pThis0) );
189 Counter2 = Gia_ManAndNum(
p) - Gia_ManBufNum(
p);
190 assert( Counter == Counter2 );
193 Vec_IntErase( &vOld );
210 int i, Counter, Limit;
211 printf(
"Table size = %d. Entries = %d. ", Vec_IntSize(&
p->vHTable), Gia_ManAndNum(
p) );
212 printf(
"Hits = %d. Misses = %d.\n", (
int)
p->nHashHit, (
int)
p->nHashMiss );
213 Limit = Abc_MinInt( 1000, Vec_IntSize(&
p->vHTable) );
214 for ( i = 0; i < Limit; i++ )
217 for ( iEntry = Vec_IntEntry(&
p->vHTable, i);
219 iEntry = iEntry? Vec_IntEntry(&
p->vHash, iEntry) : 0 )
222 printf(
"%d ", Counter );
243 assert( !Gia_IsComplement(pNode0) );
244 assert( !Gia_IsComplement(pNode1) );
246 if ( Gia_ObjFanin1(pNode0) == Gia_ObjFanin1(pNode1) && (Gia_ObjFaninC1(pNode0) ^ Gia_ObjFaninC1(pNode1)) )
249 if ( Gia_ObjFaninC1(pNode0) )
251 *ppNodeT = Gia_Not(Gia_ObjChild0(pNode1));
252 *ppNodeE = Gia_Not(Gia_ObjChild0(pNode0));
253 return Gia_ObjChild1(pNode1);
257 *ppNodeT = Gia_Not(Gia_ObjChild0(pNode0));
258 *ppNodeE = Gia_Not(Gia_ObjChild0(pNode1));
259 return Gia_ObjChild1(pNode0);
262 else if ( Gia_ObjFanin0(pNode0) == Gia_ObjFanin0(pNode1) && (Gia_ObjFaninC0(pNode0) ^ Gia_ObjFaninC0(pNode1)) )
265 if ( Gia_ObjFaninC0(pNode0) )
267 *ppNodeT = Gia_Not(Gia_ObjChild1(pNode1));
268 *ppNodeE = Gia_Not(Gia_ObjChild1(pNode0));
269 return Gia_ObjChild0(pNode1);
273 *ppNodeT = Gia_Not(Gia_ObjChild1(pNode0));
274 *ppNodeE = Gia_Not(Gia_ObjChild1(pNode1));
275 return Gia_ObjChild0(pNode0);
278 else if ( Gia_ObjFanin0(pNode0) == Gia_ObjFanin1(pNode1) && (Gia_ObjFaninC0(pNode0) ^ Gia_ObjFaninC1(pNode1)) )
281 if ( Gia_ObjFaninC0(pNode0) )
283 *ppNodeT = Gia_Not(Gia_ObjChild0(pNode1));
284 *ppNodeE = Gia_Not(Gia_ObjChild1(pNode0));
285 return Gia_ObjChild1(pNode1);
289 *ppNodeT = Gia_Not(Gia_ObjChild1(pNode0));
290 *ppNodeE = Gia_Not(Gia_ObjChild0(pNode1));
291 return Gia_ObjChild0(pNode0);
294 else if ( Gia_ObjFanin1(pNode0) == Gia_ObjFanin0(pNode1) && (Gia_ObjFaninC1(pNode0) ^ Gia_ObjFaninC0(pNode1)) )
297 if ( Gia_ObjFaninC1(pNode0) )
299 *ppNodeT = Gia_Not(Gia_ObjChild1(pNode1));
300 *ppNodeE = Gia_Not(Gia_ObjChild0(pNode0));
301 return Gia_ObjChild0(pNode1);
305 *ppNodeT = Gia_Not(Gia_ObjChild0(pNode0));
306 *ppNodeE = Gia_Not(Gia_ObjChild1(pNode1));
307 return Gia_ObjChild1(pNode0);
328 return Gia_ObjFromLit(
p,
Gia_ManHashAnd(
p, Gia_ObjToLit(
p, p0), Gia_ObjToLit(
p, p1) ) );
344 Gia_Obj_t * pNode0, * pNode1, * pFanA, * pFanB, * pFanC, * pFanD;
346 pNode0 = Gia_Regular(p0);
347 pNode1 = Gia_Regular(p1);
348 if ( !Gia_ObjIsAnd(pNode0) && !Gia_ObjIsAnd(pNode1) )
350 pFanA = Gia_ObjIsAnd(pNode0) ? Gia_ObjChild0(pNode0) : NULL;
351 pFanB = Gia_ObjIsAnd(pNode0) ? Gia_ObjChild1(pNode0) : NULL;
352 pFanC = Gia_ObjIsAnd(pNode1) ? Gia_ObjChild0(pNode1) : NULL;
353 pFanD = Gia_ObjIsAnd(pNode1) ? Gia_ObjChild1(pNode1) : NULL;
354 if ( Gia_IsComplement(p0) )
356 if ( pFanA == Gia_Not(p1) || pFanB == Gia_Not(p1) )
359 return Gia_ManHashAndP(
p, Gia_Not(pFanA), pFanB );
361 return Gia_ManHashAndP(
p, Gia_Not(pFanB), pFanA );
365 if ( pFanA == Gia_Not(p1) || pFanB == Gia_Not(p1) )
366 return Gia_ManConst0(
p);
367 if ( pFanA == p1 || pFanB == p1 )
370 if ( Gia_IsComplement(p1) )
372 if ( pFanC == Gia_Not(p0) || pFanD == Gia_Not(p0) )
375 return Gia_ManHashAndP(
p, Gia_Not(pFanC), pFanD );
377 return Gia_ManHashAndP(
p, Gia_Not(pFanD), pFanC );
381 if ( pFanC == Gia_Not(p0) || pFanD == Gia_Not(p0) )
382 return Gia_ManConst0(
p);
383 if ( pFanC == p0 || pFanD == p0 )
386 if ( !Gia_IsComplement(p0) && !Gia_IsComplement(p1) )
388 if ( pFanA == Gia_Not(pFanC) || pFanA == Gia_Not(pFanD) || pFanB == Gia_Not(pFanC) || pFanB == Gia_Not(pFanD) )
389 return Gia_ManConst0(
p);
390 if ( pFanA == pFanC || pFanB == pFanC )
391 return Gia_ManHashAndP(
p, p0, pFanD );
392 if ( pFanB == pFanC || pFanB == pFanD )
393 return Gia_ManHashAndP(
p, pFanA, p1 );
394 if ( pFanA == pFanD || pFanB == pFanD )
395 return Gia_ManHashAndP(
p, p0, pFanC );
396 if ( pFanA == pFanC || pFanA == pFanD )
397 return Gia_ManHashAndP(
p, pFanB, p1 );
399 else if ( Gia_IsComplement(p0) && !Gia_IsComplement(p1) )
401 if ( pFanA == Gia_Not(pFanC) || pFanA == Gia_Not(pFanD) || pFanB == Gia_Not(pFanC) || pFanB == Gia_Not(pFanD) )
403 if ( pFanB == pFanC || pFanB == pFanD )
404 return Gia_ManHashAndP(
p, Gia_Not(pFanA), p1 );
405 if ( pFanA == pFanC || pFanA == pFanD )
406 return Gia_ManHashAndP(
p, Gia_Not(pFanB), p1 );
408 else if ( !Gia_IsComplement(p0) && Gia_IsComplement(p1) )
410 if ( pFanC == Gia_Not(pFanA) || pFanC == Gia_Not(pFanB) || pFanD == Gia_Not(pFanA) || pFanD == Gia_Not(pFanB) )
412 if ( pFanD == pFanA || pFanD == pFanB )
413 return Gia_ManHashAndP(
p, Gia_Not(pFanC), p0 );
414 if ( pFanC == pFanA || pFanC == pFanB )
415 return Gia_ManHashAndP(
p, Gia_Not(pFanD), p0 );
419 if ( pFanA == pFanD && pFanB == Gia_Not(pFanC) )
420 return Gia_Not(pFanA);
421 if ( pFanB == pFanC && pFanA == Gia_Not(pFanD) )
422 return Gia_Not(pFanB);
423 if ( pFanA == pFanC && pFanB == Gia_Not(pFanD) )
424 return Gia_Not(pFanA);
425 if ( pFanB == pFanD && pFanA == Gia_Not(pFanC) )
426 return Gia_Not(pFanB);
474 return iLit0 ? Abc_LitNot(iLit1) : iLit1;
476 return iLit1 ? Abc_LitNot(iLit0) : iLit0;
477 if ( iLit0 == iLit1 )
479 if ( iLit0 == Abc_LitNot(iLit1) )
481 if ( (
p->nObjs & 0xFF) == 0 && 2 * Vec_IntSize(&
p->vHTable) < Gia_ManAndNum(
p) )
484 iLit0 ^= iLit1, iLit1 ^= iLit0, iLit0 ^= iLit1;
485 if ( Abc_LitIsCompl(iLit0) )
486 iLit0 = Abc_LitNot(iLit0), fCompl ^= 1;
487 if ( Abc_LitIsCompl(iLit1) )
488 iLit1 = Abc_LitNot(iLit1), fCompl ^= 1;
490 int *pPlace = Gia_ManHashFind(
p, iLit0, iLit1, -1 );
494 return Abc_Var2Lit( *pPlace, fCompl );
497 if ( Vec_IntSize(&
p->vHash) < Vec_IntCap(&
p->vHash) )
498 *pPlace = Abc_Lit2Var( Gia_ManAppendXorReal(
p, iLit0, iLit1 ) );
501 int iNode = Gia_ManAppendXorReal(
p, iLit0, iLit1 );
502 pPlace = Gia_ManHashFind(
p, iLit0, iLit1, -1 );
504 *pPlace = Abc_Lit2Var( iNode );
506 return Abc_Var2Lit( *pPlace, fCompl );
526 return iLitC ? iLit1 : iLit0;
531 assert( iLit0 > 1 && iLit1 > 1 && iLitC > 1 );
532 if ( iLit0 == iLit1 )
534 if ( iLitC == iLit0 || iLitC == Abc_LitNot(iLit1) )
536 if ( iLitC == iLit1 || iLitC == Abc_LitNot(iLit0) )
538 if ( Abc_Lit2Var(iLit0) == Abc_Lit2Var(iLit1) )
541 iLit0 ^= iLit1, iLit1 ^= iLit0, iLit0 ^= iLit1, iLitC = Abc_LitNot(iLitC);
542 if ( Abc_LitIsCompl(iLit1) )
543 iLit0 = Abc_LitNot(iLit0), iLit1 = Abc_LitNot(iLit1), fCompl = 1;
545 int *pPlace = Gia_ManHashFind(
p, iLit0, iLit1, iLitC );
549 return Abc_Var2Lit( *pPlace, fCompl );
552 if ( Vec_IntSize(&
p->vHash) < Vec_IntCap(&
p->vHash) )
553 *pPlace = Abc_Lit2Var( Gia_ManAppendMuxReal(
p, iLitC, iLit1, iLit0 ) );
556 int iNode = Gia_ManAppendMuxReal(
p, iLitC, iLit1, iLit0 );
557 pPlace = Gia_ManHashFind(
p, iLit0, iLit1, iLitC );
559 *pPlace = Abc_Lit2Var( iNode );
561 return Abc_Var2Lit( *pPlace, fCompl );
579 return iLit0 ? iLit1 : 0;
581 return iLit1 ? iLit0 : 0;
582 if ( iLit0 == iLit1 )
584 if ( iLit0 == Abc_LitNot(iLit1) )
588 assert( Vec_IntSize(&
p->vHTable) == 0 );
589 return Gia_ManAppendAnd(
p, iLit0, iLit1 );
591 if ( (
p->nObjs & 0xFF) == 0 && 2 * Vec_IntSize(&
p->vHTable) < Gia_ManAndNum(
p) )
595 Gia_Obj_t * pObj = Gia_ManAddStrash(
p, Gia_ObjFromLit(
p, iLit0), Gia_ObjFromLit(
p, iLit1) );
597 return Gia_ObjToLit(
p, pObj );
600 iLit0 ^= iLit1, iLit1 ^= iLit0, iLit0 ^= iLit1;
602 int * pPlace = Gia_ManHashFind(
p, iLit0, iLit1, -1 );
606 return Abc_Var2Lit( *pPlace, 0 );
609 if ( Vec_IntSize(&
p->vHash) < Vec_IntCap(&
p->vHash) )
610 *pPlace = Abc_Lit2Var( Gia_ManAppendAnd(
p, iLit0, iLit1 ) );
613 int iNode = Gia_ManAppendAnd(
p, iLit0, iLit1 );
614 pPlace = Gia_ManHashFind(
p, iLit0, iLit1, -1 );
616 *pPlace = Abc_Lit2Var( iNode );
618 return Abc_Var2Lit( *pPlace, 0 );
623 return Abc_LitNot(
Gia_ManHashAnd(
p, Abc_LitNot(iLit0), Abc_LitNot(iLit1) ));
640 return iLit0 ? iLit1 : 0;
642 return iLit1 ? iLit0 : 0;
643 if ( iLit0 == iLit1 )
645 if ( iLit0 == Abc_LitNot(iLit1) )
648 iLit0 ^= iLit1, iLit1 ^= iLit0, iLit0 ^= iLit1;
650 int * pPlace = Gia_ManHashFind(
p, iLit0, iLit1, -1 );
652 return Abc_Var2Lit( *pPlace, 0 );
674 int fCompl = Abc_LitIsCompl(iLit0) ^ Abc_LitIsCompl(iLit1);
675 int iTemp0 =
Gia_ManHashAnd(
p, Abc_LitRegular(iLit0), Abc_LitNot(Abc_LitRegular(iLit1)) );
676 int iTemp1 =
Gia_ManHashAnd(
p, Abc_LitRegular(iLit1), Abc_LitNot(Abc_LitRegular(iLit0)) );
677 return Abc_LitNotCond(
Gia_ManHashAnd(
p, Abc_LitNot(iTemp0), Abc_LitNot(iTemp1) ), !fCompl );
698 int iTemp0, iTemp1, fCompl = 0;
699 if ( iData0 > iData1 )
700 iData0 ^= iData1, iData1 ^= iData0, iData0 ^= iData1, iCtrl = Abc_LitNot(iCtrl);
701 if ( Abc_LitIsCompl(iData1) )
702 iData0 = Abc_LitNot(iData0), iData1 = Abc_LitNot(iData1), fCompl = 1;
705 return Abc_LitNotCond(
Gia_ManHashAnd(
p, Abc_LitNot(iTemp0), Abc_LitNot(iTemp1) ), !fCompl );
745 pNew->
pName = Abc_UtilStrsav(
p->pName );
746 pNew->
pSpec = Abc_UtilStrsav(
p->pSpec );
749 Gia_ManConst0(
p)->Value = 0;
755 if ( Gia_ObjIsAnd(pObj) )
757 else if ( Gia_ObjIsCi(pObj) )
758 pObj->
Value = Gia_ManAppendCi( pNew );
759 else if ( Gia_ObjIsCo(pObj) )
760 pObj->
Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
785 if ( Vec_IntSize(vLits) == 0 )
787 while ( Vec_IntSize(vLits) > 1 )
789 int i, k = 0, Lit1, Lit2, LitRes;
793 Vec_IntWriteEntry( vLits, k++, LitRes );
795 if ( Vec_IntSize(vLits) & 1 )
796 Vec_IntWriteEntry( vLits, k++, Vec_IntEntryLast(vLits) );
797 Vec_IntShrink( vLits, k );
799 assert( Vec_IntSize(vLits) == 1 );
800 return Vec_IntEntry(vLits, 0);
804 int i, iLit, iRes = 1;
811 int i, iLit0, iLit1, iRes = 0;
833 for ( i = 0; i < nVars; i++ )
834 pRes[i] = Abc_Var2Lit( i+1, 0 );
845 for ( i = 0; i < nBits; i++ )
847 for ( i = 0; i < nBits; i++ )
849 int iPerm = rand() % nBits;
850 ABC_SWAP(
int, pRes[i], pRes[iPerm] );
858 for ( i = 0; i < nBits; i++ )
859 pRes[i] = rand() % nBits;
865 for ( i = 1; i < nPerm; i++ )
866 if ( pPerm[i-1] <= pPerm[i] )
876 for ( i = 0; i < nVars; i++ )
877 printf(
"%d ", pPerm[i] );
882 for ( i = 1; i < nVars; i++ )
883 if ( pPerm[i-1] >= pPerm[i] )
887 assert( pPerm[i-1] >= pPerm[i] );
888 if ( pPerm[i-1] > pPerm[i] )
890 ABC_SWAP(
int, pPerm[i-1], pPerm[i] );
891 ABC_SWAP(
int, pVars[i-1], pVars[i] );
895 assert( pPerm[i-1] == pPerm[i] );
903 for ( i = i+1; i < nVars; i++ )
905 pPerm[i-1] = pPerm[i];
906 pVars[i-1] = pVars[i];
912 for ( i = 0; i < nVars; i++ )
913 printf(
"%d ", pPerm[i] );
918 for ( i = 1; i < nVars; i++ )
930 int i, iRes, * pPerm;
933 pNew->
pName = Abc_UtilStrsav(
"multi" );
934 for ( i = 0; i < nBits; i++ )
935 Gia_ManAppendCi( pNew );
940 Gia_ManAppendCo( pNew, iRes );
961 for ( i = 0; i < nVars; i++ )
962 iLit =
Gia_ManHashAnd( pNew, iLit, Abc_LitNotCond(pLits[i], !((Vars >> i) & 1)) );
977 int i, k, m, nVars = nBits + (1 << nBits);
980 for ( i = 0; i < nVars; i++ )
981 printf(
"%d ", pPerm[i] );
984 for ( i = 0; i < nBits; i++ )
986 for ( k = i+1; k < nBits; k++ )
987 if ( pPerm[i] > pPerm[k] )
991 assert( pPerm[i] > pPerm[k] );
992 ABC_SWAP(
int, pPerm[i], pPerm[k] );
993 ABC_SWAP(
int, pTree[i], pTree[k] );
994 for ( m = 0; m < (1 << nBits); m++ )
995 if ( ((m >> i) & 1) && !((m >> k) & 1) )
997 ABC_SWAP(
int, pTree[nBits+m], pTree[nBits+(m^(1<<i)^(1<<k))] );
998 ABC_SWAP(
int, pPerm[nBits+m], pPerm[nBits+(m^(1<<i)^(1<<k))] );
1003 for ( i = 0; i < nVars; i++ )
1004 printf(
"%d ", pPerm[i] );
1011 assert( iLate1 != iLate2 );
1012 for ( i = 0; i < nBits; i++ )
1013 if ( (((iLate1 ^ iLate2) >> i) & 1) )
1014 return Abc_LitNotCond( pLits[i], (iLate1 >> i) & 1 );
1019 int i, Value = -1, iLate = -1;
1020 for ( i = 0; i < nVars; i++ )
1021 if ( Value < pPerm[i] && i != iPrev1 && i != iPrev2 && i != iPrev3 )
1031 for ( i = 0; i < nVars; i++ )
1032 if ( Value > pPerm[i] )
1042 assert( iLate >= 0 && iLate < (1<<nBits) );
1043 iData = pTree[nBits+iLate];
1044 pTree[nBits+iLate] = pTree[nBits+(iLate^1)];
1050 int iRes, iData1, iData2, iData, iCond, iCond2;
1051 assert( iLate1 != iLate2 );
1052 assert( iLate1 >= 0 && iLate1 < (1<<nBits) );
1053 assert( iLate2 >= 0 && iLate2 < (1<<nBits) );
1054 iData1 = pTree[nBits+iLate1];
1055 iData2 = pTree[nBits+iLate2];
1056 pTree[nBits+iLate1] = pTree[nBits+(iLate1^1)];
1057 pTree[nBits+iLate2] = pTree[nBits+(iLate2^1)];
1066 int iRes, iData1, iData2, iData3, iCube1, iCube2, iCube3, iCtrl0, iCtrl1, iMux10, iMux11;
1067 assert( iLate1 != iLate2 );
1068 assert( iLate1 != iLate3 );
1069 assert( iLate2 != iLate3 );
1070 assert( iLate1 >= 0 && iLate1 < (1<<nBits) );
1071 assert( iLate2 >= 0 && iLate2 < (1<<nBits) );
1072 assert( iLate3 >= 0 && iLate3 < (1<<nBits) );
1073 iData1 = pTree[nBits+iLate1];
1074 iData2 = pTree[nBits+iLate2];
1075 iData3 = pTree[nBits+iLate3];
1076 pTree[nBits+iLate1] = pTree[nBits+(iLate1^1)];
1077 pTree[nBits+iLate2] = pTree[nBits+(iLate2^1)];
1078 pTree[nBits+iLate3] = pTree[nBits+(iLate3^1)];
1080 iCube1 =
Gia_ManCube( pNew, iLate1, nBits, pTree );
1081 iCube2 =
Gia_ManCube( pNew, iLate2, nBits, pTree );
1082 iCube3 =
Gia_ManCube( pNew, iLate3, nBits, pTree );
1095 int iBase =
Gia_ManEarliest( pPerm+nBits, 1<<nBits ), BaseValue = pPerm[nBits+iBase];
1096 int iLate1 =
Gia_ManLatest( pPerm+nBits, 1<<nBits, -1, -1, -1 );
1097 int iLate2 =
Gia_ManLatest( pPerm+nBits, 1<<nBits, iLate1, -1, -1 );
1098 int iLate3 =
Gia_ManLatest( pPerm+nBits, 1<<nBits, iLate1, iLate2, -1 );
1099 int iLate4 =
Gia_ManLatest( pPerm+nBits, 1<<nBits, iLate1, iLate2, iLate3 );
1103 for ( i = 0; i < (1<<nBits); i++ )
1104 printf(
"%d ", pPerm[nBits+i] );
1107 if ( pPerm[nBits+iLate1] > BaseValue && pPerm[nBits+iLate2] > BaseValue && pPerm[nBits+iLate3] > BaseValue && pPerm[nBits+iLate4] == BaseValue )
1109 if ( pPerm[nBits+iLate1] > BaseValue && pPerm[nBits+iLate2] > BaseValue && pPerm[nBits+iLate3] == BaseValue )
1111 if ( pPerm[nBits+iLate1] > BaseValue && pPerm[nBits+iLate2] == BaseValue )
1119 int i, iLit, nVars = nBits + (1 << nBits);
1122 pNew->
pName = Abc_UtilStrsav(
"mux_tree" );
1123 for ( i = 0; i < nVars; i++ )
1124 Gia_ManAppendCi( pNew );
1128 pPerm[nBits+1] = 100;
1129 pPerm[nBits+5] = 100;
1130 pPerm[nBits+4] = 100;
1133 Gia_ManAppendCo( pNew, iLit );
#define ABC_SWAP(Type, a, b)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
#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 ///.
int Gia_ManCube(Gia_Man_t *pNew, int Vars, int nVars, int *pLits)
int * Gia_ManGenPerm(int nBits)
int Gia_ManMultiCheck(int *pPerm, int nPerm)
void Gia_ManHashStart(Gia_Man_t *p)
int * Gia_ManGenZero(int nBits)
Gia_Man_t * Gia_ManMuxTreeTest(int nBits)
int Gia_ManEarliest(int *pPerm, int nVars)
int Gia_ManHashMuxReal(Gia_Man_t *p, int iLitC, int iLit1, int iLit0)
int Gia_ManHashLookup(Gia_Man_t *p, Gia_Obj_t *p0, Gia_Obj_t *p1)
int * Gia_ManGenPerm2(int nBits)
int Gia_ManHashDualMiter(Gia_Man_t *p, Vec_Int_t *vOuts)
int * Gia_ManCollectLiterals(int nVars)
int Gia_ManHashAndMulti(Gia_Man_t *p, Vec_Int_t *vLits)
int Gia_ManDecomp(Gia_Man_t *pNew, int *pTree, int nBits, int *pPerm)
int Gia_ManDecompOne(Gia_Man_t *pNew, int *pTree, int nBits, int *pPerm, int iLate)
void Gia_ManHashProfile(Gia_Man_t *p)
int Gia_ManDecompThree(Gia_Man_t *pNew, int *pTree, int nBits, int *pPerm, int iLate1, int iLate2, int iLate3)
int Gia_ManHashAndMulti2(Gia_Man_t *p, Vec_Int_t *vLits)
void Gia_ManHashAlloc(Gia_Man_t *p)
Gia_Man_t * Gia_ManRehash(Gia_Man_t *p, int fAddStrash)
void Gia_ManUsePerm(int *pTree, int nBits, int *pPerm)
int Gia_ManHashOr(Gia_Man_t *p, int iLit0, int iLit1)
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
int Gia_ManHashMux(Gia_Man_t *p, int iCtrl, int iData1, int iData0)
int Gia_ManDecompTwo(Gia_Man_t *pNew, int *pTree, int nBits, int *pPerm, int iLate1, int iLate2)
int Gia_ManFindCond(int *pLits, int nBits, int iLate1, int iLate2)
int Gia_ManLatest(int *pPerm, int nVars, int iPrev1, int iPrev2, int iPrev3)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
void Gia_ManHashResize(Gia_Man_t *p)
int Gia_ManHashAndTry(Gia_Man_t *p, int iLit0, int iLit1)
int Gia_ManHashXorReal(Gia_Man_t *p, int iLit0, int iLit1)
int Gia_ManHashLookupInt(Gia_Man_t *p, int iLit0, int iLit1)
void Gia_ManHashStop(Gia_Man_t *p)
int Gia_ManHashMaj(Gia_Man_t *p, int iData0, int iData1, int iData2)
int Gia_ManMuxTree_rec(Gia_Man_t *pNew, int *pCtrl, int nCtrl, int *pData)
int Gia_ManMultiInputPerm(Gia_Man_t *pNew, int *pVars, int nVars, int *pPerm, int fOr, int fXor)
Gia_Man_t * Gia_ManMultiInputTest(int nBits)
void Gia_ManStop(Gia_Man_t *p)
#define Gia_ManForEachAnd(p, pObj, i)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
struct Gia_Man_t_ Gia_Man_t
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.