66 if ( iDomNext == iDom1 )
74 if ( iDomNext == iDom0 )
89 if ( p->
vDoms == NULL )
146 printf(
"FAILURE.\n" );
170 int i, iDom, iDomNext;
187 if ( iDomNext == iDom )
243 printf(
"Fanoutless flops = %d.\n", Counter );
516 int nBits = (1 << nSize);
517 int nStep = (1 << nSize0);
519 for ( i = 0; i < nBits; i++ )
521 if ( i % nStep == 0 )
524 assert( Res || (Mark[0] && Mark[1]) );
525 Mark[0] = Mark[1] = 0;
532 assert( Res || (Mark[0] && Mark[1]) );
550 unsigned char * pStr = (
unsigned char *)pTruth;
551 int nStr = (nSize >= 3 ? (1 << (nSize - 3)) : 1);
553 assert( nSize0 > 0 && nSize0 <= nSize );
556 for ( i = 0; i < nStr; i++ )
557 if ( (((
unsigned)pStr[i] ^ ((
unsigned)pStr[i] >> 1)) & 0x55) != 0x55 )
563 for ( i = 0; i < nStr; i++ )
564 if ( ((
unsigned)pStr[i] & 0xF) == 0x0 || (((
unsigned)pStr[i] >> 4) & 0xF) == 0x0 ||
565 ((
unsigned)pStr[i] & 0xF) == 0xF || (((
unsigned)pStr[i] >> 4) & 0xF) == 0xF )
570 nSteps = (1 << (nSize0 - 3));
571 for ( i = 0; i < nStr; i += nSteps )
573 for ( k = 0; k < nSteps; k++ )
574 if ( ((
unsigned)pStr[i+k] & 0xFF) != 0x00 )
578 for ( k = 0; k < nSteps; k++ )
579 if ( ((
unsigned)pStr[i+k] & 0xFF) != 0xFF )
585 return (
int)( i == nStr );
605 int Iter, i, nSize0, nNodes;
606 int fHasConst, fChanges = 1;
615 for ( Iter = 0; fChanges; Iter++ )
620 if ( fVerbose || fVeryVerbose )
623 printf(
"Iter %3d : ", Iter );
666 assert( nSize0 > 0 && nSize0 <= nCutMax );
669 if ( pTruth == NULL )
677 printf(
"Nodes =%3d ", nNodes );
679 printf(
"Size0 =%3d ", nSize0 );
680 printf(
"%3s", fHasConst ?
"yes" :
"no" );
698 printf(
"Iter %3d : ", Iter );
void Gia_ManComputeDoms(Gia_Man_t *p)
static int * Vec_IntArray(Vec_Int_t *p)
int Abs_ManSupport3(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSupp)
static int Gia_ManAppendAnd(Gia_Man_t *p, int iLit0, int iLit1)
void Gia_ManCreateRefs(Gia_Man_t *p)
void Abs_RpmPerformMark(Gia_Man_t *p, int nCutMax, int fVerbose, int fVeryVerbose)
static int Abs_GiaObjDeref_rec(Gia_Man_t *p, Gia_Obj_t *pNode)
static void Gia_ObjSetDom(Gia_Man_t *p, Gia_Obj_t *pObj, int d)
#define Gia_ManForEachCo(p, pObj, i)
void Gia_ObjComputeTruthTableStart(Gia_Man_t *p, int nVarsMax)
void Gia_ManCountPisNodes(Gia_Man_t *p, Vec_Int_t *vPis, Vec_Int_t *vAnds)
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
word * Gia_ObjComputeTruthTableCut(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vLeaves)
static int Gia_ObjIsTravIdCurrent(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Abc_InfoHasBit(unsigned *p, int i)
static int Abs_GiaObjRef_rec(Gia_Man_t *p, Gia_Obj_t *pNode)
static int Gia_ManAppendCi(Gia_Man_t *p)
void Gia_ManTestDoms(Gia_Man_t *p)
void Gia_ObjComputeTruthTableStop(Gia_Man_t *p)
void Gia_ManCountFanoutlessFlops(Gia_Man_t *p)
void Abs_ManSupport1_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSupp)
static int Vec_IntFind(Vec_Int_t *p, int Entry)
static int Abs_ManSupport2(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSupp)
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
#define Gia_ManForEachObjReverse(p, pObj, i)
int Abs_GiaCheckTruth(word *pTruth, int nSize, int nSize0)
static abctime Abc_Clock()
void Gia_ManCountPisNodes_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vPis, Vec_Int_t *vAnds)
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
void Gia_ManCleanMark1(Gia_Man_t *p)
void Gia_ManTestDoms2(Gia_Man_t *p)
static ABC_NAMESPACE_IMPL_START int Gia_ObjDom(Gia_Man_t *p, Gia_Obj_t *pObj)
DECLARATIONS ///.
int Abs_ManSupport1(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSupp)
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 Gia_ManAndNum(Gia_Man_t *p)
Gia_Man_t * Gia_ManDupRpm(Gia_Man_t *p)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
static int Gia_ObjIsRo(Gia_Man_t *p, Gia_Obj_t *pObj)
int Abs_GiaCofPrint(word *pTruth, int nSize, int nSize0, int Res)
static int Vec_IntEntry(Vec_Int_t *p, int i)
unsigned __int64 word
DECLARATIONS ///.
static void Gia_ObjSetTravIdCurrent(Gia_Man_t *p, Gia_Obj_t *pObj)
Vec_Int_t * Gia_ManComputePiDoms(Gia_Man_t *p)
static int Gia_ObjRefInc(Gia_Man_t *p, Gia_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
static int Vec_IntUniqify(Vec_Int_t *p)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
void Gia_ManFillValue(Gia_Man_t *p)
#define Gia_ManForEachPi(p, pObj, i)
Gia_Man_t * Abs_RpmPerform(Gia_Man_t *p, int nCutMax, int fVerbose, int fVeryVerbose)
static int Vec_IntRemove(Vec_Int_t *p, int Entry)
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
#define ABC_NAMESPACE_IMPL_START
static int Gia_ObjRefDec(Gia_Man_t *p, Gia_Obj_t *pObj)
int Abs_GiaSortNodes(Gia_Man_t *p, Vec_Int_t *vSupp)
static int Vec_IntSize(Vec_Int_t *p)
static void Vec_IntShrink(Vec_Int_t *p, int nSizeNew)
void Abs_ManSupport2_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSupp)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
#define Gia_ManForEachRo(p, pObj, i)
void Gia_ManAddDom(Gia_Man_t *p, Gia_Obj_t *pObj, int iDom0)
FUNCTION DEFINITIONS ///.
void Gia_ManIncrementTravId(Gia_Man_t *p)
Vec_Int_t * Gia_ManCollectDoms(Gia_Man_t *p)
static void Vec_IntFree(Vec_Int_t *p)
static int Gia_ManPiNum(Gia_Man_t *p)
static void Vec_IntClear(Vec_Int_t *p)
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
char * Abc_UtilStrsav(char *s)
static int Gia_ManObjNum(Gia_Man_t *p)
static int Gia_ManRegNum(Gia_Man_t *p)