From 9d219eee4b8901d18b0c471205b1cec9fb1f0d1b Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sun, 12 May 2013 19:09:28 -0700 Subject: New MFS package. --- src/opt/sfm/sfmCore.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) (limited to 'src/opt/sfm/sfmCore.c') 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 @@ -31,6 +31,56 @@ ABC_NAMESPACE_IMPL_START /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// +/**Function************************************************************* + + 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 [] @@ -42,8 +92,17 @@ ABC_NAMESPACE_IMPL_START 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; } -- cgit v1.2.3