summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-05-09 12:51:18 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-05-09 12:51:18 -0700
commitcac32a32c720af661e5f30ef62a2dfc75d13da92 (patch)
treec3febc1c01e1e108e8f0496323c797079710250a /src
parent964c5cd5df28a3831c972362cc004ca61f51347a (diff)
downloadabc-cac32a32c720af661e5f30ef62a2dfc75d13da92.tar.gz
abc-cac32a32c720af661e5f30ef62a2dfc75d13da92.tar.bz2
abc-cac32a32c720af661e5f30ef62a2dfc75d13da92.zip
Enabled switch 'fx -N <num>' to extract a fixed number of divisors.
Diffstat (limited to 'src')
-rw-r--r--src/base/abci/abc.c4
-rw-r--r--src/base/abci/abcFx.c13
2 files changed, 9 insertions, 8 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 9fa73eaf..6de6a637 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -3531,7 +3531,7 @@ usage:
***********************************************************************/
int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- extern int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int fVerbose );
+ extern int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int nNewNodesMax, int fVerbose );
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Fxu_Data_t Params, * p = &Params;
int c, fNewAlgo = 1;
@@ -3634,7 +3634,7 @@ int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
// the nodes to be merged are linked into the special linked list
if ( fNewAlgo )
- Abc_NtkFxPerform( pNtk, p->fVerbose );
+ Abc_NtkFxPerform( pNtk, p->nNodesExt, p->fVerbose );
else
Abc_NtkFastExtract( pNtk, p );
Abc_NtkFxuFreeInfo( p );
diff --git a/src/base/abci/abcFx.c b/src/base/abci/abcFx.c
index 6c770592..c515afb1 100644
--- a/src/base/abci/abcFx.c
+++ b/src/base/abci/abcFx.c
@@ -298,9 +298,9 @@ int Abc_NtkFxCheck( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int fVerbose )
+int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int nNewNodesMax, int fVerbose )
{
- extern int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int fVerbose );
+ extern int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int nNewNodesMax, int fVerbose );
Vec_Wec_t * vCubes;
assert( Abc_NtkIsSopLogic(pNtk) );
// check unique fanins
@@ -315,7 +315,7 @@ int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int fVerbose )
// collect information about the covers
vCubes = Abc_NtkFxRetrieve( pNtk );
// call the fast extract procedure
- if ( Fx_FastExtract( vCubes, Abc_NtkObjNumMax(pNtk), fVerbose ) > 0 )
+ if ( Fx_FastExtract( vCubes, Abc_NtkObjNumMax(pNtk), nNewNodesMax, fVerbose ) > 0 )
{
// update the network
Abc_NtkFxInsert( pNtk, vCubes );
@@ -1095,9 +1095,10 @@ void Fx_ManUpdate( Fx_Man_t * p, int iDiv )
SeeAlso []
***********************************************************************/
-int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int fVerbose )
+int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int nNewNodesMax, int fVerbose )
{
int fVeryVerbose = 0;
+ int i, iDiv;
Fx_Man_t * p;
clock_t clk = clock();
// initialize the data-structure
@@ -1110,9 +1111,9 @@ int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int fVerbose )
Fx_PrintStats( p, clock() - clk );
// perform extraction
p->timeStart = clock();
- while ( Vec_QueTopCost(p->vPrio) > 0.0 )
+ for ( i = 0; i < nNewNodesMax && Vec_QueTopCost(p->vPrio) > 0.0; i++ )
{
- int iDiv = Vec_QuePop(p->vPrio);
+ iDiv = Vec_QuePop(p->vPrio);
if ( fVerbose )
Fx_PrintDiv( p, iDiv );
Fx_ManUpdate( p, iDiv );