33 #define LF_LEAF_MAX 12
35 #define LF_LOG_PAGE 12
36 #define LF_NO_LEAF 255
37 #define LF_CUT_WORDS (4+LF_LEAF_MAX/2)
38 #define LF_TT_WORDS ((LF_LEAF_MAX > 6) ? 1 << (LF_LEAF_MAX-6) : 1)
133 #define Lf_CutSetForEachCut( nWords, pCutSet, pCut, i, nCuts ) for ( i = 0, pCut = pCutSet; i < nCuts; pCut = Lf_CutNext(pCut, nWords), i++ )
134 #define Lf_CutForEachVar( pCut, Var, i ) for ( i = 0; i < (int)pCut->nLeaves && (Var = pCut->pLeaves[i]); i++ ) if ( Lf_ObjOff(p, Var) < 0 ) {} else
191 return pBest->
Delay[Index];
228 int i, nCutMax = 0, nCutCur = 0;
243 if ( nCutMax < nCutCur )
252 printf(
"Cutset is not 0\n" );
255 printf(
"CutMax = %d\n", nCutMax );
272 static unsigned s_Muxes[24] = {
273 (~0xAAAAAAAA & ~0xCCCCCCCC) | ( 0xAAAAAAAA & ~0xF0F0F0F0),
274 (~0xAAAAAAAA & ~0xCCCCCCCC) | ( 0xAAAAAAAA & 0xF0F0F0F0),
275 (~0xAAAAAAAA & 0xCCCCCCCC) | ( 0xAAAAAAAA & ~0xF0F0F0F0),
276 (~0xAAAAAAAA & 0xCCCCCCCC) | ( 0xAAAAAAAA & 0xF0F0F0F0),
277 ( 0xAAAAAAAA & ~0xCCCCCCCC) | (~0xAAAAAAAA & ~0xF0F0F0F0),
278 ( 0xAAAAAAAA & ~0xCCCCCCCC) | (~0xAAAAAAAA & 0xF0F0F0F0),
279 ( 0xAAAAAAAA & 0xCCCCCCCC) | (~0xAAAAAAAA & ~0xF0F0F0F0),
280 ( 0xAAAAAAAA & 0xCCCCCCCC) | (~0xAAAAAAAA & 0xF0F0F0F0),
282 (~0xCCCCCCCC & ~0xAAAAAAAA) | ( 0xCCCCCCCC & ~0xF0F0F0F0),
283 (~0xCCCCCCCC & ~0xAAAAAAAA) | ( 0xCCCCCCCC & 0xF0F0F0F0),
284 (~0xCCCCCCCC & 0xAAAAAAAA) | ( 0xCCCCCCCC & ~0xF0F0F0F0),
285 (~0xCCCCCCCC & 0xAAAAAAAA) | ( 0xCCCCCCCC & 0xF0F0F0F0),
286 ( 0xCCCCCCCC & ~0xAAAAAAAA) | (~0xCCCCCCCC & ~0xF0F0F0F0),
287 ( 0xCCCCCCCC & ~0xAAAAAAAA) | (~0xCCCCCCCC & 0xF0F0F0F0),
288 ( 0xCCCCCCCC & 0xAAAAAAAA) | (~0xCCCCCCCC & ~0xF0F0F0F0),
289 ( 0xCCCCCCCC & 0xAAAAAAAA) | (~0xCCCCCCCC & 0xF0F0F0F0),
291 (~0xF0F0F0F0 & ~0xCCCCCCCC) | ( 0xF0F0F0F0 & ~0xAAAAAAAA),
292 (~0xF0F0F0F0 & ~0xCCCCCCCC) | ( 0xF0F0F0F0 & 0xAAAAAAAA),
293 (~0xF0F0F0F0 & 0xCCCCCCCC) | ( 0xF0F0F0F0 & ~0xAAAAAAAA),
294 (~0xF0F0F0F0 & 0xCCCCCCCC) | ( 0xF0F0F0F0 & 0xAAAAAAAA),
295 ( 0xF0F0F0F0 & ~0xCCCCCCCC) | (~0xF0F0F0F0 & ~0xAAAAAAAA),
296 ( 0xF0F0F0F0 & ~0xCCCCCCCC) | (~0xF0F0F0F0 & 0xAAAAAAAA),
297 ( 0xF0F0F0F0 & 0xCCCCCCCC) | (~0xF0F0F0F0 & ~0xAAAAAAAA),
298 ( 0xF0F0F0F0 & 0xCCCCCCCC) | (~0xF0F0F0F0 & 0xAAAAAAAA)
301 for ( i = 0; i < 24; i++ )
302 if ( ((
unsigned)t) == s_Muxes[i] )
321 int i, Entry, nDrivers, nInverts;
323 nDrivers = nInverts = 0;
327 nDrivers += (int)(Entry != 0), nInverts += (int)(Entry == 3);
329 *pnDrivers = nDrivers;
330 *pnInverts = nInverts;
337 *vSwitches = *vSwitching;
378 for ( Entry = uMaskPage; Entry >= 0; Entry-- )
388 else if ( --pObj->
Value == 0 )
424 word Sign = 0;
int i;
425 for ( i = 0; i < (int)pCut->
nLeaves; i++ )
431 i = i - ((i >> 1) & 0x5555555555555555);
432 i = (i & 0x3333333333333333) + ((i >> 2) & 0x3333333333333333);
433 i = ((i + (i >> 4)) & 0x0F0F0F0F0F0F0F0F);
434 return (i*(0x0101010101010101))>>56;
443 for ( i = 0; i < (int)pCut0->
nLeaves; i++ )
450 float Switches = 0;
int i;
451 for ( i = 0; i < (int)pCut->
nLeaves; i++ )
459 printf(
"%d {", pCut->
nLeaves );
460 for ( i = 0; i < (int)pCut->
nLeaves; i++ )
461 printf(
" %*d", nDigits, pCut->
pLeaves[i] );
463 printf(
" %*s", nDigits,
" " );
464 printf(
" } Late = %d D = %4d A = %9.4f F = %6d\n",
486 for ( i = 0; i < 3; i++ )
492 for ( i = 0; i < 3; i++ )
498 for ( i = 0; i < 3; i++ )
527 unsigned char * pPlace;
528 int i, iPlace, Prev = iObj, iCur = p->
iCur;
536 for ( i = pCut->
nLeaves - 1; i >= 0; i-- )
539 if ( pCut->
iFunc >= 0 )
549 unsigned char * pPlace;
550 int i, Prev = iObj, Page = iCur >> p->
LogPage;
555 for ( i = pCut->
nLeaves - 1; i >= 0; i-- )
570 void * pPlace;
int i;
634 for ( i = 0; i < nSizeC; i++ )
636 for ( k = 0; k < nSizeB; k++ )
637 if ( pC[i] == pB[k] )
647 int i, k, m, n, Value;
649 for ( i = 0; i < nCuts; i++ )
656 for ( m = 0; m < (int)pCut0->
nLeaves; m++ )
657 for ( n = m + 1; n < (int)pCut0->
nLeaves; n++ )
660 for ( k = 0; k < nCuts; k++ )
663 if ( pCut0 == pCut1 )
692 if ( nSize0 == nLutSize && nSize1 == nLutSize )
694 for ( i = 0; i < nSize0; i++ )
696 if ( pC0[i] != pC1[i] )
return 0;
706 if ( nSize0 == 0 )
goto FlushCut1;
707 if ( nSize1 == 0 )
goto FlushCut0;
710 if ( c == nLutSize )
return 0;
711 if ( pC0[i] < pC1[k] )
714 if ( i >= nSize0 )
goto FlushCut1;
716 else if ( pC0[i] > pC1[k] )
719 if ( k >= nSize1 )
goto FlushCut0;
723 pC[c++] = pC0[i++]; k++;
724 if ( i >= nSize0 )
goto FlushCut1;
725 if ( k >= nSize1 )
goto FlushCut0;
730 if ( c + nSize0 > nLutSize + i )
return 0;
740 if ( c + nSize1 > nLutSize + k )
return 0;
753 int xMin, c = 0, * pC = pCut->
pLeaves;
760 if ( c == nLutSize )
return 0;
762 if (x0 == xMin) i0++;
763 if (x1 == xMin) i1++;
776 int xMin, c = 0, * pC = pCut->
pLeaves;
784 if ( c == nLutSize )
return 0;
786 if (x0 == xMin) i0++;
787 if (x1 == xMin) i1++;
788 if (x2 == xMin) i2++;
799 int i, nSizeB = pBase->
nLeaves;
801 if ( nSizeB == nSizeC )
803 for ( i = 0; i < nSizeB; i++ )
808 assert( nSizeB > nSizeC );
811 for ( i = k = 0; i < nSizeB; i++ )
826 for ( i = 0; i < nCuts; i++ )
827 if ( pCuts[i]->nLeaves <= pCuts[nCuts]->nLeaves && (pCuts[i]->Sign & pCuts[nCuts]->Sign) == pCuts[i]->Sign &&
Lf_SetCutIsContainedOrder(pCuts[nCuts], pCuts[i]) )
850 if ( pCut0->
Flow < pCut1->
Flow )
return -1;
851 if ( pCut0->
Flow > pCut1->
Flow )
return 1;
858 if ( pCut0->
Flow < pCut1->
Flow )
return -1;
859 if ( pCut0->
Flow > pCut1->
Flow )
return 1;
868 int i, k, fChanges = 0;
869 for ( i = 1; i < nCuts; i++ )
870 if ( pCuts[nCuts]->nLeaves < pCuts[i]->nLeaves && (pCuts[nCuts]->Sign & pCuts[i]->Sign) == pCuts[nCuts]->Sign &&
Lf_SetCutIsContainedOrder(pCuts[i], pCuts[nCuts]) )
874 for ( i = k = 1; i <= nCuts; i++ )
887 for ( i = nCuts; i > 1; i-- )
904 if ( pCuts[0]->nLeaves < pCuts[nCuts]->nLeaves && (pCuts[0]->Sign & pCuts[nCuts]->Sign) == pCuts[0]->Sign &&
Lf_SetCutIsContainedOrder(pCuts[nCuts], pCuts[0]) )
915 for ( i = 1; i < nCutsR-1; i++ )
918 for ( j = i+1; j < nCutsR; j++ )
919 if ( pCutsR[j]->nLeaves > pCutsR[best_i]->nLeaves )
939 for ( iVar = 0; iVar < nVars; iVar++ )
966 int nOldSupp = pCutR->
nLeaves, truthId, fCompl;
word t;
973 t = fIsXor ? t0 ^ t1 : t0 & t1;
974 if ( (fCompl = (
int)(t & 1)) ) t = ~t;
976 assert( (
int)(t & 1) == 0 );
982 return (
int)pCutR->
nLeaves < nOldSupp;
990 int nOldSupp = pCutR->
nLeaves, truthId;
1000 Abc_TtXor( uTruth, uTruth0, uTruth1, nWords, (fCompl = (
int)((uTruth0[0] ^ uTruth1[0]) & 1)) );
1002 Abc_TtAnd( uTruth, uTruth0, uTruth1, nWords, (fCompl = (
int)((uTruth0[0] & uTruth1[0]) & 1)) );
1004 assert( (uTruth[0] & 1) == 0 );
1009 return (
int)pCutR->
nLeaves < nOldSupp;
1014 int nOldSupp = pCutR->
nLeaves, truthId, fCompl;
word t;
1024 t = (tC & t1) | (~tC & t0);
1025 if ( (fCompl = (
int)(t & 1)) ) t = ~t;
1027 assert( (
int)(t & 1) == 0 );
1031 return (
int)pCutR->
nLeaves < nOldSupp;
1039 int nOldSupp = pCutR->
nLeaves, truthId;
1051 Abc_TtMux( uTruth, uTruthC, uTruth1, uTruth0, nWords );
1052 fCompl = (int)(uTruth[0] & 1);
1053 if ( fCompl )
Abc_TtNot( uTruth, nWords );
1055 assert( (uTruth[0] & 1) == 0 );
1059 return (
int)pCutR->
nLeaves < nOldSupp;
1117 int i, Arr, Req, Arrival = 0, Required = 0;
1118 for ( i = 0; i < (int)pCut->
nLeaves; i++ )
1130 return Abc_MaxInt( Required + 2, Arrival + 1 );
1135 int i, Index, Delay;
1141 for ( i = 0; i < (int)pCut->
nLeaves; i++ )
1158 Delay = pBest->
Delay[Index];
1165 if ( pCut->
Delay > Required )
1176 Lf_Cut_t * pCutSet0, * pCutSet1, * pCutSet2, * pCut0, * pCut1, * pCut2;
1190 int i, k, n, iCutUsed, nCutsR = 0;
1191 float Value1 = -1, Value2 = -1;
1209 Lf_CutParams( p, pCutsR[nCutsR++], Required, FlowRefs, pObj );
1213 Lf_CutParams( p, pCutsR[nCutsR], Required, FlowRefs, pObj );
1216 if ( pCutsR[0]->fLate )
1226 if ( pCut2->
pLeaves[0] == iSibl )
1228 Lf_CutCopy( pCutsR[nCutsR], pCut2, nCutWords );
1229 if ( pCutsR[nCutsR]->iFunc >= 0 )
1230 pCutsR[nCutsR]->iFunc =
Abc_LitNotCond( pCutsR[nCutsR]->iFunc, fCompE );
1231 Lf_CutParams( p, pCutsR[nCutsR], Required, FlowRefs, pObj );
1239 p->
CutCount[0] += nCuts0 * nCuts1 * nCuts2;
1257 Lf_CutParams( p, pCutsR[nCutsR], Required, FlowRefs, pObj );
1281 Lf_CutParams( p, pCutsR[nCutsR], Required, FlowRefs, pObj );
1288 printf(
"*** Obj = %d FlowRefs = %.2f MapRefs = %2d Required = %2d\n", iObj, FlowRefs,
Lf_ObjMapRefNum(p, iObj), Required );
1289 for ( i = 0; i < nCutsR; i++ )
1294 assert( nCutsR > 0 && nCutsR < nCutNum );
1297 assert( nCutsR == 1 || pCutsR[0]->Delay <= pCutsR[1]->Delay );
1300 pBest->
Delay[0] = pBest->
Delay[1] = pCutsR[0]->Delay;
1301 pBest->
Flow[0] = pBest->
Flow[1] = pCutsR[0]->Flow;
1307 if ( nCutsR > 1 && pCutsR[0]->Flow > pCutsR[1]->Flow )
1310 pBest->
Delay[1] = pCutsR[1]->Delay;
1311 pBest->
Flow[1] = pCutsR[1]->Flow;
1314 if ( !pCutsR[1]->fLate )
1340 if ( pObj->
Value == 0 )
1349 else if ( i == nCutsR && pCutsR[0]->nLeaves > 1 && (nCutsR == 1 || pCutsR[1]->nLeaves > 1) )
1375 Gia_Obj_t * pObj, * pCtrl, * pData0, * pData1;
1434 if ( pBest->
Delay[2] > Required )
1436 if ( pBest->
Flow[2] > 1.1 * pBest->
Flow[1] )
1460 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
1482 float Coef = 1.0 / (1.0 + (p->
Iter + 1) * (p->
Iter + 1));
1495 if ( Delay < p->pPars->DelayTarget + 0.01 )
1572 pFlowRefs[i] = Coef * pFlowRefs[i] + (1.0 - Coef) *
Abc_MaxFloat(1, pMapRefs[i]);
1586 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
1597 int i, Id, Delay = 0;
1605 if ( Delay < p->pPars->DelayTarget + 0.01 )
1686 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
1729 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
1749 for ( c = 0; c < 2; c++ )
1751 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
1761 for ( k = 0; k < nVarsNew; k++ )
1763 iLitCofs[c] =
Kit_TruthToGia( pNew, (
unsigned *)pTruthCof, nVarsNew, vCover, vLeaves, 0 );
1772 pTruthCof[0] =
ABC_CONST(0xCACACACACACACACA);
1796 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
1863 iLit =
Lf_ManDerivePart( p, pNew, vMapping, vMapping2, vCopies, pCut, vLeaves, vCover, pObj );
2014 printf(
"%s : ", pTitle );
2016 printf(
"Area =%9lu ", p->
pPars->
Area );
2017 printf(
"Edge =%9lu ", p->
pPars->
Edge );
2020 printf(
"Swt =%8.1f ", p->
Switches );
2022 printf(
"Mux7 =%7lu ", p->
pPars->
Mux7 );
2042 printf(
"Computing cuts...\r" );
2057 printf(
"CutPair = %.0f ", p->
CutCount[0] );
2062 printf(
"Gia = %.2f MB ", MemGia );
2063 printf(
"Man = %.2f MB ", MemMan );
2064 printf(
"Best = %.2f MB ", MemCutsB );
2065 printf(
"Front = %.2f MB ", MemCutsF );
2066 printf(
"Map = %.2f MB ", MemMap );
2067 printf(
"TT = %.2f MB ", MemTt );
2068 printf(
"Total = %.2f MB", MemGia + MemMan + MemCutsB + MemCutsF + MemMap + MemTt );
2135 int fUsePowerMode = 0;
static int Gia_ObjFanin2Copy(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Lf_CutCreateUnit(Lf_Cut_t *p, int i)
static int * Vec_IntArray(Vec_Int_t *p)
static int Gia_ManAppendAnd(Gia_Man_t *p, int iLit0, int iLit1)
static int Lf_ObjMapRefNum(Lf_Man_t *p, int i)
static void Lf_CutCopy(Lf_Cut_t *p, Lf_Cut_t *q, int n)
static word Abc_Tt6Expand(word t, int *pCut0, int nCutSize0, int *pCut, int nCutSize)
static int Gia_ManMuxNum(Gia_Man_t *p)
static void Lf_CutPrint(Lf_Man_t *p, Lf_Cut_t *pCut)
static int Gia_ObjFaninC2(Gia_Man_t *p, Gia_Obj_t *pObj)
struct Lf_Bst_t_ Lf_Bst_t
struct Lf_Cut_t_ Lf_Cut_t
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Gia_ObjIsAndNotBuf(Gia_Obj_t *pObj)
Gia_Man_t * Gia_ManDupUnnormalize(Gia_Man_t *p)
static int Lf_CutIsMux(Lf_Man_t *p, Lf_Cut_t *pCut, Gia_Obj_t *pMux)
static void Vec_MemAddMuxTT(Vec_Mem_t *p, int nVars)
static int Gia_ObjPhase(Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ObjSiblObj(Gia_Man_t *p, int Id)
static int Gia_ManAppendXor(Gia_Man_t *p, int iLit0, int iLit1)
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
static int Abc_TtMinBase(word *pTruth, int *pVars, int nVars, int nVarsAll)
float Lf_CutDeref_rec(Lf_Man_t *p, Lf_Cut_t *pCut)
void Gia_ManStop(Gia_Man_t *p)
void Tim_ManIncrementTravId(Tim_Man_t *p)
DECLARATIONS ///.
static double Vec_IntMemory(Vec_Int_t *p)
#define Gia_ManForEachCo(p, pObj, i)
static int Lf_CutComputeTruth6(Lf_Man_t *p, Lf_Cut_t *pCut0, Lf_Cut_t *pCut1, int fCompl0, int fCompl1, Lf_Cut_t *pCutR, int fIsXor)
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
static int Lf_CutCompareArea(Lf_Cut_t *pCut0, Lf_Cut_t *pCut1)
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Gia_Man_t * Lf_ManDeriveMappingGia(Lf_Man_t *p)
static void Abc_TtCofactor1p(word *pOut, word *pIn, int nWords, int iVar)
static void Vec_IntFillExtra(Vec_Int_t *p, int nSize, int Fill)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static float Lf_ObjFlowRefs(Lf_Man_t *p, int i)
static Gia_Obj_t * Gia_Regular(Gia_Obj_t *p)
static int Vec_FltCap(Vec_Flt_t *p)
#define LF_LEAF_MAX
DECLARATIONS ///.
static int Lf_ManPrepareSet(Lf_Man_t *p, int iObj, int Index, Lf_Cut_t **ppCutSet)
static char * Gia_ManName(Gia_Man_t *p)
static void Vec_PtrGrow(Vec_Ptr_t *p, int nCapMin)
static int Lf_SetCutIsContainedOrder(Lf_Cut_t *pBase, Lf_Cut_t *pCut)
static int Abc_Truth6WordNum(int nVars)
static int Lf_CutMergeOrderMux(Lf_Cut_t *pCut0, Lf_Cut_t *pCut1, Lf_Cut_t *pCut2, Lf_Cut_t *pCut, int nLutSize)
Gia_Man_t * Lf_ManDeriveMappingCoarse(Lf_Man_t *p)
static int Gia_ManAppendCi(Gia_Man_t *p)
void Lf_ManComputeSwitching(Gia_Man_t *p, Vec_Flt_t *vSwitches)
void Gia_ManCleanValue(Gia_Man_t *p)
void Gia_ManCleanMark0(Gia_Man_t *p)
static int Lf_CutComputeTruth(Lf_Man_t *p, Lf_Cut_t *pCut0, Lf_Cut_t *pCut1, int fCompl0, int fCompl1, Lf_Cut_t *pCutR, int fIsXor)
void Tim_ManSetCoArrival(Tim_Man_t *p, int iCo, float Delay)
static int Abc_Var2Lit(int Var, int fCompl)
#define Lf_CutForEachVar(pCut, Var, i)
static Lf_Bst_t * Lf_ObjReadBest(Lf_Man_t *p, int i)
static int Gia_ObjFaninId1p(Gia_Man_t *p, Gia_Obj_t *pObj)
int Lf_ManTtIsMux(word t)
typedefABC_NAMESPACE_IMPL_START struct Vec_Mem_t_ Vec_Mem_t
DECLARATIONS ///.
static int Vec_MemEntryNum(Vec_Mem_t *p)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static int Lf_SetCheckArray(Lf_Cut_t **ppCuts, int nCuts)
static void Vec_IntSetEntry(Vec_Int_t *p, int i, int Entry)
#define ABC_ALLOC(type, num)
static int Gia_ObjIsBuf(Gia_Obj_t *pObj)
static int Lf_ManSetMuxCut(Lf_Man_t *p, Lf_Bst_t *pBest, int iObj, int Required)
static float * Vec_FltArray(Vec_Flt_t *p)
static int Lf_CutComputeTruthMux6(Lf_Man_t *p, Lf_Cut_t *pCut0, Lf_Cut_t *pCut1, Lf_Cut_t *pCutC, int fCompl0, int fCompl1, int fComplC, Lf_Cut_t *pCutR)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
static void Lf_ObjSetCiArrival(Lf_Man_t *p, int iCi, int Time)
FUNCTION DEFINITIONS ///.
static int Gia_ManAndNotBufNum(Gia_Man_t *p)
static Lf_Cut_t * Lf_ManFetchSet(Lf_Man_t *p, int i)
static abctime Abc_Clock()
static int Abc_MaxInt(int a, int b)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void * Vec_PtrPop(Vec_Ptr_t *p)
int Lf_ManSetMapRefs(Lf_Man_t *p)
static int Lf_ManFindCofVar(word *pTruth, int nWords, int nVars)
static void Vec_FltFill(Vec_Flt_t *p, int nSize, float Entry)
static Vec_Int_t * Vec_IntStartFull(int nSize)
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
static float Abc_MaxFloat(float a, float b)
static int Abc_LitNotCond(int Lit, int c)
static int Lf_CutCountBits(word i)
static int Lf_ObjMapRefInc(Lf_Man_t *p, int i)
int Kit_TruthToGia(Gia_Man_t *pMan, unsigned *pTruth, int nVars, Vec_Int_t *vMemory, Vec_Int_t *vLeaves, int fHash)
DECLARATIONS ///.
#define ABC_SWAP(Type, a, b)
void Lf_ManSetFlowRefs(Gia_Man_t *p, Vec_Flt_t *vRefs, Vec_Int_t *vOffsets)
static int Lf_CutCheck(Lf_Cut_t *pBase, Lf_Cut_t *pCut)
static int Abc_Tt6MinBase(word *pTruth, int *pVars, int nVars)
static int Lf_SetLastCutIsContained(Lf_Cut_t **pCuts, int nCuts)
static void Lf_MemAlloc(Lf_Mem_t *p, int LogPage, Vec_Ptr_t *vFree, int nCutWords)
static int Gia_ManHasChoices(Gia_Man_t *p)
static float Lf_CutAreaDerefed(Lf_Man_t *p, Lf_Cut_t *pCut)
static void Lf_SetSortByArea(Lf_Cut_t **pCuts, int nCuts)
void Lf_ManAnalyzeCoDrivers(Gia_Man_t *p, int *pnDrivers, int *pnInverts)
static int Lf_ObjOff(Lf_Man_t *p, int i)
#define Gia_ManForEachCoDriverId(p, DriverId, i)
void Tim_ManSetCiRequired(Tim_Man_t *p, int iCi, float Delay)
static void Vec_IntGrow(Vec_Int_t *p, int nCapMin)
#define Gia_ManForEachCi(p, pObj, i)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static void Lf_ObjSetRequired(Lf_Man_t *p, int i, int t)
Lf_Man_t * Lf_ManAlloc(Gia_Man_t *pGia, Jf_Par_t *pPars)
static int Lf_BestIsMapped(Lf_Bst_t *p)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static int Gia_ManAppendMux(Gia_Man_t *p, int iCtrl, int iData1, int iData0)
static int Lf_CutEqual(Lf_Cut_t *pCut0, Lf_Cut_t *pCut1)
static int Gia_ManAndNum(Gia_Man_t *p)
static int Abc_MinInt(int a, int b)
static int Gia_ObjSibl(Gia_Man_t *p, int Id)
static Vec_Int_t * Vec_IntStart(int nSize)
static int Abc_LitIsCompl(int Lit)
static Lf_Cut_t * Lf_ObjCutBest(Lf_Man_t *p, int i)
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
static void Abc_TtCopy(word *pOut, word *pIn, int nWords, int fCompl)
static void Vec_IntDowndateEntry(Vec_Int_t *p, int i, int Value)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void Abc_TtCofactor0p(word *pOut, word *pIn, int nWords, int iVar)
static int Lf_SetAddCut(Lf_Cut_t **pCuts, int nCuts, int nCutNum)
static void Vec_FltUpdateEntry(Vec_Flt_t *p, int i, float Value)
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
#define Lf_CutSetForEachCut(nWords, pCutSet, pCut, i, nCuts)
static void Lf_SetSortBySize(Lf_Cut_t **pCutsR, int nCutsR)
static Vec_Mem_t * Vec_MemAllocForTT(int nVars, int fCompl)
Gia_Man_t * Gia_ManDupNormalize(Gia_Man_t *p)
#define Gia_ManForEachAndReverse(p, pObj, i)
static word * Lf_CutTruth(Lf_Man_t *p, Lf_Cut_t *pCut)
static int Gia_ManAppendBuf(Gia_Man_t *p, int iLit)
static int Vec_IntEntry(Vec_Int_t *p, int i)
unsigned __int64 word
DECLARATIONS ///.
static int Abc_Base10Log(unsigned n)
#define ABC_NAMESPACE_IMPL_END
void Lf_ManPrintInit(Lf_Man_t *p)
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
static Lf_Cut_t * Lf_CutNext(Lf_Cut_t *p, int n)
static double Vec_MemMemory(Vec_Mem_t *p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Gia_Man_t * Gia_ManDupMuxes(Gia_Man_t *p, int Limit)
static int Gia_ObjIsXor(Gia_Obj_t *pObj)
#define Gia_ManForEachAnd(p, pObj, i)
int nCutCounts[LF_LEAF_MAX+1]
static int Lf_CutComputeTruthMux(Lf_Man_t *p, Lf_Cut_t *pCut0, Lf_Cut_t *pCut1, Lf_Cut_t *pCutC, int fCompl0, int fCompl1, int fComplC, Lf_Cut_t *pCutR)
Tim_Man_t * Tim_ManDup(Tim_Man_t *p, int fUnitDelay)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
void Lf_ManSetDefaultPars(Jf_Par_t *pPars)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
void Tim_ManStop(Tim_Man_t *p)
static int Lf_MemSaveCut(Lf_Mem_t *p, Lf_Cut_t *pCut, int iObj)
static int Gia_ManXorNum(Gia_Man_t *p)
void Lf_ManPrintStats(Lf_Man_t *p, char *pTitle)
int Tim_ManBoxNum(Tim_Man_t *p)
void Gia_ManTransferTiming(Gia_Man_t *p, Gia_Man_t *pGia)
static void Vec_IntFreeP(Vec_Int_t **p)
void Gia_ManMappingVerify(Gia_Man_t *p)
static int Vec_IntCap(Vec_Int_t *p)
static void Vec_MemDumpTruthTables(Vec_Mem_t *p, char *pName, int nLutSize)
static void Lf_ManSetFlowRefInc(Gia_Man_t *p, Vec_Flt_t *vRefs, Vec_Int_t *vOffsets, int i)
static void Vec_MemFree(Vec_Mem_t *p)
static void Abc_Print(int level, const char *format,...)
static int Lf_ObjCoArrival2(Lf_Man_t *p, int iCo)
static int Lf_ObjCiArrival(Lf_Man_t *p, int iCi)
static Lf_Cut_t * Lf_MemLoadMuxCut(Lf_Man_t *p, int iObj, Lf_Cut_t *pCut)
void Gia_ManPrintMuxStats(Gia_Man_t *p)
float * Tim_ManGetReqTimes(Tim_Man_t *p)
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
Gia_Man_t * Lf_ManPerformMappingInt(Gia_Man_t *pGia, Jf_Par_t *pPars)
static float Lf_ObjSwitches(Lf_Man_t *p, int i)
static Gia_Obj_t * Gia_ObjFanin2(Gia_Man_t *p, Gia_Obj_t *pObj)
Gia_Man_t * Lf_ManPerformMapping(Gia_Man_t *p, Jf_Par_t *pPars)
static int Lf_CutMergeOrder(Lf_Cut_t *pCut0, Lf_Cut_t *pCut1, Lf_Cut_t *pCut, int nLutSize)
static Lf_Cut_t * Lf_ObjCutMux(Lf_Man_t *p, int i)
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
static void Lf_MemRecycle(Lf_Mem_t *p)
static int Lf_BestIndex(Lf_Bst_t *p)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
int Gia_ObjIsMuxType(Gia_Obj_t *pNode)
static Lf_Cut_t * Lf_ObjCutBestNew(Lf_Man_t *p, int i, Lf_Cut_t *pCut)
static int Gia_ManCiNum(Gia_Man_t *p)
float Lf_CutRef_rec(Lf_Man_t *p, Lf_Cut_t *pCut)
Gia_Man_t * Gia_ManPerformLfMapping(Gia_Man_t *p, Jf_Par_t *pPars, int fNormalized)
static void Vec_FltAddToEntry(Vec_Flt_t *p, int i, float Addition)
static Gia_Obj_t * Gia_ManCo(Gia_Man_t *p, int v)
static int Vec_IntSize(Vec_Int_t *p)
Gia_Man_t * Lf_ManDeriveMapping(Lf_Man_t *p)
static void Abc_TtExpand(word *pTruth0, int nVars, int *pCut0, int nCutSize0, int *pCut, int nCutSize)
static int Lf_SetLastCutContainsArea(Lf_Cut_t **pCuts, int nCuts)
static int Lf_CutRequired(Lf_Man_t *p, Lf_Cut_t *pCut)
static void Vec_IntShrink(Vec_Int_t *p, int nSizeNew)
static int Lf_ObjCoArrival(Lf_Man_t *p, int iCo)
#define ABC_CONST(number)
PARAMETERS ///.
static int Lf_ManDerivePart(Lf_Man_t *p, Gia_Man_t *pNew, Vec_Int_t *vMapping, Vec_Int_t *vMapping2, Vec_Int_t *vCopies, Lf_Cut_t *pCut, Vec_Int_t *vLeaves, Vec_Int_t *vCover, Gia_Obj_t *pObj)
Gia_Obj_t * Gia_ObjRecognizeMux(Gia_Obj_t *pNode, Gia_Obj_t **ppNodeT, Gia_Obj_t **ppNodeE)
static void Abc_TtMux(word *pOut, word *pCtrl, word *pIn1, word *pIn0, int nWords)
int Gia_ManIsNormalized(Gia_Man_t *p)
static int Gia_ManBufNum(Gia_Man_t *p)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
void Lf_ManCountMapRefsOne(Lf_Man_t *p, int iObj)
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
int Lf_ObjCoArrival2_rec(Lf_Man_t *p, Gia_Obj_t *pDriver)
#define ABC_CALLOC(type, num)
static int Abc_Lit2Var(int Lit)
static int Abc_TtSupportSize(word *t, int nVars)
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
static int Gia_ObjFaninId2p(Gia_Man_t *p, Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
int Lf_ObjArrival_rec(Lf_Man_t *p, Gia_Obj_t *pDriver)
static word Lf_CutGetSign(Lf_Cut_t *pCut)
static int Vec_MemHashInsert(Vec_Mem_t *p, word *pEntry)
void Lf_ManComputeMapping(Lf_Man_t *p)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
static int Lf_ObjMapRefDec(Lf_Man_t *p, int i)
static void Vec_MemHashFree(Vec_Mem_t *p)
static float Lf_CutArea(Lf_Man_t *p, Lf_Cut_t *pCut)
void Gia_ManTransferMapping(Gia_Man_t *p, Gia_Man_t *pGia)
float Tim_ManGetCoRequired(Tim_Man_t *p, int iCo)
static void Vec_PtrClear(Vec_Ptr_t *p)
static int * Vec_IntEntryP(Vec_Int_t *p, int i)
double Gia_ManMemory(Gia_Man_t *p)
void Lf_ManFree(Lf_Man_t *p)
void Gia_ManSetPhase(Gia_Man_t *p)
static int Gia_ObjFaninId2(Gia_Man_t *p, int ObjId)
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
static unsigned Gia_AigerReadUnsigned(unsigned char **ppPos)
static float Vec_FltEntry(Vec_Flt_t *p, int i)
static float Lf_CutSwitches(Lf_Man_t *p, Lf_Cut_t *pCut)
static Lf_Cut_t * Lf_MemLoadCut(Lf_Mem_t *p, int iCur, int iObj, Lf_Cut_t *pCut, int fTruth, int fRecycle)
static int Lf_BestDiffCuts(Lf_Bst_t *p)
void Tim_ManSetCoRequired(Tim_Man_t *p, int iCo, float Delay)
#define Gia_ManForEachObj1(p, pObj, i)
#define Gia_ManForEachAndId(p, i)
#define Gia_ManForEachObjReverse1(p, pObj, i)
static int Gia_AigerWriteUnsignedBuffer(unsigned char *pBuffer, int Pos, unsigned x)
void Lf_ManCountMapRefs(Lf_Man_t *p)
static int Lf_CutMergeOrder2(Lf_Cut_t *pCut0, Lf_Cut_t *pCut1, Lf_Cut_t *pCut, int nLutSize)
static word * Vec_MemReadEntry(Vec_Mem_t *p, int i)
static int Lf_BestCutIndex(Lf_Bst_t *p)
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
float * Tim_ManGetArrTimes(Tim_Man_t *p)
static void Abc_TtAnd(word *pOut, word *pIn1, word *pIn2, int nWords, int fCompl)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Gia_ManPiNum(Gia_Man_t *p)
int Lf_ManComputeCrossCut(Gia_Man_t *p)
static void Vec_IntClear(Vec_Int_t *p)
static void Lf_CutParams(Lf_Man_t *p, Lf_Cut_t *pCut, int Required, float FlowRefs, Gia_Obj_t *pMux)
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
static int Vec_FltSize(Vec_Flt_t *p)
Vec_Int_t * Gia_ManComputeSwitchProbs(Gia_Man_t *pGia, int nFrames, int nPref, int fProbOne)
char * Abc_UtilStrsav(char *s)
void Lf_ManSetCutRefs(Lf_Man_t *p)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static int Lf_CutCompareDelay(Lf_Cut_t *pCut0, Lf_Cut_t *pCut1)
static int Gia_ObjFaninId1(Gia_Obj_t *pObj, int ObjId)
static int Gia_ObjIsMux(Gia_Man_t *p, Gia_Obj_t *pObj)
float Tim_ManGetCiArrival(Tim_Man_t *p, int iCi)
static void Vec_PtrFreeData(Vec_Ptr_t *p)
void Lf_ManSetMapRefsOne(Lf_Man_t *p, int iObj)
void Lf_ManPrintQuit(Lf_Man_t *p, Gia_Man_t *pNew)
static void Abc_TtXor(word *pOut, word *pIn1, word *pIn2, int nWords, int fCompl)
static void Abc_TtNot(word *pOut, int nWords)
static int Gia_ObjCioId(Gia_Obj_t *pObj)
static int Gia_ManObjNum(Gia_Man_t *p)
void Tim_ManInitPoRequiredAll(Tim_Man_t *p, float Delay)
static int Lf_ObjRequired(Lf_Man_t *p, int i)
static int Gia_ObjFaninId0(Gia_Obj_t *pObj, int ObjId)
static int Gia_ManCoNum(Gia_Man_t *p)
void Lf_ObjMergeOrder(Lf_Man_t *p, int iObj)
static int Gia_ManRegNum(Gia_Man_t *p)