66extern int Abc_ResubComputeFunction(
void ** ppDivs,
int nDivs,
int nWords,
int nLimit,
int nDivsMax,
int iChoice,
int fUseXor,
int fDebug,
int fVerbose,
int ** ppArray );
90 Vec_IntErase( &
p->vObjs );
91 Vec_WrdErase( &
p->vSims );
92 Vec_PtrErase( &
p->vpDivs );
93 Vec_IntErase( &
p->vDivs );
94 Vec_IntErase( &
p->vLevels );
95 Vec_IntErase( &
p->vRefs );
96 Vec_IntErase( &
p->vCopies );
97 Vec_IntErase( &
p->vTried );
104 p->nDivsMax = nDivsMax;
105 p->nLevelIncrease = nLevelIncrease;
106 p->fUseXor = fUseXor;
107 p->fUseZeroCost = fUseZeroCost;
109 p->fVerbose = fVerbose;
111 Vec_IntClear( &
p->vObjs );
112 Vec_IntPushArray( &
p->vObjs, pObjs, 2*nObjs );
120 for ( i = 1; i < nObjs; i++ )
122 if ( pObjs[2*i+0] == 0 && pObjs[2*i+1] == 0 )
124 else if ( pObjs[2*i+0] == pObjs[2*i+1] )
129 assert( nObjs == 1 +
p->nPis +
p->nNodes +
p->nPos );
130 p->iFirstPo = nObjs -
p->nPos;
131 Vec_WrdClear( &
p->vSims );
132 Vec_WrdGrow( &
p->vSims, 2*nObjs );
133 Vec_WrdPush( &
p->vSims, 0 );
134 Vec_WrdPush( &
p->vSims, 0 );
135 for ( i = 0; i <
p->nPis; i++ )
137 Vec_WrdPush( &
p->vSims, s_Truths6[i] );
138 Vec_WrdPush( &
p->vSims, ~s_Truths6[i] );
140 p->vSims.nSize = 2*
p->nObjs;
141 Vec_IntClear( &
p->vDivs );
142 Vec_IntClear( &
p->vLevels );
143 Vec_IntClear( &
p->vRefs );
144 Vec_IntClear( &
p->vCopies );
145 Vec_IntClear( &
p->vTried );
146 Vec_PtrClear( &
p->vpDivs );
147 Vec_IntGrow( &
p->vDivs, nObjs );
148 Vec_IntGrow( &
p->vLevels, nObjs );
149 Vec_IntGrow( &
p->vRefs, nObjs );
150 Vec_IntGrow( &
p->vCopies, nObjs );
151 Vec_IntGrow( &
p->vTried, nObjs );
152 Vec_PtrGrow( &
p->vpDivs, nObjs );
168 int i, * pObjs = Vec_IntArray( &
p->vObjs );
169 printf(
"PI = %d. PO = %d. Obj = %d.\n",
p->nPis,
p->nPos,
p->nObjs );
170 for ( i =
p->nPis + 1; i < p->iFirstPo; i++ )
171 printf(
"%2d = %c%2d & %c%2d;\n", i,
172 Abc_LitIsCompl(pObjs[2*i+0]) ?
'!' :
' ', Abc_Lit2Var(pObjs[2*i+0]),
173 Abc_LitIsCompl(pObjs[2*i+1]) ?
'!' :
' ', Abc_Lit2Var(pObjs[2*i+1]) );
174 for ( i =
p->iFirstPo; i < p->nObjs; i++ )
175 printf(
"%2d = %c%2d;\n", i,
176 Abc_LitIsCompl(pObjs[2*i+0]) ?
'!' :
' ', Abc_Lit2Var(pObjs[2*i+0]) );
181 int i, * pLevs, Level = 0;
182 Vec_IntClear( &
p->vLevels );
183 Vec_IntGrow( &
p->vLevels,
p->nObjs );
184 pLevs = Vec_IntArray( &
p->vLevels );
185 for ( i =
p->nPis + 1; i < p->iFirstPo; i++ )
186 pLevs[i] = 1 + Abc_MaxInt( pLevs[2*i+0]/2, pLevs[2*i+1]/2 );
187 for ( i =
p->iFirstPo; i < p->nObjs; i++ )
188 Level = Abc_MaxInt( Level, pLevs[i] = pLevs[2*i+0]/2 );
194 int * pObjs = Vec_IntArray( &
p->vObjs );
195 word * pSims = Vec_WrdArray( &
p->vSims );
196 for ( i =
p->nPis + 1; i < p->iFirstPo; i++ )
198 if ( pObjs[2*i+0] < pObjs[2*i+1] )
199 pSims[2*i+0] = pSims[pObjs[2*i+0]] & pSims[pObjs[2*i+1]];
200 else if ( pObjs[2*i+0] > pObjs[2*i+1] )
201 pSims[2*i+0] = pSims[pObjs[2*i+0]] ^ pSims[pObjs[2*i+1]];
203 pSims[2*i+1] = ~pSims[2*i+0];
205 for ( i =
p->iFirstPo; i < p->nObjs; i++ )
206 pSims[2*i+0] = pSims[pObjs[2*i+0]];
208 for ( i = iNode + 1; i <
p->iFirstPo; i++ )
210 if ( pObjs[2*i+0] < pObjs[2*i+1] )
211 pSims[2*i+0] = pSims[pObjs[2*i+0]] & pSims[pObjs[2*i+1]];
212 else if ( pObjs[2*i+0] < pObjs[2*i+1] )
213 pSims[2*i+0] = pSims[pObjs[2*i+0]] ^ pSims[pObjs[2*i+1]];
215 pSims[2*i+1] = ~pSims[2*i+0];
217 for ( i =
p->iFirstPo; i < p->nObjs; i++ )
218 Res |= pSims[2*i+0] ^ pSims[pObjs[2*i+0]];
226 if ( iNode <= p->nPis )
228 if ( --pRefs[Abc_Lit2Var(pObjs[2*iNode+0])] == 0 )
230 if ( --pRefs[Abc_Lit2Var(pObjs[2*iNode+1])] == 0 )
236 int i, * pRefs, * pObjs;
237 Vec_IntFill( &
p->vRefs,
p->nObjs, 0 );
238 pRefs = Vec_IntArray( &
p->vRefs );
239 pObjs = Vec_IntArray( &
p->vObjs );
240 assert( pObjs[2*iNode+0] != pObjs[2*iNode+1] );
241 for ( i =
p->nPis + 1; i < p->iFirstPo; i++ )
242 pRefs[Abc_Lit2Var(pObjs[2*i+0])]++,
243 pRefs[Abc_Lit2Var(pObjs[2*i+1])]++;
244 for ( i =
p->iFirstPo; i < p->nObjs; i++ )
245 pRefs[Abc_Lit2Var(pObjs[2*i+0])]++;
246 for ( i =
p->nPis + 1; i < p->iFirstPo; i++ )
249 for ( i = iNode + 1; i <
p->iFirstPo; i++ )
250 if ( !pRefs[Abc_Lit2Var(pObjs[2*i+0])] || !pRefs[Abc_Lit2Var(pObjs[2*i+1])] )
258 int i, iNodeLevel = 0;
259 int * pRefs = Vec_IntArray( &
p->vRefs );
261 p->Truth1 =
p->CareSet & Vec_WrdEntry(&
p->vSims, 2*iNode);
262 p->Truth0 =
p->CareSet &
~p->Truth1;
263 Vec_PtrClear( &
p->vpDivs );
264 Vec_PtrPush( &
p->vpDivs, &
p->Truth0 );
265 Vec_PtrPush( &
p->vpDivs, &
p->Truth1 );
266 Vec_IntClear( &
p->vDivs );
267 Vec_IntPushTwo( &
p->vDivs, -1, -1 );
268 for ( i = 1; i <=
p->nPis; i++ )
270 Vec_PtrPush( &
p->vpDivs, Vec_WrdEntryP(&
p->vSims, 2*i) );
271 Vec_IntPush( &
p->vDivs, i );
274 if (
p->nLevelIncrease >= 0 )
277 iNodeLevel = Vec_IntEntry(&
p->vLevels, iNode);
279 for ( i =
p->nPis + 1; i < p->iFirstPo; i++ )
281 if ( !pRefs[i] || (
p->nLevelIncrease >= 0 && Vec_IntEntry(&
p->vLevels, i) > iNodeLevel +
p->nLevelIncrease) )
283 Vec_PtrPush( &
p->vpDivs, Vec_WrdEntryP(&
p->vSims, 2*i) );
284 Vec_IntPush( &
p->vDivs, i );
286 assert( Vec_IntSize(&
p->vDivs) == Vec_PtrSize(&
p->vpDivs) );
287 return Vec_IntSize(&
p->vDivs);
303 int iLitMin = iRes0 < iRes1 ? Abc_LitNotCond(iRes0, Abc_LitIsCompl(iLit0)) : Abc_LitNotCond(iRes1, Abc_LitIsCompl(iLit1));
304 int iLitMax = iRes0 < iRes1 ? Abc_LitNotCond(iRes1, Abc_LitIsCompl(iLit1)) : Abc_LitNotCond(iRes0, Abc_LitIsCompl(iLit0));
305 int iLitRes = Vec_IntSize(vRes);
312 if ( iLitMin == Abc_LitNot(iLitMax) )
315 else if ( iLit0 > iLit1 )
320 return Abc_LitNot(iLitMax);
321 if ( iLitMin == Abc_LitNot(iLitMax) )
325 assert( iLitMin >= 2 && iLitMax >= 2 );
327 Vec_IntPushTwo( vRes, iLitMin, iLitMax );
328 else if ( iLit0 > iLit1 )
330 assert( !Abc_LitIsCompl(iLit0) );
331 assert( !Abc_LitIsCompl(iLit1) );
332 Vec_IntPushTwo( vRes, iLitMax, iLitMin );
339 if ( Vec_IntEntry(vCopies, iObj) >= 0 )
340 return Vec_IntEntry(vCopies, iObj);
344 int nVars = Vec_IntSize(vDivs);
345 int iLitRes = -1, iTopLit = Vec_IntEntryLast( vResub );
346 if ( Abc_Lit2Var(iTopLit) == 0 )
348 else if ( Abc_Lit2Var(iTopLit) < nVars )
349 iLitRes =
Gia_Rsb2ManInsert_rec( vRes, nPis, vObjs, -1, vResub, vDivs, vCopies, Vec_IntEntry(vDivs, Abc_Lit2Var(iTopLit)) );
353 int k, iLit, iLit0, iLit1;
355 if ( Abc_Lit2Var(iLit) < nVars )
356 Gia_Rsb2ManInsert_rec( vRes, nPis, vObjs, -1, vResub, vDivs, vCopies, Vec_IntEntry(vDivs, Abc_Lit2Var(iLit)) );
359 int iVar0 = Abc_Lit2Var(iLit0);
360 int iVar1 = Abc_Lit2Var(iLit1);
361 int iRes0 = iVar0 < nVars ? Vec_IntEntry(vCopies, Vec_IntEntry(vDivs, iVar0)) : Vec_IntEntry(vCopy, iVar0 - nVars);
362 int iRes1 = iVar1 < nVars ? Vec_IntEntry(vCopies, Vec_IntEntry(vDivs, iVar1)) : Vec_IntEntry(vCopy, iVar1 - nVars);
364 Vec_IntPush( vCopy, iLitRes );
366 Vec_IntFree( vCopy );
368 iLitRes = Abc_LitNotCond( iLitRes, Abc_LitIsCompl(iTopLit) );
369 Vec_IntWriteEntry( vCopies, iObj, iLitRes );
374 int iLit0 = Vec_IntEntry( vObjs, 2*iObj+0 );
375 int iLit1 = Vec_IntEntry( vObjs, 2*iObj+1 );
376 int iRes0 =
Gia_Rsb2ManInsert_rec( vRes, nPis, vObjs, iNode, vResub, vDivs, vCopies, Abc_Lit2Var(iLit0) );
377 int iRes1 =
Gia_Rsb2ManInsert_rec( vRes, nPis, vObjs, iNode, vResub, vDivs, vCopies, Abc_Lit2Var(iLit1) );
379 Vec_IntWriteEntry( vCopies, iObj, iLitRes );
385 int i, nObjs = Vec_IntSize(vObjs)/2, iFirstPo = nObjs - nPos;
386 Vec_Int_t * vRes = Vec_IntAlloc( Vec_IntSize(vObjs) );
389 Vec_IntFill( vCopies, Vec_IntSize(vObjs), -1 );
390 Vec_IntFill( vRes, 2*(nPis + 1), 0 );
391 for ( i = 0; i <= nPis; i++ )
392 Vec_IntWriteEntry( vCopies, i, 2*i );
393 for ( i = iFirstPo; i < nObjs; i++ )
394 Gia_Rsb2ManInsert_rec( vRes, nPis, vObjs, iNode, vResub, vDivs, vCopies, Abc_Lit2Var( Vec_IntEntry(vObjs, 2*i) ) );
395 for ( i = iFirstPo; i < nObjs; i++ )
397 int iLitNew = Abc_Lit2LitL( Vec_IntArray(vCopies), Vec_IntEntry(vObjs, 2*i) );
398 Vec_IntPushTwo( vRes, iLitNew, iLitNew );
419 for ( i = 0; i < nDivs; i++ )
421 printf(
"Div %2d : ", i );
429 for ( iNode = iLast - 1; iNode >= iFirst; iNode-- )
430 if ( Vec_IntFind(vTried, iNode) == -1 )
434int Abc_ResubComputeWindow(
int * pObjs,
int nObjs,
int nDivsMax,
int nLevelIncrease,
int fUseXor,
int fUseZeroCost,
int fDebug,
int fVerbose,
int ** ppArray,
int * pnResubs )
436 int iNode, nChanges = 0, RetValue = 0;
438 Gia_Rsb2ManStart(
p, pObjs, nObjs, nDivsMax, nLevelIncrease, fUseXor, fUseZeroCost, fDebug, fVerbose );
443 int * pResub, nResub =
Abc_ResubComputeFunction( Vec_PtrArray(&
p->vpDivs), nDivs, 1,
p->nMffc-1, nDivsMax, 0, fUseXor, fDebug, fVerbose, &pResub );
445 Vec_IntPush( &
p->vTried, iNode );
448 int i, k = 0, iTried;
449 Vec_Int_t vResub = { nResub, nResub, pResub };
453 p->nObjs = Vec_IntSize(vRes)/2;
454 p->iFirstPo =
p->nObjs -
p->nPos;
455 Vec_IntClear( &
p->vObjs );
456 Vec_IntAppend( &
p->vObjs, vRes );
459 if ( Vec_IntEntry(&
p->vCopies, iTried) > Abc_Var2Lit(
p->nPis, 0) )
460 Vec_IntWriteEntry( &
p->vTried, k++, Abc_Lit2Var(Vec_IntEntry(&
p->vCopies, iTried)) );
461 Vec_IntShrink( &
p->vTried, k );
469 *ppArray =
p->vObjs.pArray;
470 Vec_IntZero( &
p->vObjs );
474 *pnResubs = nChanges;
477int Abc_ResubComputeWindow2(
int * pObjs,
int nObjs,
int nDivsMax,
int nLevelIncrease,
int fUseXor,
int fUseZeroCost,
int fDebug,
int fVerbose,
int ** ppArray,
int * pnResubs )
480 memmove( *ppArray, pObjs, 2*nObjs *
sizeof(
int) );
500 int i, * pObjs =
ABC_CALLOC(
int, 2*Gia_ManObjNum(
p) );
504 if ( Gia_ObjIsCi(pObj) )
506 pObjs[2*i+0] = Gia_ObjFaninLit0(Gia_ManObj(
p, i), i);
507 if ( Gia_ObjIsCo(pObj) )
508 pObjs[2*i+1] = pObjs[2*i+0];
509 else if ( Gia_ObjIsAnd(pObj) )
510 pObjs[2*i+1] = Gia_ObjFaninLit1(Gia_ManObj(
p, i), i);
519 for ( i = 1; i < nObjs; i++ )
521 if ( pObjs[2*i] == 0 && i <= nIns )
522 Gia_ManAppendCi( pNew );
523 else if ( pObjs[2*i] == pObjs[2*i+1] )
524 Gia_ManAppendCo( pNew, pObjs[2*i] );
525 else if ( pObjs[2*i] < pObjs[2*i+1] )
526 Gia_ManAppendAnd( pNew, pObjs[2*i], pObjs[2*i+1] );
527 else if ( pObjs[2*i] > pObjs[2*i+1] )
528 Gia_ManAppendXor( pNew, pObjs[2*i], pObjs[2*i+1] );
545 pNew->
pName = Abc_UtilStrsav(
p->pName );
572 int k, i, f, Count = 0;
574 assert( Vec_WecSizeSize(vLevels) == 0 );
576 assert( !Gia_ObjIsTravIdCurrentId(
p, iPivot) );
578 Gia_ObjSetTravIdCurrentId(
p, iPivot );
579 Vec_WecPush( vLevels, Gia_ObjLevelId(
p, iPivot), iPivot );
584 assert( !Gia_ObjIsTravIdCurrentId(
p, iPivot2) );
586 Gia_ObjSetTravIdCurrentId(
p, iPivot2 );
587 Vec_WecPush( vLevels, Gia_ObjLevelId(
p, iPivot2), iPivot2 );
596 if ( Gia_ObjIsAnd(pFanout) &&
597 !Gia_ObjIsTravIdCurrent(
p, pFanout) &&
598 Gia_ObjIsTravIdCurrent(
p, Gia_ObjFanin0(pFanout)) &&
599 Gia_ObjIsTravIdCurrent(
p, Gia_ObjFanin1(pFanout)) )
602 Gia_ObjSetTravIdCurrent(
p, pFanout );
603 Vec_WecPush( vLevels, Gia_ObjLevel(
p, pFanout), Gia_ObjId(
p, pFanout) );
612 if ( vNodes == NULL )
613 Gia_ObjSetTravIdPrevious(
p, pObj );
615 Vec_IntPush( vNodes, Gia_ObjId(
p, pObj) );
617 Vec_IntClear( vLevel );
625 int i, Id, nMaxFan = -1, iMaxFan = -1;
627 if ( nMaxFan < Gia_ObjFanoutNumId(
p, Id) )
629 nMaxFan = Gia_ObjFanoutNumId(
p, Id);
638 int i, Id, nCurFan, nMaxFan = -1, iMaxFan = -1;
641 if ( Gia_ObjIsTravIdCurrentId(
p, Id ) )
644 if ( nMaxFan < nCurFan )
658 if ( !Gia_ObjIsTravIdCurrentId(
p, iFan) )
667 int i, iObj, Lit0, Lit1, Fan0, Fan1;
668 Vec_Int_t * vNodes = Vec_IntAlloc( 100 );
669 assert( Vec_IntSize(vMap) == Gia_ManObjNum(
p) );
670 Vec_IntPushTwo( vNodes, 0, 0 );
674 assert( Gia_ObjIsTravIdCurrentId(
p, iObj) );
675 Fan0 = Gia_ObjIsCi(pObj) ? 0 : Vec_IntEntry(vMap, Gia_ObjFaninId0(pObj, iObj));
676 Fan1 = Gia_ObjIsCi(pObj) ? 0 : Vec_IntEntry(vMap, Gia_ObjFaninId1(pObj, iObj));
677 Lit0 = Gia_ObjIsCi(pObj) ? 0 : Abc_LitNotCond( Fan0, Gia_ObjFaninC0(pObj) );
678 Lit1 = Gia_ObjIsCi(pObj) ? 0 : Abc_LitNotCond( Fan1, Gia_ObjFaninC1(pObj) );
679 Vec_IntWriteEntry( vMap, iObj, Vec_IntSize(vNodes) );
680 Vec_IntPushTwo( vNodes, Lit0, Lit1 );
684 Vec_IntPushTwo( vNodes, Vec_IntEntry(vMap, iObj), Vec_IntEntry(vMap, iObj) );
691 Vec_Int_t * vNodes = Vec_IntAlloc( 100 );
692 Vec_Int_t * vMap = Vec_IntStartFull( Gia_ManObjNum(
p) );
698 Gia_ObjSetTravIdCurrentId(
p, iMaxFan );
699 Vec_IntPush( vNodes, iMaxFan );
701 for ( i = 1; i < nPis; i++ )
706 Vec_IntSort( vNodes, 0 );
709 Vec_WecFree( vLevels );
712 Vec_IntFree( vNodes );
738static inline int Gia_ObjTravIsTopTwo(
Gia_Man_t *
p,
int iNodeA ) {
return (
p->pTravIds[iNodeA] >=
p->nTravIds - 1); }
739static inline int Gia_ObjTravIsSame(
Gia_Man_t *
p,
int iNodeA,
int iNodeB ) {
return (
p->pTravIds[iNodeA] ==
p->pTravIds[iNodeB]); }
740static inline void Gia_ObjTravSetSame(
Gia_Man_t *
p,
int iNodeA,
int iNodeB ) {
p->pTravIds[iNodeA] =
p->pTravIds[iNodeB]; }
748 Vec_IntPush( vVisited, iNode );
749 iPrev = Vec_IntEntry( vPaths, iNode );
752 assert( Gia_ObjTravIsSame(
p, iPrev, iNode) );
758 int i, n, iObj, iLimit = Vec_IntSize( vVisited );
759 *piMeet = *piNode = 0;
763 if ( !Gia_ObjIsAnd(pObj) )
765 for ( n = 0; n < 2; n++ )
767 int iFan = Gia_ObjFaninId( pObj, iObj, n );
769 if ( Gia_ObjTravIsTopTwo(
p, iObj) && Gia_ObjTravIsTopTwo(
p, iFan) && !Gia_ObjTravIsSame(
p, iObj, iFan) )
776 if ( Gia_ObjTravIsTopTwo(
p, iFan) )
778 assert( Gia_ObjTravIsSame(
p, iObj, iFan) );
782 Gia_ObjTravSetSame(
p, iFan, iObj );
783 Vec_IntWriteEntry( vPaths, iFan, iObj );
784 Vec_IntPush( vVisited, iFan );
791 Vec_Int_t * vVisited = Vec_IntAlloc( 100 );
793 int i, n, iStart = 0;
794 assert( Gia_ObjIsAnd(pPivot) );
796 for ( n = 0; n < 2; n++ )
798 int iFan = Gia_ObjFaninId( pPivot, iPivot, n );
800 Vec_IntPush( vVisited, iFan );
801 Vec_IntWriteEntry( vPaths, iFan, 0 );
802 Gia_ObjSetTravIdCurrentId(
p, iFan );
805 for ( i = 0; i < nIter; i++ )
807 int iMeet, iNode, iNext = Vec_IntSize(vVisited);
811 if ( Gia_ObjIsTravIdCurrentId(
p, iMeet) )
812 assert( Gia_ObjIsTravIdPreviousId(
p, iNode) );
813 else if ( Gia_ObjIsTravIdPreviousId(
p, iMeet) )
814 assert( Gia_ObjIsTravIdCurrentId(
p, iNode) );
817 Vec_IntClear( vVisited );
820 Vec_IntPush( vVisited, iPivot );
827 Vec_IntFreeP( &vVisited );
836 Gia_ObjSetTravIdCurrent(
p, pObj);
839 assert( Gia_ObjIsAnd(pObj) );
840 for ( n = 0; n < 2; n++ )
842 int iFan = n ? Gia_ObjFaninId1p(
p, pObj) : Gia_ObjFaninId0p(
p, pObj);
843 if ( !Gia_ObjIsTravIdCurrentId(
p, iFan) )
844 Vec_IntPushUnique( vInputs, iFan );
849 Gia_ObjSetTravIdCurrentId(
p, iObj );
850 Vec_IntPush( vWin, iObj );
872 assert( Vec_WecSizeSize(vLevels) == 0 );
876 assert( Gia_ObjIsTravIdCurrentId(
p, iObj) );
877 Vec_WecPush( vLevels, Gia_ObjLevelId(
p, iObj), iObj );
886 if ( Gia_ObjIsAnd(pFanout) &&
887 !Gia_ObjIsTravIdCurrent(
p, pFanout) &&
888 Gia_ObjIsTravIdCurrent(
p, Gia_ObjFanin0(pFanout)) &&
889 Gia_ObjIsTravIdCurrent(
p, Gia_ObjFanin1(pFanout)) )
892 Gia_ObjSetTravIdCurrent(
p, pFanout );
893 Vec_WecPush( vLevels, Gia_ObjLevel(
p, pFanout), Gia_ObjId(
p, pFanout) );
894 Vec_IntPush( vWin, Gia_ObjId(
p, pFanout) );
899 Vec_IntClear( vLevel );
905 int i, n, iFans[2], fChange = 1;
911 if ( !Gia_ObjIsAnd(pObj) )
913 iFans[0] = Gia_ObjFaninId0p(
p, pObj);
914 iFans[1] = Gia_ObjFaninId1p(
p, pObj);
915 if ( !Gia_ObjIsTravIdCurrentId(
p, iFans[0]) && !Gia_ObjIsTravIdCurrentId(
p, iFans[1]) )
917 Vec_IntRemove( vInputs, Gia_ObjId(
p, pObj) );
918 assert( Vec_IntFind(vWin, Gia_ObjId(
p, pObj)) >= 0 );
919 for ( n = 0; n < 2; n++ )
921 if ( Gia_ObjIsTravIdCurrentId(
p, iFans[n]) )
923 assert( Vec_IntFind(vInputs, iFans[n]) == -1 );
924 Vec_IntPush( vInputs, iFans[n] );
926 assert( Gia_ObjIsTravIdCurrentId(
p, iFans[n]) );
935 int i, iNode = 0, WeightThis, WeightBest = -1;
938 if ( Gia_ObjIsAnd(pObj) )
940 int iFan0 = Gia_ObjFaninId0p(
p, pObj);
941 int iFan1 = Gia_ObjFaninId1p(
p, pObj);
942 assert( !Gia_ObjIsTravIdCurrentId(
p, iFan0) && !Gia_ObjIsTravIdCurrentId(
p, iFan1) );
944 if ( WeightBest < WeightThis )
946 WeightBest = WeightThis;
947 iNode = Gia_ObjId(
p, pObj);
960 int iFan0 = Gia_ObjFaninId0p(
p, Gia_ManObj(
p, iNode));
961 int iFan1 = Gia_ObjFaninId1p(
p, Gia_ManObj(
p, iNode));
962 assert( !Gia_ObjIsTravIdCurrentId(
p, iFan0) && !Gia_ObjIsTravIdCurrentId(
p, iFan1) );
964 assert( Gia_ObjIsTravIdCurrentId(
p, iFan0) && Gia_ObjIsTravIdCurrentId(
p, iFan1) );
965 Vec_IntRemove( vIns, iNode );
966 Vec_IntPushTwo( vIns, iFan0, iFan1 );
985 if ( Gia_ObjIsTravIdCurrentId(
p, iObj) )
987 Gia_ObjSetTravIdCurrentId(
p, iObj);
988 pObj = Gia_ManObj(
p, iObj );
989 assert( Gia_ObjIsAnd(pObj) );
992 Vec_IntPush( vWin, iObj );
999 int k, i, f, iObj, Level;
1000 Vec_Int_t * vUsed = Vec_IntAlloc( 100 );
1002 assert( Vec_WecSizeSize(vLevels) == 0 );
1004 Vec_IntClear( vWin );
1009 Gia_ObjSetTravIdCurrentId(
p, iObj );
1010 Vec_IntPush( vWin, iObj );
1017 Vec_WecPush( vLevels, Gia_ObjLevelId(
p, iObj), iObj );
1018 Vec_IntPushUniqueOrder( vUsed, Gia_ObjLevelId(
p, iObj) );
1024 vLevel = Vec_WecEntry( vLevels, Level );
1030 if ( Gia_ObjIsAnd(pFanout) &&
1031 !Gia_ObjIsTravIdCurrent(
p, pFanout) &&
1032 Gia_ObjIsTravIdCurrent(
p, Gia_ObjFanin0(pFanout)) &&
1033 Gia_ObjIsTravIdCurrent(
p, Gia_ObjFanin1(pFanout)) )
1036 Gia_ObjSetTravIdCurrent(
p, pFanout );
1037 Vec_WecPush( vLevels, Gia_ObjLevel(
p, pFanout), Gia_ObjId(
p, pFanout) );
1038 Vec_IntPush( vWin, Gia_ObjId(
p, pFanout) );
1039 Vec_IntPushUniqueOrder( vUsed, Gia_ObjLevel(
p, pFanout) );
1042 Vec_IntClear( vLevel );
1044 Vec_IntSort( vWin, 0 );
1045 Vec_IntFree( vUsed );
1050 int fOnlyPis = 0, fChange = 1, nSize = Vec_IntSize(vIns);
1054 int i, iFan0, iFan1, fHave0, fHave1;
1060 assert( Gia_ObjIsTravIdCurrent(
p, pObj) );
1061 if ( !Gia_ObjIsAnd(pObj) )
1064 iFan0 = Gia_ObjFaninId0p(
p, pObj);
1065 iFan1 = Gia_ObjFaninId1p(
p, pObj);
1066 fHave0 = Gia_ObjIsTravIdCurrentId(
p, iFan0);
1067 fHave1 = Gia_ObjIsTravIdCurrentId(
p, iFan1);
1068 if ( !fHave0 && !fHave1 )
1072 Vec_IntDrop( vIns, i );
1076 Vec_IntPush( vIns, iFan0 );
1077 Gia_ObjSetTravIdCurrentId(
p, iFan0 );
1081 Vec_IntPush( vIns, iFan1 );
1082 Gia_ObjSetTravIdCurrentId(
p, iFan1 );
1088 assert( Vec_IntSize(vIns) <= nSize );
1094 for ( i = 0; i < nFanins; i++ )
1095 if ( pFanins[i] == iFan )
1099 return nFanins + (i == nFanins);
1104 int nFanins = 0, pFanins[64] = {0}, pFaninCounts[64] = {0};
1105 int i, iFan0, iFan1, iFanMax = -1, CountMax = 0;
1108 if ( !Gia_ObjIsAnd(pObj) )
1110 iFan0 = Gia_ObjFaninId0p(
p, pObj);
1111 iFan1 = Gia_ObjFaninId1p(
p, pObj);
1112 assert( !Gia_ObjIsTravIdCurrentId(
p, iFan0) );
1113 assert( !Gia_ObjIsTravIdCurrentId(
p, iFan1) );
1119 if (
p->vFanoutNums != NULL )
1121 for ( i = 0; i < nFanins; i++ )
1122 if ( CountMax < pFaninCounts[i] || (CountMax == pFaninCounts[i] && (Gia_ObjFanoutNumId(
p, iFanMax) < Gia_ObjFanoutNumId(
p, pFanins[i]))) )
1124 CountMax = pFaninCounts[i];
1125 iFanMax = pFanins[i];
1130 for ( i = 0; i < nFanins; i++ )
1131 if ( CountMax < pFaninCounts[i] || (CountMax == pFaninCounts[i] && (Gia_ObjRefNumId(
p, iFanMax) < Gia_ObjRefNumId(
p, pFanins[i]))) )
1133 CountMax = pFaninCounts[i];
1134 iFanMax = pFanins[i];
1143 Vec_IntClear( vWin );
1148 Vec_Int_t * vBest = Vec_IntSize(vIns) <= nInputsMax ? Vec_IntDup(vIns) : NULL;
1149 int fOnlyPis = 0, Iter = 0;
1153 while ( !fOnlyPis && (Vec_IntSize(vIns) <= nInputsMax || Iter < 5) )
1156 Vec_IntPush( vIns, iFanBest );
1157 Gia_ObjSetTravIdCurrentId(
p, iFanBest );
1159 if ( Vec_IntSize(vIns) > nInputsMax )
1163 if ( Vec_IntSize(vIns) <= nInputsMax && (!vBest || Vec_IntSize(vBest) <= Vec_IntSize(vIns)) )
1166 Vec_IntClear(vBest);
1168 vBest = Vec_IntAlloc( 10 );
1169 Vec_IntAppend( vBest, vIns );
1174 Vec_IntClear( vIns );
1175 Vec_IntAppend( vIns, vBest );
1176 Vec_IntFree( vBest );
1179 assert( Vec_IntSize(vIns) > nInputsMax );
1181 if ( vLevels && Vec_IntSize(vIns) <= nInputsMax )
1183 Vec_IntSort( vIns, 0 );
1202 *pvWin = *pvIns = NULL;
1210 if ( Vec_IntSize(vIns) <= nInputsMax + 3 )
1212 if ( Vec_IntSize(vIns) <= nInputsMax )
1214 Vec_IntSort( vWin, 0 );
1215 Vec_IntSort( vIns, 0 );
1222 Vec_IntFree( vWin );
1223 Vec_IntFree( vIns );
1241 Vec_Int_t * vOuts = Vec_IntAlloc( 100 );
1245 Gia_ObjSetTravIdCurrent(
p, pObj );
1247 if ( !Gia_ObjIsTravIdCurrent(
p, pObj) && Gia_ObjIsAnd(pObj) )
1249 Vec_IntAddToEntry( vRefs, Gia_ObjFaninId0p(
p, pObj), 1 );
1250 Vec_IntAddToEntry( vRefs, Gia_ObjFaninId1p(
p, pObj), 1 );
1253 if ( !Gia_ObjIsTravIdCurrent(
p, pObj) && Gia_ObjFanoutNum(
p, pObj) != Vec_IntEntry(vRefs, Gia_ObjId(
p, pObj)) )
1254 Vec_IntPush( vOuts, Gia_ObjId(
p, pObj) );
1256 if ( !Gia_ObjIsTravIdCurrent(
p, pObj) && Gia_ObjIsAnd(pObj) )
1258 Vec_IntAddToEntry( vRefs, Gia_ObjFaninId0p(
p, pObj), -1 );
1259 Vec_IntAddToEntry( vRefs, Gia_ObjFaninId1p(
p, pObj), -1 );
1270 pNew->
pName = Abc_UtilStrsav(
p->pName );
1271 pNew->
pSpec = Abc_UtilStrsav(
p->pSpec );
1274 Gia_ManConst0(
p)->Value = 0;
1276 pObj->
Value = Gia_ManAppendCi( pNew );
1278 if ( !~pObj->
Value )
1281 Gia_ManAppendCo( pNew, pObj->
Value );
1299 word Truth0, Truth1;
1300 if ( Gia_ObjIsCi(pObj) )
1301 return s_Truths6[Gia_ObjCioId(pObj)];
1302 if ( Gia_ObjIsConst0(pObj) )
1304 assert( Gia_ObjIsAnd(pObj) );
1307 if ( Gia_ObjFaninC0(pObj) )
1309 if ( Gia_ObjFaninC1(pObj) )
1311 return Truth0 & Truth1;
1316 assert( Gia_ManCoNum(p1) == Gia_ManCoNum(p2) );
1317 for ( i = 0; i < Gia_ManCoNum(p1); i++ )
1323 if ( Gia_ObjFaninC0(pPo1) )
1325 if ( Gia_ObjFaninC0(pPo2) )
1327 if ( word1 != word2 )
1331 printf(
"Verification failed for output %d (out of %d).\n", i, Gia_ManCoNum(p1) );
1357 int i, nWins = 0, nWinSize = 0, nInsSize = 0, nOutSize = 0, nNodeGain = 0;
1359 Vec_Int_t * vPaths = Vec_IntStart( Gia_ManObjNum(
p) );
1360 Vec_Int_t * vRefs = Vec_IntStart( Gia_ManObjNum(
p) );
1373 nWinSize += Vec_IntSize(vWin);
1374 nInsSize += Vec_IntSize(vIns);
1375 nOutSize += Vec_IntSize(vOuts);
1380 printf(
"\n\nObj %d\n", i );
1381 Vec_IntPrint( vWin );
1382 Vec_IntPrint( vIns );
1383 Vec_IntPrint( vOuts );
1386 else if ( Vec_IntSize(vWin) > 1000 )
1387 printf(
"Obj %d. Window: Ins = %d. Ands = %d. Outs = %d.\n",
1388 i, Vec_IntSize(vIns), Vec_IntSize(vWin)-Vec_IntSize(vIns), Vec_IntSize(vOuts) );
1392 int nEntries = Hsh_VecSize(pHash);
1393 Hsh_VecManAdd( pHash, vWin );
1394 if ( nEntries == Hsh_VecSize(pHash) )
1396 Vec_IntFree( vWin );
1397 Vec_IntFree( vIns );
1398 Vec_IntFree( vOuts );
1413 nNodeGain += Gia_ManAndNum(pIn) - Gia_ManAndNum(pOut);
1417 Vec_IntFree( vWin );
1418 Vec_IntFree( vIns );
1419 Vec_IntFree( vOuts );
1422 Vec_WecFree( vLevels );
1423 Vec_IntFree( vPaths );
1424 Vec_IntFree( vRefs );
1425 printf(
"Computed windows for %d nodes (out of %d). Unique = %d. Ave inputs = %.2f. Ave outputs = %.2f. Ave volume = %.2f. Gain = %d. ",
1426 nWins, Gia_ManAndNum(
p), Hsh_VecSize(pHash), 1.0*nInsSize/Abc_MaxInt(1,nWins),
1427 1.0*nOutSize/Abc_MaxInt(1,nWins), 1.0*nWinSize/Abc_MaxInt(1,nWins), nNodeGain );
1428 Abc_PrintTime( 1,
"Time", Abc_Clock() - clk );
1429 Hsh_VecManStop( pHash );
1462 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 3, 7, 15, 17, 8, 19,
1463 5, 20, 5, 12, 8, 24, 4, 12, 9, 28, 27, 31, 23, 32, 4, 13, 8, 36, 5,
1464 13, 18, 40, 9, 18, 5, 44, 19, 36, 9, 48, 47, 51, 10, 18, 40, 54, 8,
1465 56, 25, 37, 44, 61, 59, 63, 8, 28, 8, 18, 25, 68, 66, 70, 64, 73, 11,
1466 19, 8, 13, 76, 78, 10, 19, 40, 82, 9, 84, 81, 87, 20, 61, 19, 28, 30,
1467 92, 91, 95, 88, 96, 74, 98, 9, 40, 49, 103, 27, 104, 10, 107, 8, 40,
1468 9, 24, 111, 113, 11, 115, 109, 117, 11, 66, 51, 121, 118, 122, 18, 36,
1469 18, 110, 93, 127, 10, 131, 129, 133, 11, 38, 32, 137, 103, 138, 19, 141,
1470 134, 143, 28, 76, 9, 146, 11, 110, 19, 150, 149, 153, 87, 95, 9, 19, 10,
1471 159, 61, 160, 18, 30, 61, 158, 9, 12, 25, 169, 19, 171, 111, 173, 10, 175,
1472 167, 177, 18, 102, 4, 20, 18, 171, 183, 185, 11, 187, 181, 189, 178, 190,
1473 24, 44, 11, 194, 8, 54, 4, 198, 197, 201, 45, 49, 10, 39, 9, 126, 73, 209,
1474 11, 211, 54, 168, 213, 215, 43, 167, 67, 218, 10, 221, 26, 54, 18, 18, 34,
1475 34, 38, 38, 40, 40, 42, 42, 52, 52, 100, 100, 124, 124, 126, 126, 144, 144,
1476 148, 148, 154, 154, 156, 156, 162, 162, 164, 164, 192, 192, 70, 70, 202,
1477 202, 204, 204, 206, 206, 216, 216, 222, 222, 224, 224
1479 int i, iFan0, iFan1, nResubs;
1482 Vec_Int_t * vArray = Vec_IntAlloc( 100 );
1483 for ( i = 0; i < 50 || Array[i] > 0; i++ )
1484 Vec_IntPush( vArray, Array[i] );
1485 Vec_IntPrint( vArray );
1487 printf(
"Constant0 and primary inputs:\n" );
1490 if ( iFan0 != iFan1 )
1492 printf(
"%2d = %c%2d & %c%2d;\n", i,
1493 Abc_LitIsCompl(iFan0) ?
'!' :
' ', Abc_Lit2Var(iFan0),
1494 Abc_LitIsCompl(iFan1) ?
'!' :
' ', Abc_Lit2Var(iFan1) );
1496 printf(
"Primary outputs:\n" );
1499 if ( iFan0 != iFan1 )
1501 printf(
"%2d = %c%2d & %c%2d;\n", i,
1502 Abc_LitIsCompl(iFan0) ?
'!' :
' ', Abc_Lit2Var(iFan0),
1503 Abc_LitIsCompl(iFan1) ?
'!' :
' ', Abc_Lit2Var(iFan1) );
1507 Abc_ResubComputeWindow( Vec_IntArray(vArray), Vec_IntSize(vArray)/2, 10, -1, 0, 0, 1, 1, &pRes, &nResubs );
1509 Vec_IntFree( vArray );
1525 int c, nLevelMax = 8;
1527 Vec_Wec_t * vCuts = Vec_WecStart( nCuts );
1528 Vec_Int_t * vPaths = Vec_IntStart( Gia_ManObjNum(
p) );
1529 srand( time(NULL) );
1530 for ( c = 0; c < nCuts; )
1533 while ( vWin == NULL )
1535 int iPivot = 1 + Gia_ManCiNum(
p) + rand() % Gia_ManAndNum(
p);
1536 assert( Gia_ObjIsAnd(Gia_ManObj(
p, iPivot)) );
1540 if ( Vec_IntSize(vCut) >= nCutSize - 2 && Vec_IntSize(vCut) <= nCutSize )
1542 Vec_IntPush( Vec_WecEntry(vCuts, c), Vec_IntSize(vCut) );
1543 Vec_IntAppend( Vec_WecEntry(vCuts, c++), vCut );
1545 Vec_IntFree( vCut );
1546 Vec_IntFree( vWin );
1548 Vec_IntFree( vPaths );
1549 Abc_PrintTime( 0,
"Computing cuts ", Abc_Clock() - clk );
#define ABC_SWAP(Type, a, b)
#define ABC_ALLOC(type, num)
#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 ///.
void Dau_DsdPrintFromTruth(word *pTruth, int nVarsInit)
Gia_Man_t * Gia_ManResub2Test(Gia_Man_t *p)
void Gia_WinCreateFromCut(Gia_Man_t *p, int iPivot, Vec_Int_t *vIn, Vec_Wec_t *vLevels, Vec_Int_t *vWin)
int Gia_ManVerifyTwoTruths(Gia_Man_t *p1, Gia_Man_t *p2)
void Gia_Rsb2ManFree(Gia_Rsb2Man_t *p)
void Abc_ResubPrintDivs(void **ppDivs, int nDivs)
int Gia_Rsb2ManLevel(Gia_Rsb2Man_t *p)
void Abc_ResubPrepareManager(int nWords)
void Gia_RsbWindowGrow(Gia_Man_t *p, Vec_Wec_t *vLevels, Vec_Int_t *vWin, Vec_Int_t *vIns, int nInputsMax)
int Gia_RsbSelectOneInput(Gia_Man_t *p, Vec_Wec_t *vLevels, Vec_Int_t *vIns)
int Gia_Rsb2ManMffc(Gia_Rsb2Man_t *p, int iNode)
void Gia_RsbAddSideInputs(Gia_Man_t *p, Vec_Wec_t *vLevels, Vec_Int_t *vWin)
int Gia_WinNodeHasUnmarkedFanouts(Gia_Man_t *p, int iPivot)
void Gia_Rsb2ManStart(Gia_Rsb2Man_t *p, int *pObjs, int nObjs, int nDivsMax, int nLevelIncrease, int fUseXor, int fUseZeroCost, int fDebug, int fVerbose)
int Abc_ResubNodeToTry(Vec_Int_t *vTried, int iFirst, int iLast)
int Gia_RsbWindowCompute(Gia_Man_t *p, int iObj, int nInputsMax, int nLevelsMax, Vec_Wec_t *vLevels, Vec_Int_t *vPaths, Vec_Int_t **pvWin, Vec_Int_t **pvIns)
int Gia_Rsb2ManInsert_rec(Vec_Int_t *vRes, int nPis, Vec_Int_t *vObjs, int iNode, Vec_Int_t *vResub, Vec_Int_t *vDivs, Vec_Int_t *vCopies, int iObj)
Vec_Int_t * Gia_RsbFindOutputs(Gia_Man_t *p, Vec_Int_t *vWin, Vec_Int_t *vIns, Vec_Int_t *vRefs)
int Gia_Rsb2ManDivs(Gia_Rsb2Man_t *p, int iNode)
int Gia_Rsb2AddNode(Vec_Int_t *vRes, int iLit0, int iLit1, int iRes0, int iRes1)
word Gia_Rsb2ManOdcs(Gia_Rsb2Man_t *p, int iNode)
int Gia_RsbWindowExplore(Gia_Man_t *p, Vec_Int_t *vVisited, int iStart, Vec_Int_t *vPaths, int *piMeet, int *piNode)
Gia_Rsb2Man_t * Gia_Rsb2ManAlloc()
FUNCTION DEFINITIONS ///.
int Gia_Rsb2ManDeref_rec(Gia_Rsb2Man_t *p, int *pObjs, int *pRefs, int iNode)
void Gia_RsbCiWindowTest(Gia_Man_t *p)
Vec_Int_t * Gia_RsbCiTranslate(Gia_Man_t *p, Vec_Int_t *vObjs, Vec_Int_t *vMap)
word Gia_LutComputeTruth66_rec(Gia_Man_t *p, Gia_Obj_t *pObj)
Vec_Int_t * Gia_RsbCreateWindowInputs(Gia_Man_t *p, Vec_Int_t *vWin)
int Abc_ResubComputeWindow(int *pObjs, int nObjs, int nDivsMax, int nLevelIncrease, int fUseXor, int fUseZeroCost, int fDebug, int fVerbose, int **ppArray, int *pnResubs)
void Gia_RsbWindowGrow2(Gia_Man_t *p, int iObj, Vec_Wec_t *vLevels, Vec_Int_t *vWin, Vec_Int_t *vIns, int nInputsMax)
void Gia_RsbEnumerateWindows(Gia_Man_t *p, int nInputsMax, int nLevelsMax)
int Gia_RsbFindFaninAdd(int iFan, int pFanins[32], int pFaninCounts[32], int nFanins)
int Gia_WinAddCiWithMaxFanouts(Gia_Man_t *p)
void Gia_Rsb2ManPrint(Gia_Rsb2Man_t *p)
void Gia_RsbExpandInputs(Gia_Man_t *p, Vec_Wec_t *vLevels, Vec_Int_t *vWin, Vec_Int_t *vInputs)
Gia_Man_t * Gia_RsbTryOneWindow(Gia_Man_t *p)
Vec_Int_t * Gia_RsbWindowInit(Gia_Man_t *p, Vec_Int_t *vPaths, int iPivot, int nIter)
void Gia_WinCreateFromCut_rec(Gia_Man_t *p, int iObj, Vec_Int_t *vWin)
Gia_Man_t * Gia_RsbDeriveGiaFromWindows(Gia_Man_t *p, Vec_Int_t *vWin, Vec_Int_t *vIns, Vec_Int_t *vOuts)
Vec_Int_t * Gia_Rsb2ManInsert(int nPis, int nPos, Vec_Int_t *vObjs, int iNode, Vec_Int_t *vResub, Vec_Int_t *vDivs, Vec_Int_t *vCopies)
int Gia_WinTryAddingNode(Gia_Man_t *p, int iPivot, int iPivot2, Vec_Wec_t *vLevels, Vec_Int_t *vNodes)
int * Gia_ManToResub(Gia_Man_t *p)
typedefABC_NAMESPACE_IMPL_START struct Gia_Rsb2Man_t_ Gia_Rsb2Man_t
DECLARATIONS ///.
Vec_Wec_t * Gia_ManExtractCuts2(Gia_Man_t *p, int nCutSize, int nCuts, int fVerbose)
void Gia_RsbWindowGather(Gia_Man_t *p, Vec_Int_t *vPaths, int iNode, Vec_Int_t *vVisited)
int Abc_ResubComputeFunction(void **ppDivs, int nDivs, int nWords, int nLimit, int nDivsMax, int iChoice, int fUseXor, int fDebug, int fVerbose, int **ppArray)
Gia_Man_t * Gia_ManFromResub(int *pObjs, int nObjs, int nIns)
int Gia_WinAddCiWithMaxDivisors(Gia_Man_t *p, Vec_Wec_t *vLevels)
int Abc_ResubComputeWindow2(int *pObjs, int nObjs, int nDivsMax, int nLevelIncrease, int fUseXor, int fUseZeroCost, int fDebug, int fVerbose, int **ppArray, int *pnResubs)
int Gia_RsbFindFaninToAddToCut(Gia_Man_t *p, Vec_Int_t *vIns)
Vec_Int_t * Gia_RsbCiWindow(Gia_Man_t *p, int nPis)
int Gia_RsbExpandCut(Gia_Man_t *p, Vec_Int_t *vIns)
#define Gia_ObjForEachFanoutStatic(p, pObj, pFanout, i)
void Gia_ManStop(Gia_Man_t *p)
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
void Gia_ManStaticFanoutStart(Gia_Man_t *p)
void Gia_ManStaticFanoutStop(Gia_Man_t *p)
int Gia_ManIsNormalized(Gia_Man_t *p)
#define Gia_ManForEachAnd(p, pObj, i)
void Gia_ManHashAlloc(Gia_Man_t *p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
void Gia_ManPrint(Gia_Man_t *p)
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)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
void Gia_ManIncrementTravId(Gia_Man_t *p)
#define Gia_ObjForEachFanoutStaticId(p, Id, FanId, i)
void Gia_ManHashStop(Gia_Man_t *p)
int Gia_ManLevelNum(Gia_Man_t *p)
#define Gia_ManForEachCiId(p, Id, i)
unsigned __int64 word
DECLARATIONS ///.
struct Hsh_VecMan_t_ Hsh_VecMan_t
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
#define Vec_IntForEachEntryStop(vVec, Entry, i, Stop)
#define Vec_IntForEachEntryStartStop(vVec, Entry, i, Start, Stop)
#define Vec_IntForEachEntryDoubleStart(vVec, Entry1, Entry2, i, Start)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Wrd_t_ Vec_Wrd_t
INCLUDES ///.