34 #define MF_LEAF_MAX 10
36 #define MF_LOG_PAGE 12
38 #define MF_TT_WORDS ((MF_LEAF_MAX > 6) ? 1 << (MF_LEAF_MAX-6) : 1)
39 #define MF_NO_FUNC 134217727 // (1<<27)-1
92 static inline int Mf_CutFunc(
int * pCut ) {
return ((
unsigned)pCut[0] >> 5); }
93 static inline int Mf_CutSetBoth(
int n,
int f ) {
return n | (f << 5); }
96 #define Mf_SetForEachCut( pList, pCut, i ) for ( i = 0, pCut = pList + 1; i < pList[0]; i++, pCut += Mf_CutSize(pCut) + 1 )
97 #define Mf_ObjForEachCut( pCuts, i, nCuts ) for ( i = 0, i < nCuts; i++ )
120 word Temp, Best = *t;
121 int r, i, Config = 0;
122 for ( r = 0; r < 1; r++ )
124 if ( Best > (Temp = ~Best) )
125 Best = Temp, Config ^= (1 << nVars);
126 for ( i = 0; i < nVars; i++ )
128 Best = Temp, Config ^= (1 << i);
155 word uTruth, tCur, tTemp1, tTemp2;
159 for ( i = 0; i < 2; i++ )
161 tCur = i ? ~uTruth : uTruth;
163 for ( p = 0; p < 720; p++ )
166 for ( c = 0; c < 64; c++ )
217 int i, Entry, * pCut,
Counter = 0;
230 printf(
"%6d : ", Counter++ );
231 printf(
"%6d : ", i );
232 printf(
"Occur = %4d ", Entry );
250 static inline int Mf_CubeLit(
int Cube,
int iVar ) {
return (Cube >> (iVar << 1)) & 3; }
253 int i, k, nLits = nCubes;
254 for ( i = 0; i < nCubes; i++ )
255 for ( k = 0; k < nVars; k++ )
262 int i, k, iFunc, nCubes, nLits, * pCut, pCnf[512];
268 for ( iFunc = 0; iFunc < 2; iFunc++ )
278 for ( k = 0; k < nCubes; k++ )
303 for ( k = 0; k < nCubes; k++ )
329 int Id, DriId, nVars, nClas, nLits, iVar = 1, iCla = 0, iLit = 0;
332 int pFanins[16], * pCut, * pCnfIds =
Vec_IntArray( vCnfIds );
333 int i, k, c, iFunc, nCubes, * pCubes, fComplLast;
405 pFanins[k] = pCnfIds[pCut[k+1]];
406 pFanins[k++] = pCnfIds[Id];
410 for ( c = 0; c < nCubes; c++ )
435 for ( i = 0; i < pCnf->
nClauses; i++ )
490 int nOldSupp = pCutR->
nLeaves, truthId, fCompl;
word t;
497 t = fIsXor ? t0 ^ t1 : t0 & t1;
498 if ( (fCompl = (
int)(t & 1)) ) t = ~t;
500 assert( (
int)(t & 1) == 0 );
508 return (
int)pCutR->
nLeaves < nOldSupp;
516 int nOldSupp = pCutR->
nLeaves, truthId;
526 Abc_TtXor( uTruth, uTruth0, uTruth1, nWords, (fCompl = (
int)((uTruth0[0] ^ uTruth1[0]) & 1)) );
528 Abc_TtAnd( uTruth, uTruth0, uTruth1, nWords, (fCompl = (
int)((uTruth0[0] & uTruth1[0]) & 1)) );
530 assert( (uTruth[0] & 1) == 0 );
537 return (
int)pCutR->
nLeaves < nOldSupp;
542 int nOldSupp = pCutR->
nLeaves, truthId, fCompl;
word t;
552 t = (tC & t1) | (~tC & t0);
553 if ( (fCompl = (
int)(t & 1)) ) t = ~t;
555 assert( (
int)(t & 1) == 0 );
561 return (
int)pCutR->
nLeaves < nOldSupp;
569 int nOldSupp = pCutR->
nLeaves, truthId;
581 Abc_TtMux( uTruth, uTruthC, uTruth1, uTruth0, nWords );
582 fCompl = (int)(uTruth[0] & 1);
583 if ( fCompl )
Abc_TtNot( uTruth, nWords );
585 assert( (uTruth[0] & 1) == 0 );
591 return (
int)pCutR->
nLeaves < nOldSupp;
609 i = i - ((i >> 1) & 0x5555555555555555);
610 i = (i & 0x3333333333333333) + ((i >> 2) & 0x3333333333333333);
611 i = ((i + (i >> 4)) & 0x0F0F0F0F0F0F0F0F);
612 return (i*(0x0101010101010101))>>56;
616 word Sign = 0;
int i;
617 for ( i = 0; i < nLeaves; i++ )
618 Sign |= ((
word)1) << (pLeaves[i] & 0x3F);
634 printf(
"%d {", pCut->
nLeaves );
635 for ( i = 0; i < (int)pCut->
nLeaves; i++ )
636 printf(
" %*d", nDigits, pCut->
pLeaves[i] );
638 printf(
" %*s", nDigits,
" " );
639 printf(
" } D = %4d A = %9.4f F = %6d ",
666 if ( fAddUnit && pCuts->
nLeaves > 1 )
674 int i, * pPlace, iCur, nInts = 1;
675 for ( i = 0; i < nCuts; i++ )
676 nInts += pCuts[i]->nLeaves + 1;
677 if ( (p->
iCur & 0xFFFF) + nInts > 0xFFFF )
678 p->
iCur = ((p->
iCur >> 16) + 1) << 16;
684 for ( i = 0; i < nCuts; i++ )
686 *pPlace++ =
Mf_CutSetBoth(pCuts[i]->nLeaves, pCuts[i]->iFunc);
687 memcpy( pPlace, pCuts[i]->pLeaves,
sizeof(
int) * pCuts[i]->nLeaves );
695 if ( ++pCuts < pCut )
698 int nBlock = pCut - pCuts;
700 memmove( pTemp, pCuts,
sizeof(
int) * nBlock );
701 memmove( pCuts, pCut,
sizeof(
int) * nSize );
702 memmove( pCuts + nSize, pTemp,
sizeof(
int) * nBlock );
723 for ( i = 0; i < nSizeC; i++ )
725 for ( k = 0; k < nSizeB; k++ )
726 if ( pC[i] == pB[k] )
736 int i, k, m, n, Value;
738 for ( i = 0; i < nCuts; i++ )
744 for ( m = 0; m < (int)pCut0->
nLeaves; m++ )
745 for ( n = m + 1; n < (int)pCut0->
nLeaves; n++ )
748 for ( k = 0; k < nCuts; k++ )
751 if ( pCut0 == pCut1 )
781 if ( nSize0 == nLutSize && nSize1 == nLutSize )
783 for ( i = 0; i < nSize0; i++ )
785 if ( pC0[i] != pC1[i] )
return 0;
795 if ( nSize0 == 0 )
goto FlushCut1;
796 if ( nSize1 == 0 )
goto FlushCut0;
799 if ( c == nLutSize )
return 0;
800 if ( pC0[i] < pC1[k] )
803 if ( i >= nSize0 )
goto FlushCut1;
805 else if ( pC0[i] > pC1[k] )
808 if ( k >= nSize1 )
goto FlushCut0;
812 pC[c++] = pC0[i++]; k++;
813 if ( i >= nSize0 )
goto FlushCut1;
814 if ( k >= nSize1 )
goto FlushCut0;
819 if ( c + nSize0 > nLutSize + i )
return 0;
828 if ( c + nSize1 > nLutSize + k )
return 0;
841 int xMin, c = 0, * pC = pCut->
pLeaves;
849 if ( c == nLutSize )
return 0;
851 if (x0 == xMin) i0++;
852 if (x1 == xMin) i1++;
853 if (x2 == xMin) i2++;
862 int i, nSizeB = pBase->
nLeaves;
864 if ( nSizeB == nSizeC )
866 for ( i = 0; i < nSizeB; i++ )
871 assert( nSizeB > nSizeC );
874 for ( i = k = 0; i < nSizeB; i++ )
889 for ( i = 0; i < nCuts; i++ )
890 if ( pCuts[i]->nLeaves <= pCuts[nCuts]->nLeaves && (pCuts[i]->Sign & pCuts[nCuts]->Sign) == pCuts[i]->Sign &&
Mf_SetCutIsContainedOrder(pCuts[nCuts], pCuts[i]) )
896 int i, k, fChanges = 0;
897 for ( i = 0; i < nCuts; i++ )
898 if ( pCuts[nCuts]->nLeaves < pCuts[i]->nLeaves && (pCuts[nCuts]->Sign & pCuts[i]->Sign) == pCuts[nCuts]->Sign &&
Mf_SetCutIsContainedOrder(pCuts[i], pCuts[nCuts]) )
902 for ( i = k = 0; i <= nCuts; i++ )
914 if ( pCut0->
Flow < pCut1->
Flow )
return -1;
915 if ( pCut0->
Flow > pCut1->
Flow )
return 1;
925 for ( i = nCuts; i > 0; i-- )
953 int i, nLeaves = pCut->
nLeaves;
954 assert( nLeaves <= p->pPars->nLutSize );
957 for ( i = 0; i < nLeaves; i++ )
963 pCut->
Delay += (int)(nLeaves > 1);
978 Mf_Cut_t * pCut0, * pCut1, * pCut0Lim = pCuts0 + nCuts0, * pCut1Lim = pCuts1 + nCuts1;
980 for ( i = 0; i < nCutNum; i++ )
981 pCutsR[i] = pCuts + i;
988 Mf_Cut_t * pCut2, * pCut2Lim = pCuts2 + nCuts2;
989 for ( pCut2 = pCuts2; pCut2 < pCut2Lim; pCut2++ )
991 *pCutsR[nCutsR] = *pCut2;
992 if ( pCutsR[nCutsR]->iFunc >= 0 )
1003 Mf_Cut_t * pCut2, * pCut2Lim = pCuts2 + nCuts2;
1004 p->
CutCount[0] += nCuts0 * nCuts1 * nCuts2;
1005 for ( pCut0 = pCuts0; pCut0 < pCut0Lim; pCut0++ )
1006 for ( pCut1 = pCuts1; pCut1 < pCut1Lim; pCut1++ )
1007 for ( pCut2 = pCuts2; pCut2 < pCut2Lim; pCut2++ )
1018 pCutsR[nCutsR]->
Sign =
Mf_CutGetSign(pCutsR[nCutsR]->pLeaves, pCutsR[nCutsR]->nLeaves);
1027 for ( pCut0 = pCuts0; pCut0 < pCut0Lim; pCut0++ )
1028 for ( pCut1 = pCuts1; pCut1 < pCut1Lim; pCut1++ )
1039 pCutsR[nCutsR]->
Sign =
Mf_CutGetSign(pCutsR[nCutsR]->pLeaves, pCutsR[nCutsR]->nLeaves);
1049 printf(
"*** Obj = %d FlowRefs = %.2f MapRefs = %2d\n", iObj, pBest->
nFlowRefs, pBest->
nMapRefs );
1050 for ( i = 0; i < nCutsR; i++ )
1059 assert( nCutsR > 0 && nCutsR < nCutNum );
1080 Gia_Obj_t * pObj, * pCtrl, * pData0, * pData1;
1113 float Coef = 1.0 / (1.0 + (p->
Iter + 1) * (p->
Iter + 1));
1114 int * pCut, i, k, Id;
1124 if ( Delay < p->pPars->DelayTarget + 0.01 )
1241 int i, k, Id, iLit, * pCut;
1242 word uTruth = 0, * pTruth = &uTruth;
1408 printf(
"%s : ", pTitle );
1410 printf(
"Area =%9lu ", p->
pPars->
Area );
1411 printf(
"Edge =%9lu ", p->
pPars->
Edge );
1429 printf(
"Computing cuts...\r" );
1436 float MemCuts = 1.0 *
sizeof(int) * (1 << 16) *
Vec_PtrSize(&p->
vPages) / (1<<20);
1443 printf(
"CutPair = %.0f ", p->
CutCount[0] );
1448 printf(
"Gia = %.2f MB ", MemGia );
1449 printf(
"Man = %.2f MB ", MemMan );
1450 printf(
"Cut = %.2f MB ", MemCuts );
1451 printf(
"Map = %.2f MB ", MemMap );
1452 printf(
"TT = %.2f MB ", MemTt );
1453 printf(
"Total = %.2f MB", MemGia + MemMan + MemCuts + MemMap + MemTt );
1527 int * pCut, * pCutBest = NULL;
1528 int Value1 = -1, Value2 = -1;
1538 if ( pCutBest == NULL || FlowBest > Flow || (FlowBest == Flow && TimeBest > Time) )
1539 pCutBest = pCut, FlowBest = Flow, TimeBest = Time;
1541 assert( pCutBest != NULL );
1546 assert( Value1 >= Value2 );
1549 pBest->
Delay = TimeBest;
1633 assert( nLutSize >= 3 && nLutSize <= 8 );
1654 printf(
"CNF stats: Vars = %6d. Clauses = %7d. Literals = %8d. ", pCnf->
nVars, pCnf->
nClauses, pCnf->
nLiterals );
static int Mf_ObjMapRefInc(Mf_Man_t *p, int i)
static int Gia_ObjFanin2Copy(Gia_Man_t *p, Gia_Obj_t *pObj)
static int * Vec_IntArray(Vec_Int_t *p)
static int Gia_ManAppendAnd(Gia_Man_t *p, int iLit0, int iLit1)
static word Abc_Tt6Expand(word t, int *pCut0, int nCutSize0, int *pCut, int nCutSize)
static int Mf_CutCompareArea(Mf_Cut_t *pCut0, Mf_Cut_t *pCut1)
static int * Mf_ManCutSet(Mf_Man_t *p, int i)
static int Gia_ManMuxNum(Gia_Man_t *p)
static int Gia_ObjFaninC2(Gia_Man_t *p, Gia_Obj_t *pObj)
void Mf_ManComputeCuts(Mf_Man_t *p)
int Mf_CutDeref_rec(Mf_Man_t *p, int *pCut)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
int pLeaves[MF_LEAF_MAX+1]
static int Gia_ObjPhase(Gia_Obj_t *pObj)
static int Mf_CutComputeTruthMux(Mf_Man_t *p, Mf_Cut_t *pCut0, Mf_Cut_t *pCut1, Mf_Cut_t *pCutC, int fCompl0, int fCompl1, int fComplC, Mf_Cut_t *pCutR)
static Gia_Obj_t * Gia_ObjSiblObj(Gia_Man_t *p, int Id)
static int Gia_ManAppendXor(Gia_Man_t *p, int iLit0, int iLit1)
int nCutCounts[MF_LEAF_MAX+1]
static int Abc_TtMinBase(word *pTruth, int *pVars, int nVars, int nVarsAll)
static int Mf_CutComputeTruth(Mf_Man_t *p, Mf_Cut_t *pCut0, Mf_Cut_t *pCut1, int fCompl0, int fCompl1, Mf_Cut_t *pCutR, int fIsXor)
static int Mf_CutSize(int *pCut)
void Gia_ManStop(Gia_Man_t *p)
static double Vec_IntMemory(Vec_Int_t *p)
#define Gia_ManForEachCo(p, pObj, i)
static int Mf_SetLastCutIsContained(Mf_Cut_t **pCuts, int nCuts)
Cnf_Dat_t * Mf_ManDeriveCnf(Mf_Man_t *p, int fCnfObjIds, int fAddOrCla)
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
static int Mf_SetAddCut(Mf_Cut_t **pCuts, int nCuts, int nCutNum)
static int Mf_ManCountLits(int *pCnf, int nCubes, int nVars)
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 int s_nCalls
FUNCTION DEFINITIONS ///.
static int Mf_CutComputeTruthMux6(Mf_Man_t *p, Mf_Cut_t *pCut0, Mf_Cut_t *pCut1, Mf_Cut_t *pCutC, int fCompl0, int fCompl1, int fComplC, Mf_Cut_t *pCutR)
static int Abc_Tt6CnfSize(word t, int nVars)
static Gia_Obj_t * Gia_Regular(Gia_Obj_t *p)
void Cnf_DataWriteIntoFile(Cnf_Dat_t *p, char *pFileName, int fReadable, Vec_Int_t *vForAlls, Vec_Int_t *vExists)
static char * Gia_ManName(Gia_Man_t *p)
static void Mf_CutPrint(Mf_Man_t *p, Mf_Cut_t *pCut)
static void Vec_PtrGrow(Vec_Ptr_t *p, int nCapMin)
static int Abc_Truth6WordNum(int nVars)
static void Vec_WrdPush(Vec_Wrd_t *p, word Entry)
static int Mf_CutMergeOrder(Mf_Cut_t *pCut0, Mf_Cut_t *pCut1, Mf_Cut_t *pCut, int nLutSize)
static int Gia_ManAppendCi(Gia_Man_t *p)
static void Mf_ObjSetBestCut(int *pCuts, int *pCut)
static int Abc_Var2Lit(int Var, int fCompl)
typedefABC_NAMESPACE_IMPL_START struct Vec_Mem_t_ Vec_Mem_t
DECLARATIONS ///.
Gia_Man_t * Mf_ManDeriveMappingCoarse(Mf_Man_t *p)
void Dau_DsdPrintFromTruth(word *pTruth, int nVarsInit)
static int Vec_MemEntryNum(Vec_Mem_t *p)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static void Vec_IntSetEntry(Vec_Int_t *p, int i, int Entry)
#define ABC_ALLOC(type, num)
void Mf_ManFree(Mf_Man_t *p)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
static int Mf_CutIsTriv(int *pCut, int i)
static int Mf_ManPrepareCuts(Mf_Cut_t *pCuts, Mf_Man_t *p, int iObj, int fAddUnit)
static abctime Abc_Clock()
static float Mf_CutFlow(Mf_Man_t *p, int *pCut, int *pTime)
Vec_Int_t * Mf_ManDeriveCnfs(Mf_Man_t *p, int *pnVars, int *pnClas, int *pnLits)
static int Abc_MaxInt(int a, int b)
static int Vec_PtrSize(Vec_Ptr_t *p)
static int Vec_WrdSize(Vec_Wrd_t *p)
#define Vec_WrdForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static Vec_Int_t * Vec_IntStartFull(int nSize)
void Mf_ManDumpCnf(Gia_Man_t *p, char *pFileName, int nLutSize, int fCnfObjIds, int fAddOrCla, int fVerbose)
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)
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 Gia_ManStopP(Gia_Man_t **p)
static int Abc_Tt6MinBase(word *pTruth, int *pVars, int nVars)
static int Gia_ManHasChoices(Gia_Man_t *p)
static int Mf_SetCutIsContainedOrder(Mf_Cut_t *pBase, Mf_Cut_t *pCut)
struct Mf_Obj_t_ Mf_Obj_t
static int Mf_CutCountBits(word i)
#define Gia_ManForEachAndReverseId(p, i)
#define Gia_ManForEachCoDriverId(p, DriverId, i)
#define Gia_ManForEachCiId(p, Id, i)
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 Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static int Mf_CutMergeOrderMux(Mf_Cut_t *pCut0, Mf_Cut_t *pCut1, Mf_Cut_t *pCut2, Mf_Cut_t *pCut, int nLutSize)
static int Gia_ManAppendMux(Gia_Man_t *p, int iCtrl, int iData1, int iData0)
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 word Abc_Tt6SwapAdjacent(word Truth, int iVar)
static int Abc_LitIsCompl(int Lit)
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
static Vec_Wrd_t * Vec_WrdUniqifyHash(Vec_Wrd_t *vData, int nWordSize)
static void Abc_TtCopy(word *pOut, word *pIn, int nWords, int fCompl)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Mf_ManComputeMapping(Mf_Man_t *p)
Gia_Man_t * Mf_ManDeriveMappingGia(Mf_Man_t *p)
static int Mf_SetLastCutContainsArea(Mf_Cut_t **pCuts, int nCuts)
Vec_Wrd_t * Mpm_ManGetTruthWithCnf(int Limit)
FUNCTION DEFINITIONS ///.
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
static int Mf_CutCheck(Mf_Cut_t *pBase, Mf_Cut_t *pCut)
static void Vec_WrdWriteEntry(Vec_Wrd_t *p, int i, word Entry)
static Vec_Mem_t * Vec_MemAllocForTT(int nVars, int fCompl)
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
static void Vec_WrdFree(Vec_Wrd_t *p)
static int Mf_SetCheckArray(Mf_Cut_t **ppCuts, int nCuts)
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
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 void Vec_IntUpdateEntry(Vec_Int_t *p, int i, int Value)
static int Gia_ObjIsXor(Gia_Obj_t *pObj)
#define Gia_ManForEachAnd(p, pObj, i)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Abc_Tt8CnfSize(word t[4], int nVars)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ManXorNum(Gia_Man_t *p)
#define MF_LEAF_MAX
DECLARATIONS ///.
static void Vec_IntFreeP(Vec_Int_t **p)
void Gia_ManMappingVerify(Gia_Man_t *p)
static int Vec_IntCap(Vec_Int_t *p)
static int Gia_ManCoIdToId(Gia_Man_t *p, int CoId)
static void Vec_MemDumpTruthTables(Vec_Mem_t *p, char *pName, int nLutSize)
static word Abc_Tt6Flip(word Truth, int iVar)
static void Vec_MemFree(Vec_Mem_t *p)
static int Abc_Tt8Cnf(word t[4], int nVars, int *pCover)
static void Abc_Print(int level, const char *format,...)
void Mf_ManPrintQuit(Mf_Man_t *p, Gia_Man_t *pNew)
int Mf_CutRef_rec(Mf_Man_t *p, int *pCut)
static int * Mf_ObjCutSet(Mf_Man_t *p, int i)
void Gia_ManPrintMuxStats(Gia_Man_t *p)
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
static int Mf_CutArea(Mf_Man_t *p, int nLeaves, int iFunc)
static Gia_Obj_t * Gia_ObjFanin2(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Mf_ObjMapRefDec(Mf_Man_t *p, int i)
static Vec_Wrd_t * Vec_WrdAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define ABC_NAMESPACE_IMPL_START
static void Mf_ObjComputeBestCut(Mf_Man_t *p, int iObj)
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Gia_Man_t * Mf_ManPerformMapping(Gia_Man_t *pGia, Jf_Par_t *pPars)
Vec_Wrd_t * Mf_ManTruthCollect(int Limit)
int Gia_ObjIsMuxType(Gia_Obj_t *pNode)
static int Gia_ManCiNum(Gia_Man_t *p)
int Mf_ManTruthCanonicize(word *t, int nVars)
static int Mf_CutFunc(int *pCut)
static int Mf_CubeLit(int Cube, int iVar)
void Mf_ManProfileTruths(Mf_Man_t *p)
static int Vec_IntSize(Vec_Int_t *p)
static void Mf_CutParams(Mf_Man_t *p, Mf_Cut_t *pCut, float FlowRefs)
static word Mf_CutGetSign(int *pLeaves, int nLeaves)
void Mf_ManPrintStats(Mf_Man_t *p, char *pTitle)
static void Abc_TtExpand(word *pTruth0, int nVars, int *pCut0, int nCutSize0, int *pCut, int nCutSize)
void Mf_ManSetDefaultPars(Jf_Par_t *pPars)
static int Abc_Tt6Cnf(word t, int nVars, int *pCover)
Mf_Man_t * Mf_ManAlloc(Gia_Man_t *pGia, Jf_Par_t *pPars)
static void Vec_IntShrink(Vec_Int_t *p, int nSizeNew)
Gia_Man_t * Mf_ManDeriveMapping(Mf_Man_t *p)
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)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
static int Mf_CutCreateUnit(Mf_Cut_t *p, int i)
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
static int Mf_ObjMapRefNum(Mf_Man_t *p, int i)
static int Mf_CutSetBoth(int n, int f)
#define ABC_CALLOC(type, num)
static int Abc_Lit2Var(int Lit)
#define Mf_SetForEachCut(pList, pCut, i)
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Mf_SetSortByArea(Mf_Cut_t **pCuts, int nCuts)
void Cnf_DataFree(Cnf_Dat_t *p)
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
static int Vec_MemHashInsert(Vec_Mem_t *p, word *pEntry)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
int Mf_ManSetMapRefs(Mf_Man_t *p)
static void Vec_MemHashFree(Vec_Mem_t *p)
static int * Vec_IntEntryP(Vec_Int_t *p, int i)
static Mf_Obj_t * Mf_ManObj(Mf_Man_t *p, int i)
double Gia_ManMemory(Gia_Man_t *p)
void Gia_ManSetPhase(Gia_Man_t *p)
void Mf_ManSetFlowRefs(Gia_Man_t *p, Vec_Int_t *vRefs)
static int Gia_ObjFaninId2(Gia_Man_t *p, int ObjId)
static Vec_Mem_t * s_vTtMem
static int * Mf_ObjCutBest(Mf_Man_t *p, int i)
#define Gia_ManForEachAndId(p, i)
void Mf_ObjMergeOrder(Mf_Man_t *p, int iObj)
Cnf_Dat_t * Mf_ManGenerateCnf(Gia_Man_t *pGia, int nLutSize, int fCnfObjIds, int fAddOrCla, int fVerbose)
static word * Vec_MemReadEntry(Vec_Mem_t *p, int i)
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
static void Abc_TtAnd(word *pOut, word *pIn1, word *pIn2, int nWords, int fCompl)
static void Vec_IntFree(Vec_Int_t *p)
static int Mf_CutAreaDerefed(Mf_Man_t *p, int *pCut)
static void Vec_IntClear(Vec_Int_t *p)
char * Abc_UtilStrsav(char *s)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static int Gia_ObjFaninId1(Gia_Obj_t *pObj, int ObjId)
static int Mf_ManSaveCuts(Mf_Man_t *p, Mf_Cut_t **pCuts, int nCuts)
void Mf_ManPrintInit(Mf_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Wrd_t_ Vec_Wrd_t
INCLUDES ///.
static void Vec_PtrFreeData(Vec_Ptr_t *p)
#define Gia_ManForEachCoId(p, Id, i)
static void Abc_TtXor(word *pOut, word *pIn1, word *pIn2, int nWords, int fCompl)
static void Abc_TtNot(word *pOut, int nWords)
static int Mf_CutComputeTruth6(Mf_Man_t *p, Mf_Cut_t *pCut0, Mf_Cut_t *pCut1, int fCompl0, int fCompl1, Mf_Cut_t *pCutR, int fIsXor)
static int Gia_ManObjNum(Gia_Man_t *p)
#define ABC_FALLOC(type, num)
static int Gia_ManCiIdToId(Gia_Man_t *p, int CiId)
static int Gia_ObjFaninId0(Gia_Obj_t *pObj, int ObjId)
static int Gia_ManCoNum(Gia_Man_t *p)
static int Gia_ManRegNum(Gia_Man_t *p)