diff options
Diffstat (limited to 'src/base/abci')
-rw-r--r-- | src/base/abci/abc.c | 25 | ||||
-rw-r--r-- | src/base/abci/abcFxu.c | 30 |
2 files changed, 30 insertions, 25 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index d3e3357d..0a395574 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -3447,23 +3447,10 @@ usage: int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv ) { Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); - Fxu_Data_t * p = NULL; + Fxu_Data_t Params, * p = &Params; int c; - extern int Abc_NtkFastExtract( Abc_Ntk_t * pNtk, Fxu_Data_t * p ); - extern void Abc_NtkFxuFreeInfo( Fxu_Data_t * p ); - - // allocate the structure - p = ABC_CALLOC( Fxu_Data_t, 1 ); // set the defaults - p->nSingleMax = 20000; - p->nPairsMax = 30000; - p->nNodesExt = 10000; - p->WeightMax = 0; - p->fOnlyS = 0; - p->fOnlyD = 0; - p->fUse0 = 0; - p->fUseCompl = 1; - p->fVerbose = 0; + Abc_NtkSetDefaultParams( p ); Extra_UtilGetoptReset(); while ( (c = Extra_UtilGetopt(argc, argv, "SDNWsdzcvh")) != EOF ) { @@ -3535,29 +3522,22 @@ int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv ) goto usage; } } - if ( pNtk == NULL ) { Abc_Print( -1, "Empty network.\n" ); - Abc_NtkFxuFreeInfo( p ); return 1; } - if ( Abc_NtkNodeNum(pNtk) == 0 ) { Abc_Print( -1, "The network does not have internal nodes.\n" ); - Abc_NtkFxuFreeInfo( p ); return 1; } - if ( !Abc_NtkIsLogic(pNtk) ) { Abc_Print( -1, "Fast extract can only be applied to a logic network (run \"renode\").\n" ); - Abc_NtkFxuFreeInfo( p ); return 1; } - // the nodes to be merged are linked into the special linked list Abc_NtkFastExtract( pNtk, p ); Abc_NtkFxuFreeInfo( p ); @@ -3576,7 +3556,6 @@ usage: Abc_Print( -2, "\t-c : use complement in the binary case [default = %s]\n", p->fUseCompl? "yes": "no" ); Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", p->fVerbose? "yes": "no" ); Abc_Print( -2, "\t-h : print the command usage\n"); - Abc_NtkFxuFreeInfo( p ); return 1; } diff --git a/src/base/abci/abcFxu.c b/src/base/abci/abcFxu.c index 9cf2e31a..c50a2bec 100644 --- a/src/base/abci/abcFxu.c +++ b/src/base/abci/abcFxu.c @@ -28,14 +28,40 @@ ABC_NAMESPACE_IMPL_START /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// -static int Abc_NtkFxuCheck( Abc_Ntk_t * pNtk ); +static int Abc_NtkFxuCheck( Abc_Ntk_t * pNtk ); static void Abc_NtkFxuCollectInfo( Abc_Ntk_t * pNtk, Fxu_Data_t * p ); static void Abc_NtkFxuReconstruct( Abc_Ntk_t * pNtk, Fxu_Data_t * p ); +extern int Fxu_FastExtract( Fxu_Data_t * pData ); + //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// +/**Function************************************************************* + + Synopsis [Sets default values of the FXU parameters.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Abc_NtkSetDefaultParams( Fxu_Data_t * p ) +{ + memset( p, 0, sizeof(Fxu_Data_t) ); + p->nSingleMax = 20000; + p->nPairsMax = 30000; + p->nNodesExt = 10000; + p->WeightMax = 0; + p->fOnlyS = 0; + p->fOnlyD = 0; + p->fUse0 = 0; + p->fUseCompl = 1; + p->fVerbose = 0; +} /**Function************************************************************* @@ -190,7 +216,7 @@ void Abc_NtkFxuFreeInfo( Fxu_Data_t * p ) if ( p->vSopsNew ) Vec_PtrFree( p->vSopsNew ); if ( p->vFanins ) Vec_PtrFree( p->vFanins ); if ( p->vFaninsNew ) Vec_PtrFree( p->vFaninsNew ); - ABC_FREE( p ); +// ABC_FREE( p ); } /**Function************************************************************* |