74 int i, nFaninsMax = 0;
161 if ( pNode->pFunc == NULL )
163 printf(
"Nwk_ManGetAigNodeNum(): Local AIG of node %d is not assigned.\n", pNode->Id );
186 int Diff = (*pp1)->Level - (*pp2)->Level;
207 int Diff = (*pp1)->Level - (*pp2)->Level;
230 printf(
"ObjId = %5d. ", pObj->Id );
237 printf(
" Fanins = " );
239 printf(
"%d ", pNext->Id );
240 printf(
" Fanouts = " );
242 printf(
"%d ", pNext->Id );
270 printf(
"Nwk_ManDumpBlif(): Network does not have POs.\n" );
276 pFile = fopen( pFileName,
"w" );
277 fprintf( pFile,
"# BLIF file written by procedure Nwk_ManDumpBlif()\n" );
279 fprintf( pFile,
".model %s\n", pNtk->
pName );
281 fprintf( pFile,
".inputs" );
284 fprintf( pFile,
" %s", (
char*)
Vec_PtrEntry(vPiNames, i) );
286 fprintf( pFile,
" n%0*d", nDigits, pObj->Id );
287 fprintf( pFile,
"\n" );
289 fprintf( pFile,
".outputs" );
292 fprintf( pFile,
" %s", (
char*)
Vec_PtrEntry(vPoNames, i) );
294 fprintf( pFile,
" n%0*d", nDigits, pObj->Id );
295 fprintf( pFile,
"\n" );
311 fprintf( pFile,
".names" );
318 fprintf( pFile,
" n%0*d", nDigits, pFanin->Id );
320 fprintf( pFile,
" n%0*d\n", nDigits, pObj->Id );
322 fprintf( pFile,
"%s", pSop );
331 fprintf( pFile,
".names" );
335 fprintf( pFile,
" n%0*d", nDigits,
Nwk_ObjFanin0(pObj)->Id );
339 fprintf( pFile,
" n%0*d\n", nDigits, pObj->Id );
340 fprintf( pFile,
"%d 1\n", !pObj->fInvert );
342 fprintf( pFile,
".end\n\n" );
362 int nFanins, nFanouts, nFaninsMax, nFanoutsMax, nFaninsAll, nFanoutsAll;
366 nFaninsMax = nFanoutsMax = 0;
367 nFaninsAll = nFanoutsAll = 0;
372 nFaninsAll += nFanins;
373 nFanoutsAll += nFanouts;
374 nFaninsMax =
Abc_MaxInt( nFaninsMax, nFanins );
375 nFanoutsMax =
Abc_MaxInt( nFanoutsMax, nFanouts );
392 else if ( nFanins < 100 )
394 else if ( nFanins < 1000 )
396 else if ( nFanins < 10000 )
398 else if ( nFanins < 100000 )
400 else if ( nFanins < 1000000 )
402 else if ( nFanins < 10000000 )
407 else if ( nFanouts < 100 )
409 else if ( nFanouts < 1000 )
411 else if ( nFanouts < 10000 )
413 else if ( nFanouts < 100000 )
415 else if ( nFanouts < 1000000 )
417 else if ( nFanouts < 10000000 )
421 printf(
"The distribution of fanins and fanouts in the network:\n" );
422 printf(
" Number Nodes with fanin Nodes with fanout\n" );
423 for ( k = 0; k < nSizeMax; k++ )
425 if ( vFanins->pArray[k] == 0 && vFanouts->pArray[k] == 0 )
428 printf(
"%15d : ", k );
431 sprintf( Buffer,
"%d - %d", (
int)pow((
double)10, k/10) * (k%10), (
int)pow((
double)10, k/10) * (k%10+1) - 1 );
432 printf(
"%15s : ", Buffer );
434 if ( vFanins->pArray[k] == 0 )
437 printf(
"%12d ", vFanins->pArray[k] );
439 if ( vFanouts->pArray[k] == 0 )
442 printf(
"%12d ", vFanouts->pArray[k] );
448 printf(
"Fanins: Max = %d. Ave = %.2f. Fanouts: Max = %d. Ave = %.2f.\n",
469 pObj->MarkA = pObj->MarkB = 0;
488 int uSupp, nSuppSize, k,
Counter = 0;
498 if ( uSupp & (1 << k) )
502 printf(
"Reducing node %d fanins from %d to %d.\n",
527 if ( fVerbose && Counter )
528 printf(
"Support minimization reduced support of %d nodes.\n", Counter );
571 if ( fVerbose && Counter )
572 printf(
"Support minimization reduced support of %d nodes.\n", Counter );
589 Hop_Man_t * pManHop = pObj->pMan->pManHop;
592 assert( pObj->pFanio[iFan0] == pObj->pFanio[iFan1] );
618 for ( k = 0; k < pObj->nFanins; k++ )
620 for ( m = k + 1; m < pObj->nFanins; m++ )
621 if ( pObj->pFanio[k] == pObj->pFanio[m] )
624 printf(
"Removing duplicated fanins of node %d (fanins %d and %d).\n",
625 pObj->Id, pObj->pFanio[k]->Id, pObj->pFanio[m]->Id );
void Nwk_ManRemoveDupFanins(Nwk_Man_t *pNtk, int fVerbose)
void Nwk_ManMinimumBaseRec(Nwk_Man_t *pNtk, int fVerbose)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Nwk_ObjFanoutNum(Nwk_Obj_t *p)
int Nwk_NodeCompareLevelsIncrease(Nwk_Obj_t **pp1, Nwk_Obj_t **pp2)
#define Nwk_ManForEachCo(p, pObj, i)
int Nwk_ManMinimumBaseInt(Nwk_Man_t *pNtk, int fVerbose)
int Nwk_NodeCompareLevelsDecrease(Nwk_Obj_t **pp1, Nwk_Obj_t **pp2)
int Nwk_ManPoNum(Nwk_Man_t *pNtk)
int Hop_DagSize(Hop_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Nwk_Obj_t_ Nwk_Obj_t
INCLUDES ///.
int Nwk_ManPiNum(Nwk_Man_t *pNtk)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
char * Kit_PlaFromTruth(void *p, unsigned *pTruth, int nVars, Vec_Int_t *vCover)
#define Nwk_ManForEachCi(p, pObj, i)
ITERATORS ///.
Hop_Obj_t * Hop_Compose(Hop_Man_t *p, Hop_Obj_t *pRoot, Hop_Obj_t *pFunc, int iVar)
static int Nwk_ObjIsPi(Nwk_Obj_t *p)
#define Nwk_ObjForEachFanout(pObj, pFanout, i)
int Nwk_ManMinimumBaseNode(Nwk_Obj_t *pObj, Vec_Int_t *vTruth, int fVerbose)
static int Kit_TruthIsConst0(unsigned *pIn, int nVars)
ABC_DLL void Nwk_ObjReplace(Nwk_Obj_t *pNodeOld, Nwk_Obj_t *pNodeNew)
static abctime Abc_Clock()
static int Abc_MaxInt(int a, int b)
static int Nwk_ObjFaninNum(Nwk_Obj_t *p)
Hop_Obj_t * Hop_Remap(Hop_Man_t *p, Hop_Obj_t *pRoot, unsigned uSupp, int nVars)
int Nwk_ManGetAigNodeNum(Nwk_Man_t *pNtk)
static Vec_Int_t * Vec_IntStart(int nSize)
static int Kit_TruthIsConst1(unsigned *pIn, int nVars)
void Nwk_ManMinimumBase(Nwk_Man_t *pNtk, int fVerbose)
ABC_DLL Vec_Ptr_t * Nwk_ManDfs(Nwk_Man_t *pNtk)
void Nwk_ManCleanMarks(Nwk_Man_t *pMan)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
static int Abc_Base10Log(unsigned n)
#define ABC_NAMESPACE_IMPL_END
static int Nwk_ObjIsPo(Nwk_Obj_t *p)
static int Hop_IsComplement(Hop_Obj_t *p)
void Nwk_ManDumpBlif(Nwk_Man_t *pNtk, char *pFileName, Vec_Ptr_t *vPiNames, Vec_Ptr_t *vPoNames)
ABC_NAMESPACE_IMPL_START void Nwk_ManIncrementTravId(Nwk_Man_t *pNtk)
DECLARATIONS ///.
static void Kit_TruthNot(unsigned *pOut, unsigned *pIn, int nVars)
static int Nwk_ObjIsNode(Nwk_Obj_t *p)
#define ABC_NAMESPACE_IMPL_START
void Nwk_ManRemoveDupFaninsNode(Nwk_Obj_t *pObj, int iFan0, int iFan1, Vec_Int_t *vTruth)
void Nwk_ObjPrint(Nwk_Obj_t *pObj)
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static int Nwk_ObjPioNum(Nwk_Obj_t *p)
#define Nwk_ObjForEachFanin(pObj, pFanin, i)
static int Nwk_ManObjNumMax(Nwk_Man_t *p)
Aig_MmFlex_t * Aig_MmFlexStart()
void Aig_MmFlexStop(Aig_MmFlex_t *p, int fVerbose)
unsigned Kit_TruthSupport(unsigned *pTruth, int nVars)
int Nwk_ManGetFaninMax(Nwk_Man_t *pNtk)
#define Nwk_ManForEachObj(p, pObj, i)
static int Nwk_ManNodeNum(Nwk_Man_t *p)
static Nwk_Obj_t * Nwk_ObjFanin0(Nwk_Obj_t *p)
int Nwk_ManGetTotalFanins(Nwk_Man_t *pNtk)
unsigned * Hop_ManConvertAigToTruth(Hop_Man_t *p, Hop_Obj_t *pRoot, int nVars, Vec_Int_t *vTruth, int fMsbFirst)
ABC_DLL void Nwk_ObjAddFanin(Nwk_Obj_t *pObj, Nwk_Obj_t *pFanin)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static Hop_Obj_t * Hop_Regular(Hop_Obj_t *p)
void Nwk_ManPrintFanioNew(Nwk_Man_t *pNtk)
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
int Kit_TruthSupportSize(unsigned *pTruth, int nVars)
static void Vec_PtrFree(Vec_Ptr_t *p)
#define Nwk_ManForEachNode(p, pObj, i)
ABC_DLL Nwk_Obj_t * Nwk_ManCreateNode(Nwk_Man_t *pMan, int nFanins, int nFanouts)