49 Gia_Obj_t * pObj, * pFan0, * pFan1;
int i;
50 *pnMuxes = *pnXors = 0;
69 nTotal = nAnds + 3*nXors + 3*
nMuxes;
78 Abc_Print( 1,
"xor =%8d %6.2f %% ", nXors, 300.0*nXors/nTotal );
79 Abc_Print( 1,
"mux =%8d %6.2f %% ", nMuxes, 300.0*nMuxes/nTotal );
80 Abc_Print( 1,
"and =%8d %6.2f %% ", nAnds, 100.0*nAnds/nTotal );
99 Gia_Obj_t * pObj, * pFan0, * pFan1, * pFanC, * pSiblNew, * pObjNew;
277 assert( Count1 == Count2 );
308 printf(
"%d", iCtrl );
334 assert( Count1 == Count2 );
388 assert( Count1 == Count2 );
405 int Diff =
strcmp( *pp1, *pp2 );
416 Count += (*p ==
'[');
485 printf(
"The distribution of MUX tree %s:\n", fWidth ?
"widths" :
"sizes" );
489 if ( !Entry )
continue;
490 if ( ++Counter == 12 )
491 printf(
"\n" ), Counter = 0;
492 printf(
" %d=%d", i, Entry );
494 printf(
"\nSummary: " );
496 printf(
"Ave = %.2f", 1.0*
Vec_IntSum(vCounts)/Total );
520 int i,
Counter, fFound, iStructId, nDigitsId;
553 printf(
"MUX structure profile for AIG \"%s\":\n", p->
pName );
554 printf(
"Total MUXes = %d. Total trees = %d. Unique trees = %d. Memory = %.2f MB ",
564 printf(
"The first %d structures: \n", 10 );
568 printf(
"%5d : ", i );
570 printf(
"Size = %4d ", atoi(pTemp) );
571 printf(
"%s\n", pTemp );
582 printf(
"For example, structure %d has %d MUXes and bit-width %d:\n", i, atoi(pTemp),
Vec_IntSize(vVec) );
585 if ( ++Counter == 5 )
static int Gia_ObjFanin2Copy(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Vec_IntCountPositive(Vec_Int_t *p)
static int Gia_ObjToLit(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ObjLevelId(Gia_Man_t *p, int Id)
void Gia_ManCreateRefs(Gia_Man_t *p)
static void Gia_ObjRefFanin0Inc(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ManMuxNum(Gia_Man_t *p)
int Gia_ObjRecognizeExor(Gia_Obj_t *pObj, Gia_Obj_t **ppFan0, Gia_Obj_t **ppFan1)
static int Gia_ObjFaninC2(Gia_Man_t *p, Gia_Obj_t *pObj)
int Gia_MuxDeref_rec(Gia_Man_t *p, int iObj)
static Vec_Wec_t * Vec_WecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Abc_NamStop(Abc_Nam_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
static Gia_Obj_t * Gia_ObjSiblObj(Gia_Man_t *p, int Id)
int Gia_MuxStructDump(Gia_Man_t *p, int iObj, Vec_Str_t *vStr, int nDigitsNum, int nDigitsId)
void Gia_ManStop(Gia_Man_t *p)
#define Gia_ManForEachCo(p, pObj, i)
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
void Gia_MuxStructDump_rec(Gia_Man_t *p, int iObj, int fFirst, Vec_Str_t *vStr, int nDigitsId)
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static char * Vec_StrArray(Vec_Str_t *p)
Vec_Int_t * Gia_ManFirstFanouts(Gia_Man_t *p)
static void Vec_WecFree(Vec_Wec_t *p)
static int Gia_ManAppendCi(Gia_Man_t *p)
int Abc_NamObjNumMax(Abc_Nam_t *p)
static Vec_Int_t * Vec_WecPushLevel(Vec_Wec_t *p)
static int Gia_ObjRefNumId(Gia_Man_t *p, int Id)
void Gia_MuxStructPrint_rec(Gia_Man_t *p, int iObj, int fFirst)
static int Gia_ObjFaninId1p(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Vec_StrClear(Vec_Str_t *p)
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ObjIsBuf(Gia_Obj_t *pObj)
void Gia_ManMuxProfiling(Gia_Man_t *p)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
int Abc_NamStrFindOrAdd(Abc_Nam_t *p, char *pStr, int *pfFound)
static int Gia_ManAndNotBufNum(Gia_Man_t *p)
static Vec_Str_t * Vec_StrAlloc(int nCap)
static abctime Abc_Clock()
static void Vec_StrPush(Vec_Str_t *p, char Entry)
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
static int Vec_WecSize(Vec_Wec_t *p)
Abc_Nam_t * Abc_NamStart(int nObjs, int nAveSize)
FUNCTION DEFINITIONS ///.
#define Gia_ManForEachMux(p, pObj, i)
static int Gia_ManHasChoices(Gia_Man_t *p)
ABC_NAMESPACE_IMPL_START void Gia_ManCountMuxXor(Gia_Man_t *p, int *pnMuxes, int *pnXors)
DECLARATIONS ///.
int Gia_ManMuxProfile(Mux_Man_t *p, int fWidth)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
#define Vec_WecForEachLevelStartStop(vGlob, vVec, i, LevelStart, LevelStop)
int Gia_MuxDeref(Gia_Man_t *p, int iObj)
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 Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
void Gia_MuxStructPrint(Gia_Man_t *p, int iObj)
int Abc_NamMemUsed(Abc_Nam_t *p)
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
static void Vec_StrFree(Vec_Str_t *p)
static int Gia_ManAppendBuf(Gia_Man_t *p, int iLit)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Vec_IntFindMax(Vec_Int_t *p)
static int Abc_Base10Log(unsigned n)
static int Gia_ObjRefInc(Gia_Man_t *p, Gia_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
int Gia_MuxMffcSize(Gia_Man_t *p, int iObj)
int Gia_ManHashMux(Gia_Man_t *p, int iCtrl, int iData1, int iData0)
int Gia_ManMuxCountOne(char *p)
Gia_Man_t * Gia_ManDupMuxesTest(Gia_Man_t *p)
void Gia_ManHashStart(Gia_Man_t *p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
int Gia_ManMuxCompare(char **pp1, char **pp2)
static int Gia_ObjIsXor(Gia_Obj_t *pObj)
#define Gia_ManForEachAnd(p, pObj, i)
void Gia_ManPrintMuxStats(Gia_Man_t *p)
int Gia_ManHashXorReal(Gia_Man_t *p, int iLit0, int iLit1)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ManXorNum(Gia_Man_t *p)
static void Abc_Print(int level, const char *format,...)
static int Gia_ObjLitCopy(Gia_Man_t *p, int iLit)
static void Vec_StrPrintNumStar(Vec_Str_t *p, int Num, int nDigits)
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
char * Abc_NamStr(Abc_Nam_t *p, int NameId)
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_START
static int Gia_ObjRefDec(Gia_Man_t *p, Gia_Obj_t *pObj)
static Vec_Int_t * Vec_WecEntry(Vec_Wec_t *p, int i)
int Gia_ObjIsMuxType(Gia_Obj_t *pNode)
static int Vec_IntSize(Vec_Int_t *p)
#define Vec_WecForEachLevelStart(vGlob, vVec, i, LevelStart)
static int Vec_IntSum(Vec_Int_t *p)
Mux_Man_t * Mux_ManAlloc(Gia_Man_t *pGia)
int Gia_MuxRef(Gia_Man_t *p, int iObj)
Gia_Obj_t * Gia_ObjRecognizeMux(Gia_Obj_t *pNode, Gia_Obj_t **ppNodeT, Gia_Obj_t **ppNodeE)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
static int Abc_Lit2Var(int Lit)
#define ABC_CALLOC(type, num)
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ObjFaninId2p(Gia_Man_t *p, Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Abc_Nam_t_ Abc_Nam_t
INCLUDES ///.
Gia_Man_t * Gia_ManDupMuxes(Gia_Man_t *p, int Limit)
int Gia_ManLevelNum(Gia_Man_t *p)
int Gia_ManHashMuxReal(Gia_Man_t *p, int iLitC, int iLit1, int iLit0)
#define Gia_ManForEachObj1(p, pObj, i)
void Mux_ManFree(Mux_Man_t *p)
static void Vec_IntFree(Vec_Int_t *p)
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Gia_Man_t * Gia_ManCleanup(Gia_Man_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)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
static int Gia_ManObjNum(Gia_Man_t *p)
int Gia_MuxRef_rec(Gia_Man_t *p, int iObj)
static int Vec_WecSizeSize(Vec_Wec_t *p)
int nTotal
DECLARATIONS ///.
void Gia_ManHashStop(Gia_Man_t *p)
static int Gia_ObjFaninId0(Gia_Obj_t *pObj, int ObjId)
Gia_Man_t * Gia_ManDupNoMuxes(Gia_Man_t *p)
static int Gia_ManRegNum(Gia_Man_t *p)