summaryrefslogtreecommitdiffstats
path: root/src/opt/sfm/sfmCore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/opt/sfm/sfmCore.c')
-rw-r--r--src/opt/sfm/sfmCore.c61
1 files changed, 60 insertions, 1 deletions
diff --git a/src/opt/sfm/sfmCore.c b/src/opt/sfm/sfmCore.c
index 351b4ef9..a8ff1e21 100644
--- a/src/opt/sfm/sfmCore.c
+++ b/src/opt/sfm/sfmCore.c
@@ -36,14 +36,73 @@ ABC_NAMESPACE_IMPL_START
Synopsis []
Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Sfm_ParSetDefault( Sfm_Par_t * pPars )
+{
+ memset( pPars, 0, sizeof(Sfm_Par_t) );
+ pPars->nTfoLevMax = 2; // the maximum fanout levels
+ pPars->nFanoutMax = 10; // the maximum number of fanouts
+ pPars->nDepthMax = 0; // the maximum depth to try
+ pPars->nWinSizeMax = 500; // the maximum number of divisors
+ pPars->nBTLimit = 0; // the maximum number of conflicts in one SAT run
+ pPars->fFixLevel = 0; // does not allow level to increase
+ pPars->fArea = 0; // performs optimization for area
+ pPars->fMoreEffort = 0; // performs high-affort minimization
+ pPars->fVerbose = 0; // enable basic stats
+ pPars->fVeryVerbose = 0; // enable detailed stats
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Sfm_NtkPrepare( Sfm_Ntk_t * p )
+{
+ p->vLeaves = Vec_IntAlloc( 1000 );
+ p->vRoots = Vec_IntAlloc( 1000 );
+ p->vNodes = Vec_IntAlloc( 1000 );
+ p->vTfo = Vec_IntAlloc( 1000 );
+ p->vDivs = Vec_IntAlloc( 100 );
+ p->vLits = Vec_IntAlloc( 100 );
+ p->vClauses = Vec_WecAlloc( 100 );
+ p->vFaninMap = Vec_IntAlloc( 10 );
+}
+
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
SideEffects []
SeeAlso []
***********************************************************************/
-int Sfm_ManPerform( Sfm_Ntk_t * p, Sfm_Par_t * pPars )
+int Sfm_NtkPerform( Sfm_Ntk_t * p, Sfm_Par_t * pPars )
{
+ int i;
+ p->pPars = pPars;
+ Sfm_NtkPrepare( p );
+ Sfm_NtkForEachNode( p, i )
+ {
+ printf( "Node %d:\n", i );
+ Sfm_PrintCnf( (Vec_Str_t *)Vec_WecEntry(p->vCnfs, i) );
+ printf( "\n" );
+ }
return 0;
}