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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Abc_NtkMfsParsDefault (Mfs_Par_t *pPars)
 DECLARATIONS ///. More...
 
int Abc_NtkMfsResub (Mfs_Man_t *p, Abc_Obj_t *pNode)
 
int Abc_NtkMfsNode (Mfs_Man_t *p, Abc_Obj_t *pNode)
 
int Abc_NtkMfs (Abc_Ntk_t *pNtk, Mfs_Par_t *pPars)
 

Function Documentation

int Abc_NtkMfs ( Abc_Ntk_t pNtk,
Mfs_Par_t pPars 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 206 of file mfsCore_.c.

207 {
208  extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
209 
210  Bdc_Par_t Pars = {0}, * pDecPars = &Pars;
211  ProgressBar * pProgress;
212  Mfs_Man_t * p;
213  Abc_Obj_t * pObj;
214  Vec_Vec_t * vLevels;
215  Vec_Ptr_t * vNodes;
216  int i, k, nNodes, nFaninMax;
217  clock_t clk = clock(), clk2;
218  int nTotalNodesBeg = Abc_NtkNodeNum(pNtk);
219  int nTotalEdgesBeg = Abc_NtkGetTotalFanins(pNtk);
220 
221  assert( Abc_NtkIsLogic(pNtk) );
222  nFaninMax = Abc_NtkGetFaninMax(pNtk);
223  if ( pPars->fResub )
224  {
225  if ( nFaninMax > 8 )
226  {
227  printf( "Nodes with more than %d fanins will not be processed.\n", 8 );
228  nFaninMax = 8;
229  }
230  }
231  else
232  {
233  if ( nFaninMax > MFS_FANIN_MAX )
234  {
235  printf( "Nodes with more than %d fanins will not be processed.\n", MFS_FANIN_MAX );
236  nFaninMax = MFS_FANIN_MAX;
237  }
238  }
239  // perform the network sweep
240  Abc_NtkSweep( pNtk, 0 );
241  // convert into the AIG
242  if ( !Abc_NtkToAig(pNtk) )
243  {
244  fprintf( stdout, "Converting to AIGs has failed.\n" );
245  return 0;
246  }
247  assert( Abc_NtkHasAig(pNtk) );
248 
249  // start the manager
250  p = Mfs_ManAlloc( pPars );
251  p->pNtk = pNtk;
252  p->nFaninMax = nFaninMax;
253 
254  // precomputer power-aware metrics
255  if ( pPars->fPower )
256  {
257  extern Vec_Int_t * Abc_NtkPowerEstimate( Abc_Ntk_t * pNtk, int fProbOne );
258  if ( pPars->fResub )
259  p->vProbs = Abc_NtkPowerEstimate( pNtk, 0 );
260  else
261  p->vProbs = Abc_NtkPowerEstimate( pNtk, 1 );
262  printf( "Total switching before = %7.2f.\n", Abc_NtkMfsTotalSwitching(pNtk) );
263  }
264 
265  if ( pNtk->pExcare )
266  {
267  Abc_Ntk_t * pTemp;
268  if ( Abc_NtkPiNum(pNtk->pExcare) != Abc_NtkCiNum(pNtk) )
269  printf( "The PI count of careset (%d) and logic network (%d) differ. Careset is not used.\n",
270  Abc_NtkPiNum(pNtk->pExcare), Abc_NtkCiNum(pNtk) );
271  else
272  {
273  pTemp = Abc_NtkStrash( pNtk->pExcare, 0, 0, 0 );
274  p->pCare = Abc_NtkToDar( pTemp, 0, 0 );
275  Abc_NtkDelete( pTemp );
277  }
278  }
279  if ( p->pCare != NULL )
280  printf( "Performing optimization with %d external care clauses.\n", Aig_ManPoNum(p->pCare) );
281  // prepare the BDC manager
282  if ( !pPars->fResub )
283  {
284  pDecPars->nVarsMax = (nFaninMax < 3) ? 3 : nFaninMax;
285  pDecPars->fVerbose = pPars->fVerbose;
286  p->vTruth = Vec_IntAlloc( 0 );
287  p->pManDec = Bdc_ManAlloc( pDecPars );
288  }
289 
290  // label the register outputs
291  if ( p->pCare )
292  {
293  Abc_NtkForEachCi( pNtk, pObj, i )
294  pObj->pData = (void *)(PORT_PTRUINT_T)i;
295  }
296 
297  // compute levels
298  Abc_NtkLevel( pNtk );
299  Abc_NtkStartReverseLevels( pNtk, pPars->nGrowthLevel );
300 
301  // compute don't-cares for each node
302  nNodes = 0;
303  p->nTotalNodesBeg = nTotalNodesBeg;
304  p->nTotalEdgesBeg = nTotalEdgesBeg;
305  if ( pPars->fResub )
306  {
307  pProgress = Extra_ProgressBarStart( stdout, Abc_NtkObjNumMax(pNtk) );
308  Abc_NtkForEachNode( pNtk, pObj, i )
309  {
310  if ( p->pPars->nDepthMax && (int)pObj->Level > p->pPars->nDepthMax )
311  continue;
312  if ( Abc_ObjFaninNum(pObj) < 2 || Abc_ObjFaninNum(pObj) > nFaninMax )
313  continue;
314  if ( !p->pPars->fVeryVerbose )
315  Extra_ProgressBarUpdate( pProgress, i, NULL );
316  if ( pPars->fResub )
317  Abc_NtkMfsResub( p, pObj );
318  else
319  Abc_NtkMfsNode( p, pObj );
320  }
321  Extra_ProgressBarStop( pProgress );
322  }
323  else
324  {
325  pProgress = Extra_ProgressBarStart( stdout, Abc_NtkNodeNum(pNtk) );
326  vLevels = Abc_NtkLevelize( pNtk );
327  Vec_VecForEachLevelStart( vLevels, vNodes, k, 1 )
328  {
329  if ( !p->pPars->fVeryVerbose )
330  Extra_ProgressBarUpdate( pProgress, nNodes, NULL );
331  p->nNodesGainedLevel = 0;
332  p->nTotConfLevel = 0;
333  p->nTimeOutsLevel = 0;
334  clk2 = clock();
335  Vec_PtrForEachEntry( vNodes, pObj, i )
336  {
337  if ( p->pPars->nDepthMax && (int)pObj->Level > p->pPars->nDepthMax )
338  break;
339  if ( Abc_ObjFaninNum(pObj) < 2 || Abc_ObjFaninNum(pObj) > nFaninMax )
340  continue;
341  if ( pPars->fResub )
342  Abc_NtkMfsResub( p, pObj );
343  else
344  Abc_NtkMfsNode( p, pObj );
345  }
346  nNodes += Vec_PtrSize(vNodes);
347  if ( pPars->fVerbose )
348  {
349  printf( "Lev = %2d. Node = %5d. Ave gain = %5.2f. Ave conf = %5.2f. T/o = %6.2f %% ",
350  k, Vec_PtrSize(vNodes),
351  1.0*p->nNodesGainedLevel/Vec_PtrSize(vNodes),
352  1.0*p->nTotConfLevel/Vec_PtrSize(vNodes),
353  100.0*p->nTimeOutsLevel/Vec_PtrSize(vNodes) );
354  PRT( "Time", clock() - clk2 );
355  }
356  }
357  Extra_ProgressBarStop( pProgress );
358  Vec_VecFree( vLevels );
359  }
360  Abc_NtkStopReverseLevels( pNtk );
361 
362  // perform the sweeping
363  if ( !pPars->fResub )
364  {
365  extern void Abc_NtkBidecResyn( Abc_Ntk_t * pNtk, int fVerbose );
366 // Abc_NtkSweep( pNtk, 0 );
367 // Abc_NtkBidecResyn( pNtk, 0 );
368  }
369 
370  p->nTotalNodesEnd = Abc_NtkNodeNum(pNtk);
372 
373  // undo labesl
374  if ( p->pCare )
375  {
376  Abc_NtkForEachCi( pNtk, pObj, i )
377  pObj->pData = NULL;
378  }
379  if ( pPars->fPower )
380  printf( "Total switching after = %7.2f.\n", Abc_NtkMfsTotalSwitching(pNtk) );
381 
382  // free the manager
383  p->timeTotal = clock() - clk;
384  Mfs_ManStop( p );
385  return 1;
386 }
ABC_DLL Vec_Vec_t * Abc_NtkLevelize(Abc_Ntk_t *pNtk)
Definition: abcDfs.c:1239
Vec_Int_t * vProbs
Definition: mfsInt.h:97
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static int Abc_NtkObjNumMax(Abc_Ntk_t *pNtk)
Definition: abc.h:284
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
int Abc_NtkMfsResub(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsCore_.c:74
int nTotalNodesEnd
Definition: mfsInt.h:121
Mfs_Par_t * pPars
Definition: mfsInt.h:53
#define Vec_VecForEachLevelStart(vGlob, vVec, i, LevelStart)
Definition: vecVec.h:57
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
int nNodesGainedLevel
Definition: mfsInt.h:85
Bdc_Man_t * Bdc_ManAlloc(Bdc_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition: bdcCore.c:68
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:453
Bdc_Man_t * pManDec
Definition: mfsInt.h:82
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:287
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static void Vec_VecFree(Vec_Vec_t *p)
Definition: vecVec.h:347
ABC_DLL int Abc_NtkGetTotalFanins(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:487
ABC_DLL float Abc_NtkMfsTotalSwitching(Abc_Ntk_t *pNtk)
Definition: abcPrint.c:132
ABC_DLL void Abc_NtkStopReverseLevels(Abc_Ntk_t *pNtk)
Definition: abcTiming.c:1190
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
unsigned Level
Definition: abc.h:142
void Mfs_ManStop(Mfs_Man_t *p)
Definition: mfsMan.c:170
Vec_Ptr_t * vSuppsInv
Definition: mfsInt.h:56
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
int nTimeOutsLevel
Definition: mfsInt.h:115
DECLARATIONS ///.
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
Vec_Int_t * Abc_NtkPowerEstimate(Abc_Ntk_t *pNtk, int fProbOne)
Definition: abcSpeedup.c:669
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
void * pExcare
Definition: abc.h:202
int Abc_NtkMfsNode(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsCore_.c:135
if(last==0)
Definition: sparse_int.h:34
int nFaninMax
Definition: mfsInt.h:57
ABC_DLL void Abc_NtkStartReverseLevels(Abc_Ntk_t *pNtk, int nMaxLevelIncrease)
Definition: abcTiming.c:1162
void Extra_ProgressBarStop(ProgressBar *p)
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
Vec_Ptr_t * Aig_ManSupportsInverse(Aig_Man_t *p)
Definition: aigPart.c:385
int nTotConfLevel
Definition: mfsInt.h:95
Mfs_Man_t * Mfs_ManAlloc(Mfs_Par_t *pPars)
DECLARATIONS ///.
Definition: mfsMan.c:45
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
ABC_DLL int Abc_NtkSweep(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcSweep.c:574
Definition: bdc.h:45
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
void Abc_NtkBidecResyn(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcBidec.c:110
Abc_Ntk_t * pNtk
Definition: mfsInt.h:54
ProgressBar * Extra_ProgressBarStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
Definition: abcFunc.c:1192
#define assert(ex)
Definition: util_old.h:213
static void Extra_ProgressBarUpdate(ProgressBar *p, int nItemsCur, char *pString)
Definition: extra.h:243
static int Abc_NtkHasAig(Abc_Ntk_t *pNtk)
Definition: abc.h:255
Aig_Man_t * pCare
Definition: mfsInt.h:55
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
Vec_Int_t * vTruth
Definition: mfsInt.h:81
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
Definition: abcDfs.c:1265
int nTotalEdgesEnd
Definition: mfsInt.h:123
#define MFS_FANIN_MAX
INCLUDES ///.
Definition: mfsInt.h:47
int Abc_NtkMfsNode ( Mfs_Man_t p,
Abc_Obj_t pNode 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 135 of file mfsCore_.c.

136 {
137  Hop_Obj_t * pObj;
138  int RetValue;
139  float dProb;
140  extern Hop_Obj_t * Abc_NodeIfNodeResyn( Bdc_Man_t * p, Hop_Man_t * pHop, Hop_Obj_t * pRoot, int nVars, Vec_Int_t * vTruth, unsigned * puCare, float dProb );
141 
142  int nGain;
143  clock_t clk;
144  p->nNodesTried++;
145  // prepare data structure for this node
146  Mfs_ManClean( p );
147  // compute window roots, window support, and window nodes
148 clk = clock();
149  p->vRoots = Abc_MfsComputeRoots( pNode, p->pPars->nWinTfoLevs, p->pPars->nFanoutsMax );
152 p->timeWin += clock() - clk;
153  // count the number of patterns
154 // p->dTotalRatios += Abc_NtkConstraintRatio( p, pNode );
155  // construct AIG for the window
156 clk = clock();
157  p->pAigWin = Abc_NtkConstructAig( p, pNode );
158 p->timeAig += clock() - clk;
159  // translate it into CNF
160 clk = clock();
161  p->pCnf = Cnf_DeriveSimple( p->pAigWin, Abc_ObjFaninNum(pNode) );
162 p->timeCnf += clock() - clk;
163  // create the SAT problem
164 clk = clock();
165  p->pSat = Cnf_DataWriteIntoSolver( p->pCnf, 1, 0 );
166  if ( p->pSat && p->pPars->fOneHotness )
168  if ( p->pSat == NULL )
169  return 0;
170  // solve the SAT problem
171  RetValue = Abc_NtkMfsSolveSat( p, pNode );
172  p->nTotConfLevel += p->pSat->stats.conflicts;
173 p->timeSat += clock() - clk;
174  if ( RetValue == 0 )
175  {
176  p->nTimeOutsLevel++;
177  p->nTimeOuts++;
178  return 0;
179  }
180  // minimize the local function of the node using bi-decomposition
181  assert( p->nFanins == Abc_ObjFaninNum(pNode) );
182  dProb = p->pPars->fPower? ((float *)p->vProbs->pArray)[pNode->Id] : -1.0;
183  pObj = Abc_NodeIfNodeResyn( p->pManDec, pNode->pNtk->pManFunc, pNode->pData, p->nFanins, p->vTruth, p->uCare, dProb );
184  nGain = Hop_DagSize(pNode->pData) - Hop_DagSize(pObj);
185  if ( nGain >= 0 )
186  {
187  p->nNodesDec++;
188  p->nNodesGained += nGain;
189  p->nNodesGainedLevel += nGain;
190  pNode->pData = pObj;
191  }
192  return 1;
193 }
Vec_Int_t * vProbs
Definition: mfsInt.h:97
int Hop_DagSize(Hop_Obj_t *pObj)
Definition: hopDfs.c:279
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
Vec_Ptr_t * vSupp
Definition: mfsInt.h:60
Vec_Ptr_t * vRoots
Definition: mfsInt.h:59
Mfs_Par_t * pPars
Definition: mfsInt.h:53
int nNodesGainedLevel
Definition: mfsInt.h:85
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
abctime timeCnf
Definition: mfsInt.h:131
Bdc_Man_t * pManDec
Definition: mfsInt.h:82
int nNodesGained
Definition: mfsInt.h:84
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
stats_t stats
Definition: satSolver.h:156
Definition: hop.h:65
abctime timeAig
Definition: mfsInt.h:129
Vec_Ptr_t * vNodes
Definition: mfsInt.h:61
Aig_Man_t * pAigWin
Definition: mfsInt.h:87
int Abc_NtkMfsSolveSat(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsSat.c:95
int Abc_NtkAddOneHotness(Mfs_Man_t *p)
Definition: mfsSat.c:155
int nNodesDec
Definition: mfsInt.h:83
Aig_Man_t * Abc_NtkConstructAig(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsStrash.c:233
void * pManFunc
Definition: abc.h:191
int nTimeOutsLevel
Definition: mfsInt.h:115
unsigned uCare[(MFS_FANIN_MAX<=5)?1:1<<(MFS_FANIN_MAX-5)]
Definition: mfsInt.h:102
ABC_DLL Vec_Ptr_t * Abc_NtkNodeSupport(Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
Definition: abcDfs.c:859
Vec_Ptr_t * Abc_MfsComputeRoots(Abc_Obj_t *pNode, int nWinTfoMax, int nFanoutLimit)
Definition: mfsWin.c:99
int nFanins
Definition: mfsInt.h:99
int nNodesTried
Definition: mfsInt.h:108
int nTotConfLevel
Definition: mfsInt.h:95
ABC_INT64_T conflicts
Definition: satVec.h:154
Abc_Ntk_t * pNtk
Definition: abc.h:130
abctime timeWin
Definition: mfsInt.h:127
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
Definition: cnfMan.c:463
Cnf_Dat_t * Cnf_DeriveSimple(Aig_Man_t *p, int nOutputs)
Definition: cnfWrite.c:587
int Id
Definition: abc.h:132
Abc_Ntk_t * pNtk
Definition: mfsInt.h:54
abctime timeSat
Definition: mfsInt.h:132
Hop_Obj_t * Abc_NodeIfNodeResyn(Bdc_Man_t *p, Hop_Man_t *pHop, Hop_Obj_t *pRoot, int nVars, Vec_Int_t *vTruth, unsigned *puCare, float dProb)
FUNCTION DEFINITIONS ///.
Definition: abcBidec.c:49
#define assert(ex)
Definition: util_old.h:213
sat_solver * pSat
Definition: mfsInt.h:89
void Mfs_ManClean(Mfs_Man_t *p)
Definition: mfsMan.c:75
Cnf_Dat_t * pCnf
Definition: mfsInt.h:88
void * pData
Definition: abc.h:145
ABC_DLL Vec_Ptr_t * Abc_NtkDfsNodes(Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
Definition: abcDfs.c:120
Vec_Int_t * vTruth
Definition: mfsInt.h:81
static void ** Vec_PtrArray(Vec_Ptr_t *p)
Definition: vecPtr.h:279
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition: hop.h:49
int nTimeOuts
Definition: mfsInt.h:114
ABC_NAMESPACE_IMPL_START void Abc_NtkMfsParsDefault ( Mfs_Par_t pPars)

DECLARATIONS ///.

MACRO DEFINITIONS ///.

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

FileName [mfsCore.c]

SystemName [ABC: Logic synthesis and verification system.]

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

Synopsis [Core procedures of this package.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

Id:
mfsCore.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 mfsCore_.c.

46 {
47  memset( pPars, 0, sizeof(Mfs_Par_t) );
48  pPars->nWinTfoLevs = 2;
49  pPars->nFanoutsMax = 10;
50  pPars->nDepthMax = 20;
51  pPars->nWinSizeMax = 300;
52  pPars->nGrowthLevel = 0;
53  pPars->nBTLimit = 5000;
54  pPars->fResub = 1;
55  pPars->fArea = 0;
56  pPars->fMoreEffort = 0;
57  pPars->fSwapEdge = 0;
58  pPars->fOneHotness = 0;
59  pPars->fVerbose = 0;
60  pPars->fVeryVerbose = 0;
61 }
char * memset()
typedefABC_NAMESPACE_HEADER_START struct Mfs_Par_t_ Mfs_Par_t
INCLUDES ///.
Definition: mfs.h:42
int Abc_NtkMfsResub ( Mfs_Man_t p,
Abc_Obj_t pNode 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 74 of file mfsCore_.c.

75 {
76  clock_t clk;
77  p->nNodesTried++;
78  // prepare data structure for this node
79  Mfs_ManClean( p );
80  // compute window roots, window support, and window nodes
81 clk = clock();
82  p->vRoots = Abc_MfsComputeRoots( pNode, p->pPars->nWinTfoLevs, p->pPars->nFanoutsMax );
85 p->timeWin += clock() - clk;
86  if ( p->pPars->nWinSizeMax && Vec_PtrSize(p->vNodes) > p->pPars->nWinSizeMax )
87  return 1;
88  // compute the divisors of the window
89 clk = clock();
90  p->vDivs = Abc_MfsComputeDivisors( p, pNode, Abc_ObjRequiredLevel(pNode) - 1 );
91  p->nTotalDivs += Vec_PtrSize(p->vDivs) - Abc_ObjFaninNum(pNode);
92 p->timeDiv += clock() - clk;
93  // construct AIG for the window
94 clk = clock();
95  p->pAigWin = Abc_NtkConstructAig( p, pNode );
96 p->timeAig += clock() - clk;
97  // translate it into CNF
98 clk = clock();
99  p->pCnf = Cnf_DeriveSimple( p->pAigWin, 1 + Vec_PtrSize(p->vDivs) );
100 p->timeCnf += clock() - clk;
101  // create the SAT problem
102 clk = clock();
103  p->pSat = Abc_MfsCreateSolverResub( p, NULL, 0, 0 );
104  if ( p->pSat == NULL )
105  {
106  p->nNodesBad++;
107  return 1;
108  }
109  // solve the SAT problem
110  if ( p->pPars->fPower )
111  Abc_NtkMfsEdgePower( p, pNode );
112  else if ( p->pPars->fSwapEdge )
113  Abc_NtkMfsEdgeSwapEval( p, pNode );
114  else
115  {
116  Abc_NtkMfsResubNode( p, pNode );
117  if ( p->pPars->fMoreEffort )
118  Abc_NtkMfsResubNode2( p, pNode );
119  }
120 p->timeSat += clock() - clk;
121  return 1;
122 }
Vec_Ptr_t * Abc_MfsComputeDivisors(Mfs_Man_t *p, Abc_Obj_t *pNode, int nLevDivMax)
BASIC TYPES ///.
Definition: mfsDiv.c:193
Vec_Ptr_t * vSupp
Definition: mfsInt.h:60
Vec_Ptr_t * vRoots
Definition: mfsInt.h:59
Mfs_Par_t * pPars
Definition: mfsInt.h:53
int Abc_NtkMfsResubNode(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsResub.c:539
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
abctime timeCnf
Definition: mfsInt.h:131
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
abctime timeAig
Definition: mfsInt.h:129
Vec_Ptr_t * vNodes
Definition: mfsInt.h:61
Vec_Ptr_t * vDivs
Definition: mfsInt.h:62
Aig_Man_t * pAigWin
Definition: mfsInt.h:87
int Abc_NtkMfsEdgeSwapEval(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsResub.c:488
int nNodesBad
Definition: mfsInt.h:112
Aig_Man_t * Abc_NtkConstructAig(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsStrash.c:233
ABC_DLL int Abc_ObjRequiredLevel(Abc_Obj_t *pObj)
Definition: abcTiming.c:1102
abctime timeDiv
Definition: mfsInt.h:128
ABC_DLL Vec_Ptr_t * Abc_NtkNodeSupport(Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
Definition: abcDfs.c:859
Vec_Ptr_t * Abc_MfsComputeRoots(Abc_Obj_t *pNode, int nWinTfoMax, int nFanoutLimit)
Definition: mfsWin.c:99
int nNodesTried
Definition: mfsInt.h:108
abctime timeWin
Definition: mfsInt.h:127
int Abc_NtkMfsResubNode2(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsResub.c:585
Cnf_Dat_t * Cnf_DeriveSimple(Aig_Man_t *p, int nOutputs)
Definition: cnfWrite.c:587
int nTotalDivs
Definition: mfsInt.h:113
Abc_Ntk_t * pNtk
Definition: mfsInt.h:54
sat_solver * Abc_MfsCreateSolverResub(Mfs_Man_t *p, int *pCands, int nCands, int fInvert)
Definition: mfsInter.c:88
abctime timeSat
Definition: mfsInt.h:132
int Abc_NtkMfsEdgePower(Mfs_Man_t *p, Abc_Obj_t *pNode)
Definition: mfsResub.c:508
sat_solver * pSat
Definition: mfsInt.h:89
void Mfs_ManClean(Mfs_Man_t *p)
Definition: mfsMan.c:75
Cnf_Dat_t * pCnf
Definition: mfsInt.h:88
ABC_DLL Vec_Ptr_t * Abc_NtkDfsNodes(Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
Definition: abcDfs.c:120
static void ** Vec_PtrArray(Vec_Ptr_t *p)
Definition: vecPtr.h:279