abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mpmMap.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [mpmMap.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Configurable technology mapper.]
8 
9  Synopsis [Mapping algorithm.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 1, 2013.]
16 
17  Revision [$Id: mpmMap.c,v 1.00 2013/06/01 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "mpmInt.h"
22 
24 
25 ////////////////////////////////////////////////////////////////////////
26 /// DECLARATIONS ///
27 ////////////////////////////////////////////////////////////////////////
28 
29 //#define MIG_RUNTIME
30 
31 ////////////////////////////////////////////////////////////////////////
32 /// FUNCTION DEFINITIONS ///
33 ////////////////////////////////////////////////////////////////////////
34 
35 /**Function*************************************************************
36 
37  Synopsis [Cut manipulation.]
38 
39  Description []
40 
41  SideEffects []
42 
43  SeeAlso []
44 
45 ***********************************************************************/
46 static inline int Mpm_CutAlloc( Mpm_Man_t * p, int nLeaves, Mpm_Cut_t ** ppCut )
47 {
48  int hHandle = Mmr_StepFetch( p->pManCuts, Mpm_CutWordNum(nLeaves) );
49  *ppCut = (Mpm_Cut_t *)Mmr_StepEntry( p->pManCuts, hHandle );
50  (*ppCut)->nLeaves = nLeaves;
51  (*ppCut)->hNext = 0;
52  (*ppCut)->fUseless = 0;
53  (*ppCut)->fCompl = 0;
54  return hHandle;
55 }
56 static inline int Mpm_CutCreateZero( Mpm_Man_t * p )
57 {
58  Mpm_Cut_t * pCut;
59  int hCut = Mpm_CutAlloc( p, 0, &pCut );
60  pCut->iFunc = 0; // const0
61  return hCut;
62 }
63 static inline int Mpm_CutCreateUnit( Mpm_Man_t * p, int Id )
64 {
65  Mpm_Cut_t * pCut;
66  int hCut = Mpm_CutAlloc( p, 1, &pCut );
67  pCut->iFunc = Abc_Var2Lit( p->funcVar0, 0 ); // var
68  pCut->pLeaves[0] = Abc_Var2Lit( Id, 0 );
69  return hCut;
70 }
71 static inline int Mpm_CutCreate( Mpm_Man_t * p, Mpm_Cut_t * pUni, Mpm_Cut_t ** ppCut )
72 {
73  int hCutNew = Mpm_CutAlloc( p, pUni->nLeaves, ppCut );
74  (*ppCut)->iFunc = pUni->iFunc;
75  (*ppCut)->fCompl = pUni->fCompl;
76  (*ppCut)->fUseless = pUni->fUseless;
77  (*ppCut)->nLeaves = pUni->nLeaves;
78  memcpy( (*ppCut)->pLeaves, pUni->pLeaves, sizeof(int) * pUni->nLeaves );
79  return hCutNew;
80 }
81 static inline int Mpm_CutDup( Mpm_Man_t * p, Mpm_Cut_t * pCut, int fCompl )
82 {
83  Mpm_Cut_t * pCutNew;
84  int hCutNew = Mpm_CutAlloc( p, pCut->nLeaves, &pCutNew );
85  pCutNew->iFunc = Abc_LitNotCond( pCut->iFunc, fCompl );
86  pCutNew->fUseless = pCut->fUseless;
87  pCutNew->nLeaves = pCut->nLeaves;
88  memcpy( pCutNew->pLeaves, pCut->pLeaves, sizeof(int) * pCut->nLeaves );
89  return hCutNew;
90 }
91 static inline int Mpm_CutCopySet( Mpm_Man_t * p, Mig_Obj_t * pObj, int fCompl )
92 {
93  Mpm_Cut_t * pCut;
94  int hCut, iList = 0, * pList = &iList;
95  Mpm_ObjForEachCut( p, pObj, hCut, pCut )
96  {
97  *pList = Mpm_CutDup( p, pCut, fCompl );
98  pList = &Mpm_CutFetch( p, *pList )->hNext;
99  }
100  *pList = 0;
101  return iList;
102 }
103 void Mpm_CutPrint( Mpm_Cut_t * pCut )
104 {
105  int i;
106  printf( "%d : { ", pCut->nLeaves );
107  for ( i = 0; i < (int)pCut->nLeaves; i++ )
108  printf( "%d ", pCut->pLeaves[i] );
109  printf( "}\n" );
110 }
111 static inline void Mpm_CutPrintAll( Mpm_Man_t * p )
112 {
113  int i;
114  for ( i = 0; i < p->nCutStore; i++ )
115  {
116  printf( "%2d : ", i );
117  Mpm_CutPrint( &p->pCutStore[i]->pCut );
118  }
119 }
120 static inline int Mpm_CutFindLeaf( Mpm_Cut_t * pNew, int iObj )
121 {
122  int i;
123  for ( i = 0; i < (int)pNew->nLeaves; i++ )
124  if ( Abc_Lit2Var(pNew->pLeaves[i]) == iObj )
125  return i;
126  return i;
127 }
128 static inline int Mpm_CutIsContained( Mpm_Man_t * p, Mpm_Cut_t * pBase, Mpm_Cut_t * pCut ) // check if pCut is contained pBase
129 {
130  int i;
131  for ( i = 0; i < (int)pCut->nLeaves; i++ )
132  if ( Mpm_CutFindLeaf( pBase, Abc_Lit2Var(pCut->pLeaves[i]) ) == (int)pBase->nLeaves )
133  return 0;
134  return 1;
135 }
136 
137 /**Function*************************************************************
138 
139  Synopsis [Cut attibutes.]
140 
141  Description []
142 
143  SideEffects []
144 
145  SeeAlso []
146 
147 ***********************************************************************/
148 static inline int Mpm_CutGetArea( Mpm_Man_t * p, Mpm_Cut_t * pCut )
149 {
150  if ( p->pPars->fMap4Cnf )
151  return MPM_UNIT_AREA * p->pDsd6[Abc_Lit2Var(pCut->iFunc)].nClauses;
152  if ( p->pPars->fMap4Aig )
153  return MPM_UNIT_AREA * p->pDsd6[Abc_Lit2Var(pCut->iFunc)].nAnds;
154  if ( p->pPars->fMap4Gates )
155  return MPM_UNIT_AREA * 1;
156  return p->pLibLut->pLutAreas[pCut->nLeaves];
157 }
158 static inline word Mpm_CutGetSign( Mpm_Cut_t * pCut )
159 {
160  int i, iLeaf;
161  word uSign = 0;
162  Mpm_CutForEachLeafId( pCut, iLeaf, i )
163  uSign |= ((word)1 << (iLeaf & 0x3F));
164  return uSign;
165 }
166 static inline int Mpm_CutGetArrTime( Mpm_Man_t * p, Mpm_Cut_t * pCut )
167 {
168  int * pmTimes = Vec_IntArray( &p->vTimes );
169  int * pDelays = p->pLibLut->pLutDelays[pCut->nLeaves];
170  int i, iLeaf, ArrTime = 0;
171  Mpm_CutForEachLeafId( pCut, iLeaf, i )
172  ArrTime = Abc_MaxInt( ArrTime, pmTimes[iLeaf] + pDelays[i] );
173  return ArrTime;
174 }
175 static inline Mpm_Uni_t * Mpm_CutSetupInfo( Mpm_Man_t * p, Mpm_Cut_t * pCut, int ArrTime )
176 {
177  int * pMigRefs = Vec_IntArray( &p->vMigRefs );
178  int * pMapRefs = Vec_IntArray( &p->vMapRefs );
179  int * pEstRefs = Vec_IntArray( &p->vEstRefs );
180  int * pmArea = Vec_IntArray( &p->vAreas );
181  int * pmEdge = Vec_IntArray( &p->vEdges );
182  int i, iLeaf;
184  assert( &pUnit->pCut == pCut );
185  pUnit->mTime = ArrTime;
186  pUnit->mArea = Mpm_CutGetArea( p, pCut );
187  pUnit->mEdge = MPM_UNIT_EDGE * pCut->nLeaves;
188  pUnit->mAveRefs = 0;
189  pUnit->Cost = 0;
190  pUnit->uSign = 0;
191  Mpm_CutForEachLeafId( pCut, iLeaf, i )
192  {
193  if ( p->fMainRun && pMapRefs[iLeaf] == 0 ) // not used in the mapping
194  {
195  pUnit->mArea += pmArea[iLeaf];
196  pUnit->mEdge += pmEdge[iLeaf];
197  }
198  else
199  {
200  assert( pEstRefs[iLeaf] > 0 );
201  pUnit->mArea += MPM_UNIT_REFS * pmArea[iLeaf] / pEstRefs[iLeaf];
202  pUnit->mEdge += MPM_UNIT_REFS * pmEdge[iLeaf] / pEstRefs[iLeaf];
203  pUnit->mAveRefs += p->fMainRun ? pMapRefs[iLeaf] : pMigRefs[iLeaf];
204  }
205  pUnit->uSign |= ((word)1 << (iLeaf & 0x3F));
206  }
207  pUnit->mAveRefs = pUnit->mAveRefs * MPM_UNIT_EDGE / Abc_MaxInt(pCut->nLeaves, 1);
208  assert( pUnit->mTime <= 0x3FFFFFFF );
209  assert( pUnit->mArea <= 0x3FFFFFFF );
210  assert( pUnit->mEdge <= 0x3FFFFFFF );
211  return pUnit;
212 }
213 
214 /**Function*************************************************************
215 
216  Synopsis [Compares cut against those present in the store.]
217 
218  Description []
219 
220  SideEffects []
221 
222  SeeAlso []
223 
224 ***********************************************************************/
225 int Mpm_ObjAddCutToStore( Mpm_Man_t * p, Mpm_Cut_t * pCut, int ArrTime )
226 {
227  int fEnableContainment = 1;
228  Mpm_Uni_t * pUnit, * pUnitNew;
229  int k, iPivot, last;
230  // create new unit
231 #ifdef MIG_RUNTIME
232  abctime clk;
233 clk = Abc_Clock();
234 #endif
235  pUnitNew = Mpm_CutSetupInfo( p, pCut, ArrTime );
236 #ifdef MIG_RUNTIME
237 p->timeEval += Abc_Clock() - clk;
238 #endif
239  // special case when the cut store is empty
240  if ( p->nCutStore == 0 )
241  {
242  p->pCutStore[p->nCutStore++] = pUnitNew;
243  Vec_PtrPop( &p->vFreeUnits );
244  return 1;
245  }
246  // special case when the cut store is full and last cut is better than new cut
247  if ( p->nCutStore == p->nNumCuts-1 && p->pCutCmp(pUnitNew, p->pCutStore[p->nCutStore-1]) > 0 )
248  return 0;
249 
250  // find place of the given cut in the store
251  assert( p->nCutStore <= p->nNumCuts );
252  for ( iPivot = p->nCutStore - 1; iPivot >= 0; iPivot-- )
253  if ( p->pCutCmp(pUnitNew, p->pCutStore[iPivot]) > 0 ) // iPivot-th cut is better than new cut
254  break;
255 
256  if ( fEnableContainment )
257  {
258 #ifdef MIG_RUNTIME
259 clk = Abc_Clock();
260 #endif
261  // filter this cut using other cuts
262  for ( k = 0; k <= iPivot; k++ )
263  {
264  pUnit = p->pCutStore[k];
265  if ( pUnitNew->pCut.nLeaves >= pUnit->pCut.nLeaves &&
266  (pUnitNew->uSign & pUnit->uSign) == pUnit->uSign &&
267  Mpm_CutIsContained(p, &pUnitNew->pCut, &pUnit->pCut) )
268  {
269 #ifdef MIG_RUNTIME
270 p->timeCompare += Abc_Clock() - clk;
271 #endif
272  return 0;
273  }
274  }
275  }
276 
277  // special case when the best cut is useless while the new cut is not
278  if ( p->pCutStore[0]->pCut.fUseless && !pUnitNew->pCut.fUseless )
279  iPivot = -1;
280 
281  // add the cut to storage
282  assert( pUnitNew == (Mpm_Uni_t *)Vec_PtrEntryLast(&p->vFreeUnits) );
283  Vec_PtrPop( &p->vFreeUnits );
284 
285  // insert this cut at location iPivot
286  iPivot++;
287  for ( k = p->nCutStore++; k > iPivot; k-- )
288  p->pCutStore[k] = p->pCutStore[k-1];
289  p->pCutStore[iPivot] = pUnitNew;
290 
291  if ( fEnableContainment )
292  {
293  // filter other cuts using this cut
294  for ( k = last = iPivot+1; k < p->nCutStore; k++ )
295  {
296  pUnit = p->pCutStore[k];
297  if ( pUnitNew->pCut.nLeaves <= pUnit->pCut.nLeaves &&
298  (pUnitNew->uSign & pUnit->uSign) == pUnitNew->uSign &&
299  Mpm_CutIsContained(p, &pUnit->pCut, &pUnitNew->pCut) )
300  {
301  Vec_PtrPush( &p->vFreeUnits, pUnit );
302  continue;
303  }
304  p->pCutStore[last++] = p->pCutStore[k];
305  }
306  p->nCutStore = last;
307 #ifdef MIG_RUNTIME
308 p->timeCompare += Abc_Clock() - clk;
309 #endif
310  }
311 
312  // remove the last cut if too many
313  if ( p->nCutStore == p->nNumCuts )
314  Vec_PtrPush( &p->vFreeUnits, p->pCutStore[--p->nCutStore] );
315  assert( p->nCutStore < p->nNumCuts );
316  return 1;
317 }
318 
319 /**Function*************************************************************
320 
321  Synopsis [Cut enumeration.]
322 
323  Description []
324 
325  SideEffects []
326 
327  SeeAlso []
328 
329 ***********************************************************************/
330 static inline Mpm_Cut_t * Mpm_ManMergeCuts( Mpm_Man_t * p, Mpm_Cut_t * pCut0, Mpm_Cut_t * pCut1, Mpm_Cut_t * pCut2 )
331 {
332  Mpm_Cut_t * pTemp, * pCut = &((Mpm_Uni_t *)Vec_PtrEntryLast(&p->vFreeUnits))->pCut;
333  int i, c, iPlace;
334  // base cut
335  memcpy( pCut->pLeaves, pCut0->pLeaves, sizeof(int) * pCut0->nLeaves );
336  pCut->nLeaves = pCut0->nLeaves;
337  // remaining cuts
338  if ( p->pPars->fUseDsd )
339  {
340  for ( c = 1; c < 3; c++ )
341  {
342  pTemp = (c == 1) ? pCut1 : pCut2;
343  if ( pTemp == NULL )
344  break;
345  p->uPermMask[c] = 0x3FFFF; // 18 bits
346  p->uComplMask[c] = 0;
347  for ( i = 0; i < (int)pTemp->nLeaves; i++ )
348  {
349  iPlace = Mpm_CutFindLeaf( pCut, Abc_Lit2Var(pTemp->pLeaves[i]) );
350  if ( iPlace == (int)pCut->nLeaves )
351  {
352  if ( (int)pCut->nLeaves == p->nLutSize )
353  return NULL;
354  pCut->pLeaves[pCut->nLeaves++] = pTemp->pLeaves[i];
355  }
356  p->uPermMask[c] ^= (((i & 7) ^ 7) << (3*iPlace));
357  if ( pTemp->pLeaves[i] != pCut->pLeaves[iPlace] )
358  p->uComplMask[c] |= (1 << iPlace);
359  }
360  }
361  }
362  else
363  {
364  for ( c = 1; c < 3; c++ )
365  {
366  pTemp = (c == 1) ? pCut1 : pCut2;
367  if ( pTemp == NULL )
368  break;
369  for ( i = 0; i < (int)pTemp->nLeaves; i++ )
370  {
371  iPlace = Mpm_CutFindLeaf( pCut, Abc_Lit2Var(pTemp->pLeaves[i]) );
372  if ( iPlace == (int)pCut->nLeaves )
373  {
374  if ( (int)pCut->nLeaves == p->nLutSize )
375  return NULL;
376  pCut->pLeaves[pCut->nLeaves++] = pTemp->pLeaves[i];
377  }
378  }
379  }
380  }
381  if ( pCut1 == NULL )
382  {
383  pCut->hNext = 0;
384  pCut->iFunc = pCut0->iFunc;
385  pCut->fUseless = pCut0->fUseless;
386  pCut->fCompl = pCut0->fCompl;
387  }
388  else
389  {
390  pCut->hNext = 0;
391  pCut->iFunc = 0; pCut->iFunc = ~pCut->iFunc;
392  pCut->fUseless = 0;
393  pCut->fCompl = 0;
394  }
395  p->nCutsMerged++;
396  p->nCutsMergedAll++;
397  if ( p->pPars->fUseTruth )
398  Vec_IntSelectSort( pCut->pLeaves, pCut->nLeaves );
399  return pCut;
400 }
401 static inline int Mpm_ManExploreNewCut( Mpm_Man_t * p, Mig_Obj_t * pObj, Mpm_Cut_t * pCut0, Mpm_Cut_t * pCut1, Mpm_Cut_t * pCut2, int Required )
402 {
403  Mpm_Cut_t * pCut;
404  int ArrTime;
405 #ifdef MIG_RUNTIME
406 abctime clk = clock();
407 #endif
408 
409  if ( pCut0->nLeaves >= pCut1->nLeaves )
410  {
411  pCut = Mpm_ManMergeCuts( p, pCut0, pCut1, pCut2 );
412 #ifdef MIG_RUNTIME
413 p->timeMerge += clock() - clk;
414 #endif
415  if ( pCut == NULL )
416  return 1;
417  if ( p->pPars->fUseTruth )
418  Mpm_CutComputeTruth( p, pCut, pCut0, pCut1, pCut2, Mig_ObjFaninC0(pObj), Mig_ObjFaninC1(pObj), Mig_ObjFaninC2(pObj), Mig_ObjNodeType(pObj) );
419  else if ( p->pPars->fUseDsd )
420  {
421  if ( !Mpm_CutComputeDsd6( p, pCut, pCut0, pCut1, pCut2, Mig_ObjFaninC0(pObj), Mig_ObjFaninC1(pObj), Mig_ObjFaninC2(pObj), Mig_ObjNodeType(pObj) ) )
422  return 1;
423  }
424  }
425  else
426  {
427  pCut = Mpm_ManMergeCuts( p, pCut1, pCut0, pCut2 );
428 #ifdef MIG_RUNTIME
429 p->timeMerge += clock() - clk;
430 #endif
431  if ( pCut == NULL )
432  return 1;
433  if ( p->pPars->fUseTruth )
434  Mpm_CutComputeTruth( p, pCut, pCut1, pCut0, pCut2, Mig_ObjFaninC1(pObj), Mig_ObjFaninC0(pObj), 1 ^ Mig_ObjFaninC2(pObj), Mig_ObjNodeType(pObj) );
435  else if ( p->pPars->fUseDsd )
436  {
437  if ( !Mpm_CutComputeDsd6( p, pCut, pCut1, pCut0, pCut2, Mig_ObjFaninC1(pObj), Mig_ObjFaninC0(pObj), 1 ^ Mig_ObjFaninC2(pObj), Mig_ObjNodeType(pObj) ) )
438  return 1;
439  }
440  }
441 
442 #ifdef MIG_RUNTIME
443 clk = clock();
444 #endif
445  ArrTime = Mpm_CutGetArrTime( p, pCut );
446 #ifdef MIG_RUNTIME
447 p->timeEval += clock() - clk;
448 #endif
449  if ( p->fMainRun && ArrTime > Required )
450  return 1;
451 
452 #ifdef MIG_RUNTIME
453 clk = Abc_Clock();
454 #endif
455  Mpm_ObjAddCutToStore( p, pCut, ArrTime );
456 #ifdef MIG_RUNTIME
457 p->timeStore += Abc_Clock() - clk;
458 #endif
459 
460 /*
461  // return 0 if const or buffer cut is derived - reset all cuts to contain only one --- does not work
462 // if ( pCut->nLeaves < 2 && p->nCutStore == 1 )
463 // return 0;
464  if ( pCut->nLeaves < 2 )
465  {
466  int i;
467  assert( p->nCutStore >= 1 );
468  for ( i = 1; i < p->nCutStore; i++ )
469  Vec_PtrPush( &p->vFreeUnits, p->pCutStore[i] );
470  p->nCutStore = 1;
471  return 0;
472  }
473 */
474  return 1;
475 }
476 
477 
478 /**Function*************************************************************
479 
480  Synopsis []
481 
482  Description []
483 
484  SideEffects []
485 
486  SeeAlso []
487 
488 ***********************************************************************/
489 static inline void Mpm_ObjRecycleCuts( Mpm_Man_t * p, Mig_Obj_t * pObj )
490 {
491  Mpm_Cut_t * pCut;
492  int hCut, hNext;
493  Mpm_ObjForEachCutSafe( p, pObj, hCut, pCut, hNext )
494  Mmr_StepRecycle( p->pManCuts, hCut );
495  Mpm_ObjSetCutList( p, pObj, 0 );
496 }
497 static inline void Mpm_ObjDerefFaninCuts( Mpm_Man_t * p, Mig_Obj_t * pObj )
498 {
499  Mig_Obj_t * pFanin;
500  int i;
501  Mig_ObjForEachFanin( pObj, pFanin, i )
502  if ( Mig_ObjIsNode(pFanin) && Mig_ObjMigRefDec(p, pFanin) == 0 )
503  Mpm_ObjRecycleCuts( p, pFanin );
504  pFanin = Mig_ObjSibl(pObj);
505  if ( pFanin && Mig_ObjMigRefDec(p, pFanin) == 0 )
506  Mpm_ObjRecycleCuts( p, pFanin );
507  if ( Mig_ObjMigRefNum(p, pObj) == 0 )
508  Mpm_ObjRecycleCuts( p, pObj );
509 }
510 static inline void Mpm_ObjCollectFaninsAndSigns( Mpm_Man_t * p, Mig_Obj_t * pObj, int i )
511 {
512  Mpm_Cut_t * pCut;
513  int hCut, nCuts = 0;
514  Mpm_ObjForEachCut( p, pObj, hCut, pCut )
515  {
516  p->pCuts[i][nCuts] = pCut;
517  p->pSigns[i][nCuts++] = Mpm_CutGetSign( pCut );
518  }
519  p->nCuts[i] = nCuts;
520 }
521 static inline void Mpm_ObjPrepareFanins( Mpm_Man_t * p, Mig_Obj_t * pObj )
522 {
523  Mig_Obj_t * pFanin;
524  int i;
525  Mig_ObjForEachFanin( pObj, pFanin, i )
526  Mpm_ObjCollectFaninsAndSigns( p, pFanin, i );
527 }
528 // create storage from cuts at the node
529 void Mpm_ObjAddChoiceCutsToStore( Mpm_Man_t * p, Mig_Obj_t * pRoot, Mig_Obj_t * pObj, int ReqTime )
530 {
531  Mpm_Cut_t * pCut;
532  int hCut, hNext, ArrTime;
533  int fCompl = Mig_ObjPhase(pRoot) ^ Mig_ObjPhase(pObj);
534  Mpm_ObjForEachCutSafe( p, pObj, hCut, pCut, hNext )
535  {
536  if ( Abc_Lit2Var(pCut->pLeaves[0]) == Mig_ObjId(pObj) )
537  continue;
538  ArrTime = Mpm_CutGetArrTime( p, pCut );
539  if ( ArrTime > ReqTime )
540  continue;
541  pCut->fCompl ^= fCompl;
542  pCut = Mpm_ManMergeCuts( p, pCut, NULL, NULL );
543  Mpm_ObjAddCutToStore( p, pCut, ArrTime );
544  }
545 }
546 // create cuts at the node from storage
548 {
549  Mpm_Cut_t * pCut = NULL;
550  Mpm_Uni_t * pUnit;
551  int i, *pList = Mpm_ObjCutListP( p, pObj );
552  assert( p->nCutStore > 0 && p->nCutStore <= p->nNumCuts );
553  assert( *pList == 0 );
554  // translate cuts
555  for ( i = 0; i < p->nCutStore; i++ )
556  {
557  pUnit = p->pCutStore[i];
558  *pList = Mpm_CutCreate( p, &pUnit->pCut, &pCut );
559  pList = &pCut->hNext;
560  Vec_PtrPush( &p->vFreeUnits, pUnit );
561  }
562  assert( Vec_PtrSize(&p->vFreeUnits) == p->nNumCuts + 1 );
563  if ( p->nCutStore == 1 && pCut->nLeaves < 2 )
564  *pList = 0;
565  else
566  *pList = Mpm_CutCreateUnit( p, Mig_ObjId(pObj) );
567 }
568 
569 /**Function*************************************************************
570 
571  Synopsis []
572 
573  Description []
574 
575  SideEffects []
576 
577  SeeAlso []
578 
579 ***********************************************************************/
581 {
582  Mpm_Cut_t * pCut0, * pCut1, * pCut2;
583  int Required = Mpm_ObjRequired( p, pObj );
584  int hCutBest = Mpm_ObjCutBest( p, pObj );
585  int c0, c1, c2;
586 #ifdef MIG_RUNTIME
587 abctime clk;
588 #endif
589 
590  assert( Vec_PtrSize( &p->vFreeUnits ) == p->nNumCuts + 1 );
591  assert( Mpm_ObjCutList(p, pObj) == 0 );
592  p->nCutStore = 0;
593  if ( hCutBest > 0 ) // cut list is assigned
594  {
595  Mpm_Cut_t * pCut = Mpm_ObjCutBestP( p, pObj );
596  int Times = Mpm_CutGetArrTime( p, pCut );
597  assert( pCut->hNext == 0 );
598  if ( Times > Required )
599  printf( "Arrival time (%d) exceeds required time (%d) at object %d.\n", Times, Required, Mig_ObjId(pObj) );
600  if ( p->fMainRun )
601  Mpm_ObjAddCutToStore( p, Mpm_ManMergeCuts(p, pCut, NULL, NULL), Times );
602  else
603  Mpm_ObjSetTime( p, pObj, Times );
604  }
605  // start storage with choice cuts
606  if ( Mig_ManChoiceNum(p->pMig) && Mig_ObjSiblId(pObj) )
607  Mpm_ObjAddChoiceCutsToStore( p, pObj, Mig_ObjSibl(pObj), Required );
608 
609 #ifdef MIG_RUNTIME
610 clk = Abc_Clock();
611 #endif
612  Mpm_ObjPrepareFanins( p, pObj );
613  if ( Mig_ObjIsNode2(pObj) )
614  {
615  // go through cut pairs
616  for ( c0 = 0; c0 < p->nCuts[0] && (pCut0 = p->pCuts[0][c0]); c0++ )
617  for ( c1 = 0; c1 < p->nCuts[1] && (pCut1 = p->pCuts[1][c1]); c1++ )
618  if ( Abc_TtCountOnes(p->pSigns[0][c0] | p->pSigns[1][c1]) <= p->nLutSize )
619  if ( !Mpm_ManExploreNewCut( p, pObj, pCut0, pCut1, NULL, Required ) )
620  goto finish;
621  }
622  else if ( Mig_ObjIsNode3(pObj) )
623  {
624  // go through cut triples
625  for ( c0 = 0; c0 < p->nCuts[0] && (pCut0 = p->pCuts[0][c0]); c0++ )
626  for ( c1 = 0; c1 < p->nCuts[1] && (pCut1 = p->pCuts[1][c1]); c1++ )
627  for ( c2 = 0; c2 < p->nCuts[2] && (pCut2 = p->pCuts[2][c2]); c2++ )
628  if ( Abc_TtCountOnes(p->pSigns[0][c0] | p->pSigns[1][c1] | p->pSigns[2][c2]) <= p->nLutSize )
629  if ( !Mpm_ManExploreNewCut( p, pObj, pCut0, pCut1, pCut2, Required ) )
630  goto finish;
631  }
632  else assert( 0 );
633 #ifdef MIG_RUNTIME
634 p->timeDerive += Abc_Clock() - clk;
635 #endif
636 
637 finish:
638  // save best cut
639  assert( p->nCutStore > 0 );
640  if ( p->pCutStore[0]->mTime <= Required )
641  {
642  Mpm_Cut_t * pCut;
643  if ( hCutBest )
644  Mmr_StepRecycle( p->pManCuts, hCutBest );
645  hCutBest = Mpm_CutCreate( p, &p->pCutStore[0]->pCut, &pCut );
646  Mpm_ObjSetCutBest( p, pObj, hCutBest );
647  Mpm_ObjSetTime( p, pObj, p->pCutStore[0]->mTime );
648  Mpm_ObjSetArea( p, pObj, p->pCutStore[0]->mArea );
649  Mpm_ObjSetEdge( p, pObj, p->pCutStore[0]->mEdge );
650  }
651  else assert( !p->fMainRun );
652  assert( hCutBest > 0 );
653  // transform internal storage into regular cuts
655  // dereference fanin cuts and reference node
656  Mpm_ObjDerefFaninCuts( p, pObj );
657  return 1;
658 }
659 
660 
661 /**Function*************************************************************
662 
663  Synopsis [Required times.]
664 
665  Description []
666 
667  SideEffects []
668 
669  SeeAlso []
670 
671 ***********************************************************************/
672 static inline int Mpm_ManFindArrivalMax( Mpm_Man_t * p )
673 {
674  int * pmTimes = Vec_IntArray( &p->vTimes );
675  Mig_Obj_t * pObj;
676  int i, ArrMax = 0;
677  Mig_ManForEachCo( p->pMig, pObj, i )
678  ArrMax = Abc_MaxInt( ArrMax, pmTimes[ Mig_ObjFaninId0(pObj) ] );
679  return ArrMax;
680 }
681 static inline void Mpm_ManFinalizeRound( Mpm_Man_t * p )
682 {
683  int * pMapRefs = Vec_IntArray( &p->vMapRefs );
684  int * pRequired = Vec_IntArray( &p->vRequireds );
685  Mig_Obj_t * pObj;
686  Mpm_Cut_t * pCut;
687  int * pDelays;
688  int i, iLeaf;
689  p->GloArea = 0;
690  p->GloEdge = 0;
692  if ( p->pPars->DelayTarget != -1 )
694  Mpm_ManCleanMapRefs( p );
696  Mig_ManForEachObjReverse( p->pMig, pObj )
697  {
698  if ( Mig_ObjIsCo(pObj) )
699  {
700  pRequired[Mig_ObjFaninId0(pObj)] = p->GloRequired;
701  pMapRefs [Mig_ObjFaninId0(pObj)]++;
702  }
703  else if ( Mig_ObjIsNode(pObj) )
704  {
705  int Required = pRequired[Mig_ObjId(pObj)];
706  assert( Required > 0 );
707  if ( pMapRefs[Mig_ObjId(pObj)] > 0 )
708  {
709  pCut = Mpm_ObjCutBestP( p, pObj );
710  pDelays = p->pLibLut->pLutDelays[pCut->nLeaves];
711  Mpm_CutForEachLeafId( pCut, iLeaf, i )
712  {
713  pRequired[iLeaf] = Abc_MinInt( pRequired[iLeaf], Required - pDelays[i] );
714  pMapRefs [iLeaf]++;
715  }
716  p->GloArea += Mpm_CutGetArea( p, pCut );
717  p->GloEdge += pCut->nLeaves;
718  }
719  }
720  else if ( Mig_ObjIsBuf(pObj) )
721  {
722  }
723  }
724  p->GloArea /= MPM_UNIT_AREA;
725 }
726 static inline void Mpm_ManComputeEstRefs( Mpm_Man_t * p )
727 {
728  int * pMapRefs = Vec_IntArray( &p->vMapRefs );
729  int * pEstRefs = Vec_IntArray( &p->vEstRefs );
730  int i;
731  assert( p->fMainRun );
732 // pObj->EstRefs = (float)((2.0 * pObj->EstRefs + pObj->nRefs) / 3.0);
733  for ( i = 0; i < Mig_ManObjNum(p->pMig); i++ )
734  pEstRefs[i] = (1 * pEstRefs[i] + MPM_UNIT_REFS * pMapRefs[i]) / 2;
735 }
736 
737 /**Function*************************************************************
738 
739  Synopsis [Cut comparison.]
740 
741  Description [Returns positive number if new one is better than old one.]
742 
743  SideEffects []
744 
745  SeeAlso []
746 
747 ***********************************************************************/
749 {
750  if ( pOld->mTime != pNew->mTime ) return pOld->mTime - pNew->mTime;
751  if ( pOld->pCut.nLeaves != pNew->pCut.nLeaves ) return pOld->pCut.nLeaves - pNew->pCut.nLeaves;
752  if ( pOld->mArea != pNew->mArea ) return pOld->mArea - pNew->mArea;
753  if ( pOld->mEdge != pNew->mEdge ) return pOld->mEdge - pNew->mEdge;
754  return 0;
755 }
757 {
758  if ( pOld->mTime != pNew->mTime ) return pOld->mTime - pNew->mTime;
759  if ( pOld->mArea != pNew->mArea ) return pOld->mArea - pNew->mArea;
760  if ( pOld->mEdge != pNew->mEdge ) return pOld->mEdge - pNew->mEdge;
761  if ( pOld->pCut.nLeaves != pNew->pCut.nLeaves ) return pOld->pCut.nLeaves - pNew->pCut.nLeaves;
762  return 0;
763 }
765 {
766  if ( pOld->mArea != pNew->mArea ) return pOld->mArea - pNew->mArea;
767  if ( pOld->pCut.nLeaves != pNew->pCut.nLeaves ) return pOld->pCut.nLeaves - pNew->pCut.nLeaves;
768  if ( pOld->mEdge != pNew->mEdge ) return pOld->mEdge - pNew->mEdge;
769  if ( pOld->mAveRefs != pNew->mAveRefs ) return pOld->mAveRefs - pNew->mAveRefs;
770  if ( pOld->mTime != pNew->mTime ) return pOld->mTime - pNew->mTime;
771  return 0;
772 }
774 {
775  if ( pOld->mArea != pNew->mArea ) return pOld->mArea - pNew->mArea;
776  if ( pOld->mEdge != pNew->mEdge ) return pOld->mEdge - pNew->mEdge;
777  if ( pOld->mAveRefs != pNew->mAveRefs ) return pOld->mAveRefs - pNew->mAveRefs;
778  if ( pOld->pCut.nLeaves != pNew->pCut.nLeaves ) return pOld->pCut.nLeaves - pNew->pCut.nLeaves;
779  if ( pOld->mTime != pNew->mTime ) return pOld->mTime - pNew->mTime;
780  return 0;
781 }
782 
783 /**Function*************************************************************
784 
785  Synopsis [Technology mapping experiment.]
786 
787  Description []
788 
789  SideEffects []
790 
791  SeeAlso []
792 
793 ***********************************************************************/
795 {
796  Mig_Obj_t * pObj;
797  int i, hCut;
798  Mig_ManForEachCi( p->pMig, pObj, i )
799  {
800  hCut = Mpm_CutCreateUnit( p, Mig_ObjId(pObj) );
801  Mpm_ObjSetCutBest( p, pObj, hCut );
802  Mpm_ObjSetCutList( p, pObj, hCut );
803  }
804  Mig_ManForEachCand( p->pMig, pObj )
805  Mpm_ObjSetEstRef( p, pObj, MPM_UNIT_REFS * Mig_ObjRefNum(pObj) );
806 }
808 {
809  Mig_Obj_t * pObj;
810  abctime clk = Abc_Clock();
811  int i;
812  // copy references
813  assert( Vec_IntSize(&p->vMigRefs) == Vec_IntSize(&p->pMig->vRefs) );
814  memcpy( Vec_IntArray(&p->vMigRefs), Vec_IntArray(&p->pMig->vRefs), sizeof(int) * Mig_ManObjNum(p->pMig) );
815  Mig_ManForEachCo( p->pMig, pObj, i )
816  Mig_ObjMigRefDec( p, Mig_ObjFanin0(pObj) );
817  // derive cuts
818  p->nCutsMerged = 0;
819  Mig_ManForEachNode( p->pMig, pObj )
820  Mpm_ManDeriveCuts( p, pObj );
823  // report results
824  if ( p->pPars->fVerbose )
825  {
826  printf( "Del =%5d. Ar =%8d. Edge =%8d. Cut =%10d. Max =%8d. Tru =%8d. Small =%6d. ",
827  p->GloRequired, (int)p->GloArea, (int)p->GloEdge,
829  p->vTtMem ? p->vTtMem->nEntries : 0, p->nSmallSupp );
830  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
831  }
832 }
834 {
835  if ( p->pPars->fMap4Cnf )
836  {
838  Mpm_ManPerformRound( p );
839  }
840  else
841  {
843  Mpm_ManPerformRound( p );
844  if ( p->pPars->fOneRound )
845  return;
846 
848  Mpm_ManPerformRound( p );
849 
851  Mpm_ManPerformRound( p );
852 
853  p->fMainRun = 1;
854 
857  Mpm_ManPerformRound( p );
858 
861  Mpm_ManPerformRound( p );
862  }
863 }
864 
865 
866 ////////////////////////////////////////////////////////////////////////
867 /// END OF FILE ///
868 ////////////////////////////////////////////////////////////////////////
869 
870 
872 
static void Mpm_ObjCollectFaninsAndSigns(Mpm_Man_t *p, Mig_Obj_t *pObj, int i)
Definition: mpmMap.c:510
word GloArea
Definition: mpmInt.h:107
#define Mig_ManForEachNode(p, pObj)
Definition: mpmMig.h:322
void Mpm_ObjTranslateCutsFromStore(Mpm_Man_t *p, Mig_Obj_t *pObj)
Definition: mpmMap.c:547
static int * Vec_IntArray(Vec_Int_t *p)
Definition: vecInt.h:328
static int Mig_ObjMigRefDec(Mpm_Man_t *p, Mig_Obj_t *pObj)
Definition: mpmInt.h:186
static int Mig_ManObjNum(Mig_Man_t *p)
Definition: mpmMig.h:109
static int Mig_ManChoiceNum(Mig_Man_t *p)
Definition: mpmMig.h:112
static int Mpm_CutCopySet(Mpm_Man_t *p, Mig_Obj_t *pObj, int fCompl)
Definition: mpmMap.c:91
Mpm_Par_t * pPars
Definition: mpmInt.h:98
static void Mpm_CutPrintAll(Mpm_Man_t *p)
Definition: mpmMap.c:111
#define MPM_UNIT_REFS
Definition: mpmInt.h:55
static int Mpm_ManExploreNewCut(Mpm_Man_t *p, Mig_Obj_t *pObj, Mpm_Cut_t *pCut0, Mpm_Cut_t *pCut1, Mpm_Cut_t *pCut2, int Required)
Definition: mpmMap.c:401
int DelayTarget
Definition: mpm.h:62
static int Mig_ObjIsNode3(Mig_Obj_t *p)
Definition: mpmMig.h:139
int Mpm_CutComputeDsd6(Mpm_Man_t *p, Mpm_Cut_t *pCut, Mpm_Cut_t *pCut0, Mpm_Cut_t *pCut1, Mpm_Cut_t *pCutC, int fCompl0, int fCompl1, int fComplC, int Type)
Definition: mpmDsd.c:930
static void Mpm_ObjSetEstRef(Mpm_Man_t *p, Mig_Obj_t *pObj, int i)
Definition: mpmInt.h:193
static int Mig_ObjIsNode2(Mig_Obj_t *p)
Definition: mpmMig.h:138
static int Mpm_CutGetArea(Mpm_Man_t *p, Mpm_Cut_t *pCut)
Definition: mpmMap.c:148
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Mpm_CutCompareDelay2(Mpm_Uni_t *pOld, Mpm_Uni_t *pNew)
Definition: mpmMap.c:756
#define Mig_ManForEachObjReverse(p, pObj)
Definition: mpmMig.h:312
int fOneRound
Definition: mpm.h:67
#define Mig_ManForEachCo(p, pObj, i)
Definition: mpmMig.h:329
Vec_Int_t vRequireds
Definition: mpmInt.h:147
static int Mig_ObjFaninC0(Mig_Obj_t *p)
Definition: mpmMig.h:180
static int Mig_ObjRefNum(Mig_Obj_t *p)
Definition: mpmMig.h:191
static int Mpm_CutCreate(Mpm_Man_t *p, Mpm_Cut_t *pUni, Mpm_Cut_t **ppCut)
Definition: mpmMap.c:71
Vec_Int_t vRefs
Definition: mpmMig.h:78
Vec_Int_t vMapRefs
Definition: mpmInt.h:145
static int Abc_Var2Lit(int Var, int fCompl)
Definition: abc_global.h:263
static ABC_NAMESPACE_IMPL_START int Mpm_CutAlloc(Mpm_Man_t *p, int nLeaves, Mpm_Cut_t **ppCut)
DECLARATIONS ///.
Definition: mpmMap.c:46
int Mpm_CutComputeTruth(Mpm_Man_t *p, Mpm_Cut_t *pCut, Mpm_Cut_t *pCut0, Mpm_Cut_t *pCut1, Mpm_Cut_t *pCutC, int fCompl0, int fCompl1, int fComplC, int Type)
Definition: mpmTruth.c:215
static int Mig_ManCandNum(Mig_Man_t *p)
Definition: mpmMig.h:111
#define Mpm_CutForEachLeafId(pCut, iLeafId, i)
Definition: mpmInt.h:218
static int Mig_ObjIsNode(Mig_Obj_t *p)
Definition: mpmMig.h:137
static int Mpm_CutDup(Mpm_Man_t *p, Mpm_Cut_t *pCut, int fCompl)
Definition: mpmMap.c:81
static int Mpm_ObjCutBest(Mpm_Man_t *p, Mig_Obj_t *pObj)
MACRO DEFINITIONS ///.
Definition: mpmInt.h:171
unsigned fCompl
Definition: mpmInt.h:66
int nCutsMergedAll
Definition: mpmInt.h:156
static int Mpm_ObjCutList(Mpm_Man_t *p, Mig_Obj_t *pObj)
Definition: mpmInt.h:178
char * memcpy()
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
int nCuts[3]
Definition: mpmInt.h:120
static void Mpm_ObjSetCutBest(Mpm_Man_t *p, Mig_Obj_t *pObj, int i)
Definition: mpmInt.h:172
Vec_Mem_t * vTtMem
Definition: mpmInt.h:124
static int Mig_ObjPhase(Mig_Obj_t *p)
Definition: mpmMig.h:150
int Mpm_CutCompareArea(Mpm_Uni_t *pOld, Mpm_Uni_t *pNew)
Definition: mpmMap.c:764
int fVerbose
Definition: mpm.h:72
static Mig_Obj_t * Mig_ObjSibl(Mig_Obj_t *p)
Definition: mpmMig.h:190
static int Abc_TtCountOnes(word x)
Definition: utilTruth.h:1470
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static int Mpm_CutGetArrTime(Mpm_Man_t *p, Mpm_Cut_t *pCut)
Definition: mpmMap.c:166
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static void Mpm_ManFinalizeRound(Mpm_Man_t *p)
Definition: mpmMap.c:681
static void * Vec_PtrPop(Vec_Ptr_t *p)
Definition: vecPtr.h:677
int nSmallSupp
Definition: mpmInt.h:157
abctime timeDerive
Definition: mpmInt.h:158
int fMainRun
Definition: mpmInt.h:105
static int Abc_LitNotCond(int Lit, int c)
Definition: abc_global.h:267
static int Mig_ObjId(Mig_Obj_t *p)
Definition: mpmMig.h:146
int nClauses
Definition: mpmInt.h:89
int mTime
Definition: mpmInt.h:74
#define Mig_ManForEachCand(p, pObj)
Definition: mpmMig.h:324
int nCutStore
Definition: mpmInt.h:112
int(* pCutCmp)(Mpm_Uni_t *, Mpm_Uni_t *)
Definition: mpmInt.h:118
static int * Mpm_ObjCutListP(Mpm_Man_t *p, Mig_Obj_t *pObj)
Definition: mpmInt.h:179
Mpm_Uni_t * pCutStore[MPM_CUT_MAX+1]
Definition: mpmInt.h:113
static Mpm_Cut_t * Mpm_CutFetch(Mpm_Man_t *p, int h)
Definition: mpmInt.h:175
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
Mpm_LibLut_t * pLibLut
Definition: mpmInt.h:103
unsigned fUseless
Definition: mpmInt.h:67
static void Vec_IntSelectSort(int *pArray, int nSize)
Definition: vecInt.h:1740
static int Abc_MinInt(int a, int b)
Definition: abc_global.h:239
int Mpm_ObjAddCutToStore(Mpm_Man_t *p, Mpm_Cut_t *pCut, int ArrTime)
Definition: mpmMap.c:225
int nEntries
Definition: mem2.h:62
static void Mpm_ObjSetTime(Mpm_Man_t *p, Mig_Obj_t *pObj, int i)
Definition: mpmInt.h:200
static int Mig_ObjIsBuf(Mig_Obj_t *p)
Definition: mpmMig.h:136
void Mpm_ManPerformRound(Mpm_Man_t *p)
Definition: mpmMap.c:807
static int Mpm_CutCreateUnit(Mpm_Man_t *p, int Id)
Definition: mpmMap.c:63
static void * Vec_PtrEntryLast(Vec_Ptr_t *p)
Definition: vecPtr.h:413
static Mpm_Cut_t * Mpm_ManMergeCuts(Mpm_Man_t *p, Mpm_Cut_t *pCut0, Mpm_Cut_t *pCut1, Mpm_Cut_t *pCut2)
Definition: mpmMap.c:330
Mpm_Cut_t * pCuts[3][MPM_CUT_MAX+1]
Definition: mpmInt.h:121
static int Mmr_StepFetch(Mmr_Step_t *p, int nWords)
Definition: mem2.h:241
static void Mpm_ObjDerefFaninCuts(Mpm_Man_t *p, Mig_Obj_t *pObj)
Definition: mpmMap.c:497
int mArea
Definition: mpmInt.h:75
word GloEdge
Definition: mpmInt.h:108
static void Mpm_ManCleanRequired(Mpm_Man_t *p)
Definition: mpmInt.h:195
int fMap4Cnf
Definition: mpm.h:69
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
int Mpm_CutCompareArea2(Mpm_Uni_t *pOld, Mpm_Uni_t *pNew)
Definition: mpmMap.c:773
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
#define Mig_ObjForEachFanin(p, pFanin, i)
Definition: mpmMig.h:335
abctime timeCompare
Definition: mpmInt.h:161
static Mig_Obj_t * Mig_ObjFanin0(Mig_Obj_t *p)
Definition: mpmMig.h:176
static word * Mmr_StepEntry(Mmr_Step_t *p, int h)
Definition: mem2.h:236
static Mpm_Uni_t * Mpm_CutSetupInfo(Mpm_Man_t *p, Mpm_Cut_t *pCut, int ArrTime)
Definition: mpmMap.c:175
Vec_Int_t vTimes
Definition: mpmInt.h:148
Vec_Int_t vAreas
Definition: mpmInt.h:149
int fMap4Gates
Definition: mpm.h:71
int fMap4Aig
Definition: mpm.h:70
static int Mpm_ObjRequired(Mpm_Man_t *p, Mig_Obj_t *pObj)
Definition: mpmInt.h:196
static int Mpm_CutFindLeaf(Mpm_Cut_t *pNew, int iObj)
Definition: mpmMap.c:120
static int Mpm_CutCreateZero(Mpm_Man_t *p)
Definition: mpmMap.c:56
static int Mpm_CutIsContained(Mpm_Man_t *p, Mpm_Cut_t *pBase, Mpm_Cut_t *pCut)
Definition: mpmMap.c:128
int nAnds
Definition: mpmInt.h:88
int hNext
Definition: mpmInt.h:64
int pLutDelays[MPM_VAR_MAX+1][MPM_VAR_MAX+1]
Definition: mpm.h:53
unsigned uComplMask[3]
Definition: mpmInt.h:139
static void Mmr_StepRecycle(Mmr_Step_t *p, int h)
Definition: mem2.h:249
static int Mig_ObjSiblId(Mig_Obj_t *p)
Definition: mpmMig.h:188
int nCutsMerged
Definition: mpmInt.h:155
#define MPM_UNIT_AREA
Definition: mpmInt.h:53
abctime timeStore
Definition: mpmInt.h:162
static int Mig_ObjFaninC1(Mig_Obj_t *p)
Definition: mpmMig.h:181
static void Mpm_ObjSetEdge(Mpm_Man_t *p, Mig_Obj_t *pObj, int i)
Definition: mpmInt.h:206
unsigned uPermMask[3]
Definition: mpmInt.h:138
int nNumCuts
Definition: mpmInt.h:101
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
static void Mpm_ManCleanMapRefs(Mpm_Man_t *p)
Definition: mpmInt.h:188
#define Mpm_ObjForEachCutSafe(p, pObj, hCut, pCut, hNext)
Definition: mpmInt.h:214
void Mpm_ManPerform(Mpm_Man_t *p)
Definition: mpmMap.c:833
static void Mpm_ObjSetArea(Mpm_Man_t *p, Mig_Obj_t *pObj, int i)
Definition: mpmInt.h:203
Vec_Int_t vEdges
Definition: mpmInt.h:150
void Mpm_ManPrepare(Mpm_Man_t *p)
Definition: mpmMap.c:794
word uSign
Definition: mpmInt.h:78
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
abctime timeMerge
Definition: mpmInt.h:159
int Cost
Definition: mpmInt.h:79
word pSigns[3][MPM_CUT_MAX+1]
Definition: mpmInt.h:122
static int Mig_ObjFaninC2(Mig_Obj_t *p)
Definition: mpmMig.h:182
Mig_Man_t * pMig
Definition: mpmInt.h:97
#define Mpm_ObjForEachCut(p, pObj, hCut, pCut)
Definition: mpmInt.h:212
static int Mig_ObjFaninId0(Mig_Obj_t *p)
Definition: mpmMig.h:171
#define MPM_UNIT_EDGE
Definition: mpmInt.h:54
abctime timeEval
Definition: mpmInt.h:160
static int Mig_ObjMigRefNum(Mpm_Man_t *p, Mig_Obj_t *pObj)
Definition: mpmInt.h:185
static int Mpm_ManFindArrivalMax(Mpm_Man_t *p)
Definition: mpmMap.c:672
int funcVar0
Definition: mpmInt.h:126
void Mpm_CutPrint(Mpm_Cut_t *pCut)
Definition: mpmMap.c:103
Mmr_Step_t * pManCuts
Definition: mpmInt.h:110
static int Abc_Lit2Var(int Lit)
Definition: abc_global.h:264
Vec_Int_t vEstRefs
Definition: mpmInt.h:146
int Mpm_CutCompareDelay(Mpm_Uni_t *pOld, Mpm_Uni_t *pNew)
Definition: mpmMap.c:748
Vec_Int_t vMigRefs
Definition: mpmInt.h:144
#define Mig_ManForEachCi(p, pObj, i)
Definition: mpmMig.h:327
Mpm_Cut_t pCut
Definition: mpmInt.h:80
static Mpm_Cut_t * Mpm_ObjCutBestP(Mpm_Man_t *p, Mig_Obj_t *pObj)
Definition: mpmInt.h:176
int mAveRefs
Definition: mpmInt.h:77
int mEdge
Definition: mpmInt.h:76
int pLeaves[1]
Definition: mpmInt.h:69
#define assert(ex)
Definition: util_old.h:213
static void Mpm_ObjSetCutList(Mpm_Man_t *p, Mig_Obj_t *pObj, int i)
Definition: mpmInt.h:180
static void Mpm_ObjRecycleCuts(Mpm_Man_t *p, Mig_Obj_t *pObj)
Definition: mpmMap.c:489
Vec_Ptr_t vFreeUnits
Definition: mpmInt.h:115
int GloRequired
Definition: mpmInt.h:106
unsigned nLeaves
Definition: mpmInt.h:68
static word Mpm_CutGetSign(Mpm_Cut_t *pCut)
Definition: mpmMap.c:158
int pLutAreas[MPM_VAR_MAX+1]
Definition: mpm.h:52
int nLutSize
Definition: mpmInt.h:100
int Mpm_ManDeriveCuts(Mpm_Man_t *p, Mig_Obj_t *pObj)
Definition: mpmMap.c:580
ABC_INT64_T abctime
Definition: abc_global.h:278
static int Mig_ObjNodeType(Mig_Obj_t *p)
Definition: mpmMig.h:144
static int Mig_ObjIsCo(Mig_Obj_t *p)
Definition: mpmMig.h:135
int fUseTruth
Definition: mpm.h:64
unsigned iFunc
Definition: mpmInt.h:65
Mpm_Dsd_t * pDsd6
Definition: mpmInt.h:132
int nEntriesMax
Definition: mem2.h:63
static int Mpm_CutWordNum(int nLeaves)
Definition: mpmInt.h:174
int fUseDsd
Definition: mpm.h:65
static void Mpm_ManComputeEstRefs(Mpm_Man_t *p)
Definition: mpmMap.c:726
void Mpm_ObjAddChoiceCutsToStore(Mpm_Man_t *p, Mig_Obj_t *pRoot, Mig_Obj_t *pObj, int ReqTime)
Definition: mpmMap.c:529
static void Mpm_ObjPrepareFanins(Mpm_Man_t *p, Mig_Obj_t *pObj)
Definition: mpmMap.c:521