52 for ( i = 0; i < nSizeC; i++ )
54 for ( k = 0; k < nSizeB; k++ )
66 int i, k, m, n, Value;
68 for ( i = 0; i < pCutSet->
nCuts; i++ )
70 pCut0 = pCutSet->
ppCuts[i];
75 for ( m = 1; m < (int)pCut0->
nLeaves; m++ )
81 for ( m = 0; m < (int)pCut0->
nLeaves; m++ )
82 for ( n = m+1; n < (int)pCut0->
nLeaves; n++ )
86 for ( k = 0; k < pCutSet->
nCuts; k++ )
88 pCut1 = pCutSet->
ppCuts[k];
123 for ( i = 0; i < (int)pDom->
nLeaves; i++ )
125 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
151 for ( i = 0; i < pCutSet->
nCuts; i++ )
153 pTemp = pCutSet->
ppCuts[i];
170 for ( k = i; k < pCutSet->
nCuts; k++ )
209 if ( nSizeC0 == nLimit && nSizeC1 == nLimit )
211 for ( i = 0; i < nSizeC0; i++ )
227 if ( nSizeC0 == 0 )
goto FlushCut1;
228 if ( nSizeC1 == 0 )
goto FlushCut0;
231 if ( c == nLimit )
return 0;
236 if ( i == nSizeC0 )
goto FlushCut1;
242 if ( k == nSizeC1 )
goto FlushCut0;
249 if ( i == nSizeC0 )
goto FlushCut1;
250 if ( k == nSizeC1 )
goto FlushCut0;
255 if ( c + nSizeC0 > nLimit + i )
return 0;
256 while ( i < nSizeC0 )
267 if ( c + nSizeC1 > nLimit + k )
return 0;
268 while ( k < nSizeC1 )
298 if ( nSizeC0 == nLimit && nSizeC1 == nLimit )
300 for ( i = 0; i < nSizeC0; i++ )
313 if ( nSizeC0 == 0 )
goto FlushCut1;
314 if ( nSizeC1 == 0 )
goto FlushCut0;
317 if ( c == nLimit )
return 0;
321 if ( i == nSizeC0 )
goto FlushCut1;
326 if ( k == nSizeC1 )
goto FlushCut0;
331 if ( i == nSizeC0 )
goto FlushCut1;
332 if ( k == nSizeC1 )
goto FlushCut0;
337 if ( c + nSizeC0 > nLimit + i )
return 0;
338 while ( i < nSizeC0 )
345 if ( c + nSizeC1 > nLimit + k )
return 0;
346 while ( k < nSizeC1 )
366 int nLutSize = pCut0->
nLimit;
375 for ( i = 0; i < nSize1; i++ )
377 for ( k = 0; k < nSize0; k++ )
378 if ( pC1[i] == pC0[k] )
390 for ( i = 0; i < nSize0; i++ )
748 if ( pCutSet->
nCuts == 0 )
763 pCutSet->
ppCuts[0] = pCut;
771 for ( i = pCutSet->
nCuts-1; i >= 0; i-- )
777 pCutSet->
ppCuts[i] = pCut;
799 int i, Temp, fChanges;
802 for ( i = 0; i < (int)pCut->
nLeaves - 1; i++ )
812 }
while ( fChanges );
832 for ( i = 1; i < (int)pCut->
nLeaves; i++ )
836 Abc_Print( -1,
"If_CutCheck(): Cut has wrong ordering of inputs.\n" );
860 for ( i = 0; i < pCut->
nLeaves; i++ )
900 for ( i = 0; i < pCut->
nLeaves; i++ )
982 float * pSwitching = (
float *)p->
vSwitching->pArray;
987 Power += pSwitching[pLeaf->
Id];
1016 nRefsTotal += pLeaf->
nRefs;
1017 return ((
float)nRefsTotal)/pCut->
nLeaves;
1088 float aResult, aResult2;
1094 assert( aResult < aResult2 + p->fEpsilon );
1111 float aResult, aResult2;
1117 assert( aResult < aResult2 + p->fEpsilon );
1189 float aResult, aResult2;
1195 assert( aResult < aResult2 + p->fEpsilon );
1212 float aResult, aResult2;
1218 assert( aResult < aResult2 + p->fEpsilon );
1237 float * pSwitching = (
float *)p->
vSwitching->pArray;
1242 Power += pSwitching[pLeaf->
Id];
1265 float * pSwitching = (
float *)p->
vSwitching->pArray;
1270 Power += pSwitching[pLeaf->
Id];
1292 float aResult, aResult2;
1298 assert( aResult < aResult2 + p->fEpsilon );
1315 float aResult, aResult2;
1321 assert( aResult < aResult2 + p->fEpsilon );
1341 nMinLevel =
IF_MIN( nMinLevel, (
int)pLeaf->
Level );
1361 for ( i = 0; i < (int)pCut->
nLeaves; i++ )
1370 for ( pTemp = pObj; pTemp; pTemp = pTemp->
pEquiv )
1406 Abc_Print( 1,
"Cound not find boundary for %d nodes.\n", Counter );
1449 int i, nFaninsTotal = 0,
Counter = 0;
1463 Abc_Print( 1,
"Total cut inputs = %d. Total fanins incremental = %d.\n", nFaninsTotal,
Counter );
float If_CutEdgeFlow(If_Man_t *p, If_Cut_t *pCut)
int If_CutGetCutMinLevel(If_Man_t *p, If_Cut_t *pCut)
static unsigned Abc_InfoMask(int nVar)
void If_CutLift(If_Cut_t *pCut)
float If_CutEdgeDerefed(If_Man_t *p, If_Cut_t *pCut)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static float If_CutLutArea(If_Man_t *p, If_Cut_t *pCut)
static int If_ObjIsAnd(If_Obj_t *pObj)
#define If_CutForEachLeaf(p, pCut, pLeaf, i)
int pPerm[3][IF_MAX_LUTSIZE]
int If_CutFilter(If_Set_t *pCutSet, If_Cut_t *pCut, int fSaveCut0)
float If_CutAverageRefs(If_Man_t *p, If_Cut_t *pCut)
static If_Obj_t * If_ObjFanin0(If_Obj_t *pObj)
float If_CutEdgeRefed(If_Man_t *p, If_Cut_t *pCut)
static int If_ObjIsCi(If_Obj_t *pObj)
int If_CutMerge(If_Man_t *p, If_Cut_t *pCut0, If_Cut_t *pCut1, If_Cut_t *pCut)
static If_Cut_t * If_ObjCutBest(If_Obj_t *pObj)
float If_CutEdgeRef(If_Man_t *p, If_Cut_t *pCut)
float If_CutPowerRefed(If_Man_t *p, If_Cut_t *pCut, If_Obj_t *pRoot)
static abctime Abc_Clock()
int If_CutGetCone_rec(If_Man_t *p, If_Obj_t *pObj, If_Cut_t *pCut)
int If_CutCompareArea(If_Man_t *p, If_Cut_t **ppC0, If_Cut_t **ppC1)
float If_CutPowerDeref(If_Man_t *p, If_Cut_t *pCut, If_Obj_t *pRoot)
int If_CutCheck(If_Cut_t *pCut)
int If_CutCountTotalFanins(If_Man_t *p)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
#define If_ManForEachObj(p, pObj, i)
static ABC_NAMESPACE_IMPL_START int If_CutVerifyCut(If_Cut_t *pBase, If_Cut_t *pCut)
DECLARATIONS ///.
static unsigned If_ObjCutSignCompute(If_Cut_t *p)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
int If_CutCompareDelayOld(If_Man_t *p, If_Cut_t **ppC0, If_Cut_t **ppC1)
float If_CutAreaRefed(If_Man_t *p, If_Cut_t *pCut)
float If_CutAreaRef(If_Man_t *p, If_Cut_t *pCut)
void If_CutPrintTiming(If_Man_t *p, If_Cut_t *pCut)
#define ABC_NAMESPACE_IMPL_END
int If_CutCompareDelay(If_Man_t *p, If_Cut_t **ppC0, If_Cut_t **ppC1)
int If_CutGetCones(If_Man_t *p)
#define IF_MIN(a, b)
MACRO DEFINITIONS ///.
static If_Obj_t * If_ObjFanin1(If_Obj_t *pObj)
float If_CutAreaDeref(If_Man_t *p, If_Cut_t *pCut)
static int If_ManSortCompare_old(If_Man_t *p, If_Cut_t *pC0, If_Cut_t *pC1)
float If_CutAreaDerefed(If_Man_t *p, If_Cut_t *pCut)
static void Abc_Print(int level, const char *format,...)
void If_CutSort(If_Man_t *p, If_Set_t *pCutSet, If_Cut_t *pCut)
int If_CutVerifyCuts(If_Set_t *pCutSet, int fOrdered)
float If_CutPowerRef(If_Man_t *p, If_Cut_t *pCut, If_Obj_t *pRoot)
#define ABC_NAMESPACE_IMPL_START
float If_CutAreaFlow(If_Man_t *p, If_Cut_t *pCut)
float If_CutEdgeDeref(If_Man_t *p, If_Cut_t *pCut)
int If_CutMergeOrdered_(If_Man_t *p, If_Cut_t *pC0, If_Cut_t *pC1, If_Cut_t *pC)
static int If_CutLeafBit(If_Cut_t *pCut, int i)
static int Vec_IntSize(Vec_Int_t *p)
static int If_ObjIsConst1(If_Obj_t *pObj)
void If_CutPrint(If_Cut_t *pCut)
static int If_ManSortCompare(If_Man_t *p, If_Cut_t *pC0, If_Cut_t *pC1)
void If_CutFoundFanins_rec(If_Obj_t *pObj, Vec_Int_t *vLeaves)
static int If_CutCheckDominance(If_Cut_t *pDom, If_Cut_t *pCut)
int If_CutMergeOrdered(If_Man_t *p, If_Cut_t *pC0, If_Cut_t *pC1, If_Cut_t *pC)
float If_CutPowerDerefed(If_Man_t *p, If_Cut_t *pCut, If_Obj_t *pRoot)
float If_CutPowerFlow(If_Man_t *p, If_Cut_t *pCut, If_Obj_t *pRoot)
void If_CutOrder(If_Cut_t *pCut)
static void Vec_IntFree(Vec_Int_t *p)
static int Vec_IntPushUnique(Vec_Int_t *p, int Entry)
static void Vec_IntClear(Vec_Int_t *p)