diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2017-04-23 09:45:23 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2017-04-23 09:45:23 -0700 |
commit | bef247a4cbb191c22630a20daf67a43ef717bac0 (patch) | |
tree | dfb04daecd301a66b45b7e7c86d30d1b63e861b2 | |
parent | 4124a00d4ba7b9d32b19d7164321eb8d245d07df (diff) | |
download | abc-bef247a4cbb191c22630a20daf67a43ef717bac0.tar.gz abc-bef247a4cbb191c22630a20daf67a43ef717bac0.tar.bz2 abc-bef247a4cbb191c22630a20daf67a43ef717bac0.zip |
Logic restructuring after mapping.
-rw-r--r-- | src/base/abci/abc.c | 1 | ||||
-rw-r--r-- | src/base/acb/acbPush.c | 24 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 98870a20..bc06fbb9 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -5863,6 +5863,7 @@ int Abc_CommandLogicPush( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Print( -1, "This command can only be applied to a logic network.\n" ); return 1; } + nLutSize = Abc_MaxInt( nLutSize, Abc_NtkGetFaninMax(pNtk) ); Abc_NtkToSop( pNtk, -1, ABC_INFINITY ); pNtkRes = Abc_NtkOptPush( pNtk, nLutSize, fVerbose ); Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes ); diff --git a/src/base/acb/acbPush.c b/src/base/acb/acbPush.c index 5dd2f63d..01de31db 100644 --- a/src/base/acb/acbPush.c +++ b/src/base/acb/acbPush.c @@ -262,7 +262,7 @@ void Acb_ObjRemoveBufInv( Acb_Ntk_t * p, int iObj ) SeeAlso [] ***********************************************************************/ -static inline int Acb_ObjFindPushableIndex( Acb_Ntk_t * p, int iObj, int iFanIndex ) +static inline int Acb_ObjFindFaninPushableIndex( Acb_Ntk_t * p, int iObj, int iFanIndex ) { int k, iFanin, * pFanins; Acb_ObjForEachFaninFast( p, iObj, pFanins, iFanin, k ) @@ -270,6 +270,14 @@ static inline int Acb_ObjFindPushableIndex( Acb_Ntk_t * p, int iObj, int iFanInd return k; return -1; } +static inline int Acb_ObjFindFanoutPushableIndex( Acb_Ntk_t * p, int iObj ) +{ + int k, iFanin, * pFanins; + Acb_ObjForEachFaninFast( p, iObj, pFanins, iFanin, k ) + if ( Abc_TtCheckOutAnd(Acb_ObjTruth(p, iObj), k, NULL) >= 0 ) + return k; + return -1; +} int Acb_ObjPushToFanins( Acb_Ntk_t * p, int iObj, int nLutSize ) { int k, k2, iFanin, * pFanins; @@ -283,11 +291,23 @@ int Acb_ObjPushToFanins( Acb_Ntk_t * p, int iObj, int nLutSize ) continue; if ( Acb_ObjFaninNum(p, iFanin) == nLutSize ) continue; - if ( (k2 = Acb_ObjFindPushableIndex(p, iObj, k)) == -1 ) + if ( (k2 = Acb_ObjFindFaninPushableIndex(p, iObj, k)) == -1 ) continue; + //printf( "Object %4d : Pushing fanin %d (%d) into fanin %d.\n", iObj, Acb_ObjFanin(p, iObj, k2), k2, iFanin ); Acb_ObjPushToFanin( p, iObj, k2, iFanin ); return 1; } + if ( Acb_ObjFaninNum(p, iObj) == 2 && Acb_ObjFanoutNum(p, iObj) == 1 ) + { + int iFanout = Acb_ObjFanout( p, iObj, 0 ); + if ( !Acb_ObjIsCo(p, iFanout) && Acb_ObjFaninNum(p, iFanout) < nLutSize ) + { + k2 = Acb_ObjFindFanoutPushableIndex( p, iObj ); + //printf( "Object %4d : Pushing fanin %d (%d) into fanout %d.\n", iObj, Acb_ObjFanin(p, iObj, k2), k2, iFanout ); + Acb_ObjPushToFanout( p, iObj, k2, iFanout ); + return 1; + } + } return 0; } |