124 p->DecPars.nVarsMax = pPars->
nLeafMax;
125 p->DecPars.fVerbose = pPars->
fVerbose;
126 p->DecPars.fVeryVerbose = 0;
145 printf(
"NodesBeg = %8d. NodesEnd = %8d. Gain = %6d. (%6.2f %%).\n",
146 p->nNodesInit,
Aig_ManNodeNum(p->pAig), Gain, 100.0*Gain/p->nNodesInit );
147 printf(
"Tried = %6d. Below = %5d. Extended = %5d. Used = %5d. Levels = %4d.\n",
148 p->nNodesTried, p->nNodesBelow, p->nNodesExten, p->nCutsUsed,
Aig_ManLevels(p->pAig) );
149 ABC_PRT(
"Cuts ", p->timeCuts );
150 ABC_PRT(
"Eval ", p->timeEval );
151 ABC_PRT(
"Other ", p->timeOther );
152 ABC_PRT(
"TOTAL ", p->timeTotal );
170 if ( p->pPars->fVerbose )
232 int i,
Counter, LevelNew, LevelOld;
254 if ( pAnd0 && pAnd1 )
269 if ( ++Counter > NodeMax )
285 if ( LevelNew > LevelMax )
288 pNode->
Level = LevelNew;
363 int k, RetValue, GainCur, nNodesAdded;
367 p->pGraphBest = NULL;
379 pTruth =
Aig_ManCutTruth( pObj, vCut, p->vCutNodes, p->vTruthElem, p->vTruthStore );
407 nNodesAdded =
Dar_RefactTryGraph( p->pAig, pObj, vCut, pGraphCur, nNodesSaved - !p->pPars->fUseZeros, Required );
408 if ( nNodesAdded > -1 )
410 GainCur = nNodesSaved - nNodesAdded;
411 if ( p->GainBest < GainCur || (p->GainBest == GainCur &&
414 p->GainBest = GainCur;
417 p->pGraphBest = pGraphCur;
440 nNodesAdded =
Dar_RefactTryGraph( p->pAig, pObj, vCut, pGraphCur, nNodesSaved - !p->pPars->fUseZeros, Required );
441 if ( nNodesAdded > -1 )
443 GainCur = nNodesSaved - nNodesAdded;
444 if ( p->GainBest < GainCur || (p->GainBest == GainCur &&
447 p->GainBest = GainCur;
450 p->pGraphBest = pGraphCur;
502 int nNodesOld, nNodeBefore, nNodeAfter, nNodesSaved, nNodesSaved2;
503 int i, Required, nLevelMin;
512 if ( p->pPars->fUpdateLevel )
529 if ( pAig->Time2Quit && !(i & 256) &&
Abc_Clock() > pAig->Time2Quit )
538 if ( nNodesSaved < p->pPars->
nMffcMin )
546 Aig_ManFindCut( pObj, vCut, p->vCutNodes, p->pPars->nLeafMax, 50 );
549 else if (
Vec_PtrSize(vCut) < p->pPars->nLeafMax - 2 && p->pPars->fExtend )
556 assert( nNodesSaved2 == nNodesSaved );
578 if ( !(p->GainBest > 0 || (p->GainBest == 0 && p->pPars->fUseZeros)) )
594 assert( p->GainBest <= nNodeBefore - nNodeAfter );
600 p->timeOther = p->timeTotal - p->timeCuts - p->timeEval;
607 if ( p->pPars->fUpdateLevel )
626 printf(
"Dar_ManRefactor: The network check has failed.\n" );
#define Vec_VecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
void Dar_ManRefStop(Ref_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
ABC_DLL int Aig_ManCheck(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
static int Kit_TruthWordNum(int nVars)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
static void Vec_PtrCopy(Vec_Ptr_t *pDest, Vec_Ptr_t *pSour)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static Kit_Node_t * Kit_GraphNode(Kit_Graph_t *pGraph, int i)
static int Aig_ObjIsTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
static int Kit_GraphIsComplement(Kit_Graph_t *pGraph)
static int Aig_IsComplement(Aig_Obj_t *p)
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
void Dar_ManRefPrintStats(Ref_Man_t *p)
#define ABC_ALLOC(type, num)
int Aig_ObjRequiredLevel(Aig_Man_t *p, Aig_Obj_t *pObj)
static int Kit_TruthIsConst0(unsigned *pIn, int nVars)
static int Kit_GraphIsVar(Kit_Graph_t *pGraph)
int Dar_ManRefactor(Aig_Man_t *pAig, Dar_RefPar_t *pPars)
static abctime Abc_Clock()
static int Abc_MaxInt(int a, int b)
int Dar_ObjCutLevelAchieved(Vec_Ptr_t *vCut, int nLevelMin)
static int Vec_PtrSize(Vec_Ptr_t *p)
#define Kit_GraphForEachLeaf(pGraph, pLeaf, i)
static void Vec_VecFree(Vec_Vec_t *p)
void Ref_ObjPrint(Aig_Obj_t *pObj)
static int Aig_ManNodeNum(Aig_Man_t *p)
Aig_Obj_t * Dar_RefactBuildGraph(Aig_Man_t *pAig, Vec_Ptr_t *vCut, Kit_Graph_t *pGraph)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
void Aig_ManFanoutStart(Aig_Man_t *p)
FUNCTION DEFINITIONS ///.
static void Vec_VecClear(Vec_Vec_t *p)
static int Kit_GraphIsConst(Kit_Graph_t *pGraph)
void Aig_ManStartReverseLevels(Aig_Man_t *p, int nMaxLevelIncrease)
unsigned * Aig_ManCutTruth(Aig_Obj_t *pRoot, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vNodes, Vec_Ptr_t *vTruthElem, Vec_Ptr_t *vTruthStore)
void Aig_ManFanoutStop(Aig_Man_t *p)
static Vec_Ptr_t * Vec_PtrAllocTruthTables(int nVars)
int Aig_NodeMffcSupp(Aig_Man_t *p, Aig_Obj_t *pNode, int LevelMin, Vec_Ptr_t *vSupp)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static int Kit_TruthIsConst1(unsigned *pIn, int nVars)
void Aig_ManStopReverseLevels(Aig_Man_t *p)
void Aig_ObjCollectCut(Aig_Obj_t *pRoot, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vNodes)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Ref_ObjComputeCuts(Aig_Man_t *pAig, Aig_Obj_t *pRoot, Vec_Vec_t *vCuts)
void Kit_GraphFree(Kit_Graph_t *pGraph)
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
FUNCTION DEFINITIONS ///.
int Dar_RefactTryGraph(Aig_Man_t *pAig, Aig_Obj_t *pRoot, Vec_Ptr_t *vCut, Kit_Graph_t *pGraph, int NodeMax, int LevelMax)
#define Kit_GraphForEachNode(pGraph, pAnd, i)
void Aig_ObjReplace(Aig_Man_t *p, Aig_Obj_t *pObjOld, Aig_Obj_t *pObjNew, int fUpdateLevel)
#define ABC_NAMESPACE_IMPL_END
Kit_Graph_t * Kit_GraphCreateConst1()
static Vec_Vec_t * Vec_VecStart(int nSize)
Aig_Obj_t * Aig_TableLookupTwo(Aig_Man_t *p, Aig_Obj_t *pFanin0, Aig_Obj_t *pFanin1)
static void Kit_TruthNot(unsigned *pOut, unsigned *pIn, int nVars)
Kit_Graph_t * Kit_GraphCreateConst0()
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
void Dar_ManDefaultRefParams(Dar_RefPar_t *pPars)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_IMPL_START struct Ref_Man_t_ Ref_Man_t
DECLARATIONS ///.
#define Aig_ManForEachObj(p, pObj, i)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
int Aig_NodeMffcExtendCut(Aig_Man_t *p, Aig_Obj_t *pNode, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vResult)
static int Aig_ObjLevel(Aig_Obj_t *pObj)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
static Kit_Node_t * Kit_GraphVar(Kit_Graph_t *pGraph)
static void Vec_PtrClear(Vec_Ptr_t *p)
void Bdc_ManFree(Bdc_Man_t *p)
int Dar_ManRefactorTryCuts(Ref_Man_t *p, Aig_Obj_t *pObj, int nNodesSaved, int Required)
int Aig_NodeMffcLabelCut(Aig_Man_t *p, Aig_Obj_t *pNode, Vec_Ptr_t *vLeaves)
static Vec_Ptr_t * Vec_VecEntry(Vec_Vec_t *p, int i)
void Aig_ManFindCut(Aig_Obj_t *pRoot, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited, int nSizeLimit, int nFanoutLimit)
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
Ref_Man_t * Dar_ManRefStart(Aig_Man_t *pAig, Dar_RefPar_t *pPars)
int Aig_ManLevels(Aig_Man_t *p)
int Aig_ManCleanup(Aig_Man_t *p)
static Vec_Ptr_t * Vec_PtrAllocSimInfo(int nEntries, int nWords)
static void Vec_PtrFree(Vec_Ptr_t *p)
Kit_Graph_t * Kit_SopFactor(Vec_Int_t *vCover, int fCompl, int nVars, Vec_Int_t *vMemory)
FUNCTION DEFINITIONS ///.
static int Kit_GraphRootLevel(Kit_Graph_t *pGraph)