abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mfsMan.c File Reference
#include "mfsInt.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Mfs_Man_t
Mfs_ManAlloc (Mfs_Par_t *pPars)
 DECLARATIONS ///. More...
 
void Mfs_ManClean (Mfs_Man_t *p)
 
void Mfs_ManPrint (Mfs_Man_t *p)
 
void Mfs_ManStop (Mfs_Man_t *p)
 

Function Documentation

ABC_NAMESPACE_IMPL_START Mfs_Man_t* Mfs_ManAlloc ( Mfs_Par_t pPars)

DECLARATIONS ///.

CFile****************************************************************

FileName [mfsMan.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [The good old minimization with complete don't-cares.]

Synopsis [Procedures working with the manager.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
mfsMan.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file mfsMan.c.

46 {
47  Mfs_Man_t * p;
48  // start the manager
49  p = ABC_ALLOC( Mfs_Man_t, 1 );
50  memset( p, 0, sizeof(Mfs_Man_t) );
51  p->pPars = pPars;
52  p->vProjVarsCnf = Vec_IntAlloc( 100 );
53  p->vProjVarsSat = Vec_IntAlloc( 100 );
54  p->vDivLits = Vec_IntAlloc( 100 );
55  p->nDivWords = Abc_BitWordNum(p->pPars->nWinMax + MFS_FANIN_MAX);
56  p->vDivCexes = Vec_PtrAllocSimInfo( p->pPars->nWinMax + MFS_FANIN_MAX + 1, p->nDivWords );
57  p->pMan = Int_ManAlloc();
58  p->vMem = Vec_IntAlloc( 0 );
59  p->vLevels = Vec_VecStart( 32 );
60  p->vMfsFanins= Vec_PtrAlloc( 32 );
61  return p;
62 }
char * memset()
Vec_Int_t * vProjVarsSat
Definition: mfsInt.h:65
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Mfs_Par_t * pPars
Definition: mfsInt.h:53
Int_Man_t * pMan
Definition: mfsInt.h:90
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
Vec_Int_t * vMem
Definition: mfsInt.h:91
Int_Man_t * Int_ManAlloc()
FUNCTION DEFINITIONS ///.
Definition: satInter.c:107
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static Vec_Vec_t * Vec_VecStart(int nSize)
Definition: vecVec.h:168
int nDivWords
Definition: mfsInt.h:68
Vec_Ptr_t * vDivCexes
Definition: mfsInt.h:67
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
Vec_Ptr_t * vMfsFanins
Definition: mfsInt.h:93
static int Abc_BitWordNum(int nBits)
Definition: abc_global.h:255
Vec_Int_t * vProjVarsCnf
Definition: mfsInt.h:64
Vec_Vec_t * vLevels
Definition: mfsInt.h:92
Vec_Int_t * vDivLits
Definition: mfsInt.h:63
static Vec_Ptr_t * Vec_PtrAllocSimInfo(int nEntries, int nWords)
Definition: vecPtr.h:929
#define MFS_FANIN_MAX
INCLUDES ///.
Definition: mfsInt.h:47
void Mfs_ManClean ( Mfs_Man_t p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 75 of file mfsMan.c.

76 {
77  if ( p->pAigWin )
78  Aig_ManStop( p->pAigWin );
79  if ( p->pCnf )
80  Cnf_DataFree( p->pCnf );
81  if ( p->pSat )
82  sat_solver_delete( p->pSat );
83  if ( p->vRoots )
84  Vec_PtrFree( p->vRoots );
85  if ( p->vSupp )
86  Vec_PtrFree( p->vSupp );
87  if ( p->vNodes )
88  Vec_PtrFree( p->vNodes );
89  if ( p->vDivs )
90  Vec_PtrFree( p->vDivs );
91  p->pAigWin = NULL;
92  p->pCnf = NULL;
93  p->pSat = NULL;
94  p->vRoots = NULL;
95  p->vSupp = NULL;
96  p->vNodes = NULL;
97  p->vDivs = NULL;
98 }
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Vec_Ptr_t * vSupp
Definition: mfsInt.h:60
Vec_Ptr_t * vRoots
Definition: mfsInt.h:59
void sat_solver_delete(sat_solver *s)
Definition: satSolver.c:1141
Vec_Ptr_t * vNodes
Definition: mfsInt.h:61
Vec_Ptr_t * vDivs
Definition: mfsInt.h:62
Aig_Man_t * pAigWin
Definition: mfsInt.h:87
void Cnf_DataFree(Cnf_Dat_t *p)
Definition: cnfMan.c:180
sat_solver * pSat
Definition: mfsInt.h:89
Cnf_Dat_t * pCnf
Definition: mfsInt.h:88
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
void Mfs_ManPrint ( Mfs_Man_t p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 111 of file mfsMan.c.

112 {
113  if ( p->pPars->fResub )
114  {
115  printf( "Nodes = %d. Try = %d. Resub = %d. Div = %d. SAT calls = %d. Timeouts = %d. MaxDivs = %d.\n",
117 
118  printf( "Attempts : " );
119  printf( "Remove %6d out of %6d (%6.2f %%) ", p->nRemoves, p->nTryRemoves, 100.0*p->nRemoves/Abc_MaxInt(1, p->nTryRemoves) );
120  printf( "Resub %6d out of %6d (%6.2f %%) ", p->nResubs, p->nTryResubs, 100.0*p->nResubs /Abc_MaxInt(1, p->nTryResubs) );
121  printf( "\n" );
122 
123  printf( "Reduction: " );
124  printf( "Nodes %6d out of %6d (%6.2f %%) ", p->nTotalNodesBeg-p->nTotalNodesEnd, p->nTotalNodesBeg, 100.0*(p->nTotalNodesBeg-p->nTotalNodesEnd)/Abc_MaxInt(1, p->nTotalNodesBeg) );
125  printf( "Edges %6d out of %6d (%6.2f %%) ", p->nTotalEdgesBeg-p->nTotalEdgesEnd, p->nTotalEdgesBeg, 100.0*(p->nTotalEdgesBeg-p->nTotalEdgesEnd)/Abc_MaxInt(1, p->nTotalEdgesBeg) );
126  printf( "\n" );
127 
128  if (p->pPars->fPower)
129  printf( "Power( %5.2f, %4.2f%%) \n",
132  if ( p->pPars->fSwapEdge )
133  printf( "Swappable edges = %d. Total edges = %d. Ratio = %5.2f.\n",
135 // printf( "Average ratio of DCs in the resubed nodes = %.2f.\n", 1.0*p->nDcMints/(64 * p->nNodesResub) );
136  }
137  else
138  {
139  printf( "Nodes = %d. Try = %d. Total mints = %d. Local DC mints = %d. Ratio = %5.2f.\n",
141  1.0 * (p->nMintsTotal-p->nMintsCare) / p->nMintsTotal );
142 // printf( "Average ratio of sequential DCs in the global space = %5.2f.\n",
143 // 1.0-(p->dTotalRatios/p->nNodesTried) );
144  printf( "Nodes resyn = %d. Ratio = %5.2f. Total AIG node gain = %d. Timeouts = %d.\n",
145  p->nNodesDec, 1.0 * p->nNodesDec / p->nNodesTried, p->nNodesGained, p->nTimeOuts );
146  }
147 
148  ABC_PRTP( "Win", p->timeWin , p->timeTotal );
149  ABC_PRTP( "Div", p->timeDiv , p->timeTotal );
150  ABC_PRTP( "Aig", p->timeAig , p->timeTotal );
151  ABC_PRTP( "Gia", p->timeGia , p->timeTotal );
152  ABC_PRTP( "Cnf", p->timeCnf , p->timeTotal );
153  ABC_PRTP( "Sat", p->timeSat-p->timeInt , p->timeTotal );
154  ABC_PRTP( "Int", p->timeInt , p->timeTotal );
155  ABC_PRTP( "ALL", p->timeTotal , p->timeTotal );
156 
157 }
int nResubs
Definition: mfsInt.h:107
int nTotalEdgesBeg
Definition: mfsInt.h:122
abctime timeGia
Definition: mfsInt.h:130
int nTotalNodesEnd
Definition: mfsInt.h:121
int nRemoves
Definition: mfsInt.h:106
Mfs_Par_t * pPars
Definition: mfsInt.h:53
abctime timeCnf
Definition: mfsInt.h:131
int nMintsCare
Definition: mfsInt.h:110
int nNodesGained
Definition: mfsInt.h:84
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
ABC_DLL int Abc_NtkGetTotalFanins(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:487
abctime timeAig
Definition: mfsInt.h:129
#define ABC_PRTP(a, t, T)
Definition: abc_global.h:223
int nNodesDec
Definition: mfsInt.h:83
abctime timeDiv
Definition: mfsInt.h:128
int nSatCalls
Definition: mfsInt.h:70
abctime timeTotal
Definition: mfsInt.h:134
int nNodesTried
Definition: mfsInt.h:108
float TotalSwitchingBeg
Definition: mfsInt.h:124
abctime timeWin
Definition: mfsInt.h:127
int nTryRemoves
Definition: mfsInt.h:104
int nTotalDivs
Definition: mfsInt.h:113
Abc_Ntk_t * pNtk
Definition: mfsInt.h:54
abctime timeSat
Definition: mfsInt.h:132
int nNodesResub
Definition: mfsInt.h:109
abctime timeInt
Definition: mfsInt.h:133
float TotalSwitchingEnd
Definition: mfsInt.h:125
int nTotalEdgesEnd
Definition: mfsInt.h:123
int nTotalNodesBeg
Definition: mfsInt.h:120
int nMaxDivs
Definition: mfsInt.h:117
int nTryResubs
Definition: mfsInt.h:105
int nMintsTotal
Definition: mfsInt.h:111
int nTimeOuts
Definition: mfsInt.h:114
void Mfs_ManStop ( Mfs_Man_t p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 170 of file mfsMan.c.

171 {
172  if ( p->pPars->fVerbose )
173  Mfs_ManPrint( p );
174  if ( p->vTruth )
175  Vec_IntFree( p->vTruth );
176  if ( p->pManDec )
177  Bdc_ManFree( p->pManDec );
178  if ( p->pCare )
179  Aig_ManStop( p->pCare );
180  if ( p->vSuppsInv )
182  if ( p->vProbs )
183  Vec_IntFree( p->vProbs );
184  Mfs_ManClean( p );
185  Int_ManFree( p->pMan );
186  Vec_IntFree( p->vMem );
187  Vec_VecFree( p->vLevels );
188  Vec_PtrFree( p->vMfsFanins );
191  Vec_IntFree( p->vDivLits );
192  Vec_PtrFree( p->vDivCexes );
193  ABC_FREE( p );
194 }
Vec_Int_t * vProbs
Definition: mfsInt.h:97
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
Vec_Int_t * vProjVarsSat
Definition: mfsInt.h:65
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Mfs_Par_t * pPars
Definition: mfsInt.h:53
Int_Man_t * pMan
Definition: mfsInt.h:90
Bdc_Man_t * pManDec
Definition: mfsInt.h:82
Vec_Int_t * vMem
Definition: mfsInt.h:91
static void Vec_VecFree(Vec_Vec_t *p)
Definition: vecVec.h:347
Vec_Ptr_t * vSuppsInv
Definition: mfsInt.h:56
void Mfs_ManPrint(Mfs_Man_t *p)
Definition: mfsMan.c:111
void Mfs_ManClean(Mfs_Man_t *p)
Definition: mfsMan.c:75
Vec_Ptr_t * vDivCexes
Definition: mfsInt.h:67
void Int_ManFree(Int_Man_t *p)
Definition: satInter.c:273
#define ABC_FREE(obj)
Definition: abc_global.h:232
Vec_Ptr_t * vMfsFanins
Definition: mfsInt.h:93
Vec_Int_t * vProjVarsCnf
Definition: mfsInt.h:64
void Bdc_ManFree(Bdc_Man_t *p)
Definition: bdcCore.c:113
Aig_Man_t * pCare
Definition: mfsInt.h:55
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
Vec_Vec_t * vLevels
Definition: mfsInt.h:92
Vec_Int_t * vTruth
Definition: mfsInt.h:81
Vec_Int_t * vDivLits
Definition: mfsInt.h:63
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223