60 if ( pFanin != pPivot )
88 int i, k,
Counter = 0, Counter2 = 0;
106 printf(
"Absorted = %6d. (%6.2f %%) Fully = %6d. (%6.2f %%) ",
127 DdNode * bSpin, * bCof0, * bCof1;
154 DdNode * bSpin, * bCof0, * bCof1;
187 DdNode * bSpin, * bCof0, * bCof1;
228 DdNode * bSpin, * bCof0, * bCof1;
266 Abc_Obj_t * pNodesBot[3], * pNodesTop[3];
268 pNodesBot[0] = pFanins[1];
269 pNodesBot[1] = pFanins[2];
270 pNodesBot[2] = pFanins[3];
273 pNodesBot[0] = pFanins[1];
274 pNodesBot[1] = pFanins[4];
275 pNodesBot[2] = pFanins[5];
278 pNodesTop[0] = pFanins[0];
295 DdNode * bNode0, * bNode1;
310 bNode0 =
cuddE(bNode);
311 bNode1 =
cuddT(bNode);
313 if ( (iCof >> (nLevels-1-iLevel)) & 1 )
332 int i, nCofs = (1<<Level);
333 assert( Level > 0 && Level < 10 );
335 for ( i = 0; i < nCofs; i++ )
420 DdNode * bCof, * bUniq, * bMint, * bTemp, * bFunc, * bBits[10], ** pbCodeVars;
421 Abc_Obj_t * pNodeNew = NULL, * pNodeBS[10];
425 assert( nBits + 2 <= nLutSize );
428 for ( b = 0; b < nBits; b++ )
437 for ( b = 0; b < nBits; b++ )
439 if ( ((u >> b) & 1) == 0 )
448 for ( b = 0; b < nBits; b++ )
451 for ( i = 0; i < nLutSize; i++ )
453 pNodeBS[b]->pData = bBits[b];
461 for ( b = 0; b < nBits; b++ )
481 pNodeNew->
pData = bFunc;
501 DdNode * bCof0 = NULL, * bCof1 = NULL, * bSupp, * bTemp, * bVar;
502 DdNode * bCof0n, * bCof1n;
503 int i, iCof, iFreeVar, fCof1Smaller = -1;
553 pNodeBot->
pData = fCof1Smaller? bCof0n : bCof1n;
596 if ( pNodeNew != NULL )
599 printf(
"Decomposing %d-input node %d using MUX.\n",
615 printf(
"Decomposing %d-input node %d using cofactoring with %d cofactors.\n",
624 else if ( nLutSize == 5 )
626 else if ( nLutSize == 6 )
634 printf(
"Decomposing %d-input node %d using Curtis with %d unique columns.\n",
723 printf(
"The LUT count (%d) should be at least 4.\n", nLutSize );
728 printf(
"The LUT count (%d) should not exceed 6.\n", nLutSize );
739 if ( pNtkNew == NULL )
748 printf(
"*** Iteration %d:\n", i+1 );
750 printf(
"Decomposing network with %d nodes and %d max fanin count for K = %d.\n",
762 printf(
"Abc_NtkLutmin: The network check has failed.\n" );
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Abc_Obj_t * Abc_NtkBddMux412(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pFanins[])
DdNode * Abc_NtkBddCofactors_rec(DdManager *dd, DdNode *bNode, int iCof, int iLevel, int nLevels)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
static int Abc_NtkObjNumMax(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NtkMinimumBase(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
static int Vec_PtrSortCompare(void **pp1, void **pp2)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
DdNode * Cudd_Support(DdManager *dd, DdNode *f)
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
#define Cudd_IsConstant(node)
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
DdNode * Cudd_ReadLogicZero(DdManager *dd)
#define Cudd_Regular(node)
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Obj_t * Abc_NtkDupObj(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj, int fCopyName)
Abc_Obj_t * Abc_NtkBddMux411(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pFanins[])
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Abc_Ntk_t * Abc_NtkLutminInt(Abc_Ntk_t *pNtk, int nLutSize, int fVerbose)
static Vec_Ptr_t * Vec_PtrDup(Vec_Ptr_t *pVec)
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
DdNode * Cudd_bddIte(DdManager *dd, DdNode *f, DdNode *g, DdNode *h)
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
static abctime Abc_Clock()
static int Vec_PtrSize(Vec_Ptr_t *p)
Abc_Obj_t * Abc_NtkBddDecompose(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNode, int nLutSize, int fVerbose)
ABC_NAMESPACE_IMPL_START int Abc_ObjCheckAbsorb(Abc_Obj_t *pObj, Abc_Obj_t *pPivot, int nLutSize, Vec_Ptr_t *vFanins)
DECLARATIONS ///.
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
static void Vec_PtrUniqify(Vec_Ptr_t *p, int(*Vec_PtrSortCompare)()) ___unused
ABC_DLL Abc_Ntk_t * Abc_NtkCollapse(Abc_Ntk_t *pNtk, int fBddSizeMax, int fDualRail, int fReorder, int fVerbose)
FUNCTION DEFINITIONS ///.
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Abc_Obj_t * Abc_NtkBddMux413(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pFanins[])
static Vec_Int_t * Vec_IntStart(int nSize)
#define Cudd_IsComplement(node)
ABC_DLL Abc_Ntk_t * Abc_NtkStartFrom(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
Abc_Obj_t * Abc_NtkBddCurtis(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNode, Vec_Ptr_t *vCofs, Vec_Ptr_t *vUniq)
DdNode * Cudd_Cofactor(DdManager *dd, DdNode *f, DdNode *g)
int Cudd_ReadPerm(DdManager *dd, int i)
Vec_Ptr_t * Abc_NtkBddCofactors(DdManager *dd, DdNode *bNode, int Level)
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
static int Vec_IntEntry(Vec_Int_t *p, int i)
int Abc_NtkFraigSweep(Abc_Ntk_t *pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose)
FUNCTION DEFINITIONS ///.
Abc_Obj_t * Abc_NtkBddMux21(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pFanins[])
#define ABC_NAMESPACE_IMPL_END
ABC_DLL void Abc_NtkFinalize(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
void Abc_NtkLutminConstruct(Abc_Ntk_t *pNtkClp, Abc_Ntk_t *pNtkDec, int nLutSize, int fVerbose)
ABC_DLL int Abc_NtkToBdd(Abc_Ntk_t *pNtk)
Abc_Ntk_t * Abc_NtkLutmin(Abc_Ntk_t *pNtkInit, int nLutSize, int fVerbose)
DdNode * Cudd_bddOr(DdManager *dd, DdNode *f, DdNode *g)
#define Abc_NtkForEachNode(pNtk, pNode, i)
#define ABC_NAMESPACE_IMPL_START
ABC_DLL int Abc_NtkLogicMakeSimpleCos(Abc_Ntk_t *pNtk, int fDuplicate)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define Abc_ObjForEachFanin(pObj, pFanin, i)
static int Abc_NtkIsBddLogic(Abc_Ntk_t *pNtk)
unsigned int Cudd_NodeReadIndex(DdNode *node)
static int Abc_Base2Log(unsigned n)
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
static Abc_Obj_t * Abc_NtkCreateNode(Abc_Ntk_t *pNtk)
Abc_Obj_t * Abc_NtkBddFindCofactor(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNode, int nLutSize)
void Abc_NtkCheckAbsorb(Abc_Ntk_t *pNtk, int nLutSize)
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
static void Vec_PtrClear(Vec_Ptr_t *p)
Abc_Obj_t * Abc_NtkCreateCofLut(Abc_Ntk_t *pNtkNew, DdManager *dd, DdNode *bCof, Abc_Obj_t *pNode, int Level)
Abc_Obj_t * Abc_NtkBddMux412a(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pFanins[])
static Abc_Obj_t * Abc_ObjFanin(Abc_Obj_t *pObj, int i)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
int Cudd_SupportSize(DdManager *dd, DdNode *f)
void Abc_NtkBddReorder(Abc_Ntk_t *pNtk, int fVerbose)
static void Vec_PtrFree(Vec_Ptr_t *p)