summaryrefslogtreecommitdiffstats
path: root/src/base/abci
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/abci')
-rw-r--r--src/base/abci/abc.c15
-rw-r--r--src/base/abci/abcMfs.c15
2 files changed, 15 insertions, 15 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 537cdf5b..01bffece 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -5672,7 +5672,7 @@ usage:
int Abc_CommandMfse( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern Abc_Ntk_t * Abc_NtkOptMfse( Abc_Ntk_t * pNtk, Acb_Par_t * pPars );
- Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+ Abc_Ntk_t * pNtkNew, * pNtk = Abc_FrameReadNtk(pAbc);
Acb_Par_t Pars, * pPars = &Pars; int c;
Acb_ParSetDefault( pPars );
Extra_UtilGetoptReset();
@@ -5771,6 +5771,19 @@ int Abc_CommandMfse( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "This command can only be applied to a logic network.\n" );
return 1;
}
+ pPars->nLutSize = Abc_NtkGetFaninMax( pNtk );
+ if ( pPars->nLutSize > 6 )
+ {
+ Abc_Print( -1, "Command is only applicable to LUT size no more than 6.\n" );
+ return 1;
+ }
+ pNtkNew = Abc_NtkOptMfse( pNtk, pPars );
+ if ( pNtkNew == NULL )
+ {
+ Abc_Print( -1, "Command \"mfse\" has failed.\n" );
+ return 1;
+ }
+ Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
return 0;
usage:
diff --git a/src/base/abci/abcMfs.c b/src/base/abci/abcMfs.c
index d44ca1a0..5c566074 100644
--- a/src/base/abci/abcMfs.c
+++ b/src/base/abci/abcMfs.c
@@ -216,21 +216,8 @@ void Abc_NtkInsertMfs( Abc_Ntk_t * pNtk, Sfm_Ntk_t * p )
vArray = Sfm_NodeReadFanins( p, pNode->iTemp );
Vec_IntForEachEntry( vArray, Fanin, k )
Abc_ObjAddFanin( pNode, Abc_NtkObj(pNtk, Vec_IntEntry(vMap, Fanin)) );
- // update function
pTruth = Sfm_NodeReadTruth( p, pNode->iTemp );
- if ( pTruth[0] == 0 )
- pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, " 0\n" );
- else if ( ~pTruth[0] == 0 )
- pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, " 1\n" );
- else
- {
- int RetValue = Kit_TruthIsop( (unsigned *)pTruth, Vec_IntSize(vArray), vCover, 1 );
- assert( Vec_IntSize(vArray) > 0 );
- assert( RetValue == 0 || RetValue == 1 );
- pNode->pData = Abc_SopCreateFromIsop( (Mem_Flex_t *)pNtk->pManFunc, Vec_IntSize(vArray), vCover );
- if ( RetValue )
- Abc_SopComplement( (char *)pNode->pData );
- }
+ pNode->pData = Abc_SopCreateFromTruthIsop( (Mem_Flex_t *)pNtk->pManFunc, Vec_IntSize(vArray), pTruth, vCover );
assert( Abc_SopGetVarNum((char *)pNode->pData) == Vec_IntSize(vArray) );
}
Vec_IntFree( vCover );