49 for ( i = 0; i < pCut->
nLeaves; i++ )
50 printf(
" %d", pCut->
pLeaves[i] );
69 printf(
"Cuts for node %d:\n", pObj->
Id );
88 uWord = (uWord & 0x55555555) + ((uWord>>1) & 0x55555555);
89 uWord = (uWord & 0x33333333) + ((uWord>>2) & 0x33333333);
90 uWord = (uWord & 0x0F0F0F0F) + ((uWord>>4) & 0x0F0F0F0F);
91 uWord = (uWord & 0x00FF00FF) + ((uWord>>8) & 0x00FF00FF);
92 return (uWord & 0x0000FFFF) + (uWord>>16);
118 Value += pLeaf->
nRefs;
119 nOnes += (pLeaf->
nRefs == 1);
149 if ( pCut->
fUsed == 0 )
153 if ( pCutMax == NULL || pCutMax->
Value > pCut->
Value )
156 if ( pCutMax == NULL )
162 if ( pCutMax == NULL || pCutMax->
Value > pCut->
Value )
166 if ( pCutMax == NULL )
170 if ( pCutMax == NULL || pCutMax->
Value > pCut->
Value )
174 assert( pCutMax != NULL );
194 for ( i = 0; i < (int)pDom->
nLeaves; i++ )
196 for ( k = 0; k < (int)pCut->
nLeaves; k++ )
277 for ( i = 0; i < (int)pC0->
nLeaves; i++ )
280 for ( i = 0; i < (int)pC0->
nLeaves; i++ )
291 for ( i = 0; i < (int)pC1->
nLeaves; i++ )
293 for ( k = (
int)pC0->
nLeaves - 1; k >= 0; k-- )
299 for ( i = 0; i < (int)pC0->
nLeaves; i++ )
307 for ( c = 0; c < 4; c++ )
394 for ( i = k = 0; i < (int)pCut->
nLeaves; i++ )
396 if ( k == (
int)pCut1->
nLeaves )
420 assert( iVar >= 0 && iVar <= 2 );
422 return (uTruth & 0x99999999) | ((uTruth & 0x22222222) << 1) | ((uTruth & 0x44444444) >> 1);
424 return (uTruth & 0xC3C3C3C3) | ((uTruth & 0x0C0C0C0C) << 2) | ((uTruth & 0x30303030) >> 2);
426 return (uTruth & 0xF00FF00F) | ((uTruth & 0x00F000F0) << 4) | ((uTruth & 0x0F000F00) >> 4);
444 assert( iVar >= 0 && iVar <= 3 );
446 return ((uTruth & 0xAAAA) >> 1) | ((uTruth & 0x5555) << 1);
448 return ((uTruth & 0xCCCC) >> 2) | ((uTruth & 0x3333) << 2);
450 return ((uTruth & 0xF0F0) >> 4) | ((uTruth & 0x0F0F) << 4);
452 return ((uTruth & 0xFF00) >> 8) | ((uTruth & 0x00FF) << 8);
472 int i, k,
Var = nVars - 1;
473 for ( i = 3; i >= 0; i-- )
474 if ( Phase & (1 << i) )
476 for ( k = Var; k < i; k++ )
500 for ( i = 0; i < 4; i++ )
501 if ( Phase & (1 << i) )
503 for ( k = i-1; k >=
Var; k-- )
523 int i, Temp, fChange,
Counter = 0;
525 for ( i = 0; i < 4; i++ )
527 if ( pVars[i] == -1 )
528 pVars[i] = 0x3FFFFFFF;
540 for ( i = 0; i < 3; i++ )
542 if ( pVars[i] <= pVars[i+1] )
548 pVars[i] = pVars[i+1];
556 for ( i = 0; i < 4; i++ )
558 if ( pVars[i] == 0x3FFFFFFF )
582 unsigned uTruth0 = fCompl0 ? ~pCut0->
uTruth : pCut0->
uTruth;
583 unsigned uTruth1 = fCompl1 ? ~pCut1->
uTruth : pCut1->
uTruth;
586 return uTruth0 & uTruth1;
602 unsigned uMasks[4][2] = {
608 unsigned uPhase = 0, uTruth = 0xFFFF & pCut->
uTruth;
613 for ( i = 0; i < (int)pCut->
nLeaves; i++ )
614 if ( (uTruth & uMasks[i][0]) == ((uTruth & uMasks[i][1]) >> (1 << i)) )
618 if ( nLeaves == (
int)pCut->
nLeaves )
622 pCut->
uTruth = 0xFFFF & uTruth;
625 for ( i = k = 0; i < (int)pCut->
nLeaves; i++ )
627 if ( !(uPhase & (1 << i)) )
650 if ( p->pMemCuts == NULL )
673 pObj->
nCuts = p->pPars->nCutsMax;
744 Dar_Cut_t * pCutSet, * pCut0, * pCut1, * pCut;
791 if ( pCut->
Value == 0 )
801 p->nCutsUsed += pCut->
fUsed;
static Dar_Cut_t * Dar_ObjCuts(Aig_Obj_t *pObj)
static unsigned Dar_CutTruthSwapAdjacentVars(unsigned uTruth, int iVar)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
static Aig_Obj_t * Aig_ObjChild0(Aig_Obj_t *pObj)
void Dar_ObjCutPrint(Aig_Man_t *p, Aig_Obj_t *pObj)
Aig_Obj_t * Aig_ObjReal_rec(Aig_Obj_t *pObj)
static int Dar_CutMerge(Dar_Cut_t *pCut, Dar_Cut_t *pCut0, Dar_Cut_t *pCut1)
void Aig_MmFixedStop(Aig_MmFixed_t *p, int fVerbose)
Dar_Cut_t * Dar_ObjComputeCuts(Dar_Man_t *p, Aig_Obj_t *pObj, int fSkipTtMin)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
static void Dar_ObjSetCuts(Aig_Obj_t *pObj, Dar_Cut_t *pCuts)
static unsigned Dar_CutTruthStretch(unsigned uTruth, int nVars, unsigned Phase)
static int Aig_IsComplement(Aig_Obj_t *p)
static unsigned Dar_CutTruthPhase(Dar_Cut_t *pCut, Dar_Cut_t *pCut1)
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
static unsigned Dar_CutTruth(Dar_Cut_t *pCut, Dar_Cut_t *pCut0, Dar_Cut_t *pCut1, int fCompl0, int fCompl1)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
void Dar_ManCutsRestart(Dar_Man_t *p, Aig_Obj_t *pRoot)
FUNCTION DECLARATIONS ///.
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
ABC_NAMESPACE_IMPL_START void Dar_CutPrint(Dar_Cut_t *pCut)
DECLARATIONS ///.
#define Dar_ObjForEachCutAll(pObj, pCut, i)
MACRO DEFINITIONS ///.
static int Dar_CutSuppMinimize(Dar_Cut_t *pCut)
static unsigned Dar_CutTruthShrink(unsigned uTruth, int nVars, unsigned Phase)
static unsigned Aig_ObjCutSign(unsigned ObjId)
MACRO DEFINITIONS ///.
static int Dar_CutFindValue(Dar_Man_t *p, Dar_Cut_t *pCut)
Dar_Cut_t * Dar_ObjComputeCuts_rec(Dar_Man_t *p, Aig_Obj_t *pObj)
#define Dar_ObjForEachCut(pObj, pCut, i)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static int Aig_ObjIsBuf(Aig_Obj_t *pObj)
static int Abc_LitIsCompl(int Lit)
typedefABC_NAMESPACE_HEADER_START struct Dar_Man_t_ Dar_Man_t
INCLUDES ///.
unsigned Dar_CutSortVars(unsigned uTruth, int *pVars)
static int Aig_ObjIsNone(Aig_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
static Aig_Obj_t * Aig_ObjChild1(Aig_Obj_t *pObj)
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
char * Aig_MmFixedEntryFetch(Aig_MmFixed_t *p)
void Dar_ManCutsFree(Dar_Man_t *p)
static int Dar_CutFilter(Aig_Obj_t *pObj, Dar_Cut_t *pCut)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
static int Dar_WordCountOnes(unsigned uWord)
#define ABC_NAMESPACE_IMPL_START
static int Abc_LitNot(int Lit)
int Aig_MmFixedReadMemUsage(Aig_MmFixed_t *p)
#define Dar_CutForEachLeaf(p, pCut, pLeaf, i)
static Dar_Cut_t * Dar_CutFindFree(Dar_Man_t *p, Aig_Obj_t *pObj)
void Aig_MmFixedRestart(Aig_MmFixed_t *p)
static void Vec_PtrClear(Vec_Ptr_t *p)
Dar_Cut_t * Dar_ObjPrepareCuts(Dar_Man_t *p, Aig_Obj_t *pObj)
static int Dar_CutCheckDominance(Dar_Cut_t *pDom, Dar_Cut_t *pCut)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
static int Dar_CutMergeOrdered(Dar_Cut_t *pC, Dar_Cut_t *pC0, Dar_Cut_t *pC1)
static unsigned Dar_CutTruthSwapPolarity(unsigned uTruth, int iVar)