diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-07-02 11:19:27 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-07-02 11:19:27 -0700 |
commit | c6814a5c8b21538ad4c18c3925aca2241b7b6a11 (patch) | |
tree | 8864e05b4720bd3998b58108949728c0c94a06a7 /src | |
parent | 7ff2bce0371ccbaf34eba20f63b84aa60448da37 (diff) | |
download | abc-c6814a5c8b21538ad4c18c3925aca2241b7b6a11.tar.gz abc-c6814a5c8b21538ad4c18c3925aca2241b7b6a11.tar.bz2 abc-c6814a5c8b21538ad4c18c3925aca2241b7b6a11.zip |
Experiment with SOP balancing.
Diffstat (limited to 'src')
-rw-r--r-- | src/aig/gia/giaIf.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c index 22b48f0e..862e4c7e 100644 --- a/src/aig/gia/giaIf.c +++ b/src/aig/gia/giaIf.c @@ -714,6 +714,18 @@ int Gia_ManBuildFromMini( Gia_Man_t * pNew, If_Man_t * pIfMan, If_Cut_t * pCut, SeeAlso [] ***********************************************************************/ +int Gia_ManFromIfAig_rec( Gia_Man_t * pNew, If_Man_t * pIfMan, If_Obj_t * pIfObj ) +{ + int iLit0, iLit1; + if ( pIfObj->iCopy ) + return pIfObj->iCopy; + iLit0 = Gia_ManFromIfAig_rec( pNew, pIfMan, pIfObj->pFanin0 ); + iLit1 = Gia_ManFromIfAig_rec( pNew, pIfMan, pIfObj->pFanin1 ); + iLit0 = Abc_LitNotCond( iLit0, pIfObj->fCompl0 ); + iLit1 = Abc_LitNotCond( iLit1, pIfObj->fCompl1 ); + pIfObj->iCopy = Gia_ManHashAnd( pNew, iLit0, iLit1 ); + return pIfObj->iCopy; +} Gia_Man_t * Gia_ManFromIfAig( If_Man_t * pIfMan ) { int fHash = 0; @@ -731,7 +743,8 @@ Gia_Man_t * Gia_ManFromIfAig( If_Man_t * pIfMan ) // iterate through nodes used in the mapping vAig = Vec_IntAlloc( 1 << 16 ); vLeaves = Vec_IntAlloc( 16 ); - If_ManCleanCutData( pIfMan ); +// If_ManForEachObj( pIfMan, pIfObj, i ) +// pIfObj->iCopy = 0; If_ManForEachObj( pIfMan, pIfObj, i ) { if ( pIfObj->nRefs == 0 && !If_ObjIsTerm(pIfObj) ) @@ -739,6 +752,12 @@ Gia_Man_t * Gia_ManFromIfAig( If_Man_t * pIfMan ) if ( If_ObjIsAnd(pIfObj) ) { pCutBest = If_ObjCutBest( pIfObj ); + // if the cut does not offer delay improvement +// if ( (int)pIfObj->Level <= (int)pCutBest->Delay ) +// { +// Gia_ManFromIfAig_rec( pNew, pIfMan, pIfObj ); +// continue; +// } // collect leaves of the best cut Vec_IntClear( vLeaves ); If_CutForEachLeaf( pIfMan, pCutBest, pIfLeaf, k ) |