170 for ( i = 0; i < p->
pPars->nVarsMax; i++ )
181 if ( pDriver == NULL )
195 printf(
" Mffc = %2d. Mapped = %2d. Gain = %3d. Depth increase = %d. SReds = %d.\n",
199 if ( !(nGain > 0 || (p->
pPars->fZeroCost && nGain == 0)) )
245 int i, k, nSuppSize, nCutNodes, RetValue;
259 if ( p->
pPars->fVeryVerbose )
260 printf(
"Node %5d : Mffc size = %5d. Cuts = %5d.\n", p->
pObj->
Id, p->
nMffc, p->
nEvals );
264 for ( i = 0; i < p->
nEvals; i++ )
268 if ( p->
pPars->fFirst && i == 1 )
273 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
277 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
309 if ( p->
pPars->fVeryVerbose )
312 printf(
" C%02d: L= %2d/%2d V= %2d/%d N= %d W= %4.2f ",
345 unsigned * pTruthInv;
346 int RetValue1, RetValue2;
374 int nNodesBef, nNodesAft, nCutNodes;
389 if ( p->
pPars->fVeryVerbose )
390 printf(
"Node %5d : Mffc size = %5d. Cuts = %5d. Level = %2d. Req = %2d.\n",
395 for ( i = 0; i < p->
nEvals; i++ )
399 if ( p->
pPars->fFirst && i == 1 )
406 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
410 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
419 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
444 if ( p->
pPars->fVeryVerbose )
448 printf(
" C%02d: L= %2d/%2d V= %2d/%d N= %d W= %4.2f ",
469 int nGain = (int)pCut->
nNodes - (
int)pCut->
nNodesDup - (nNodesAft - nNodesBef);
484 if ( p->
pPars->fVeryVerbose )
485 printf(
"Performed resynthesis: Gain = %2d. Level = %2d. Req = %2d.\n", nGain,
Abc_ObjLevel(pObjNew), Required );
512 int i, Iter, nNodes, nNodesPrev;
524 if ( pPars->nLutSize > 6 )
526 if ( pPars->nLutSize < 3 )
529 if ( pPars->nVarsShared > pPars->nLutSize - 2 )
530 pPars->nVarsShared = pPars->nLutSize - 2;
532 pPars->nVarsMax = pPars->nLutsMax * (pPars->nLutSize - 1) + 1;
533 while ( pPars->nVarsMax > 16 )
536 pPars->nVarsMax = pPars->nLutsMax * (pPars->nLutSize - 1) + 1;
539 if ( pPars->fVerbose )
541 printf(
"Resynthesis for %d %d-LUTs with %d non-MFFC LUTs, %d crossbars, and %d-input cuts.\n",
542 pPars->nLutsMax, pPars->nLutSize, pPars->nLutsOver, pPars->nVarsShared, pPars->nVarsMax );
549 fprintf( stdout,
"Converting to BDD has failed.\n" );
563 if ( p->
pPars->fSatur )
565 if ( pPars->fVerbose )
581 for ( Iter = 1; ; Iter++ )
584 if ( p->
pPars->fSatur )
589 if ( !pPars->fVeryVerbose )
601 if ( !pPars->fVeryVerbose )
608 if ( p->
pPars->fOldAlgo )
613 if ( !pPars->fVeryVerbose )
621 if ( !p->
pPars->fSatur )
641 if ( pPars->fVerbose )
646 printf(
"Node gain = %5d. (%.2f %%) ",
648 printf(
"Edge gain = %5d. (%.2f %%) ",
650 printf(
"Muxes = %4d. Dsds = %4d.", p->
nMuxes, p->
nDsds );
652 printf(
"Nodes = %5d (%3d) Cuts = %5d (%4d) Changes = %5d Iter = %2d Benefit = %d.\n",
655 printf(
"Non-DSD:" );
656 for ( i = 3; i <= pPars->nVarsMax; i++ )
658 printf(
" %d=%d", i, p->
nBlocks[i] );
682 printf(
"Lpk_Resynthesize: The network check has failed.\n" );
int pLeaves[LPK_SIZE_MAX]
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
static Kit_DsdObj_t * Kit_DsdNtkRoot(Kit_DsdNtk_t *pNtk)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
int Kit_DsdNonDsdSizeMax(Kit_DsdNtk_t *pNtk)
static int Abc_NtkObjNumMax(Abc_Ntk_t *pNtk)
int Lpk_NodeHasChanged(Lpk_Man_t *p, int iNode)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
If_Man_t * If_ManStart(If_Par_t *pPars)
FUNCTION DEFINITIONS ///.
If_Obj_t * Lpk_MapTree_rec(Lpk_Man_t *p, Kit_DsdNtk_t *pNtk, If_Obj_t **ppLeaves, int iLit, If_Obj_t *pResult)
int Kit_CreateCloudFromTruth(CloudManager *dd, unsigned *pTruth, int nVars, Vec_Int_t *vNodes)
int Lpk_ResynthesizeNode(Lpk_Man_t *p)
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst1(Abc_Ntk_t *pNtk)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
void Kit_DsdPrintFromTruth(unsigned *pTruth, int nVars)
Lpk_Man_t * Lpk_ManStart(Lpk_Par_t *pPars)
DECLARATIONS ///.
static abctime Abc_Clock()
static Abc_Obj_t * Abc_NtkObj(Abc_Ntk_t *pNtk, int i)
static int Vec_PtrSize(Vec_Ptr_t *p)
void Kit_TruthCofSupports(Vec_Int_t *vBddDir, Vec_Int_t *vBddInv, int nVars, Vec_Int_t *vMemory, unsigned *puSupps)
ABC_DLL int Abc_NtkGetTotalFanins(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_NtkStopReverseLevels(Abc_Ntk_t *pNtk)
Kit_DsdNtk_t * Kit_DsdDecompose(unsigned *pTruth, int nVars)
static int Abc_ObjIsCo(Abc_Obj_t *pObj)
If_Obj_t * If_ManCreateCo(If_Man_t *p, If_Obj_t *pDriver)
int Lpk_Resynthesize(Abc_Ntk_t *pNtk, Lpk_Par_t *pPars)
MACRO DEFINITIONS ///.
int Lpk_ExploreCut(Lpk_Man_t *p, Lpk_Cut_t *pCut, Kit_DsdNtk_t *pNtk)
#define ABC_PRTP(a, t, T)
Lpk_Cut_t pCuts[LPK_CUTS_MAX]
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
static int Abc_LitIsCompl(int Lit)
void Kit_DsdPrint(FILE *pFile, Kit_DsdNtk_t *pNtk)
void If_ManSetupSetAll(If_Man_t *p, int nCrossCut)
ABC_DLL int Abc_ObjRequiredLevel(Abc_Obj_t *pObj)
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeInv(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
static int Abc_ObjLevel(Abc_Obj_t *pObj)
int Lpk_NodeCuts(Lpk_Man_t *p)
#define Lpk_CutForEachLeaf(pNtk, pCut, pObj, i)
MACRO DEFINITIONS ///.
ABC_NAMESPACE_IMPL_START void Lpk_IfManStart(Lpk_Man_t *p)
DECLARATIONS ///.
int Lpk_ResynthesizeNodeNew(Lpk_Man_t *p)
int If_ManPerformMappingComb(If_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
static void If_ObjSetCopy(If_Obj_t *pObj, void *pCopy)
Abc_Obj_t * Abc_NodeFromIf_rec(Abc_Ntk_t *pNtkNew, If_Man_t *pIfMan, If_Obj_t *pIfObj, Vec_Int_t *vCover)
static If_Obj_t * If_ManCi(If_Man_t *p, int i)
static Vec_Vec_t * Vec_VecStart(int nSize)
ABC_DLL int Abc_NodeMffcLabel(Abc_Obj_t *pNode)
ABC_DLL void Abc_NtkStartReverseLevels(Abc_Ntk_t *pNtk, int nMaxLevelIncrease)
#define Abc_NtkForEachNode(pNtk, pNode, i)
#define ABC_NAMESPACE_IMPL_START
void If_ManSetupCiCutSets(If_Man_t *p)
static If_Obj_t * If_Regular(If_Obj_t *p)
static int Vec_IntSize(Vec_Int_t *p)
Abc_Obj_t * Lpk_Decompose(Lpk_Man_t *p, Abc_Ntk_t *pNtk, Vec_Ptr_t *vLeaves, unsigned *pTruth, unsigned *puSupps, int nLutK, int AreaLim, int DelayLim)
FUNCTION DECLARATIONS ///.
void If_ManRestart(If_Man_t *p)
ABC_DLL int Abc_NtkSweep(Abc_Ntk_t *pNtk, int fVerbose)
static void Vec_VecExpand(Vec_Vec_t *p, int Level)
ABC_DLL void Abc_NtkUpdate(Abc_Obj_t *pObj, Abc_Obj_t *pObjNew, Vec_Vec_t *vLevels)
static Hop_Obj_t * Hop_NotCond(Hop_Obj_t *p, int c)
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst0(Abc_Ntk_t *pNtk)
void If_ManCleanCutData(If_Man_t *p)
void Lpk_ManStop(Lpk_Man_t *p)
If_Obj_t * If_ManCreateCi(If_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Lpk_Par_t_ Lpk_Par_t
INCLUDES ///.
static int Abc_Lit2Var(int Lit)
unsigned * Lpk_CutTruth(Lpk_Man_t *p, Lpk_Cut_t *pCut, int fInv)
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
void Kit_DsdNtkFree(Kit_DsdNtk_t *pNtk)
void If_ManCleanNodeCopy(If_Man_t *p)
DECLARATIONS ///.
static void Vec_PtrClear(Vec_Ptr_t *p)
static int Abc_NtkHasAig(Abc_Ntk_t *pNtk)
void Lpk_ComputeSupports(Lpk_Man_t *p, Lpk_Cut_t *pCut, unsigned *pTruth)
static Vec_Ptr_t * Vec_VecEntry(Vec_Vec_t *p, int i)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int If_IsComplement(If_Obj_t *p)
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
ABC_DLL void * Abc_FrameReadLibLut()
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)