From a4325272c2db3119f0fa693002473b4493d4de64 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 14 Nov 2013 23:50:17 -0800 Subject: Adding switch to control the number of nodes tried in mfs2. --- src/opt/sfm/sfm.h | 1 + src/opt/sfm/sfmCore.c | 2 ++ src/opt/sfm/sfmNtk.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/opt/sfm') diff --git a/src/opt/sfm/sfm.h b/src/opt/sfm/sfm.h index d9156513..c8a30030 100644 --- a/src/opt/sfm/sfm.h +++ b/src/opt/sfm/sfm.h @@ -48,6 +48,7 @@ struct Sfm_Par_t_ int nWinSizeMax; // the maximum window size int nGrowthLevel; // the maximum allowed growth in level int nBTLimit; // the maximum number of conflicts in one SAT run + int nNodesMax; // the maximum number of nodes to try int nFirstFixed; // the number of first nodes to be treated as fixed int fRrOnly; // perform redundance removal int fArea; // performs optimization for area diff --git a/src/opt/sfm/sfmCore.c b/src/opt/sfm/sfmCore.c index 95a7f90b..9936fa9f 100644 --- a/src/opt/sfm/sfmCore.c +++ b/src/opt/sfm/sfmCore.c @@ -280,6 +280,8 @@ int Sfm_NtkPerform( Sfm_Ntk_t * p, Sfm_Par_t * pPars ) // break; } Counter += (k > 0); + if ( pPars->nNodesMax && Counter >= pPars->nNodesMax ) + break; } p->nTotalNodesEnd = Vec_WecSizeUsedLimits( &p->vFanins, Sfm_NtkPiNum(p), Vec_WecSize(&p->vFanins) - Sfm_NtkPoNum(p) ); p->nTotalEdgesEnd = Vec_WecSizeSize(&p->vFanins) - Sfm_NtkPoNum(p); diff --git a/src/opt/sfm/sfmNtk.c b/src/opt/sfm/sfmNtk.c index edd14f95..fd04e432 100644 --- a/src/opt/sfm/sfmNtk.c +++ b/src/opt/sfm/sfmNtk.c @@ -213,7 +213,7 @@ void Sfm_NtkFree( Sfm_Ntk_t * p ) { // user data Vec_StrFree( p->vFixed ); - Vec_StrFree( p->vEmpty ); + Vec_StrFreeP( &p->vEmpty ); Vec_WrdFree( p->vTruths ); Vec_WecErase( &p->vFanins ); // attributes -- cgit v1.2.3