mirror of https://github.com/YosysHQ/abc.git
Logic restructuring after mapping.
This commit is contained in:
parent
4124a00d4b
commit
bef247a4cb
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue