44#define ABC_RS_DIV1_MAX 150
45#define ABC_RS_DIV2_MAX 500
110static Abc_ManRes_t* Abc_ManResubStart(
int nLeavesMax,
int nDivsMax );
121static void Abc_ManResubDivsS(
Abc_ManRes_t *
p,
int Required );
122static void Abc_ManResubDivsD(
Abc_ManRes_t *
p,
int Required );
179 int i, nNodes, nGain, fCompl;
182 abctime clk, clkStart = Abc_Clock();
183 assert( Abc_NtkIsStrash(pNtk) );
186 if ( pManRwr == NULL )
191 pManCut = Abc_NtkStartCutManForRewrite( pNtk );
198 pManRwr->
nNodesBeg = Abc_NtkNodeNum(pNtk);
199 nNodes = Abc_NtkObjNumMax(pNtk);
202 if ( pGain_rw ) *pGain_rw = Vec_IntAlloc(1);
205 fpt = fopen(
"rewrite_id_nGain.csv",
"w");
209 Extra_ProgressBarUpdate( pProgress, i, NULL );
212 if ( Abc_NodeIsPersistant(pNode) )
214 Vec_IntPush( (*pGain_rw), -99);
215 fprintf(fpt,
"%d, %d\n", pNode->
Id, -99);
218 if ( Abc_ObjFanoutNum(pNode) > 1000 )
220 fprintf(fpt,
"%d, %d\n", pNode->
Id, -99);
221 Vec_IntPush( (*pGain_rw), -99);
224 nGain =
Rwr_NodeRewrite( pManRwr, pManCut, pNode, fUpdateLevel, fUseZeros, fPlaceEnable );
226 fprintf(fpt,
"%d, %d\n", pNode->
Id, nGain);
227 Vec_IntPush( (*pGain_rw), nGain);
231 if ( !(nGain > 0 || (nGain == 0 && fUseZeros)) ){
241 if ( fCompl ) Dec_GraphComplement( pGraph );
245 if ( fCompl ) Dec_GraphComplement( pGraph );
248 printf(
"size of vector: %d\n", (**pGain_rw).nSize);
252 pManRwr->
nNodesEnd = Abc_NtkNodeNum(pNtk);
270 printf(
"Abc_NtkRewrite3: The network check has failed.\n" );
273 printf(
"Abc_NtkRewrite3: success : %d; fail : %d\n", success,
fail );
291 pParams->
nIdsMax = Abc_NtkObjNumMax( pNtk );
293 if ( pParams->
fDrop )
296 if ( Abc_ObjFanoutNum(pObj) > 0 )
307 word * pTruth0, * pTruth1, * pTruth = NULL;
308 int i, k,
nWords = Abc_Truth6WordNum( Vec_PtrSize(vLeaves) );
312 for ( i = Vec_PtrSize(vFuncs); i < Vec_PtrSize(vVisited); i++ )
316 assert( !Abc_ObjIsPi(pNode) );
317 pTruth0 = (
word *)Abc_ObjFanin0(pNode)->pCopy;
318 pTruth1 = (
word *)Abc_ObjFanin1(pNode)->pCopy;
319 pTruth = (
word *)Vec_PtrEntry( vFuncs, i );
320 if ( Abc_ObjFaninC0(pNode) )
322 if ( Abc_ObjFaninC1(pNode) )
323 for ( k = 0; k <
nWords; k++ )
324 pTruth[k] = ~pTruth0[k] & ~pTruth1[k];
326 for ( k = 0; k <
nWords; k++ )
327 pTruth[k] = ~pTruth0[k] & pTruth1[k];
331 if ( Abc_ObjFaninC1(pNode) )
332 for ( k = 0; k <
nWords; k++ )
333 pTruth[k] = pTruth0[k] & ~pTruth1[k];
335 for ( k = 0; k <
nWords; k++ )
336 pTruth[k] = pTruth0[k] & pTruth1[k];
344 int k,
nWords = Abc_Truth6WordNum( nVars );
345 for ( k = 0; k <
nWords; k++ )
352 int k,
nWords = Abc_Truth6WordNum( nVars );
353 for ( k = 0; k <
nWords; k++ )
364 int fVeryVerbose = 0;
365 int nVars = Vec_PtrSize(vFanins);
366 int nWordsMax = Abc_Truth6WordNum(
p->nNodeSizeMax);
371 int i, nNodesSaved, nNodesAdded, Required;
373 p->nNodesConsidered++;
378p->timeTru += Abc_Clock() - clk;
379 if ( pTruth == NULL )
384 p->nNodesGained +=
p->nLastGain;
385 p->nNodesRefactored++;
390p->timeFact += Abc_Clock() - clk;
393 Abc_NtkIncrementTravId( pNode->
pNtk );
398 Dec_GraphNode(pFForm, i)->pFunc = pFanin;
402p->timeEval += Abc_Clock() - clk;
403 if ( nNodesAdded == -1 || (nNodesAdded == nNodesSaved && !fUseZeros) )
405 Dec_GraphFree( pFForm );
409 p->nLastGain = nNodesSaved - nNodesAdded;
410 p->nNodesGained +=
p->nLastGain;
411 p->nNodesRefactored++;
416 printf(
"Cone = %2d. ", vFanins->nSize );
417 printf(
"FF = %2d. ", 1 + Dec_GraphNodeNum(pFForm) );
418 printf(
"MFFC = %2d. ", nNodesSaved );
419 printf(
"Add = %2d. ", nNodesAdded );
420 printf(
"GAIN = %2d. ",
p->nLastGain );
433 p->vCube = Vec_StrAlloc( 100 );
434 p->vVisited = Vec_PtrAlloc( 100 );
435 p->nNodeSizeMax = nNodeSizeMax;
436 p->nConeSizeMax = nConeSizeMax;
437 p->fVerbose = fVerbose;
438 p->vVars = Vec_PtrAllocTruthTables( Abc_MaxInt(nNodeSizeMax, 6) );
439 p->vFuncs = Vec_PtrAlloc( 100 );
440 p->vMemory = Vec_IntAlloc( 1 << 16 );
446 Vec_PtrFreeFree(
p->vFuncs );
447 Vec_PtrFree(
p->vVars );
448 Vec_IntFree(
p->vMemory );
449 Vec_PtrFree(
p->vVisited );
450 Vec_StrFree(
p->vCube );
456 printf(
"Refactoring statistics:\n" );
457 printf(
"Nodes considered = %8d.\n",
p->nNodesConsidered );
458 printf(
"Nodes refactored = %8d.\n",
p->nNodesRefactored );
459 printf(
"Gain = %8d. (%6.2f %%).\n",
p->nNodesBeg-
p->nNodesEnd, 100.0*(
p->nNodesBeg-
p->nNodesEnd)/
p->nNodesBeg );
461 ABC_PRT(
"Resynthesis",
p->timeRes );
467 ABC_PRT(
"AIG update ",
p->timeNtk );
480 abctime clk, clkStart = Abc_Clock();
481 int i, nNodes, RetValue = 1;
483 assert( Abc_NtkIsStrash(pNtk) );
490 pManRef->
nNodesBeg = Abc_NtkNodeNum(pNtk);
491 nNodes = Abc_NtkObjNumMax(pNtk);
493 if (pGain_ref) *pGain_ref = Vec_IntAlloc(1);
496 fpt = fopen(
"refactor_id_nGain.csv",
"w");
501 Extra_ProgressBarUpdate( pProgress, i, NULL );
502 if ( Abc_NodeIsPersistant(pNode) )
504 if ( Abc_ObjFanoutNum(pNode) > 1000 )
510pManRef->
timeCut += Abc_Clock() - clk;
512 pFForm =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros, fUseDcs, fVerbose );
513pManRef->
timeRes += Abc_Clock() - clk;
515 fprintf(fpt,
"%d, %d\n", pNode->
Id, pManRef->
nLastGain);
516 Vec_IntPush((*pGain_ref), pManRef->
nLastGain);
518 if ( pFForm == NULL )
531pManRef->
timeNtk += Abc_Clock() - clk;
532 Dec_GraphFree( pFForm );
535 printf(
"size of vector: %d\n", (**pGain_ref).nSize);
538pManRef->
timeTotal = Abc_Clock() - clkStart;
539 pManRef->
nNodesEnd = Abc_NtkNodeNum(pNtk);
546 if ( RetValue != -1 )
554 printf(
"Abc_NtkRefactor: The network check has failed.\n" );
582 abctime clk, clkStart = Abc_Clock();
586 assert( Abc_NtkIsStrash(pNtk) );
593 if ( nLevelsOdc > 0 )
600 if ( Abc_NtkLatchNum(pNtk) ) {
606 pManRes->
nNodesBeg = Abc_NtkNodeNum(pNtk);
607 nNodes = Abc_NtkObjNumMax(pNtk);
609 if (pGain_res) *pGain_res = Vec_IntAlloc(1);
612 fpt = fopen(
"resub_id_nGain.csv",
"w");
617 Extra_ProgressBarUpdate( pProgress, i, NULL );
622 if ( Abc_NodeIsPersistant(pNode) )
624 fprintf(fpt,
"%d, %d\n", pNode->
Id, -99);
625 Vec_IntPush((*pGain_res), -99);
629 if ( Abc_ObjFanoutNum(pNode) > 1000 )
631 fprintf(fpt,
"%d, %d\n", pNode->
Id, -99);
632 Vec_IntPush((*pGain_res), -99);
643pManRes->
timeCut += Abc_Clock() - clk;
661 pFForm = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
664pManRes->
timeRes += Abc_Clock() - clk;
667 fprintf(fpt,
"%d, %d\n", pNode->
Id, pManRes->
nLastGain);
668 Vec_IntPush((*pGain_res), pManRes->
nLastGain);
670 if ( pFForm == NULL )
685pManRes->
timeNtk += Abc_Clock() - clk;
686 Dec_GraphFree( pFForm );
690 printf(
"size of vector %d\n", (**pGain_res).nSize);
693pManRes->
timeTotal = Abc_Clock() - clkStart;
694 pManRes->
nNodesEnd = Abc_NtkNodeNum(pNtk);
698 Abc_ManResubPrint( pManRes );
701 Abc_ManResubStop( pManRes );
709 if ( Abc_NtkLatchNum(pNtk) ) {
725 printf(
"Abc_NtkRefactor: The network check has failed.\n" );
744Abc_ManRes_t * Abc_ManResubStart(
int nLeavesMax,
int nDivsMax )
749 assert(
sizeof(
unsigned) == 4 );
752 p->nLeavesMax = nLeavesMax;
753 p->nDivsMax = nDivsMax;
754 p->vDivs = Vec_PtrAlloc(
p->nDivsMax );
756 p->nBits = (1 <<
p->nLeavesMax);
757 p->nWords = (
p->nBits <= 32)? 1 : (
p->nBits / 32);
758 p->pInfo =
ABC_ALLOC(
unsigned,
p->nWords * (
p->nDivsMax + 1) );
759 memset(
p->pInfo, 0,
sizeof(
unsigned) *
p->nWords *
p->nLeavesMax );
760 p->vSims = Vec_PtrAlloc(
p->nDivsMax );
761 for ( i = 0; i <
p->nDivsMax; i++ )
762 Vec_PtrPush(
p->vSims,
p->pInfo + i *
p->nWords );
764 p->pCareSet =
p->pInfo +
p->nDivsMax *
p->nWords;
765 Abc_InfoFill(
p->pCareSet,
p->nWords );
767 for ( k = 0; k <
p->nLeavesMax; k++ )
769 pData = (
unsigned *)
p->vSims->pArray[k];
770 for ( i = 0; i <
p->nBits; i++ )
772 pData[i>>5] |= (1 << (i&31));
775 p->vDivs1UP = Vec_PtrAlloc(
p->nDivsMax );
776 p->vDivs1UN = Vec_PtrAlloc(
p->nDivsMax );
777 p->vDivs1B = Vec_PtrAlloc(
p->nDivsMax );
778 p->vDivs2UP0 = Vec_PtrAlloc(
p->nDivsMax );
779 p->vDivs2UP1 = Vec_PtrAlloc(
p->nDivsMax );
780 p->vDivs2UN0 = Vec_PtrAlloc(
p->nDivsMax );
781 p->vDivs2UN1 = Vec_PtrAlloc(
p->nDivsMax );
782 p->vTemp = Vec_PtrAlloc(
p->nDivsMax );
799 Vec_PtrFree(
p->vDivs );
800 Vec_PtrFree(
p->vSims );
801 Vec_PtrFree(
p->vDivs1UP );
802 Vec_PtrFree(
p->vDivs1UN );
803 Vec_PtrFree(
p->vDivs1B );
804 Vec_PtrFree(
p->vDivs2UP0 );
805 Vec_PtrFree(
p->vDivs2UP1 );
806 Vec_PtrFree(
p->vDivs2UN0 );
807 Vec_PtrFree(
p->vDivs2UN1 );
808 Vec_PtrFree(
p->vTemp );
826 printf(
"Used constants = %6d. ",
p->nUsedNodeC );
ABC_PRT(
"Cuts ",
p->timeCut );
827 printf(
"Used replacements = %6d. ",
p->nUsedNode0 );
ABC_PRT(
"Resub ",
p->timeRes );
828 printf(
"Used single ORs = %6d. ",
p->nUsedNode1Or );
ABC_PRT(
" Div ",
p->timeDiv );
829 printf(
"Used single ANDs = %6d. ",
p->nUsedNode1And );
ABC_PRT(
" Mffc ",
p->timeMffc );
830 printf(
"Used double ORs = %6d. ",
p->nUsedNode2Or );
ABC_PRT(
" Sim ",
p->timeSim );
831 printf(
"Used double ANDs = %6d. ",
p->nUsedNode2And );
ABC_PRT(
" 1 ",
p->timeRes1 );
832 printf(
"Used OR-AND = %6d. ",
p->nUsedNode2OrAnd );
ABC_PRT(
" D ",
p->timeResD );
833 printf(
"Used AND-OR = %6d. ",
p->nUsedNode2AndOr );
ABC_PRT(
" 2 ",
p->timeRes2 );
834 printf(
"Used OR-2ANDs = %6d. ",
p->nUsedNode3OrAnd );
ABC_PRT(
"Truth ",
p->timeTruth );
835 printf(
"Used AND-2ORs = %6d. ",
p->nUsedNode3AndOr );
ABC_PRT(
"AIG ",
p->timeNtk );
836 printf(
"TOTAL = %6d. ",
p->nUsedNodeC +
846 );
ABC_PRT(
"TOTAL ",
p->timeTotal );
847 printf(
"Total leaves = %8d.\n",
p->nTotalLeaves );
848 printf(
"Total divisors = %8d.\n",
p->nTotalDivs );
850 printf(
"Gain = %8d. (%6.2f %%).\n",
p->nNodesBeg-
p->nNodesEnd, 100.0*(
p->nNodesBeg-
p->nNodesEnd)/
p->nNodesBeg );
869 if ( Abc_NodeIsTravIdCurrent(pNode) )
871 Abc_NodeSetTravIdCurrent(pNode);
877 Vec_PtrPush( vInternal, pNode );
895 int i, k, Limit, Counter;
897 Vec_PtrClear(
p->vDivs1UP );
898 Vec_PtrClear(
p->vDivs1UN );
899 Vec_PtrClear(
p->vDivs1B );
902 Vec_PtrClear(
p->vDivs );
903 Abc_NtkIncrementTravId( pRoot->
pNtk );
906 Vec_PtrPush(
p->vDivs, pNode );
907 Abc_NodeSetTravIdCurrent( pNode );
920 if ( Vec_PtrSize(
p->vDivs) - Vec_PtrSize(vLeaves) + Vec_PtrSize(
p->vTemp) >= Vec_PtrSize(
p->vSims) -
p->nLeavesMax )
924 Limit = Vec_PtrSize(
p->vSims) -
p->nLeavesMax - (Vec_PtrSize(
p->vDivs) - Vec_PtrSize(vLeaves) + Vec_PtrSize(
p->vTemp));
930 if ( Abc_ObjFanoutNum(pNode) > 100 )
938 if ( Abc_NodeIsTravIdCurrent(pFanout) || Abc_ObjIsCo(pFanout) || (
int)pFanout->
Level > Required )
940 if ( Abc_NodeIsTravIdCurrent(Abc_ObjFanin0(pFanout)) && Abc_NodeIsTravIdCurrent(Abc_ObjFanin1(pFanout)) )
942 if ( Abc_ObjFanin0(pFanout) == pRoot || Abc_ObjFanin1(pFanout) == pRoot )
944 Vec_PtrPush(
p->vDivs, pFanout );
945 Abc_NodeSetTravIdCurrent( pFanout );
947 if ( ++Counter == Limit )
955 p->nDivs = Vec_PtrSize(
p->vDivs);
959 Vec_PtrPush(
p->vDivs, pNode );
960 assert( pRoot == Vec_PtrEntryLast(
p->vDivs) );
962 assert( Vec_PtrSize(
p->vDivs) - Vec_PtrSize(vLeaves) <= Vec_PtrSize(
p->vSims) -
p->nLeavesMax );
984 if ( i < Vec_PtrSize(vLeaves) )
986 printf(
"%6d : %c\n", pNode->
Id,
'a'+i );
989 printf(
"%6d : %2d = ", pNode->
Id, i );
992 if ( Abc_ObjFanin0(pNode) == pFanin )
994 if ( k < Vec_PtrSize(vLeaves) )
995 printf(
"%c",
'a' + k );
998 printf(
"%s ", Abc_ObjFaninC0(pNode)?
"\'" :
"" );
1001 if ( Abc_ObjFanin1(pNode) == pFanin )
1003 if ( k < Vec_PtrSize(vLeaves) )
1004 printf(
"%c",
'a' + k );
1007 printf(
"%s ", Abc_ObjFaninC1(pNode)?
"\'" :
"" );
1008 if ( pNode == pRoot )
1030 unsigned * puData0, * puData1, * puData;
1032 assert( Vec_PtrSize(vDivs) - nLeaves <= Vec_PtrSize(vSims) - nLeavesMax );
1038 pObj->
pData = Vec_PtrEntry( vSims, i );
1042 pObj->
pData = Vec_PtrEntry( vSims, i - nLeaves + nLeavesMax );
1044 puData = (
unsigned *)pObj->
pData;
1045 puData0 = (
unsigned *)Abc_ObjFanin0(pObj)->pData;
1046 puData1 = (
unsigned *)Abc_ObjFanin1(pObj)->pData;
1048 if ( Abc_ObjFaninC0(pObj) && Abc_ObjFaninC1(pObj) )
1049 for ( k = 0; k <
nWords; k++ )
1050 puData[k] = ~puData0[k] & ~puData1[k];
1051 else if ( Abc_ObjFaninC0(pObj) )
1052 for ( k = 0; k <
nWords; k++ )
1053 puData[k] = ~puData0[k] & puData1[k];
1054 else if ( Abc_ObjFaninC1(pObj) )
1055 for ( k = 0; k <
nWords; k++ )
1056 puData[k] = puData0[k] & ~puData1[k];
1058 for ( k = 0; k <
nWords; k++ )
1059 puData[k] = puData0[k] & puData1[k];
1064 puData = (
unsigned *)pObj->
pData;
1065 pObj->
fPhase = (puData[0] & 1);
1067 for ( k = 0; k <
nWords; k++ )
1068 puData[k] = ~puData[k];
1089 pGraph = Dec_GraphCreate( 1 );
1090 Dec_GraphNode( pGraph, 0 )->pFunc = pObj;
1091 eRoot = Dec_EdgeCreate( 0, pObj->
fPhase );
1092 Dec_GraphSetRoot( pGraph, eRoot );
1094 Dec_GraphComplement( pGraph );
1114 assert( Abc_ObjRegular(pObj0) != Abc_ObjRegular(pObj1) );
1115 pGraph = Dec_GraphCreate( 2 );
1116 Dec_GraphNode( pGraph, 0 )->pFunc = Abc_ObjRegular(pObj0);
1117 Dec_GraphNode( pGraph, 1 )->pFunc = Abc_ObjRegular(pObj1);
1118 eNode0 = Dec_EdgeCreate( 0, Abc_ObjRegular(pObj0)->fPhase ^ Abc_ObjIsComplement(pObj0) );
1119 eNode1 = Dec_EdgeCreate( 1, Abc_ObjRegular(pObj1)->fPhase ^ Abc_ObjIsComplement(pObj1) );
1121 eRoot = Dec_GraphAddNodeOr( pGraph, eNode0, eNode1 );
1123 eRoot = Dec_GraphAddNodeAnd( pGraph, eNode0, eNode1 );
1124 Dec_GraphSetRoot( pGraph, eRoot );
1126 Dec_GraphComplement( pGraph );
1146 assert( Abc_ObjRegular(pObj0) != Abc_ObjRegular(pObj1) );
1147 assert( Abc_ObjRegular(pObj0) != Abc_ObjRegular(pObj2) );
1148 assert( Abc_ObjRegular(pObj1) != Abc_ObjRegular(pObj2) );
1149 pGraph = Dec_GraphCreate( 3 );
1150 Dec_GraphNode( pGraph, 0 )->pFunc = Abc_ObjRegular(pObj0);
1151 Dec_GraphNode( pGraph, 1 )->pFunc = Abc_ObjRegular(pObj1);
1152 Dec_GraphNode( pGraph, 2 )->pFunc = Abc_ObjRegular(pObj2);
1153 eNode0 = Dec_EdgeCreate( 0, Abc_ObjRegular(pObj0)->fPhase ^ Abc_ObjIsComplement(pObj0) );
1154 eNode1 = Dec_EdgeCreate( 1, Abc_ObjRegular(pObj1)->fPhase ^ Abc_ObjIsComplement(pObj1) );
1155 eNode2 = Dec_EdgeCreate( 2, Abc_ObjRegular(pObj2)->fPhase ^ Abc_ObjIsComplement(pObj2) );
1158 eRoot = Dec_GraphAddNodeOr( pGraph, eNode0, eNode1 );
1159 eRoot = Dec_GraphAddNodeOr( pGraph, eNode2, eRoot );
1163 eRoot = Dec_GraphAddNodeAnd( pGraph, eNode0, eNode1 );
1164 eRoot = Dec_GraphAddNodeAnd( pGraph, eNode2, eRoot );
1166 Dec_GraphSetRoot( pGraph, eRoot );
1168 Dec_GraphComplement( pGraph );
1188 Dec_Edge_t eRoot, ePrev, eNode0, eNode1, eNode2;
1189 assert( Abc_ObjRegular(pObj0) != Abc_ObjRegular(pObj1) );
1190 assert( Abc_ObjRegular(pObj0) != Abc_ObjRegular(pObj2) );
1191 assert( Abc_ObjRegular(pObj1) != Abc_ObjRegular(pObj2) );
1192 pGraph = Dec_GraphCreate( 3 );
1193 Dec_GraphNode( pGraph, 0 )->pFunc = Abc_ObjRegular(pObj0);
1194 Dec_GraphNode( pGraph, 1 )->pFunc = Abc_ObjRegular(pObj1);
1195 Dec_GraphNode( pGraph, 2 )->pFunc = Abc_ObjRegular(pObj2);
1196 eNode0 = Dec_EdgeCreate( 0, Abc_ObjRegular(pObj0)->fPhase ^ Abc_ObjIsComplement(pObj0) );
1197 if ( Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
1199 eNode1 = Dec_EdgeCreate( 1, Abc_ObjRegular(pObj1)->fPhase );
1200 eNode2 = Dec_EdgeCreate( 2, Abc_ObjRegular(pObj2)->fPhase );
1201 ePrev = Dec_GraphAddNodeOr( pGraph, eNode1, eNode2 );
1205 eNode1 = Dec_EdgeCreate( 1, Abc_ObjRegular(pObj1)->fPhase ^ Abc_ObjIsComplement(pObj1) );
1206 eNode2 = Dec_EdgeCreate( 2, Abc_ObjRegular(pObj2)->fPhase ^ Abc_ObjIsComplement(pObj2) );
1207 ePrev = Dec_GraphAddNodeAnd( pGraph, eNode1, eNode2 );
1210 eRoot = Dec_GraphAddNodeOr( pGraph, eNode0, ePrev );
1212 eRoot = Dec_GraphAddNodeAnd( pGraph, eNode0, ePrev );
1213 Dec_GraphSetRoot( pGraph, eRoot );
1215 Dec_GraphComplement( pGraph );
1235 Dec_Edge_t eRoot, ePrev0, ePrev1, eNode0, eNode1, eNode2, eNode3;
1236 assert( Abc_ObjRegular(pObj0) != Abc_ObjRegular(pObj1) );
1237 assert( Abc_ObjRegular(pObj2) != Abc_ObjRegular(pObj3) );
1238 pGraph = Dec_GraphCreate( 4 );
1239 Dec_GraphNode( pGraph, 0 )->pFunc = Abc_ObjRegular(pObj0);
1240 Dec_GraphNode( pGraph, 1 )->pFunc = Abc_ObjRegular(pObj1);
1241 Dec_GraphNode( pGraph, 2 )->pFunc = Abc_ObjRegular(pObj2);
1242 Dec_GraphNode( pGraph, 3 )->pFunc = Abc_ObjRegular(pObj3);
1243 if ( Abc_ObjIsComplement(pObj0) && Abc_ObjIsComplement(pObj1) )
1245 eNode0 = Dec_EdgeCreate( 0, Abc_ObjRegular(pObj0)->fPhase );
1246 eNode1 = Dec_EdgeCreate( 1, Abc_ObjRegular(pObj1)->fPhase );
1247 ePrev0 = Dec_GraphAddNodeOr( pGraph, eNode0, eNode1 );
1248 if ( Abc_ObjIsComplement(pObj2) && Abc_ObjIsComplement(pObj3) )
1250 eNode2 = Dec_EdgeCreate( 2, Abc_ObjRegular(pObj2)->fPhase );
1251 eNode3 = Dec_EdgeCreate( 3, Abc_ObjRegular(pObj3)->fPhase );
1252 ePrev1 = Dec_GraphAddNodeOr( pGraph, eNode2, eNode3 );
1256 eNode2 = Dec_EdgeCreate( 2, Abc_ObjRegular(pObj2)->fPhase ^ Abc_ObjIsComplement(pObj2) );
1257 eNode3 = Dec_EdgeCreate( 3, Abc_ObjRegular(pObj3)->fPhase ^ Abc_ObjIsComplement(pObj3) );
1258 ePrev1 = Dec_GraphAddNodeAnd( pGraph, eNode2, eNode3 );
1263 eNode0 = Dec_EdgeCreate( 0, Abc_ObjRegular(pObj0)->fPhase ^ Abc_ObjIsComplement(pObj0) );
1264 eNode1 = Dec_EdgeCreate( 1, Abc_ObjRegular(pObj1)->fPhase ^ Abc_ObjIsComplement(pObj1) );
1265 ePrev0 = Dec_GraphAddNodeAnd( pGraph, eNode0, eNode1 );
1266 if ( Abc_ObjIsComplement(pObj2) && Abc_ObjIsComplement(pObj3) )
1268 eNode2 = Dec_EdgeCreate( 2, Abc_ObjRegular(pObj2)->fPhase );
1269 eNode3 = Dec_EdgeCreate( 3, Abc_ObjRegular(pObj3)->fPhase );
1270 ePrev1 = Dec_GraphAddNodeOr( pGraph, eNode2, eNode3 );
1274 eNode2 = Dec_EdgeCreate( 2, Abc_ObjRegular(pObj2)->fPhase ^ Abc_ObjIsComplement(pObj2) );
1275 eNode3 = Dec_EdgeCreate( 3, Abc_ObjRegular(pObj3)->fPhase ^ Abc_ObjIsComplement(pObj3) );
1276 ePrev1 = Dec_GraphAddNodeAnd( pGraph, eNode2, eNode3 );
1280 eRoot = Dec_GraphAddNodeOr( pGraph, ePrev0, ePrev1 );
1282 eRoot = Dec_GraphAddNodeAnd( pGraph, ePrev0, ePrev1 );
1283 Dec_GraphSetRoot( pGraph, eRoot );
1285 Dec_GraphComplement( pGraph );
1307 unsigned * puData, * puDataR;
1309 Vec_PtrClear(
p->vDivs1UP );
1310 Vec_PtrClear(
p->vDivs1UN );
1311 Vec_PtrClear(
p->vDivs1B );
1312 puDataR = (
unsigned *)
p->pRoot->pData;
1315 if ( (
int)pObj->
Level > Required - 1 )
1318 puData = (
unsigned *)pObj->
pData;
1320 for ( w = 0; w <
p->nWords; w++ )
1322 if ( puData[w] & ~puDataR[w] &
p->pCareSet[w] )
1324 if ( w ==
p->nWords )
1326 Vec_PtrPush(
p->vDivs1UP, pObj );
1331 for ( w = 0; w <
p->nWords; w++ )
1333 if ( ~puData[w] & ~puDataR[w] &
p->pCareSet[w] )
1335 if ( w ==
p->nWords )
1337 Vec_PtrPush(
p->vDivs1UP, Abc_ObjNot(pObj) );
1342 for ( w = 0; w <
p->nWords; w++ )
1344 if ( ~puData[w] & puDataR[w] &
p->pCareSet[w] )
1346 if ( w ==
p->nWords )
1348 Vec_PtrPush(
p->vDivs1UN, pObj );
1353 for ( w = 0; w <
p->nWords; w++ )
1355 if ( puData[w] & puDataR[w] &
p->pCareSet[w] )
1357 if ( w ==
p->nWords )
1359 Vec_PtrPush(
p->vDivs1UN, Abc_ObjNot(pObj) );
1364 Vec_PtrPush(
p->vDivs1B, pObj );
1382 unsigned * puData0, * puData1, * puDataR;
1384 Vec_PtrClear(
p->vDivs2UP0 );
1385 Vec_PtrClear(
p->vDivs2UP1 );
1386 Vec_PtrClear(
p->vDivs2UN0 );
1387 Vec_PtrClear(
p->vDivs2UN1 );
1388 puDataR = (
unsigned *)
p->pRoot->pData;
1391 if ( (
int)pObj0->Level > Required - 2 )
1394 puData0 = (
unsigned *)pObj0->pData;
1397 if ( (
int)pObj1->Level > Required - 2 )
1400 puData1 = (
unsigned *)pObj1->pData;
1405 for ( w = 0; w <
p->nWords; w++ )
1407 if ( (puData0[w] & puData1[w]) & ~puDataR[w] &
p->pCareSet[w] )
1409 if ( w ==
p->nWords )
1411 Vec_PtrPush(
p->vDivs2UP0, pObj0 );
1412 Vec_PtrPush(
p->vDivs2UP1, pObj1 );
1414 for ( w = 0; w <
p->nWords; w++ )
1416 if ( (~puData0[w] & puData1[w]) & ~puDataR[w] &
p->pCareSet[w] )
1418 if ( w ==
p->nWords )
1420 Vec_PtrPush(
p->vDivs2UP0, Abc_ObjNot(pObj0) );
1421 Vec_PtrPush(
p->vDivs2UP1, pObj1 );
1423 for ( w = 0; w <
p->nWords; w++ )
1425 if ( (puData0[w] & ~puData1[w]) & ~puDataR[w] &
p->pCareSet[w] )
1427 if ( w ==
p->nWords )
1429 Vec_PtrPush(
p->vDivs2UP0, pObj0 );
1430 Vec_PtrPush(
p->vDivs2UP1, Abc_ObjNot(pObj1) );
1432 for ( w = 0; w <
p->nWords; w++ )
1434 if ( (puData0[w] | puData1[w]) & ~puDataR[w] &
p->pCareSet[w] )
1436 if ( w ==
p->nWords )
1438 Vec_PtrPush(
p->vDivs2UP0, Abc_ObjNot(pObj0) );
1439 Vec_PtrPush(
p->vDivs2UP1, Abc_ObjNot(pObj1) );
1446 for ( w = 0; w <
p->nWords; w++ )
1448 if ( ~(puData0[w] & puData1[w]) & puDataR[w] &
p->pCareSet[w] )
1450 if ( w ==
p->nWords )
1452 Vec_PtrPush(
p->vDivs2UN0, pObj0 );
1453 Vec_PtrPush(
p->vDivs2UN1, pObj1 );
1455 for ( w = 0; w <
p->nWords; w++ )
1457 if ( ~(~puData0[w] & puData1[w]) & puDataR[w] &
p->pCareSet[w] )
1459 if ( w ==
p->nWords )
1461 Vec_PtrPush(
p->vDivs2UN0, Abc_ObjNot(pObj0) );
1462 Vec_PtrPush(
p->vDivs2UN1, pObj1 );
1464 for ( w = 0; w <
p->nWords; w++ )
1466 if ( ~(puData0[w] & ~puData1[w]) & puDataR[w] &
p->pCareSet[w] )
1468 if ( w ==
p->nWords )
1470 Vec_PtrPush(
p->vDivs2UN0, pObj0 );
1471 Vec_PtrPush(
p->vDivs2UN1, Abc_ObjNot(pObj1) );
1473 for ( w = 0; w <
p->nWords; w++ )
1475 if ( ~(puData0[w] | puData1[w]) & puDataR[w] &
p->pCareSet[w] )
1477 if ( w ==
p->nWords )
1479 Vec_PtrPush(
p->vDivs2UN0, Abc_ObjNot(pObj0) );
1480 Vec_PtrPush(
p->vDivs2UN1, Abc_ObjNot(pObj1) );
1506 upData = (
unsigned *)
p->pRoot->pData;
1507 for ( w = 0; w <
p->nWords; w++ )
1509 if ( upData[w] &
p->pCareSet[w] )
1511 if ( w !=
p->nWords )
1514 if (
p->pRoot->fPhase )
1515 pGraph = Dec_GraphCreateConst1();
1517 pGraph = Dec_GraphCreateConst0();
1535 unsigned * puData, * puDataR;
1537 puDataR = (
unsigned *)
p->pRoot->pData;
1540 puData = (
unsigned *)pObj->
pData;
1541 for ( w = 0; w <
p->nWords; w++ )
1543 if ( (puData[w] ^ puDataR[w]) &
p->pCareSet[w] )
1545 if ( w ==
p->nWords )
1565 unsigned * puData0, * puData1, * puDataR;
1567 puDataR = (
unsigned *)
p->pRoot->pData;
1571 puData0 = (
unsigned *)Abc_ObjRegular(pObj0)->pData;
1574 puData1 = (
unsigned *)Abc_ObjRegular(pObj1)->pData;
1575 if ( Abc_ObjIsComplement(pObj0) && Abc_ObjIsComplement(pObj1) )
1577 for ( w = 0; w <
p->nWords; w++ )
1579 if ( ((~puData0[w] | ~puData1[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1582 else if ( Abc_ObjIsComplement(pObj0) )
1584 for ( w = 0; w <
p->nWords; w++ )
1586 if ( ((~puData0[w] | puData1[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1589 else if ( Abc_ObjIsComplement(pObj1) )
1591 for ( w = 0; w <
p->nWords; w++ )
1593 if ( ((puData0[w] | ~puData1[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1598 for ( w = 0; w <
p->nWords; w++ )
1600 if ( ((puData0[w] | puData1[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1603 if ( w ==
p->nWords )
1613 puData0 = (
unsigned *)Abc_ObjRegular(pObj0)->pData;
1616 puData1 = (
unsigned *)Abc_ObjRegular(pObj1)->pData;
1617 if ( Abc_ObjIsComplement(pObj0) && Abc_ObjIsComplement(pObj1) )
1619 for ( w = 0; w <
p->nWords; w++ )
1621 if ( ((~puData0[w] & ~puData1[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1624 if ( Abc_ObjIsComplement(pObj0) )
1626 for ( w = 0; w <
p->nWords; w++ )
1628 if ( ((~puData0[w] & puData1[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1631 if ( Abc_ObjIsComplement(pObj1) )
1633 for ( w = 0; w <
p->nWords; w++ )
1635 if ( ((puData0[w] & ~puData1[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1640 for ( w = 0; w <
p->nWords; w++ )
1642 if ( ((puData0[w] & puData1[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1645 if ( w ==
p->nWords )
1668 Abc_Obj_t * pObj0, * pObj1, * pObj2, * pObjMax, * pObjMin0 = NULL, * pObjMin1 = NULL;
1669 unsigned * puData0, * puData1, * puData2, * puDataR;
1670 int i, k, j, w, LevelMax;
1671 puDataR = (
unsigned *)
p->pRoot->pData;
1675 puData0 = (
unsigned *)Abc_ObjRegular(pObj0)->pData;
1678 puData1 = (
unsigned *)Abc_ObjRegular(pObj1)->pData;
1681 puData2 = (
unsigned *)Abc_ObjRegular(pObj2)->pData;
1682 if ( Abc_ObjIsComplement(pObj0) && Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
1684 for ( w = 0; w <
p->nWords; w++ )
1686 if ( ((~puData0[w] | ~puData1[w] | ~puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1689 else if ( Abc_ObjIsComplement(pObj0) && Abc_ObjIsComplement(pObj1) && !Abc_ObjIsComplement(pObj2) )
1691 for ( w = 0; w <
p->nWords; w++ )
1693 if ( ((~puData0[w] | ~puData1[w] | puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1696 else if ( Abc_ObjIsComplement(pObj0) && !Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
1698 for ( w = 0; w <
p->nWords; w++ )
1700 if ( ((~puData0[w] | puData1[w] | ~puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1703 else if ( Abc_ObjIsComplement(pObj0) && !Abc_ObjIsComplement(pObj1) && !Abc_ObjIsComplement(pObj2) )
1705 for ( w = 0; w <
p->nWords; w++ )
1707 if ( ((~puData0[w] | puData1[w] | puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1710 else if ( !Abc_ObjIsComplement(pObj0) && Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
1712 for ( w = 0; w <
p->nWords; w++ )
1714 if ( ((puData0[w] | ~puData1[w] | ~puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1717 else if ( !Abc_ObjIsComplement(pObj0) && Abc_ObjIsComplement(pObj1) && !Abc_ObjIsComplement(pObj2) )
1719 for ( w = 0; w <
p->nWords; w++ )
1721 if ( ((puData0[w] | ~puData1[w] | puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1724 else if ( !Abc_ObjIsComplement(pObj0) && !Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
1726 for ( w = 0; w <
p->nWords; w++ )
1728 if ( ((puData0[w] | puData1[w] | ~puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1731 else if ( !Abc_ObjIsComplement(pObj0) && !Abc_ObjIsComplement(pObj1) && !Abc_ObjIsComplement(pObj2) )
1733 for ( w = 0; w <
p->nWords; w++ )
1735 if ( ((puData0[w] | puData1[w] | puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1739 if ( w ==
p->nWords )
1741 LevelMax = Abc_MaxInt( Abc_ObjRegular(pObj0)->Level, Abc_MaxInt(Abc_ObjRegular(pObj1)->Level, Abc_ObjRegular(pObj2)->Level) );
1742 assert( LevelMax <= Required - 1 );
1745 if ( (
int)Abc_ObjRegular(pObj0)->Level == LevelMax )
1746 pObjMax = pObj0, pObjMin0 = pObj1, pObjMin1 = pObj2;
1747 if ( (
int)Abc_ObjRegular(pObj1)->Level == LevelMax )
1749 if ( pObjMax )
continue;
1750 pObjMax = pObj1, pObjMin0 = pObj0, pObjMin1 = pObj2;
1752 if ( (
int)Abc_ObjRegular(pObj2)->Level == LevelMax )
1754 if ( pObjMax )
continue;
1755 pObjMax = pObj2, pObjMin0 = pObj0, pObjMin1 = pObj1;
1769 puData0 = (
unsigned *)Abc_ObjRegular(pObj0)->pData;
1772 puData1 = (
unsigned *)Abc_ObjRegular(pObj1)->pData;
1775 puData2 = (
unsigned *)Abc_ObjRegular(pObj2)->pData;
1776 if ( Abc_ObjIsComplement(pObj0) && Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
1778 for ( w = 0; w <
p->nWords; w++ )
1780 if ( ((~puData0[w] & ~puData1[w] & ~puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1783 else if ( Abc_ObjIsComplement(pObj0) && Abc_ObjIsComplement(pObj1) && !Abc_ObjIsComplement(pObj2) )
1785 for ( w = 0; w <
p->nWords; w++ )
1787 if ( ((~puData0[w] & ~puData1[w] & puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1790 else if ( Abc_ObjIsComplement(pObj0) && !Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
1792 for ( w = 0; w <
p->nWords; w++ )
1794 if ( ((~puData0[w] & puData1[w] & ~puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1797 else if ( Abc_ObjIsComplement(pObj0) && !Abc_ObjIsComplement(pObj1) && !Abc_ObjIsComplement(pObj2) )
1799 for ( w = 0; w <
p->nWords; w++ )
1801 if ( ((~puData0[w] & puData1[w] & puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1804 else if ( !Abc_ObjIsComplement(pObj0) && Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
1806 for ( w = 0; w <
p->nWords; w++ )
1808 if ( ((puData0[w] & ~puData1[w] & ~puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1811 else if ( !Abc_ObjIsComplement(pObj0) && Abc_ObjIsComplement(pObj1) && !Abc_ObjIsComplement(pObj2) )
1813 for ( w = 0; w <
p->nWords; w++ )
1815 if ( ((puData0[w] & ~puData1[w] & puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1818 else if ( !Abc_ObjIsComplement(pObj0) && !Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
1820 for ( w = 0; w <
p->nWords; w++ )
1822 if ( ((puData0[w] & puData1[w] & ~puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1825 else if ( !Abc_ObjIsComplement(pObj0) && !Abc_ObjIsComplement(pObj1) && !Abc_ObjIsComplement(pObj2) )
1827 for ( w = 0; w <
p->nWords; w++ )
1829 if ( ((puData0[w] & puData1[w] & puData2[w]) ^ puDataR[w]) &
p->pCareSet[w] )
1833 if ( w ==
p->nWords )
1835 LevelMax = Abc_MaxInt( Abc_ObjRegular(pObj0)->Level, Abc_MaxInt(Abc_ObjRegular(pObj1)->Level, Abc_ObjRegular(pObj2)->Level) );
1836 assert( LevelMax <= Required - 1 );
1839 if ( (
int)Abc_ObjRegular(pObj0)->Level == LevelMax )
1840 pObjMax = pObj0, pObjMin0 = pObj1, pObjMin1 = pObj2;
1841 if ( (
int)Abc_ObjRegular(pObj1)->Level == LevelMax )
1843 if ( pObjMax )
continue;
1844 pObjMax = pObj1, pObjMin0 = pObj0, pObjMin1 = pObj2;
1846 if ( (
int)Abc_ObjRegular(pObj2)->Level == LevelMax )
1848 if ( pObjMax )
continue;
1849 pObjMax = pObj2, pObjMin0 = pObj0, pObjMin1 = pObj1;
1877 unsigned * puData0, * puData1, * puData2, * puDataR;
1879 puDataR = (
unsigned *)
p->pRoot->pData;
1883 puData0 = (
unsigned *)Abc_ObjRegular(pObj0)->pData;
1886 pObj2 = (
Abc_Obj_t *)Vec_PtrEntry(
p->vDivs2UP1, k );
1888 puData1 = (
unsigned *)Abc_ObjRegular(pObj1)->pData;
1889 puData2 = (
unsigned *)Abc_ObjRegular(pObj2)->pData;
1890 if ( Abc_ObjIsComplement(pObj0) )
1892 if ( Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
1894 for ( w = 0; w <
p->nWords; w++ )
1896 if ( ((~puData0[w] | (puData1[w] | puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
1899 else if ( Abc_ObjIsComplement(pObj1) )
1901 for ( w = 0; w <
p->nWords; w++ )
1903 if ( ((~puData0[w] | (~puData1[w] & puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
1906 else if ( Abc_ObjIsComplement(pObj2) )
1908 for ( w = 0; w <
p->nWords; w++ )
1910 if ( ((~puData0[w] | (puData1[w] & ~puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
1915 for ( w = 0; w <
p->nWords; w++ )
1917 if ( ((~puData0[w] | (puData1[w] & puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
1923 if ( Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
1925 for ( w = 0; w <
p->nWords; w++ )
1927 if ( ((puData0[w] | (puData1[w] | puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
1930 else if ( Abc_ObjIsComplement(pObj1) )
1932 for ( w = 0; w <
p->nWords; w++ )
1934 if ( ((puData0[w] | (~puData1[w] & puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
1937 else if ( Abc_ObjIsComplement(pObj2) )
1939 for ( w = 0; w <
p->nWords; w++ )
1941 if ( ((puData0[w] | (puData1[w] & ~puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
1946 for ( w = 0; w <
p->nWords; w++ )
1948 if ( ((puData0[w] | (puData1[w] & puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
1952 if ( w ==
p->nWords )
1954 p->nUsedNode2OrAnd++;
1962 puData0 = (
unsigned *)Abc_ObjRegular(pObj0)->pData;
1965 pObj2 = (
Abc_Obj_t *)Vec_PtrEntry(
p->vDivs2UN1, k );
1967 puData1 = (
unsigned *)Abc_ObjRegular(pObj1)->pData;
1968 puData2 = (
unsigned *)Abc_ObjRegular(pObj2)->pData;
1969 if ( Abc_ObjIsComplement(pObj0) )
1971 if ( Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
1973 for ( w = 0; w <
p->nWords; w++ )
1975 if ( ((~puData0[w] & (puData1[w] | puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
1978 else if ( Abc_ObjIsComplement(pObj1) )
1980 for ( w = 0; w <
p->nWords; w++ )
1982 if ( ((~puData0[w] & (~puData1[w] & puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
1985 else if ( Abc_ObjIsComplement(pObj2) )
1987 for ( w = 0; w <
p->nWords; w++ )
1989 if ( ((~puData0[w] & (puData1[w] & ~puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
1994 for ( w = 0; w <
p->nWords; w++ )
1996 if ( ((~puData0[w] & (puData1[w] & puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2002 if ( Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
2004 for ( w = 0; w <
p->nWords; w++ )
2006 if ( ((puData0[w] & (puData1[w] | puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2009 else if ( Abc_ObjIsComplement(pObj1) )
2011 for ( w = 0; w <
p->nWords; w++ )
2013 if ( ((puData0[w] & (~puData1[w] & puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2016 else if ( Abc_ObjIsComplement(pObj2) )
2018 for ( w = 0; w <
p->nWords; w++ )
2020 if ( ((puData0[w] & (puData1[w] & ~puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2025 for ( w = 0; w <
p->nWords; w++ )
2027 if ( ((puData0[w] & (puData1[w] & puData2[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2031 if ( w ==
p->nWords )
2033 p->nUsedNode2AndOr++;
2054 Abc_Obj_t * pObj0, * pObj1, * pObj2, * pObj3;
2055 unsigned * puData0, * puData1, * puData2, * puData3, * puDataR;
2056 int i, k, w = 0, Flag;
2057 puDataR = (
unsigned *)
p->pRoot->pData;
2061 pObj1 = (
Abc_Obj_t *)Vec_PtrEntry(
p->vDivs2UP1, i );
2062 puData0 = (
unsigned *)Abc_ObjRegular(pObj0)->pData;
2063 puData1 = (
unsigned *)Abc_ObjRegular(pObj1)->pData;
2064 Flag = (Abc_ObjIsComplement(pObj0) << 3) | (Abc_ObjIsComplement(pObj1) << 2);
2068 pObj3 = (
Abc_Obj_t *)Vec_PtrEntry(
p->vDivs2UP1, k );
2069 puData2 = (
unsigned *)Abc_ObjRegular(pObj2)->pData;
2070 puData3 = (
unsigned *)Abc_ObjRegular(pObj3)->pData;
2072 Flag = (Flag & 12) | ((
int)Abc_ObjIsComplement(pObj2) << 1) | (int)Abc_ObjIsComplement(pObj3);
2077 for ( w = 0; w <
p->nWords; w++ )
2079 if ( (((puData0[w] & puData1[w]) | (puData2[w] & puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2083 for ( w = 0; w <
p->nWords; w++ )
2085 if ( (((puData0[w] & puData1[w]) | (puData2[w] & ~puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2089 for ( w = 0; w <
p->nWords; w++ )
2091 if ( (((puData0[w] & puData1[w]) | (~puData2[w] & puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2095 for ( w = 0; w <
p->nWords; w++ )
2097 if ( (((puData0[w] & puData1[w]) | (puData2[w] | puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2102 for ( w = 0; w <
p->nWords; w++ )
2104 if ( (((puData0[w] & ~puData1[w]) | (puData2[w] & puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2108 for ( w = 0; w <
p->nWords; w++ )
2110 if ( (((puData0[w] & ~puData1[w]) | (puData2[w] & ~puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2114 for ( w = 0; w <
p->nWords; w++ )
2116 if ( (((puData0[w] & ~puData1[w]) | (~puData2[w] & puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2120 for ( w = 0; w <
p->nWords; w++ )
2122 if ( (((puData0[w] & ~puData1[w]) | (puData2[w] | puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2127 for ( w = 0; w <
p->nWords; w++ )
2129 if ( (((~puData0[w] & puData1[w]) | (puData2[w] & puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2133 for ( w = 0; w <
p->nWords; w++ )
2135 if ( (((~puData0[w] & puData1[w]) | (puData2[w] & ~puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2139 for ( w = 0; w <
p->nWords; w++ )
2141 if ( (((~puData0[w] & puData1[w]) | (~puData2[w] & puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2145 for ( w = 0; w <
p->nWords; w++ )
2147 if ( (((~puData0[w] & puData1[w]) | (puData2[w] | puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2152 for ( w = 0; w <
p->nWords; w++ )
2154 if ( (((puData0[w] | puData1[w]) | (puData2[w] & puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2158 for ( w = 0; w <
p->nWords; w++ )
2160 if ( (((puData0[w] | puData1[w]) | (puData2[w] & ~puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2164 for ( w = 0; w <
p->nWords; w++ )
2166 if ( (((puData0[w] | puData1[w]) | (~puData2[w] & puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2170 for ( w = 0; w <
p->nWords; w++ )
2172 if ( (((puData0[w] | puData1[w]) | (puData2[w] | puData3[w])) ^ puDataR[w]) &
p->pCareSet[w] )
2177 if ( w ==
p->nWords )
2179 p->nUsedNode3OrAnd++;
2317 Vec_PtrClear(
p->vDivs );
2344 p->nLeaves = Vec_PtrSize(vLeaves);
2350p->timeMffc += Abc_Clock() - clk;
2355 if ( !Abc_ManResubCollectDivs(
p, pRoot, vLeaves, Required ) )
2357 p->timeDiv += Abc_Clock() - clk;
2359 p->nTotalDivs +=
p->nDivs;
2360 p->nTotalLeaves +=
p->nLeaves;
2364 Abc_ManResubSimulate(
p->vDivs,
p->nLeaves,
p->vSims,
p->nLeavesMax,
p->nWords );
2365p->timeSim += Abc_Clock() - clk;
2369 if ( (pGraph = Abc_ManResubQuit(
p )) )
2372 p->nLastGain =
p->nMffc;
2377 if ( (pGraph = Abc_ManResubDivs0(
p )) )
2379p->timeRes1 += Abc_Clock() - clk;
2381 p->nLastGain =
p->nMffc;
2384 if ( nSteps == 0 ||
p->nMffc == 1 )
2386p->timeRes1 += Abc_Clock() - clk;
2391 Abc_ManResubDivsS(
p, Required );
2394 if ( (pGraph = Abc_ManResubDivs1(
p, Required )) )
2396p->timeRes1 += Abc_Clock() - clk;
2397 p->nLastGain =
p->nMffc - 1;
2400p->timeRes1 += Abc_Clock() - clk;
2401 if ( nSteps == 1 ||
p->nMffc == 2 )
2406 if ( (pGraph = Abc_ManResubDivs12(
p, Required )) )
2408p->timeRes2 += Abc_Clock() - clk;
2409 p->nLastGain =
p->nMffc - 2;
2412p->timeRes2 += Abc_Clock() - clk;
2416 Abc_ManResubDivsD(
p, Required );
2417p->timeResD += Abc_Clock() - clk;
2421 if ( (pGraph = Abc_ManResubDivs2(
p, Required )) )
2423p->timeRes2 += Abc_Clock() - clk;
2424 p->nLastGain =
p->nMffc - 2;
2427p->timeRes2 += Abc_Clock() - clk;
2428 if ( nSteps == 2 ||
p->nMffc == 3 )
2433 if ( (pGraph = Abc_ManResubDivs3(
p, Required )) )
2435p->timeRes3 += Abc_Clock() - clk;
2436 p->nLastGain =
p->nMffc - 3;
2439p->timeRes3 += Abc_Clock() - clk;
2440 if ( nSteps == 3 ||
p->nLeavesMax == 4 )
2463 if ( Abc_NodeIsTravIdCurrent(pObj) )
2465 Abc_NodeSetTravIdCurrent(pObj);
2467 if ( Abc_ObjIsCi(pObj) )
2468 printf(
"Abc_CutVolumeCheck() ERROR: The set of nodes is not a cut!\n" );
2489 Abc_NtkIncrementTravId( pNode->
pNtk );
2491 Abc_NodeSetTravIdCurrent( pObj );
2514 Vec_PtrPush( vLeaves, pObj );
2542 assert( !Abc_ObjIsCi(pNode) );
2543 vLeaves = Vec_PtrAlloc( 10 );
2570 Vec_Ptr_t * vLeaves, * vFactors, * vFact, * vNext;
2573 int i, k, Counter, RandLeaf;
2574 int BestCut, BestShare;
2575 assert( Abc_ObjIsNode(pNode) );
2578 if ( Vec_PtrSize(vLeaves) > nLeavesMax )
2580 Vec_PtrFree(vLeaves);
2583 if ( Vec_PtrSize(vLeaves) == nLeavesMax )
2586 vFactors = Vec_PtrAlloc( nLeavesMax );
2587 Abc_NtkIncrementTravId( pNode->
pNtk );
2590 Abc_NodeSetTravIdCurrent( pLeaf );
2591 if ( Abc_ObjIsCi(pLeaf) )
2592 Vec_PtrPush( vFactors, NULL );
2597 vFeasible = Vec_IntAlloc( nLeavesMax );
2600 BestCut = -1, BestShare = -1;
2602 Vec_IntClear( vFeasible );
2605 if ( vFact == NULL )
2610 Counter += !Abc_NodeIsTravIdCurrent(pTemp);
2612 if ( Counter <= nLeavesMax - Vec_PtrSize(vLeaves) + 1 )
2614 Vec_IntPush( vFeasible, i );
2615 if ( BestCut == -1 || BestShare < Vec_PtrSize(vFact) - Counter )
2616 BestCut = i, BestShare = Vec_PtrSize(vFact) - Counter;
2620 if ( Vec_IntSize(vFeasible) == 0 )
2627 pLeaf = (
Abc_Obj_t *)Vec_PtrEntry( vLeaves, RandLeaf );
2628 vNext = (
Vec_Ptr_t *)Vec_PtrEntry( vFactors, RandLeaf );
2630 Abc_NodeSetTravIdPrevious( pLeaf );
2632 for ( i = RandLeaf; i < Vec_PtrSize(vLeaves)-1; i++ )
2634 Vec_PtrWriteEntry( vLeaves, i, Vec_PtrEntry(vLeaves, i+1) );
2635 Vec_PtrWriteEntry( vFactors, i, Vec_PtrEntry(vFactors,i+1) );
2637 Vec_PtrShrink( vLeaves, Vec_PtrSize(vLeaves) -1 );
2638 Vec_PtrShrink( vFactors, Vec_PtrSize(vFactors)-1 );
2642 if ( Abc_NodeIsTravIdCurrent(pLeaf) )
2644 Abc_NodeSetTravIdCurrent( pLeaf );
2645 Vec_PtrPush( vLeaves, pLeaf );
2646 if ( Abc_ObjIsCi(pLeaf) )
2647 Vec_PtrPush( vFactors, NULL );
2651 Vec_PtrFree( vNext );
2652 assert( Vec_PtrSize(vLeaves) <= nLeavesMax );
2653 if ( Vec_PtrSize(vLeaves) == nLeavesMax )
2659 if ( vFact ) Vec_PtrFree( vFact );
2660 Vec_PtrFree( vFactors );
2661 Vec_IntFree( vFeasible );
2666int Abc_NtkOrchSA(
Abc_Ntk_t * pNtk,
Vec_Int_t **pGain_rwr,
Vec_Int_t **pGain_res,
Vec_Int_t **pGain_ref,
Vec_Int_t **PolicyList,
char * DecisionFile,
int fUseZeros_rwr,
int fUseZeros_ref,
int fPlaceEnable,
int nCutMax,
int nStepsMax,
int nLevelsOdc,
int fUpdateLevel,
int fVerbose,
int fVeryVerbose,
int nNodeSizeMax,
int nConeSizeMax,
int fUseDcs )
2684 Vec_Int_t * DecisionMask = Vec_IntAlloc(1);
2688 abctime clk, clkStart = Abc_Clock();
2690 int i, nNodes, nGain, fCompl, RetValue = 1;
2696 assert( Abc_NtkIsStrash(pNtk) );
2704 if ( nLevelsOdc > 0 )
2712 if ( pManRwr == NULL )
2718 if ( Abc_NtkLatchNum(pNtk) ) {
2723 pManCutRwr = Abc_NtkStartCutManForRewrite( pNtk );
2730 pManRes->
nNodesBeg = Abc_NtkNodeNum(pNtk);
2731 pManRwr->
nNodesBeg = Abc_NtkNodeNum(pNtk);
2732 pManRef->
nNodesBeg = Abc_NtkNodeNum(pNtk);
2734 nNodes = Abc_NtkObjNumMax(pNtk);
2736 if (pGain_res) *pGain_res = Vec_IntAlloc(1);
2737 if (pGain_ref) *pGain_ref = Vec_IntAlloc(1);
2738 if (pGain_rwr) *pGain_rwr = Vec_IntAlloc(1);
2739 for(
int i=0; i < nNodes; i++){Vec_IntPush(DecisionMask, atoi(
"-1"));}
2742 fpt = fopen(DecisionFile,
"w");
2746 int iterNode = pNode->
Id;
2747 Extra_ProgressBarUpdate( pProgress, i, NULL );
2748 if ( Abc_NodeIsPersistant(pNode) )
2751 Vec_IntPush((*pGain_res), -99);
2752 Vec_IntPush((*pGain_ref), -99);
2753 Vec_IntPush((*pGain_rwr), -99);
2756 if ( Abc_ObjFanoutNum(pNode) > 1000 )
2759 Vec_IntPush((*pGain_res), -99);
2760 Vec_IntPush((*pGain_ref), -99);
2761 Vec_IntPush((*pGain_rwr), -99);
2770pManRef->
timeCut += Abc_Clock() - clk;
2772 pFFormRef =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros_ref, fUseDcs, fVerbose );
2773pManRef->
timeRes += Abc_Clock() - clk;
2774 Vec_IntPush((*pGain_ref), pManRef->
nLastGain);
2777pManRes->
timeCut += Abc_Clock() - clk;
2786 pFFormRes = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
2787pManRes->
timeRes += Abc_Clock() - clk;
2788 Vec_IntPush((*pGain_res), pManRes->
nLastGain);
2790 nGain =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros_rwr, fPlaceEnable );
2791 Vec_IntPush( (*pGain_rwr), nGain);
2794 if ((**PolicyList).pArray[iterNode] == 0){sOpsOrder = 0;}
2795 if ((**PolicyList).pArray[iterNode] == 1){sOpsOrder = 1;}
2796 if ((**PolicyList).pArray[iterNode] == 2){sOpsOrder = 2;}
2797 if ((**PolicyList).pArray[iterNode] == 3){sOpsOrder = 3;}
2798 if ((**PolicyList).pArray[iterNode] == 4){sOpsOrder = 4;}
2799 if ((**PolicyList).pArray[iterNode] == 5){sOpsOrder = 5;}
2801 if ( sOpsOrder == 0)
2804 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
2810 if ( fCompl ) Dec_GraphComplement( pGraph );
2814 if ( fCompl ) Dec_GraphComplement( pGraph );
2817 (DecisionMask)->pArray[iterNode] = 0;
2824 if ( pFFormRes == NULL )
2829pManRes->
timeNtk += Abc_Clock() - clk;
2830 Dec_GraphFree( pFFormRes );
2833 (DecisionMask)->pArray[iterNode] = 2;
2839 if ( pFFormRef == NULL )
2844 Dec_GraphFree( pFFormRef );
2848pManRef->
timeNtk += Abc_Clock() - clk;
2849 Dec_GraphFree( pFFormRef );
2852 (DecisionMask)->pArray[iterNode] = 3;
2855 if (! (nGain > 0 || pManRef->
nLastGain > 0 || pManRes->
nLastGain > 0 || (nGain == 0 && fUseZeros_rwr)))
2863 if ( sOpsOrder == 1)
2866 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
2872 if ( fCompl ) Dec_GraphComplement( pGraph );
2876 if ( fCompl ) Dec_GraphComplement( pGraph );
2879 (DecisionMask)->pArray[iterNode] = 0;
2885 if ( pFFormRef == NULL )
2890 Dec_GraphFree( pFFormRef );
2894pManRef->
timeNtk += Abc_Clock() - clk;
2895 Dec_GraphFree( pFFormRef );
2898 (DecisionMask)->pArray[iterNode] = 3;
2904 if ( pFFormRes == NULL )
2909pManRes->
timeNtk += Abc_Clock() - clk;
2910 Dec_GraphFree( pFFormRes );
2913 (DecisionMask)->pArray[iterNode] = 2;
2916 if (! (nGain > 0 || pManRef->
nLastGain > 0 || pManRes->
nLastGain > 0 || (nGain == 0 && fUseZeros_rwr)))
2924 if ( sOpsOrder == 2)
2929 if ( pFFormRes == NULL )
2934pManRes->
timeNtk += Abc_Clock() - clk;
2935 Dec_GraphFree( pFFormRes );
2938 (DecisionMask)->pArray[iterNode] = 2;
2942 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
2948 if ( fCompl ) Dec_GraphComplement( pGraph );
2952 if ( fCompl ) Dec_GraphComplement( pGraph );
2955 (DecisionMask)->pArray[iterNode] = 0;
2961 if ( pFFormRef == NULL )
2966 Dec_GraphFree( pFFormRef );
2970pManRef->
timeNtk += Abc_Clock() - clk;
2971 Dec_GraphFree( pFFormRef );
2974 (DecisionMask)->pArray[iterNode] = 3;
2977 if (! (nGain > 0 || pManRef->
nLastGain > 0 || pManRes->
nLastGain > 0 || (nGain == 0 && fUseZeros_rwr)))
2985 if ( sOpsOrder == 3)
2990 if ( pFFormRes == NULL )
2995pManRes->
timeNtk += Abc_Clock() - clk;
2996 Dec_GraphFree( pFFormRes );
2999 (DecisionMask)->pArray[iterNode] = 2;
3005 if ( pFFormRef == NULL )
3010 Dec_GraphFree( pFFormRef );
3014pManRef->
timeNtk += Abc_Clock() - clk;
3015 Dec_GraphFree( pFFormRef );
3018 (DecisionMask)->pArray[iterNode] = 3;
3022 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
3028 if ( fCompl ) Dec_GraphComplement( pGraph );
3032 if ( fCompl ) Dec_GraphComplement( pGraph );
3035 (DecisionMask)->pArray[iterNode] = 0;
3039 if (! (nGain > 0 || pManRef->
nLastGain > 0 || pManRes->
nLastGain > 0 || (nGain == 0 && fUseZeros_rwr)))
3047 if ( sOpsOrder == 4)
3052 if ( pFFormRef == NULL )
3057 Dec_GraphFree( pFFormRef );
3061pManRef->
timeNtk += Abc_Clock() - clk;
3062 Dec_GraphFree( pFFormRef );
3065 (DecisionMask)->pArray[iterNode] = 3;
3069 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
3075 if ( fCompl ) Dec_GraphComplement( pGraph );
3079 if ( fCompl ) Dec_GraphComplement( pGraph );
3082 (DecisionMask)->pArray[iterNode] = 0;
3088 if ( pFFormRes == NULL )
3093pManRes->
timeNtk += Abc_Clock() - clk;
3094 Dec_GraphFree( pFFormRes );
3097 (DecisionMask)->pArray[iterNode] = 2;
3100 if (! (nGain > 0 || pManRef->
nLastGain > 0 || pManRes->
nLastGain > 0 || (nGain == 0 && fUseZeros_rwr)))
3108 if ( sOpsOrder == 5)
3113 if ( pFFormRef == NULL )
3118 Dec_GraphFree( pFFormRef );
3122pManRef->
timeNtk += Abc_Clock() - clk;
3123 Dec_GraphFree( pFFormRef );
3126 (DecisionMask)->pArray[iterNode] = 3;
3132 if ( pFFormRes == NULL )
3137pManRes->
timeNtk += Abc_Clock() - clk;
3138 Dec_GraphFree( pFFormRes );
3141 (DecisionMask)->pArray[iterNode] = 2;
3145 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
3151 if ( fCompl ) Dec_GraphComplement( pGraph );
3155 if ( fCompl ) Dec_GraphComplement( pGraph );
3158 (DecisionMask)->pArray[iterNode] = 0;
3161 if (! (nGain > 0 || pManRef->
nLastGain > 0 || pManRes->
nLastGain > 0 || (nGain == 0 && fUseZeros_rwr)))
3170 for (
int i=0; i<nNodes; i++){fprintf(fpt,
"%d\n", (DecisionMask)->pArray[i]);}
3181 pManRwr->
nNodesEnd = Abc_NtkNodeNum(pNtk);
3183pManRes->
timeTotal = Abc_Clock() - clkStart;
3184 pManRes->
nNodesEnd = Abc_NtkNodeNum(pNtk);
3186pManRef->
timeTotal = Abc_Clock() - clkStart;
3187 pManRef->
nNodesEnd = Abc_NtkNodeNum(pNtk);
3190 Abc_ManResubPrint( pManRes );
3197 Abc_ManResubStop( pManRes );
3210 pNode->
pData = NULL;
3212 if ( Abc_NtkLatchNum(pNtk) ) {
3223 printf(
"Abc_NtkOchestraction: The network check has failed.\n" );
3231int Abc_NtkOrchLocal(
Abc_Ntk_t * pNtk,
int fUseZeros_rwr,
int fUseZeros_ref,
int fPlaceEnable,
int nCutMax,
int nStepsMax,
int nLevelsOdc,
int fUpdateLevel,
int fVerbose,
int fVeryVerbose,
int nNodeSizeMax,
int nConeSizeMax,
int fUseDcs )
3254 abctime clk, clkStart = Abc_Clock();
3256 int i, nNodes, nGain, fCompl, RetValue = 1;
3262 assert( Abc_NtkIsStrash(pNtk) );
3270 if ( nLevelsOdc > 0 )
3278 if ( pManRwr == NULL )
3286 if ( Abc_NtkLatchNum(pNtk) ) {
3292 pManCutRwr = Abc_NtkStartCutManForRewrite( pNtk );
3301 pManRes->
nNodesBeg = Abc_NtkNodeNum(pNtk);
3303 pManRwr->
nNodesBeg = Abc_NtkNodeNum(pNtk);
3305 pManRef->
nNodesBeg = Abc_NtkNodeNum(pNtk);
3307 nNodes = Abc_NtkObjNumMax(pNtk);
3319 Extra_ProgressBarUpdate( pProgress, i, NULL );
3325 if ( Abc_NodeIsPersistant(pNode) )
3330 if ( Abc_ObjFanoutNum(pNode) > 1000 )
3342pManRef->
timeCut += Abc_Clock() - clk;
3345 pFFormRef =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros_ref, fUseDcs, fVerbose );
3346pManRef->
timeRes += Abc_Clock() - clk;
3352pManRes->
timeCut += Abc_Clock() - clk;
3363 pFFormRes = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
3366pManRes->
timeRes += Abc_Clock() - clk;
3370 nGain =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros_rwr, fPlaceEnable );
3374 if (((! (nGain < 0)) && (! (nGain < pManRes->nLastGain)) && (! (nGain < pManRef->nLastGain)))){
3380 if ( fCompl ) Dec_GraphComplement( pGraph );
3384 if ( fCompl ) Dec_GraphComplement( pGraph );
3386 if(pFFormRef != NULL){
3387 Dec_GraphFree( pFFormRef );
3389 if(pFFormRes != NULL){
3390 Dec_GraphFree( pFFormRes );
3397 if ( pFFormRes == NULL ) {
3398 if (pFFormRef != NULL) {
3399 Dec_GraphFree(pFFormRef);
3406pManRes->
timeNtk += Abc_Clock() - clk;
3407 Dec_GraphFree( pFFormRes );
3409 if( pFFormRef != NULL ){
3410 Dec_GraphFree( pFFormRef);
3417 if ( pFFormRef == NULL ) {
3418 if( pFFormRes != NULL) {
3419 Dec_GraphFree(pFFormRes);
3426 Dec_GraphFree( pFFormRef );
3430pManRef->
timeNtk += Abc_Clock() - clk;
3431 Dec_GraphFree( pFFormRef );
3433 if(pFFormRes != NULL){
3434 Dec_GraphFree( pFFormRes );
3440 if( pFFormRef != NULL ){
3441 Dec_GraphFree( pFFormRef);
3443 if(pFFormRes != NULL){
3444 Dec_GraphFree( pFFormRes );
3460 pManRwr->
nNodesEnd = Abc_NtkNodeNum(pNtk);
3463pManRes->
timeTotal = Abc_Clock() - clkStart;
3464 pManRes->
nNodesEnd = Abc_NtkNodeNum(pNtk);
3467pManRef->
timeTotal = Abc_Clock() - clkStart;
3468 pManRef->
nNodesEnd = Abc_NtkNodeNum(pNtk);
3472 Abc_ManResubPrint( pManRes );
3480 Abc_ManResubStop( pManRes );
3494 pNode->
pData = NULL;
3496 if ( Abc_NtkLatchNum(pNtk) ) {
3513 printf(
"Abc_NtkOchestraction: The network check has failed.\n" );
3522int Abc_NtkOchestration(
Abc_Ntk_t * pNtk,
Vec_Int_t **pGain_rwr,
Vec_Int_t **pGain_res,
Vec_Int_t **pGain_ref,
int sOpsOrder,
int fUseZeros_rwr,
int fUseZeros_ref,
int fPlaceEnable,
int nCutMax,
int nStepsMax,
int nLevelsOdc,
int fUpdateLevel,
int fVerbose,
int fVeryVerbose,
int nNodeSizeMax,
int nConeSizeMax,
int fUseDcs )
3543 abctime clk, clkStart = Abc_Clock();
3545 int i, nNodes, nGain, fCompl;
3554 assert( Abc_NtkIsStrash(pNtk) );
3562 if ( nLevelsOdc > 0 )
3570 if ( pManRwr == NULL )
3579 if ( Abc_NtkLatchNum(pNtk) ) {
3586 pManCutRwr = Abc_NtkStartCutManForRewrite( pNtk );
3595 pManRes->
nNodesBeg = Abc_NtkNodeNum(pNtk);
3597 pManRwr->
nNodesBeg = Abc_NtkNodeNum(pNtk);
3599 pManRef->
nNodesBeg = Abc_NtkNodeNum(pNtk);
3604 nNodes = Abc_NtkObjNumMax(pNtk);
3606 if (pGain_res) *pGain_res = Vec_IntAlloc(1);
3607 if (pGain_ref) *pGain_ref = Vec_IntAlloc(1);
3608 if (pGain_rwr) *pGain_rwr = Vec_IntAlloc(1);
3611 fpt = fopen(
"Ochestration_id_ops_nGain.csv",
"w");
3616 Extra_ProgressBarUpdate( pProgress, i, NULL );
3624 if ( Abc_NodeIsPersistant(pNode) )
3626 fprintf(fpt,
"%d, %s, %d\n", pNode->
Id,
"None" , -99);
3627 Vec_IntPush((*pGain_res), -99);
3628 Vec_IntPush((*pGain_ref), -99);
3629 Vec_IntPush((*pGain_rwr), -99);
3633 if ( Abc_ObjFanoutNum(pNode) > 1000 )
3635 fprintf(fpt,
"%d, %s, %d\n", pNode->
Id,
"None", -99);
3636 Vec_IntPush((*pGain_res), -99);
3637 Vec_IntPush((*pGain_ref), -99);
3638 Vec_IntPush((*pGain_rwr), -99);
3741 if ( sOpsOrder == 0)
3745 nGain =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros_rwr, fPlaceEnable );
3746 Vec_IntPush( (*pGain_rwr), nGain);
3747 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
3754 if ( fCompl ) Dec_GraphComplement( pGraph );
3758 if ( fCompl ) Dec_GraphComplement( pGraph );
3767pManRes->
timeCut += Abc_Clock() - clk;
3778 pFFormRes = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
3781pManRes->
timeRes += Abc_Clock() - clk;
3783 Vec_IntPush((*pGain_res), pManRes->
nLastGain);
3788 if ( pFFormRes != NULL ){
3793pManRes->
timeNtk += Abc_Clock() - clk;
3794 Dec_GraphFree( pFFormRes );
3802pManRef->
timeCut += Abc_Clock() - clk;
3804 pFFormRef =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros_ref, fUseDcs, fVerbose );
3805pManRef->
timeRes += Abc_Clock() - clk;
3807 Vec_IntPush((*pGain_ref), pManRef->
nLastGain);
3812 if ( pFFormRef != NULL ){
3827pManRef->
timeNtk += Abc_Clock() - clk;
3828 Dec_GraphFree( pFFormRef );
3839 if ( sOpsOrder == 1)
3843 nGain =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros_rwr, fPlaceEnable );
3844 Vec_IntPush( (*pGain_rwr), nGain);
3845 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
3853 if ( fCompl ) Dec_GraphComplement( pGraph );
3857 if ( fCompl ) Dec_GraphComplement( pGraph );
3863pManRef->
timeCut += Abc_Clock() - clk;
3865 pFFormRef =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros_ref, fUseDcs, fVerbose );
3866pManRef->
timeRes += Abc_Clock() - clk;
3867 Vec_IntPush((*pGain_ref), pManRef->
nLastGain);
3873 if ( pFFormRef != NULL ){
3878 Dec_GraphFree( pFFormRef );
3882pManRef->
timeNtk += Abc_Clock() - clk;
3883 Dec_GraphFree( pFFormRef );
3889pManRes->
timeCut += Abc_Clock() - clk;
3898 pFFormRes = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
3899pManRes->
timeRes += Abc_Clock() - clk;
3900 Vec_IntPush((*pGain_res), pManRes->
nLastGain);
3906 if ( pFFormRes != NULL ){
3911pManRes->
timeNtk += Abc_Clock() - clk;
3912 Dec_GraphFree( pFFormRes );
3926 if ( sOpsOrder == 2)
3931pManRes->
timeCut += Abc_Clock() - clk;
3940 pFFormRes = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
3941pManRes->
timeRes += Abc_Clock() - clk;
3942 Vec_IntPush((*pGain_res), pManRes->
nLastGain);
3948 if ( pFFormRes != NULL ){
3953pManRes->
timeNtk += Abc_Clock() - clk;
3954 Dec_GraphFree( pFFormRes );
3959 nGain =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros_rwr, fPlaceEnable );
3960 Vec_IntPush( (*pGain_rwr), nGain);
3962 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
3970 if ( fCompl ) Dec_GraphComplement( pGraph );
3974 if ( fCompl ) Dec_GraphComplement( pGraph );
3980pManRef->
timeCut += Abc_Clock() - clk;
3982 pFFormRef =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros_ref, fUseDcs, fVerbose );
3983pManRef->
timeRes += Abc_Clock() - clk;
3984 Vec_IntPush((*pGain_ref), pManRef->
nLastGain);
3990 if ( pFFormRef != NULL ){
3995 Dec_GraphFree( pFFormRef );
3999pManRef->
timeNtk += Abc_Clock() - clk;
4000 Dec_GraphFree( pFFormRef );
4013 if ( sOpsOrder == 3)
4018pManRes->
timeCut += Abc_Clock() - clk;
4027 pFFormRes = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
4028pManRes->
timeRes += Abc_Clock() - clk;
4029 Vec_IntPush((*pGain_res), pManRes->
nLastGain);
4035 if ( pFFormRes != NULL ){
4040pManRes->
timeNtk += Abc_Clock() - clk;
4041 Dec_GraphFree( pFFormRes );
4047pManRef->
timeCut += Abc_Clock() - clk;
4049 pFFormRef =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros_ref, fUseDcs, fVerbose );
4050pManRef->
timeRes += Abc_Clock() - clk;
4051 Vec_IntPush((*pGain_ref), pManRef->
nLastGain);
4057 if ( pFFormRef != NULL ){
4062 Dec_GraphFree( pFFormRef );
4066pManRef->
timeNtk += Abc_Clock() - clk;
4067 Dec_GraphFree( pFFormRef );
4072 nGain =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros_rwr, fPlaceEnable );
4073 Vec_IntPush( (*pGain_rwr), nGain);
4074 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
4082 if ( fCompl ) Dec_GraphComplement( pGraph );
4086 if ( fCompl ) Dec_GraphComplement( pGraph );
4101 if ( sOpsOrder == 4)
4106pManRef->
timeCut += Abc_Clock() - clk;
4108 pFFormRef =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros_ref, fUseDcs, fVerbose );
4109pManRef->
timeRes += Abc_Clock() - clk;
4110 Vec_IntPush((*pGain_ref), pManRef->
nLastGain);
4116 if ( pFFormRef != NULL ){
4121 Dec_GraphFree( pFFormRef );
4125pManRef->
timeNtk += Abc_Clock() - clk;
4126 Dec_GraphFree( pFFormRef );
4131 nGain =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros_rwr, fPlaceEnable );
4132 Vec_IntPush( (*pGain_rwr), nGain);
4134 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
4142 if ( fCompl ) Dec_GraphComplement( pGraph );
4146 if ( fCompl ) Dec_GraphComplement( pGraph );
4152pManRes->
timeCut += Abc_Clock() - clk;
4161 pFFormRes = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
4162pManRes->
timeRes += Abc_Clock() - clk;
4163 Vec_IntPush((*pGain_res), pManRes->
nLastGain);
4169 if ( pFFormRes != NULL ){
4174pManRes->
timeNtk += Abc_Clock() - clk;
4175 Dec_GraphFree( pFFormRes );
4188 if ( sOpsOrder == 5)
4193pManRef->
timeCut += Abc_Clock() - clk;
4195 pFFormRef =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros_ref, fUseDcs, fVerbose );
4196pManRef->
timeRes += Abc_Clock() - clk;
4197 Vec_IntPush((*pGain_ref), pManRef->
nLastGain);
4203 if ( pFFormRef != NULL ){
4208 Dec_GraphFree( pFFormRef );
4212pManRef->
timeNtk += Abc_Clock() - clk;
4213 Dec_GraphFree( pFFormRef );
4219pManRes->
timeCut += Abc_Clock() - clk;
4228 pFFormRes = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
4229pManRes->
timeRes += Abc_Clock() - clk;
4230 Vec_IntPush((*pGain_res), pManRes->
nLastGain);
4236 if ( pFFormRes != NULL ){
4241pManRes->
timeNtk += Abc_Clock() - clk;
4242 Dec_GraphFree( pFFormRes );
4247 nGain =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros_rwr, fPlaceEnable );
4248 Vec_IntPush( (*pGain_rwr), nGain);
4250 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
4258 if ( fCompl ) Dec_GraphComplement( pGraph );
4262 if ( fCompl ) Dec_GraphComplement( pGraph );
4287 pManRwr->
nNodesEnd = Abc_NtkNodeNum(pNtk);
4290pManRes->
timeTotal = Abc_Clock() - clkStart;
4291 pManRes->
nNodesEnd = Abc_NtkNodeNum(pNtk);
4294pManRef->
timeTotal = Abc_Clock() - clkStart;
4295 pManRef->
nNodesEnd = Abc_NtkNodeNum(pNtk);
4299 Abc_ManResubPrint( pManRes );
4307 Abc_ManResubStop( pManRes );
4321 pNode->
pData = NULL;
4323 if ( Abc_NtkLatchNum(pNtk) ) {
4340 printf(
"Abc_NtkOchestraction: The network check has failed.\n" );
4351int Abc_NtkOchestration3(
Abc_Ntk_t * pNtk,
Vec_Int_t **pGain_rwr,
Vec_Int_t **pGain_res,
Vec_Int_t **pGain_ref,
Vec_Int_t **pOps_num,
int fUseZeros,
int fUseZeros_rwr,
int fUseZeros_ref,
int fPlaceEnable,
int nCutMax,
int nStepsMax,
int nLevelsOdc,
int fUpdateLevel,
int fVerbose,
int fVeryVerbose,
int nNodeSizeMax,
int nConeSizeMax,
int fUseDcs )
4373 abctime clk, clkStart = Abc_Clock();
4375 int i, nNodes, nGain, nGain_zeros, fCompl, RetValue = 1;
4382 assert( Abc_NtkIsStrash(pNtk) );
4390 if ( nLevelsOdc > 0 )
4398 if ( pManRwr == NULL )
4406 if ( Abc_NtkLatchNum(pNtk) ) {
4412 pManCutRwr = Abc_NtkStartCutManForRewrite( pNtk );
4421 pManRes->
nNodesBeg = Abc_NtkNodeNum(pNtk);
4423 pManRwr->
nNodesBeg = Abc_NtkNodeNum(pNtk);
4425 pManRef->
nNodesBeg = Abc_NtkNodeNum(pNtk);
4427 nNodes = Abc_NtkObjNumMax(pNtk);
4429 if (pGain_res) *pGain_res = Vec_IntAlloc(1);
4430 if (pGain_ref) *pGain_ref = Vec_IntAlloc(1);
4431 if (pGain_rwr) *pGain_rwr = Vec_IntAlloc(1);
4434 fpt = fopen(
"Ochestration_id_ops_nGain.csv",
"w");
4438 if (pOps_num) *pOps_num = Vec_IntAlloc(1);
4440 Extra_ProgressBarUpdate( pProgress, i, NULL );
4445 if ( Abc_NodeIsPersistant(pNode) )
4447 if (!(pGain_res && pGain_ref && pGain_rwr))
4449 fprintf(fpt,
"%d, %s, %d\n", pNode->
Id,
"None" , -99);
4450 Vec_IntPush((*pGain_res), -99);
4451 Vec_IntPush((*pGain_ref), -99);
4452 Vec_IntPush((*pGain_rwr), -99);
4456 if ( Abc_ObjFanoutNum(pNode) > 1000 )
4458 if (!(pGain_res && pGain_ref && pGain_rwr))
4460 fprintf(fpt,
"%d, %s, %d\n", pNode->
Id,
"None", -99);
4461 Vec_IntPush((*pGain_res), -99);
4462 Vec_IntPush((*pGain_ref), -99);
4463 Vec_IntPush((*pGain_rwr), -99);
4473pManRef->
timeCut += Abc_Clock() - clk;
4475 pFFormRef =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros, fUseDcs, fVerbose );
4476 pFFormRef_zeros =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros_ref, fUseDcs, fVerbose );
4477pManRef->
timeRes += Abc_Clock() - clk;
4478 Vec_IntPush((*pGain_ref), pManRef->
nLastGain);
4484pManRes->
timeCut += Abc_Clock() - clk;
4495 pFFormRes = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
4498pManRes->
timeRes += Abc_Clock() - clk;
4500 Vec_IntPush((*pGain_res), pManRes->
nLastGain);
4504 nGain =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros, fPlaceEnable );
4505 nGain_zeros =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros_rwr, fPlaceEnable );
4506 Vec_IntPush( (*pGain_rwr), nGain);
4511 fprintf(fpt,
"%d, %s, %d, %s, %d, %s, %d, %s, %d\n", pNode->
Id,
"Oches_Res", pManRes->
nLastGain,
"Oches_Ref", pManRef->
nLastGain,
"Oches_Rwr", nGain,
"Oches_Rwr_Zeros", nGain_zeros);
4516 Vec_IntPush((*pOps_num), 0);
4518 if ( nGain_zeros > 0 )
4520 Vec_IntPush((*pOps_num), 1);
4524 Vec_IntPush((*pOps_num), 2);
4525 Vec_IntPush((*pOps_num), 3);
4529 Vec_IntPush((*pOps_num), 4);
4538 if (! ((**pOps_num).nSize > 0))
4547 int Ops_size = (**pOps_num).nSize;
4548 int r = rand() % Ops_size;
4549 int Ops_num = (**pOps_num).pArray[r];
4562 if ( fCompl ) Dec_GraphComplement( pGraph );
4566 if ( fCompl ) Dec_GraphComplement( pGraph );
4579 if ( fCompl ) Dec_GraphComplement( pGraph );
4583 if ( fCompl ) Dec_GraphComplement( pGraph );
4592 if ( pFFormRef == NULL )
4597 Dec_GraphFree( pFFormRef );
4601pManRef->
timeNtk += Abc_Clock() - clk;
4602 Dec_GraphFree( pFFormRef );
4611 if ( pFFormRef_zeros == NULL )
4616 Dec_GraphFree( pFFormRef_zeros );
4620pManRef->
timeNtk += Abc_Clock() - clk;
4621 Dec_GraphFree( pFFormRef_zeros );
4630 if ( pFFormRes == NULL )
4635pManRes->
timeNtk += Abc_Clock() - clk;
4636 Dec_GraphFree( pFFormRes );
4656 pManRwr->
nNodesEnd = Abc_NtkNodeNum(pNtk);
4659pManRes->
timeTotal = Abc_Clock() - clkStart;
4660 pManRes->
nNodesEnd = Abc_NtkNodeNum(pNtk);
4663pManRef->
timeTotal = Abc_Clock() - clkStart;
4664 pManRef->
nNodesEnd = Abc_NtkNodeNum(pNtk);
4668 Abc_ManResubPrint( pManRes );
4676 Abc_ManResubStop( pManRes );
4690 pNode->
pData = NULL;
4692 if ( Abc_NtkLatchNum(pNtk) ) {
4709 printf(
"Abc_NtkOchestraction: The network check has failed.\n" );
4717int Abc_NtkOchestration2(
Abc_Ntk_t * pNtk,
Vec_Int_t **pGain_rwr,
Vec_Int_t **pGain_res,
Vec_Int_t **pGain_ref,
Vec_Int_t **pOps_num,
int fUseZeros,
int fUseZeros_rwr,
int fUseZeros_ref,
int fPlaceEnable,
int nCutMax,
int nStepsMax,
int nLevelsOdc,
int fUpdateLevel,
int fVerbose,
int fVeryVerbose,
int nNodeSizeMax,
int nConeSizeMax,
int fUseDcs )
4739 abctime clk, clkStart = Abc_Clock();
4741 int i, nNodes, nGain, nGain_zeros, fCompl, RetValue = 1;
4749 int decisionOps = 0;
4750 assert( Abc_NtkIsStrash(pNtk) );
4758 if ( nLevelsOdc > 0 )
4766 if ( pManRwr == NULL )
4774 if ( Abc_NtkLatchNum(pNtk) ) {
4780 pManCutRwr = Abc_NtkStartCutManForRewrite( pNtk );
4789 pManRes->
nNodesBeg = Abc_NtkNodeNum(pNtk);
4791 pManRwr->
nNodesBeg = Abc_NtkNodeNum(pNtk);
4793 pManRef->
nNodesBeg = Abc_NtkNodeNum(pNtk);
4795 nNodes = Abc_NtkObjNumMax(pNtk);
4797 if (pGain_res) *pGain_res = Vec_IntAlloc(1);
4798 if (pGain_ref) *pGain_ref = Vec_IntAlloc(1);
4799 if (pGain_rwr) *pGain_rwr = Vec_IntAlloc(1);
4802 fpt = fopen(
"Ochestration_id_ops_nGain.csv",
"w");
4810 if (pOps_num) *pOps_num = Vec_IntAlloc(1);
4812 Extra_ProgressBarUpdate( pProgress, i, NULL );
4817 if ( Abc_NodeIsPersistant(pNode) )
4819 fprintf(fpt,
"%d, %d, %d, %d, %d\n", pNode->
Id, 0, 0, 0, 0);
4820 Vec_IntPush((*pGain_res), -99);
4821 Vec_IntPush((*pGain_ref), -99);
4822 Vec_IntPush((*pGain_rwr), -99);
4826 if ( Abc_ObjFanoutNum(pNode) > 1000 )
4828 fprintf(fpt,
"%d, %d, %d, %d, %d\n", pNode->
Id, 0, 0, 0, 0);
4829 Vec_IntPush((*pGain_res), -99);
4830 Vec_IntPush((*pGain_ref), -99);
4831 Vec_IntPush((*pGain_rwr), -99);
4841pManRef->
timeCut += Abc_Clock() - clk;
4843 pFFormRef =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros, fUseDcs, fVerbose );
4844 pFFormRef_zeros =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros_ref, fUseDcs, fVerbose );
4845pManRef->
timeRes += Abc_Clock() - clk;
4846 Vec_IntPush((*pGain_ref), pManRef->
nLastGain);
4852pManRes->
timeCut += Abc_Clock() - clk;
4863 pFFormRes = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
4866pManRes->
timeRes += Abc_Clock() - clk;
4868 Vec_IntPush((*pGain_res), pManRes->
nLastGain);
4872 nGain =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros, fPlaceEnable );
4873 nGain_zeros =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros_rwr, fPlaceEnable );
4874 Vec_IntPush( (*pGain_rwr), nGain);
4879 fprintf(fpt,
"%d, %s, %d, %s, %d, %s, %d, %s, %d\n", pNode->
Id,
"Oches_Res", pManRes->
nLastGain,
"Oches_Ref", pManRef->
nLastGain,
"Oches_Rwr", nGain,
"Oches_Rwr_Zeros", nGain_zeros);
4887 Vec_IntPush((*pOps_num), 0);
4898 Vec_IntPush((*pOps_num), 2);
4905 Vec_IntPush((*pOps_num), 1);
4914 if (! ((**pOps_num).nSize > 0))
4916 fprintf(fpt,
"%d, %d, %d, %d, %d\n", pNode->
Id, 0, 0, 0, 0);
4935 int Ops_size = (**pOps_num).nSize;
4936 int r = rand() % Ops_size;
4937 int Ops_num = (**pOps_num).pArray[r];
4951 if ( fCompl ) Dec_GraphComplement( pGraph );
4955 if ( fCompl ) Dec_GraphComplement( pGraph );
4957 fprintf(fpt,
"%d, %d, %d, %d, %d\n", pNode->
Id, rwr_ok, ref_ok, res_ok, decisionOps);
4984 if ( pFFormRef == NULL )
4989 Dec_GraphFree( pFFormRef );
4993pManRef->
timeNtk += Abc_Clock() - clk;
4994 Dec_GraphFree( pFFormRef );
4995 fprintf(fpt,
"%d, %d, %d, %d, %d\n", pNode->
Id, rwr_ok, ref_ok, res_ok, decisionOps);
5025 if ( pFFormRes == NULL )
5030pManRes->
timeNtk += Abc_Clock() - clk;
5031 Dec_GraphFree( pFFormRes );
5032 fprintf(fpt,
"%d, %d, %d, %d, %d\n", pNode->
Id, rwr_ok, ref_ok, res_ok, decisionOps);
5053 pManRwr->
nNodesEnd = Abc_NtkNodeNum(pNtk);
5056pManRes->
timeTotal = Abc_Clock() - clkStart;
5057 pManRes->
nNodesEnd = Abc_NtkNodeNum(pNtk);
5060pManRef->
timeTotal = Abc_Clock() - clkStart;
5061 pManRef->
nNodesEnd = Abc_NtkNodeNum(pNtk);
5065 Abc_ManResubPrint( pManRes );
5073 Abc_ManResubStop( pManRes );
5087 pNode->
pData = NULL;
5089 if ( Abc_NtkLatchNum(pNtk) ) {
5106 printf(
"Abc_NtkOchestraction: The network check has failed.\n" );
5114int Abc_NtkOrchGNN(
Abc_Ntk_t * pNtk,
char * edgelistFile,
char * featFile,
int fUseZeros,
int fUseZeros_rwr,
int fUseZeros_ref,
int fPlaceEnable,
int nCutMax,
int nStepsMax,
int nLevelsOdc,
int fUpdateLevel,
int fVerbose,
int fVeryVerbose,
int nNodeSizeMax,
int nConeSizeMax,
int fUseDcs )
5139 abctime clk, clkStart = Abc_Clock();
5141 int i, nNodes, nGain, nGain_zeros;
5146 assert( Abc_NtkIsStrash(pNtk) );
5154 if ( nLevelsOdc > 0 )
5162 if ( pManRwr == NULL )
5170 if ( Abc_NtkLatchNum(pNtk) ) {
5176 pManCutRwr = Abc_NtkStartCutManForRewrite( pNtk );
5185 pManRes->
nNodesBeg = Abc_NtkNodeNum(pNtk);
5187 pManRwr->
nNodesBeg = Abc_NtkNodeNum(pNtk);
5189 pManRef->
nNodesBeg = Abc_NtkNodeNum(pNtk);
5191 nNodes = Abc_NtkObjNumMax(pNtk);
5199 f_el = fopen(edgelistFile,
"w");
5200 f_feats = fopen(featFile,
"w");
5204 int iterNode = pNode->
Id;
5206 fprintf(f_el,
"%d %d\n", iterNode, Abc_ObjId(pFanin));
5212 Extra_ProgressBarUpdate( pProgress, i, NULL );
5218 if ( Abc_NodeIsPersistant(pNode) )
5221 fprintf(f_feats,
"%d, %d, %d, %d, %d, %d, %d, %d\n", Abc_ObjFaninC0(pNode), Abc_ObjFaninC1(pNode), -1, -1, -1, -1, -1, -1);
5226 if ( Abc_ObjFanoutNum(pNode) > 1000 )
5229 fprintf(f_feats,
"%d, %d, %d, %d, %d, %d, %d, %d\n", Abc_ObjFaninC0(pNode), Abc_ObjFaninC1(pNode), -1, -1, -1, -1, -1, -1);
5241pManRef->
timeCut += Abc_Clock() - clk;
5243 pFFormRef =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros, fUseDcs, fVerbose );
5244 pFFormRef_zeros =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros_ref, fUseDcs, fVerbose );
5245pManRef->
timeRes += Abc_Clock() - clk;
5246 if (! (pManRef->
nLastGain < 0) ) {ref_ok = 1;}
5252pManRes->
timeCut += Abc_Clock() - clk;
5263 pFFormRes = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
5266pManRes->
timeRes += Abc_Clock() - clk;
5268 if (! (pManRes->
nLastGain < 0) ) {res_ok = 1;}
5271 nGain =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros, fPlaceEnable );
5272 nGain_zeros =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros_rwr, fPlaceEnable );
5273 if (! (nGain < 0) ) {rwr_ok = 1;}
5276 fprintf(f_feats,
"%d, %d, %d, %d, %d, %d, %d, %d\n", Abc_ObjFaninC0(pNode), Abc_ObjFaninC1(pNode), rwr_ok, nGain, res_ok, pManRes->
nLastGain, ref_ok, pManRef->
nLastGain);
5294 pManRwr->
nNodesEnd = Abc_NtkNodeNum(pNtk);
5297pManRes->
timeTotal = Abc_Clock() - clkStart;
5298 pManRes->
nNodesEnd = Abc_NtkNodeNum(pNtk);
5301pManRef->
timeTotal = Abc_Clock() - clkStart;
5302 pManRef->
nNodesEnd = Abc_NtkNodeNum(pNtk);
5306 Abc_ManResubPrint( pManRes );
5314 Abc_ManResubStop( pManRes );
5328 pNode->
pData = NULL;
5330 if ( Abc_NtkLatchNum(pNtk) ) {
5347 printf(
"Abc_NtkOchestraction: The network check has failed.\n" );
5355int Abc_NtkOrchRand(
Abc_Ntk_t * pNtk,
Vec_Int_t **pGain_rwr,
Vec_Int_t **pGain_res,
Vec_Int_t **pGain_ref,
Vec_Int_t **DecisionMask,
char * DecisionFile,
int Rand_Seed,
int fUseZeros_rwr,
int fUseZeros_ref,
int fPlaceEnable,
int nCutMax,
int nStepsMax,
int nLevelsOdc,
int fUpdateLevel,
int fVerbose,
int fVeryVerbose,
int nNodeSizeMax,
int nConeSizeMax,
int fUseDcs )
5377 abctime clk, clkStart = Abc_Clock();
5378 int i, nNodes, nNodes_after, nGain, fCompl;
5388 assert( Abc_NtkIsStrash(pNtk) );
5396 if ( nLevelsOdc > 0 )
5404 if ( pManRwr == NULL )
5413 if ( Abc_NtkLatchNum(pNtk) ) {
5420 pManCutRwr = Abc_NtkStartCutManForRewrite( pNtk );
5429 pManRes->
nNodesBeg = Abc_NtkNodeNum(pNtk);
5431 pManRwr->
nNodesBeg = Abc_NtkNodeNum(pNtk);
5433 pManRef->
nNodesBeg = Abc_NtkNodeNum(pNtk);
5438 nNodes = Abc_NtkObjNumMax(pNtk);
5442 if (pGain_res) *pGain_res = Vec_IntAlloc(1);
5443 if (pGain_ref) *pGain_ref = Vec_IntAlloc(1);
5444 if (pGain_rwr) *pGain_rwr = Vec_IntAlloc(1);
5448 fpt = fopen(DecisionFile,
"w");
5453 int iterNode = pNode->
Id;
5454 Extra_ProgressBarUpdate( pProgress, i, NULL );
5462 if ( Abc_NodeIsPersistant(pNode) )
5465 Vec_IntPush((*pGain_res), -99);
5466 Vec_IntPush((*pGain_ref), -99);
5467 Vec_IntPush((*pGain_rwr), -99);
5471 if ( Abc_ObjFanoutNum(pNode) > 1000 )
5474 Vec_IntPush((*pGain_res), -99);
5475 Vec_IntPush((*pGain_ref), -99);
5476 Vec_IntPush((*pGain_rwr), -99);
5483 Vec_IntPush( (Valid_Ops), -1);
5484 nGain =
Rwr_NodeRewrite( pManRwr, pManCutRwr, pNode, fUpdateLevel, fUseZeros_rwr, fPlaceEnable );
5485 Vec_IntPush( (*pGain_rwr), nGain);
5486 if (nGain > 0 || (nGain == 0 && fUseZeros_rwr))
5488 Vec_IntPush( (Valid_Ops), 0);
5491 pManRes->
timeCut += Abc_Clock() - clk;
5500 pFFormRes = Abc_ManResubEval( pManRes, pNode, vLeaves, nStepsMax, fUpdateLevel, fVerbose );
5501pManRes->
timeRes += Abc_Clock() - clk;
5502 Vec_IntPush((*pGain_res), pManRes->
nLastGain);
5505 if ( pFFormRes != NULL ){
5506 Vec_IntPush( (Valid_Ops), 1);
5511pManRef->
timeCut += Abc_Clock() - clk;
5513 pFFormRef =
Abc_NodeRefactor_1( pManRef, pNode, vFanins, fUpdateLevel, fUseZeros_ref, fUseDcs, fVerbose );
5514pManRef->
timeRes += Abc_Clock() - clk;
5516 Vec_IntPush((*pGain_ref), pManRef->
nLastGain);
5519 if ( pFFormRef != NULL ){
5520 Vec_IntPush( (Valid_Ops), 2);
5523 Valid_Len = (Valid_Ops)->nSize;
5536int r = rand() % Valid_Len;
5538 if ((Valid_Ops)->pArray[r] == -1){
5539 (*DecisionMask)->pArray[iterNode] = -1;
5541 Vec_IntZero(Valid_Ops);
5544 else if ((Valid_Ops->pArray[r]) == 0){
5550 if ( fCompl ) Dec_GraphComplement( pGraph );
5554 if ( fCompl ) Dec_GraphComplement( pGraph );
5555 (*DecisionMask)->pArray[iterNode] = 0;
5557 Vec_IntZero(Valid_Ops);
5560 else if ((Valid_Ops->pArray[r] == 1)){
5565pManRes->
timeNtk += Abc_Clock() - clk;
5566 Dec_GraphFree( pFFormRes );
5567 (*DecisionMask)->pArray[iterNode] = 1;
5569 Vec_IntZero(Valid_Ops);
5572 else if ((Valid_Ops->pArray[r] == 2)){
5576 Dec_GraphFree( pFFormRef );
5580pManRef->
timeNtk += Abc_Clock() - clk;
5581 Dec_GraphFree( pFFormRef );
5582 (*DecisionMask)->pArray[iterNode] = 2;
5584 Vec_IntZero(Valid_Ops);
5589 for (
int i = 0; i < (nNodes); i++){
5590 fprintf(fpt,
"%d\n", (*DecisionMask)->pArray[i]);}
5602 pManRwr->
nNodesEnd = Abc_NtkNodeNum(pNtk);
5605pManRes->
timeTotal = Abc_Clock() - clkStart;
5606 pManRes->
nNodesEnd = Abc_NtkNodeNum(pNtk);
5609pManRef->
timeTotal = Abc_Clock() - clkStart;
5610 pManRef->
nNodesEnd = Abc_NtkNodeNum(pNtk);
5614 Abc_ManResubPrint( pManRes );
5622 Abc_ManResubStop( pManRes );
5636 pNode->
pData = NULL;
5638 if ( Abc_NtkLatchNum(pNtk) ) {
5655 printf(
"Abc_NtkOchestraction: The network check has failed.\n" );
5658 nNodes_after = Abc_NtkObjNumMax(pNtk);
Dec_Graph_t * Abc_ManResubQuit1_1(Abc_Obj_t *pRoot, Abc_Obj_t *pObj0, Abc_Obj_t *pObj1, int fOrGate)
int Abc_NtkOchestration3(Abc_Ntk_t *pNtk, Vec_Int_t **pGain_rwr, Vec_Int_t **pGain_res, Vec_Int_t **pGain_ref, Vec_Int_t **pOps_num, int fUseZeros, int fUseZeros_rwr, int fUseZeros_ref, int fPlaceEnable, int nCutMax, int nStepsMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose, int nNodeSizeMax, int nConeSizeMax, int fUseDcs)
void Abc_NodePrintCuts(Abc_Obj_t *pNode)
Dec_Graph_t * Abc_ManResubQuit2_1(Abc_Obj_t *pRoot, Abc_Obj_t *pObj0, Abc_Obj_t *pObj1, Abc_Obj_t *pObj2, int fOrGate)
Dec_Graph_t * Abc_NodeRefactor_1(Abc_ManRef_t *p, Abc_Obj_t *pNode, Vec_Ptr_t *vFanins, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose)
void Abc_PlaceUpdate(Vec_Ptr_t *vAddedCells, Vec_Ptr_t *vUpdatedNets)
int Abc_NodeConeIsConst0_1(word *pTruth, int nVars)
int Abc_NtkOrchSA(Abc_Ntk_t *pNtk, Vec_Int_t **pGain_rwr, Vec_Int_t **pGain_res, Vec_Int_t **pGain_ref, Vec_Int_t **PolicyList, char *DecisionFile, int fUseZeros_rwr, int fUseZeros_ref, int fPlaceEnable, int nCutMax, int nStepsMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose, int nNodeSizeMax, int nConeSizeMax, int fUseDcs)
int Abc_NodeConeIsConst1_1(word *pTruth, int nVars)
Abc_ManRef_t * Abc_NtkManRefStart_1(int nNodeSizeMax, int nConeSizeMax, int fUseDcs, int fVerbose)
int Abc_NtkOrchRand(Abc_Ntk_t *pNtk, Vec_Int_t **pGain_rwr, Vec_Int_t **pGain_res, Vec_Int_t **pGain_ref, Vec_Int_t **DecisionMask, char *DecisionFile, int Rand_Seed, int fUseZeros_rwr, int fUseZeros_ref, int fPlaceEnable, int nCutMax, int nStepsMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose, int nNodeSizeMax, int nConeSizeMax, int fUseDcs)
int Abc_NtkOrchGNN(Abc_Ntk_t *pNtk, char *edgelistFile, char *featFile, int fUseZeros, int fUseZeros_rwr, int fUseZeros_ref, int fPlaceEnable, int nCutMax, int nStepsMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose, int nNodeSizeMax, int nConeSizeMax, int fUseDcs)
void Abc_ManShowCutCone(Abc_Obj_t *pNode, Vec_Ptr_t *vLeaves)
void Abc_NtkManRefStop_1(Abc_ManRef_t *p)
int Dec_GraphUpdateNetwork(Abc_Obj_t *pRoot, Dec_Graph_t *pGraph, int fUpdateLevel, int nGain)
void Abc_CutFactor_rec_1(Abc_Obj_t *pObj, Vec_Ptr_t *vLeaves)
Dec_Graph_t * Abc_ManResubQuit3_1(Abc_Obj_t *pRoot, Abc_Obj_t *pObj0, Abc_Obj_t *pObj1, Abc_Obj_t *pObj2, Abc_Obj_t *pObj3, int fOrGate)
int Abc_NtkRefactor3(Abc_Ntk_t *pNtk, Vec_Int_t **pGain_ref, int nNodeSizeMax, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose)
void Abc_ManResubCollectDivs_rec1(Abc_Obj_t *pNode, Vec_Ptr_t *vInternal)
Vec_Ptr_t * Abc_CutFactor_1(Abc_Obj_t *pNode)
Dec_Graph_t * Abc_ManResubQuit0_1(Abc_Obj_t *pRoot, Abc_Obj_t *pObj)
struct Abc_ManRes_t_ Abc_ManRes_t
int Abc_NtkOchestration2(Abc_Ntk_t *pNtk, Vec_Int_t **pGain_rwr, Vec_Int_t **pGain_res, Vec_Int_t **pGain_ref, Vec_Int_t **pOps_num, int fUseZeros, int fUseZeros_rwr, int fUseZeros_ref, int fPlaceEnable, int nCutMax, int nStepsMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose, int nNodeSizeMax, int nConeSizeMax, int fUseDcs)
Dec_Graph_t * Abc_ManResubQuit21_1(Abc_Obj_t *pRoot, Abc_Obj_t *pObj0, Abc_Obj_t *pObj1, Abc_Obj_t *pObj2, int fOrGate)
void Abc_PlaceBegin(Abc_Ntk_t *pNtk)
int Abc_NtkOrchLocal(Abc_Ntk_t *pNtk, int fUseZeros_rwr, int fUseZeros_ref, int fPlaceEnable, int nCutMax, int nStepsMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose, int nNodeSizeMax, int nConeSizeMax, int fUseDcs)
void Abc_NtkManRefPrintStats_1(Abc_ManRef_t *p)
void Abc_PlaceEnd(Abc_Ntk_t *pNtk)
int Abc_NtkRewrite3(Abc_Ntk_t *pNtk, Vec_Int_t **pGain_rw, int fUpdateLevel, int fUseZeros, int fVerbose, int fVeryVerbose, int fPlaceEnable)
FUNCTION DEFINITIONS ///.
word * Abc_NodeConeTruth_1(Vec_Ptr_t *vVars, Vec_Ptr_t *vFuncs, int nWordsMax, Abc_Obj_t *pRoot, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vVisited)
int Abc_NtkOchestration(Abc_Ntk_t *pNtk, Vec_Int_t **pGain_rwr, Vec_Int_t **pGain_res, Vec_Int_t **pGain_ref, int sOpsOrder, int fUseZeros_rwr, int fUseZeros_ref, int fPlaceEnable, int nCutMax, int nStepsMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose, int nNodeSizeMax, int nConeSizeMax, int fUseDcs)
int Abc_NtkResubstitute3(Abc_Ntk_t *pNtk, Vec_Int_t **pGain_res, int nCutMax, int nStepsMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose)
struct Abc_ManRef_t_ Abc_ManRef_t
int Abc_CutVolumeCheck_rec_1(Abc_Obj_t *pObj)
int Abc_NodeMffcInside(Abc_Obj_t *pNode, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vInside)
struct Abc_Obj_t_ Abc_Obj_t
ABC_DLL int Abc_NodeMffcSize(Abc_Obj_t *pNode)
FUNCTION DEFINITIONS ///.
ABC_DLL Odc_Man_t * Abc_NtkDontCareAlloc(int nVarsMax, int nLevels, int fVerbose, int fVeryVerbose)
FUNCTION DEFINITIONS ///.
#define Abc_NtkForEachLatch(pNtk, pObj, i)
ABC_DLL int Abc_ObjRequiredLevel(Abc_Obj_t *pObj)
ABC_DLL void Abc_AigUpdateReset(Abc_Aig_t *pMan)
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
ABC_DLL int Abc_NtkDontCareCompute(Odc_Man_t *p, Abc_Obj_t *pNode, Vec_Ptr_t *vLeaves, unsigned *puTruth)
ABC_DLL int Abc_NodeMffcLabelAig(Abc_Obj_t *pNode)
#define Abc_ObjForEachFanin(pObj, pFanin, i)
#define Abc_ObjForEachFanout(pObj, pFanout, i)
struct Abc_ManCut_t_ Abc_ManCut_t
struct Odc_Man_t_ Odc_Man_t
ABC_DLL void Abc_NodeConeCollect(Abc_Obj_t **ppRoots, int nRoots, Vec_Ptr_t *vFanins, Vec_Ptr_t *vVisited, int fIncludeFanins)
ABC_DLL void Abc_NtkDontCareClear(Odc_Man_t *p)
struct Abc_Aig_t_ Abc_Aig_t
ABC_DLL void Abc_NtkManCutStop(Abc_ManCut_t *p)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL void Abc_NtkStopReverseLevels(Abc_Ntk_t *pNtk)
ABC_DLL Vec_Int_t * Abc_NtkFanoutCounts(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NodeIsMuxControlType(Abc_Obj_t *pNode)
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
ABC_DLL Vec_Ptr_t * Abc_NodeFindCut(Abc_ManCut_t *p, Abc_Obj_t *pRoot, int fContain)
ABC_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
ABC_DLL void Abc_NtkStartReverseLevels(Abc_Ntk_t *pNtk, int nMaxLevelIncrease)
ABC_DLL Vec_Ptr_t * Abc_NtkManCutReadCutLarge(Abc_ManCut_t *p)
#define Abc_NtkForEachCi(pNtk, pCi, i)
ABC_DLL void Abc_NtkDontCareFree(Odc_Man_t *p)
ABC_DLL void Abc_NtkReassignIds(Abc_Ntk_t *pNtk)
ABC_DLL Abc_ManCut_t * Abc_NtkManCutStart(int nNodeSizeMax, int nConeSizeMax, int nNodeFanStop, int nConeFanStop)
#define Abc_NtkForEachNode(pNtk, pNode, i)
#define ABC_ALLOC(type, num)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
#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
ABC_NAMESPACE_IMPL_START typedef char ProgressBar
struct Cut_ParamsStruct_t_ Cut_Params_t
void Cut_NodeSetTriv(Cut_Man_t *p, int Node)
Cut_Man_t * Cut_ManStart(Cut_Params_t *pParams)
FUNCTION DEFINITIONS ///.
struct Cut_ManStruct_t_ Cut_Man_t
BASIC TYPES ///.
void Cut_ManSetFanoutCounts(Cut_Man_t *p, Vec_Int_t *vFanCounts)
void Cut_ManStop(Cut_Man_t *p)
int Dec_GraphToNetworkCount(Abc_Obj_t *pRoot, Dec_Graph_t *pGraph, int NodeMax, int LevelMax)
typedefABC_NAMESPACE_HEADER_START struct Dec_Edge_t_ Dec_Edge_t
INCLUDES ///.
struct Dec_Graph_t_ Dec_Graph_t
unsigned __int64 word
DECLARATIONS ///.
Kit_Graph_t * Kit_TruthToGraph(unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
void Rwr_ManAddTimeUpdate(Rwr_Man_t *p, abctime Time)
Rwr_Man_t * Rwr_ManStart(int fPrecompute)
DECLARATIONS ///.
void Rwr_ScoresClean(Rwr_Man_t *p)
void Rwr_ManAddTimeCuts(Rwr_Man_t *p, abctime Time)
void Rwr_ManAddTimeTotal(Rwr_Man_t *p, abctime Time)
void Rwr_ScoresReport(Rwr_Man_t *p)
int Rwr_ManReadCompl(Rwr_Man_t *p)
void Rwr_ManPrintStats(Rwr_Man_t *p)
struct Rwr_Man_t_ Rwr_Man_t
void Rwr_ManStop(Rwr_Man_t *p)
int Rwr_NodeRewrite(Rwr_Man_t *p, Cut_Man_t *pManCut, Abc_Obj_t *pNode, int fUpdateLevel, int fUseZeros, int fPlaceEnable)
FUNCTION DEFINITIONS ///.
void * Rwr_ManReadDecs(Rwr_Man_t *p)
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
#define Vec_PtrForEachEntryStop(Type, vVec, pEntry, i, Stop)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.