diff options
Diffstat (limited to 'src/aig/nwk')
-rw-r--r-- | src/aig/nwk/nwkMap.c | 2 | ||||
-rw-r--r-- | src/aig/nwk/nwkUtil.c | 44 |
2 files changed, 46 insertions, 0 deletions
diff --git a/src/aig/nwk/nwkMap.c b/src/aig/nwk/nwkMap.c index e6865840..5812358b 100644 --- a/src/aig/nwk/nwkMap.c +++ b/src/aig/nwk/nwkMap.c @@ -321,6 +321,7 @@ Nwk_Man_t * Nwk_ManFromIf( If_Man_t * pIfMan, Aig_Man_t * p, Vec_Ptr_t * vAigToI pObjNew = Nwk_ManCreateCo( pNtk ); pObjNew->fInvert = Aig_ObjFaninC0(pObj); Nwk_ObjAddFanin( pObjNew, Aig_ObjFanin0(pObj)->pData ); +//printf( "%d ", pObjNew->Id ); } else if ( Aig_ObjIsConst1(pObj) ) { @@ -331,6 +332,7 @@ Nwk_Man_t * Nwk_ManFromIf( If_Man_t * pIfMan, Aig_Man_t * p, Vec_Ptr_t * vAigToI assert( 0 ); pObj->pData = pObjNew; } +//printf( "\n" ); Vec_PtrFree( vIfToAig ); pNtk->pManTime = Tim_ManDup( pIfMan->pManTim, 0 ); Nwk_ManMinimumBase( pNtk, 0 ); diff --git a/src/aig/nwk/nwkUtil.c b/src/aig/nwk/nwkUtil.c index 10b7b462..9fc292ea 100644 --- a/src/aig/nwk/nwkUtil.c +++ b/src/aig/nwk/nwkUtil.c @@ -513,6 +513,49 @@ int Nwk_ManMinimumBaseNode( Nwk_Obj_t * pObj, Vec_Int_t * vTruth, int fVerbose ) SeeAlso [] ***********************************************************************/ +int Nwk_ManMinimumBaseInt( Nwk_Man_t * pNtk, int fVerbose ) +{ + Vec_Int_t * vTruth; + Nwk_Obj_t * pObj; + int i, Counter = 0; + vTruth = Vec_IntAlloc( 1 << 16 ); + Nwk_ManForEachNode( pNtk, pObj, i ) + Counter += Nwk_ManMinimumBaseNode( pObj, vTruth, fVerbose ); + if ( fVerbose && Counter ) + printf( "Support minimization reduced support of %d nodes.\n", Counter ); + Vec_IntFree( vTruth ); + return Counter; +} + +/**Function************************************************************* + + Synopsis [Minimizes the support of all nodes.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Nwk_ManMinimumBaseRec( Nwk_Man_t * pNtk, int fVerbose ) +{ + int i, clk = clock(); + for ( i = 0; Nwk_ManMinimumBaseInt( pNtk, fVerbose ); i++ ); + ABC_PRT( "Minbase", clock() - clk ); +} + +/**Function************************************************************* + + Synopsis [Minimizes the support of all nodes.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ void Nwk_ManMinimumBase( Nwk_Man_t * pNtk, int fVerbose ) { Vec_Int_t * vTruth; @@ -585,6 +628,7 @@ void Nwk_ManRemoveDupFanins( Nwk_Man_t * pNtk, int fVerbose ) } } Vec_IntFree( vTruth ); +// Nwk_ManMinimumBase( pNtk, fVerbose ); } //////////////////////////////////////////////////////////////////////// |