mirror of https://github.com/YosysHQ/abc.git
Bug fix in &mfs.
This commit is contained in:
parent
110bac4394
commit
ea0f22de4d
|
|
@ -76,7 +76,7 @@ int Sfm_TruthToCnf( word Truth, word * pTruth, int nVars, Vec_Int_t * vCover, Ve
|
|||
{
|
||||
if ( Truth == 0 || ~Truth == 0 )
|
||||
{
|
||||
//assert( nVars == 0 );
|
||||
assert( nVars == 0 );
|
||||
Vec_StrPush( vCnf, (char)(Truth == 0) );
|
||||
Vec_StrPush( vCnf, (char)-1 );
|
||||
return 1;
|
||||
|
|
@ -92,6 +92,7 @@ int Sfm_TruthToCnf( word Truth, word * pTruth, int nVars, Vec_Int_t * vCover, Ve
|
|||
{
|
||||
Vec_StrPush( vCnf, (char)1 );
|
||||
Vec_StrPush( vCnf, (char)-1 );
|
||||
assert( 0 );
|
||||
return 1;
|
||||
}
|
||||
// const1
|
||||
|
|
@ -102,6 +103,7 @@ int Sfm_TruthToCnf( word Truth, word * pTruth, int nVars, Vec_Int_t * vCover, Ve
|
|||
{
|
||||
Vec_StrPush( vCnf, (char)0 );
|
||||
Vec_StrPush( vCnf, (char)-1 );
|
||||
assert( 0 );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -196,6 +198,7 @@ void Sfm_TranslateCnf( Vec_Wec_t * vRes, Vec_Str_t * vCnf, Vec_Int_t * vFaninMap
|
|||
Vec_Int_t * vClause;
|
||||
signed char Entry;
|
||||
int i, Lit;
|
||||
assert( Vec_StrEntry(vCnf, 1) != -1 || Vec_IntSize(vFaninMap) == 1 );
|
||||
Vec_WecClear( vRes );
|
||||
vClause = Vec_WecPushLevel( vRes );
|
||||
Vec_StrForEachEntry( vCnf, Entry, i )
|
||||
|
|
|
|||
|
|
@ -218,7 +218,9 @@ finish:
|
|||
Sfm_NtkUpdate( p, iNode, f, (iVar == -1 ? iVar : Vec_IntEntry(p->vDivs, iVar)), uTruth, p->pTruth );
|
||||
// the number of fanins cannot increase
|
||||
assert( nFanins >= Sfm_ObjFaninNum(p, iNode) );
|
||||
//printf( "Modifying node %d with %d fanins (resulting in %d fanins).\n", iNode, nFanins, Sfm_ObjFaninNum(p, iNode) );
|
||||
//printf( "Modifying node %d with %d fanins (resulting in %d fanins). ", iNode, nFanins, Sfm_ObjFaninNum(p, iNode) );
|
||||
//Abc_TtPrintHexRev( stdout, p->pTruth, Sfm_ObjFaninNum(p, iNode) );
|
||||
//printf( "\n" );
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -386,8 +388,8 @@ int Sfm_NtkPerform( Sfm_Ntk_t * p, Sfm_Par_t * pPars )
|
|||
continue;
|
||||
if ( p->pPars->nDepthMax && Sfm_ObjLevel(p, i) > p->pPars->nDepthMax )
|
||||
continue;
|
||||
if ( Sfm_ObjFaninNum(p, i) < 2 )
|
||||
continue;
|
||||
//if ( Sfm_ObjFaninNum(p, i) < 2 )
|
||||
// continue;
|
||||
if ( Sfm_ObjFaninNum(p, i) > SFM_SUPP_MAX )
|
||||
{
|
||||
CounterLarge++;
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ void Sfm_NtkUpdateLevelR_rec( Sfm_Ntk_t * p, int iNode )
|
|||
void Sfm_NtkUpdate( Sfm_Ntk_t * p, int iNode, int f, int iFaninNew, word uTruth, word * pTruth )
|
||||
{
|
||||
int iFanin = Sfm_ObjFanin( p, iNode, f );
|
||||
int nWords = Abc_Truth6WordNum( Sfm_ObjFaninNum(p, iNode) );
|
||||
int nWords = Abc_Truth6WordNum( Sfm_ObjFaninNum(p, iNode) - (int)(iFaninNew == -1) );
|
||||
assert( Sfm_ObjIsNode(p, iNode) );
|
||||
assert( iFanin != iFaninNew );
|
||||
assert( Sfm_ObjFaninNum(p, iNode) <= SFM_FANIN_MAX );
|
||||
|
|
|
|||
Loading…
Reference in New Issue