49 int i,
Var, VarBest, nSuppSize0, nSuppSize1;
50 int nSuppTotalMin = -1;
58 if ( (uNonDecSupp & (1 << Var)) == 0 )
62 for ( i = 0; i < nTruths; i++ )
76 nSuppMaxCur =
Abc_MaxInt( nSuppMaxCur, nSuppSize0 );
77 nSuppMaxCur =
Abc_MaxInt( nSuppMaxCur, nSuppSize1 );
78 nSuppTotalCur += nSuppSize0 + nSuppSize1;
80 if ( VarBest == -1 || nSuppMaxMin > nSuppMaxCur ||
81 (nSuppMaxMin == nSuppMaxCur && nSuppTotalMin > nSuppTotalCur) )
84 nSuppMaxMin = nSuppMaxCur;
85 nSuppTotalMin = nSuppTotalCur;
89 for ( i = 0; i < nTruths; i++ )
110 unsigned i, iLitFanin, uSupport, uSuppCur;
118 unsigned uSupps[16], Limit, s;
123 uSupport |= uSupps[i];
126 Limit = (1 << pObj->
nFans) - 1;
127 for ( s = 1; s < Limit; s++ )
130 for ( i = 0; i < pObj->
nFans; i++ )
132 uSuppCur |= uSupps[i];
144 uSupport |= uSuppCur;
165 unsigned uSupport, Entry;
180 assert( (uSupport & 0xFFFF0000) == 0 );
207 for ( k = 0; k < 16; k++ )
208 if ( uSupport & (1<<k) )
209 printf(
"%c",
'a'+k );
250 int Entry0, Entry1, Entry;
256 Entry = Entry0 | Entry1;
257 if ( (Entry & (Entry >> 16)) )
280 int i, nVarsBS, nVarsRem, Delay, Area;
286 if ( (uBoundSet & 0xFFFF) == 0 )
288 if ( (uBoundSet & uNonDecSupp) == 0 )
290 if ( (uBoundSet & uLateArrSupp) )
299 assert( (uBoundSet & (uBoundSet >> 16)) == 0 );
304 nVarsRem = p->
nVars - nVarsBS + 1;
308 printf(
"area = %d limit = %d delay = %d limit = %d\n", Area, (
int)p->
nAreaLim, Delay, (
int)p->
nDelayLim );
314 pRes->
BSVars = (uBoundSet & 0xFFFF);
325 printf(
"Found bound set " );
330 printf(
"Did not find boundsets.\n" );
354 unsigned i, uLateArrSupp = 0;
357 uLateArrSupp |= (1 << i);
376 unsigned uNonDecSupp, uLateArrSupp;
377 int i, k, nNonDecSize, nNonDecSizeMax;
378 assert( nCofDepth >= 1 && nCofDepth <= 3 );
384 uNonDecSupp = p->
uSupp;
385 for ( i = 0; i < (1<<(nCofDepth-1)); i++ )
388 if ( nNonDecSizeMax < nNonDecSize )
390 nNonDecSizeMax = nNonDecSize;
393 else if ( nNonDecSizeMax == nNonDecSize )
400 if ( (uNonDecSupp & ~uLateArrSupp) == 0 )
407 pCofVars[nCofDepth-1] =
Lpk_FunComputeMinSuppSizeVar( p, ppTruths[nCofDepth-1], 1<<(nCofDepth-1), ppTruths[nCofDepth], uNonDecSupp & ~uLateArrSupp );
410 for ( i = 0; i < (1<<nCofDepth); i++ )
421 for ( i = nCofDepth - 1; i >= 0; i-- )
422 for ( k = 0; k < (1<<i); k++ )
427 for ( i = nCofDepth; i >= 0; i-- )
428 for ( k = 0; k < (1<<i); k++ )
435 for ( i = 0; i < nCofDepth; i++ )
458 int fUseBackLooking = 1;
466 assert( nShared >= 0 && nShared <= 3 );
471 if ( pMan->
pPars->fVerbose )
479 { pRes = pRes0;
goto finish; }
481 { pRes = pRes0;
goto finish; }
493 { pRes = pRes1;
goto finish; }
495 { pRes = pRes0;
goto finish; }
497 { pRes = pRes1;
goto finish; }
508 { pRes = pRes2;
goto finish; }
509 if ( fUseBackLooking )
512 { pRes = pRes0;
goto finish; }
514 { pRes = pRes1;
goto finish; }
517 { pRes = pRes2;
goto finish; }
530 { pRes = pRes3;
goto finish; }
531 if ( fUseBackLooking )
534 { pRes = pRes0;
goto finish; }
536 { pRes = pRes1;
goto finish; }
538 { pRes = pRes2;
goto finish; }
541 { pRes = pRes3;
goto finish; }
546 for ( i = 0; i < (1<<nShared); i++ )
568 int i, k, iVacVar, nCofs;
574 for ( i = 0; i < nCofVars; i++ )
575 for ( k = 0; k < (1<<i); k++ )
581 nCofs = (1<<nCofVars);
582 for ( k = 0; k < nCofs; k++ )
589 for ( i = nCofVars; i >= 1; i-- )
590 for ( k = 0; k < (1<<i); k++ )
static Kit_DsdObj_t * Kit_DsdNtkRoot(Kit_DsdNtk_t *pNtk)
int Kit_DsdNonDsdSizeMax(Kit_DsdNtk_t *pNtk)
unsigned Lpk_DsdLateArriving(Lpk_Fun_t *p)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
int Lpk_SuppDelay(unsigned uSupp, char *pDelays)
Kit_DsdNtk_t * Kit_DsdDecomposeExpand(unsigned *pTruth, int nVars)
static Kit_DsdObj_t * Kit_DsdNtkObj(Kit_DsdNtk_t *pNtk, int Id)
unsigned Kit_DsdNonDsdSupports(Kit_DsdNtk_t *pNtk)
unsigned Lpk_ComputeBoundSets_rec(Kit_DsdNtk_t *p, int iLit, Vec_Int_t *vSets, int nSizeMax)
void Kit_TruthMuxVar(unsigned *pOut, unsigned *pCof0, unsigned *pCof1, int nVars, int iVar)
#define Kit_DsdObjForEachFanin(pNtk, pObj, iLit, i)
void Kit_DsdTruthPartialTwo(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk, unsigned uSupp, int iVar, unsigned *pTruthCo, unsigned *pTruthDec)
static int Abc_MaxInt(int a, int b)
void Lpk_FunCompareBoundSets(Lpk_Fun_t *p, Vec_Int_t *vBSets, int nCofDepth, unsigned uNonDecSupp, unsigned uLateArrSupp, Lpk_Res_t *pRes)
Lpk_Fun_t * Lpk_DsdSplit(Lpk_Man_t *pMan, Lpk_Fun_t *p, char *pCofVars, int nCofVars, unsigned uBoundSet)
int Lpk_DsdAnalizeOne(Lpk_Fun_t *p, unsigned *ppTruths[5][16], Kit_DsdNtk_t *pNtks[], char pCofVars[], int nCofDepth, Lpk_Res_t *pRes)
static unsigned * Lpk_FunTruth(Lpk_Fun_t *p, int Num)
void Kit_TruthCofactor0New(unsigned *pOut, unsigned *pIn, int nVars, int iVar)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
void Kit_DsdPrint(FILE *pFile, Kit_DsdNtk_t *pNtk)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Vec_Int_t * Lpk_ComputeBoundSets(Kit_DsdNtk_t *p, int nSizeMax)
static void Lpk_PrintSetOne(int uSupport)
static void Lpk_PrintSets(Vec_Int_t *vSets)
ABC_NAMESPACE_IMPL_START int Lpk_FunComputeMinSuppSizeVar(Lpk_Fun_t *p, unsigned **ppTruths, int nTruths, unsigned **ppCofs, unsigned uNonDecSupp)
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_END
unsigned * ppTruths[5][16]
void Kit_TruthCofactor1New(unsigned *pOut, unsigned *pIn, int nVars, int iVar)
int Lpk_FunSuppMinimize(Lpk_Fun_t *p)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define ABC_NAMESPACE_IMPL_START
Lpk_Res_t * Lpk_DsdAnalize(Lpk_Man_t *pMan, Lpk_Fun_t *p, int nShared)
static int Vec_IntSize(Vec_Int_t *p)
Vec_Int_t * Lpk_MergeBoundSets(Vec_Int_t *vSets0, Vec_Int_t *vSets1, int nSizeMax)
static int Kit_WordFindFirstBit(unsigned uWord)
Lpk_Fun_t * Lpk_FunDup(Lpk_Fun_t *p, unsigned *pTruth)
unsigned Kit_TruthSupport(unsigned *pTruth, int nVars)
static void Kit_TruthCopy(unsigned *pOut, unsigned *pIn, int nVars)
static int Abc_Lit2Var(int Lit)
static int Lpk_LutNumLuts(int nVarsMax, int nLutK)
void Kit_DsdNtkFree(Kit_DsdNtk_t *pNtk)
static int Kit_WordCountOnes(unsigned uWord)
#define Lpk_SuppForEachVar(Supp, Var)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
int Kit_TruthSupportSize(unsigned *pTruth, int nVars)
static unsigned Kit_BitMask(int nBits)