abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
amapMatch.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [amapMatch.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Technology mapper for standard cells.]
8 
9  Synopsis []
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: amapMatch.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "amapInt.h"
22 
24 
25 
26 ////////////////////////////////////////////////////////////////////////
27 /// DECLARATIONS ///
28 ////////////////////////////////////////////////////////////////////////
29 
30 ////////////////////////////////////////////////////////////////////////
31 /// FUNCTION DEFINITIONS ///
32 ////////////////////////////////////////////////////////////////////////
33 
34 /**Function*************************************************************
35 
36  Synopsis [Duplicates the cut using new memory manager.]
37 
38  Description []
39 
40  SideEffects []
41 
42  SeeAlso []
43 
44 ***********************************************************************/
46 {
47  Amap_Cut_t * pNew;
48  int nBytes = sizeof(Amap_Cut_t) + sizeof(int) * pCut->nFans;
49  pNew = (Amap_Cut_t *)Aig_MmFlexEntryFetch( p->pMemCutBest, nBytes );
50  memcpy( pNew, pCut, nBytes );
51  return pNew;
52 }
53 
54 /**Function*************************************************************
55 
56  Synopsis [Starts the match with cut and set.]
57 
58  Description []
59 
60  SideEffects []
61 
62  SeeAlso []
63 
64 ***********************************************************************/
65 static inline void Amap_ManMatchStart( Amap_Mat_t * p, Amap_Cut_t * pCut, Amap_Set_t * pSet )
66 {
67  memset( p, 0, sizeof(Amap_Mat_t) );
68  p->pCut = pCut;
69  p->pSet = pSet;
70 }
71 
72 /**Function*************************************************************
73 
74  Synopsis [Cleans reference counters.]
75 
76  Description []
77 
78  SideEffects []
79 
80  SeeAlso []
81 
82 ***********************************************************************/
84 {
85  Amap_Obj_t * pObj;
86  int i;
87  Amap_ManForEachObj( p, pObj, i )
88  pObj->nFouts[0] = pObj->nFouts[1] = 0;
89 }
90 
91 /**Function*************************************************************
92 
93  Synopsis [Computes delay.]
94 
95  Description []
96 
97  SideEffects []
98 
99  SeeAlso []
100 
101 ***********************************************************************/
103 {
104  Amap_Obj_t * pObj;
105  float Delay = 0.0;
106  int i;
107  Amap_ManForEachPo( p, pObj, i )
108  Delay = Abc_MaxInt( Delay, Amap_ObjFanin0(p,pObj)->Best.Delay );
109  return Delay;
110 }
111 
112 /**Function*************************************************************
113 
114  Synopsis [Cleans reference counters.]
115 
116  Description []
117 
118  SideEffects []
119 
120  SeeAlso []
121 
122 ***********************************************************************/
124 {
125  Amap_Obj_t * pObj;
126  int i;
127 // Amap_ManForEachNode( p, pObj, i )
128 // ABC_FREE( pObj->pData );
129  Amap_ManForEachObj( p, pObj, i )
130  pObj->pData = NULL;
131 }
132 
133 /**Function*************************************************************
134 
135  Synopsis [Compute nodes used in the mapping.]
136 
137  Description []
138 
139  SideEffects []
140 
141  SeeAlso []
142 
143 ***********************************************************************/
144 float Amap_ManComputeMapping_rec( Amap_Man_t * p, Amap_Obj_t * pObj, int fCompl )
145 {
146  Amap_Mat_t * pM = &pObj->Best;
147  Amap_Obj_t * pFanin;
148  Amap_Gat_t * pGate;
149  int i, iFanin, fComplFanin;
150  float Area;
151  if ( pObj->nFouts[fCompl]++ + pObj->nFouts[!fCompl] > 0 )
152  return 0.0;
153  if ( Amap_ObjIsPi(pObj) || Amap_ObjIsConst1(pObj) )
154  return 0.0;
155  pGate = Amap_LibGate( p->pLib, pM->pSet->iGate );
156  assert( pGate->nPins == pM->pCut->nFans );
157  Area = pGate->dArea;
158  for ( i = 0; i < (int)pGate->nPins; i++ )
159  {
160  iFanin = Abc_Lit2Var( pM->pSet->Ins[i] );
161  pFanin = Amap_ManObj( p, Abc_Lit2Var(pM->pCut->Fans[iFanin]) );
162  fComplFanin = Abc_LitIsCompl( pM->pSet->Ins[i] ) ^ Abc_LitIsCompl( pM->pCut->Fans[iFanin] );
163  Area += Amap_ManComputeMapping_rec( p, pFanin, fComplFanin );
164  }
165  return Area;
166 }
167 
168 /**Function*************************************************************
169 
170  Synopsis [Compute nodes used in the mapping.]
171 
172  Description []
173 
174  SideEffects []
175 
176  SeeAlso []
177 
178 ***********************************************************************/
180 {
181  Amap_Obj_t * pObj;
182  float Area = 0.0;
183  int i;
184  Amap_ManCleanRefs( p );
185  Amap_ManForEachPo( p, pObj, i )
186  Area += Amap_ManComputeMapping_rec( p, Amap_ObjFanin0(p, pObj), Amap_ObjFaninC0(pObj) );
187  return Area;
188 }
189 
190 /**Function*************************************************************
191 
192  Synopsis [Counts the number of inverters to be added.]
193 
194  Description [Should be called after mapping has been set.]
195 
196  SideEffects []
197 
198  SeeAlso []
199 
200 ***********************************************************************/
202 {
203  Amap_Obj_t * pObj;
204  int i, Counter = 0;
205  Amap_ManForEachObj( p, pObj, i )
206  Counter += (int)(pObj->nFouts[!pObj->fPolar] > 0);
207  return Counter;
208 }
209 
210 /**Function*************************************************************
211 
212  Synopsis [Compare two matches.]
213 
214  Description []
215 
216  SideEffects []
217 
218  SeeAlso []
219 
220 ***********************************************************************/
221 static inline int Amap_CutCompareDelay( Amap_Man_t * p, Amap_Mat_t * pM0, Amap_Mat_t * pM1 )
222 {
223  // compare delay
224  if ( pM0->Delay < pM1->Delay - p->pPars->fEpsilon )
225  return -1;
226  if ( pM0->Delay > pM1->Delay + p->pPars->fEpsilon )
227  return 1;
228 
229  // compare area flows
230  if ( pM0->Area < pM1->Area - p->pPars->fEpsilon )
231  return -1;
232  if ( pM0->Area > pM1->Area + p->pPars->fEpsilon )
233  return 1;
234 
235  // compare average fanouts
236  if ( pM0->AveFan > pM1->AveFan - p->pPars->fEpsilon )
237  return -1;
238  if ( pM0->AveFan < pM1->AveFan + p->pPars->fEpsilon )
239  return 1;
240  return 1;
241 }
242 static inline int Amap_CutCompareArea( Amap_Man_t * p, Amap_Mat_t * pM0, Amap_Mat_t * pM1 )
243 {
244  // compare area flows
245  if ( pM0->Area < pM1->Area - p->pPars->fEpsilon )
246  return -1;
247  if ( pM0->Area > pM1->Area + p->pPars->fEpsilon )
248  return 1;
249 
250  // compare average fanouts
251  if ( pM0->AveFan > pM1->AveFan - p->pPars->fEpsilon )
252  return -1;
253  if ( pM0->AveFan < pM1->AveFan + p->pPars->fEpsilon )
254  return 1;
255 
256  // compare delay
257  if ( pM0->Delay < pM1->Delay - p->pPars->fEpsilon )
258  return -1;
259  if ( pM0->Delay > pM1->Delay + p->pPars->fEpsilon )
260  return 1;
261  return 1;
262 }
263 
264 /**Function*************************************************************
265 
266  Synopsis [Counts area while dereferencing the match.]
267 
268  Description []
269 
270  SideEffects []
271 
272  SeeAlso []
273 
274 ***********************************************************************/
275 static inline float Amap_CutAreaDeref( Amap_Man_t * p, Amap_Mat_t * pM )
276 {
277  Amap_Obj_t * pFanin;
278  int i, fCompl;
279  float Area = Amap_LibGate( p->pLib, pM->pSet->iGate )->dArea;
280  Amap_MatchForEachFaninCompl( p, pM, pFanin, fCompl, i )
281  {
282  assert( Amap_ObjRefsTotal(pFanin) > 0 );
283  if ( (int)pFanin->fPolar != fCompl && pFanin->nFouts[fCompl] == 1 )
284  Area += p->fAreaInv;
285  if ( --pFanin->nFouts[fCompl] + pFanin->nFouts[!fCompl] == 0 && Amap_ObjIsNode(pFanin) )
286  Area += Amap_CutAreaDeref( p, &pFanin->Best );
287  }
288  return Area;
289 }
290 
291 /**Function*************************************************************
292 
293  Synopsis [Counts area while referencing the match.]
294 
295  Description []
296 
297  SideEffects []
298 
299  SeeAlso []
300 
301 ***********************************************************************/
302 static inline float Amap_CutAreaRef( Amap_Man_t * p, Amap_Mat_t * pM )
303 {
304  Amap_Obj_t * pFanin;
305  int i, fCompl;
306  float Area = Amap_LibGate( p->pLib, pM->pSet->iGate )->dArea;
307  Amap_MatchForEachFaninCompl( p, pM, pFanin, fCompl, i )
308  {
309  assert( Amap_ObjRefsTotal(pFanin) >= 0 );
310  if ( (int)pFanin->fPolar != fCompl && pFanin->nFouts[fCompl] == 0 )
311  Area += p->fAreaInv;
312  if ( pFanin->nFouts[fCompl]++ + pFanin->nFouts[!fCompl] == 0 && Amap_ObjIsNode(pFanin) )
313  Area += Amap_CutAreaRef( p, &pFanin->Best );
314  }
315  return Area;
316 }
317 
318 /**Function*************************************************************
319 
320  Synopsis [Derives area of the match for a non-referenced node.]
321 
322  Description []
323 
324  SideEffects []
325 
326  SeeAlso []
327 
328 ***********************************************************************/
329 static inline float Amap_CutAreaDerefed( Amap_Man_t * p, Amap_Obj_t * pNode, Amap_Mat_t * pM )
330 {
331  float aResult, aResult2;
332  int fComplNew;
333  aResult2 = Amap_CutAreaRef( p, pM );
334  aResult = Amap_CutAreaDeref( p, pM );
335  assert( aResult > aResult2 - p->fEpsilonInternal );
336  assert( aResult < aResult2 + p->fEpsilonInternal );
337  // if node is needed in another polarity, add inverter
338  fComplNew = pM->pCut->fInv ^ pM->pSet->fInv;
339  if ( pNode->nFouts[fComplNew] == 0 && pNode->nFouts[!fComplNew] > 0 )
340  aResult += p->fAreaInv;
341  return aResult;
342 }
343 
344 /**Function*************************************************************
345 
346  Synopsis []
347 
348  Description []
349 
350  SideEffects []
351 
352  SeeAlso []
353 
354 ***********************************************************************/
355 static inline void Amap_CutAreaTest( Amap_Man_t * p, Amap_Obj_t * pNode )
356 {
357  float aResult, aResult2;
358  if ( Amap_ObjRefsTotal(pNode) == 0 )
359  {
360  aResult2 = Amap_CutAreaRef( p, &pNode->Best );
361  aResult = Amap_CutAreaDeref( p, &pNode->Best );
362  assert( aResult > aResult2 - p->fEpsilonInternal );
363  assert( aResult < aResult2 + p->fEpsilonInternal );
364  }
365  else
366  {
367  aResult = Amap_CutAreaDeref( p, &pNode->Best );
368  aResult2 = Amap_CutAreaRef( p, &pNode->Best );
369  assert( aResult > aResult2 - p->fEpsilonInternal );
370  assert( aResult < aResult2 + p->fEpsilonInternal );
371  }
372 }
373 
374 /**Function*************************************************************
375 
376  Synopsis [Derives parameters for the match.]
377 
378  Description []
379 
380  SideEffects []
381 
382  SeeAlso []
383 
384 ***********************************************************************/
385 static inline void Amap_ManMatchGetFlows( Amap_Man_t * p, Amap_Mat_t * pM )
386 {
387  Amap_Mat_t * pMFanin;
388  Amap_Obj_t * pFanin;
389  Amap_Gat_t * pGate;
390  int i;
391  pGate = Amap_LibGate( p->pLib, pM->pSet->iGate );
392  assert( pGate->nPins == pM->pCut->nFans );
393  assert( pM->Area == 0.0 );
394  pM->Area = pGate->dArea;
395  pM->AveFan = 0.0;
396  pM->Delay = 0.0;
397  Amap_MatchForEachFanin( p, pM, pFanin, i )
398  {
399  pMFanin = &pFanin->Best;
400  pM->Delay = Abc_MaxInt( pM->Delay, pMFanin->Delay );
401  pM->AveFan += Amap_ObjRefsTotal(pFanin);
402  if ( Amap_ObjRefsTotal(pFanin) == 0 )
403  pM->Area += pMFanin->Area;
404  else
405  pM->Area += pMFanin->Area / pFanin->EstRefs;
406  }
407  pM->AveFan /= pGate->nPins;
408  pM->Delay += 1.0;
409 }
410 
411 /**Function*************************************************************
412 
413  Synopsis [Derives parameters for the match.]
414 
415  Description []
416 
417  SideEffects []
418 
419  SeeAlso []
420 
421 ***********************************************************************/
422 static inline void Amap_ManMatchGetExacts( Amap_Man_t * p, Amap_Obj_t * pNode, Amap_Mat_t * pM )
423 {
424  Amap_Mat_t * pMFanin;
425  Amap_Obj_t * pFanin;
426  Amap_Gat_t * pGate;
427  int i;
428  pGate = Amap_LibGate( p->pLib, pM->pSet->iGate );
429  assert( pGate->nPins == pM->pCut->nFans );
430  assert( pM->Area == 0.0 );
431  pM->AveFan = 0.0;
432  pM->Delay = 0.0;
433  Amap_MatchForEachFanin( p, pM, pFanin, i )
434  {
435  pMFanin = &pFanin->Best;
436  pM->Delay = Abc_MaxInt( pM->Delay, pMFanin->Delay );
437  pM->AveFan += Amap_ObjRefsTotal(pFanin);
438  }
439  pM->AveFan /= pGate->nPins;
440  pM->Delay += 1.0;
441  pM->Area = Amap_CutAreaDerefed( p, pNode, pM );
442 }
443 
444 /**Function*************************************************************
445 
446  Synopsis [Computes the best match at each node.]
447 
448  Description []
449 
450  SideEffects []
451 
452  SeeAlso []
453 
454 ***********************************************************************/
455 void Amap_ManMatchNode( Amap_Man_t * p, Amap_Obj_t * pNode, int fFlow, int fRefs )
456 {
457  int fVerbose = 0; //(pNode->Level == 2 || pNode->Level == 4);
458  int fVeryVerbose = fVerbose;
459 
460  Amap_Mat_t MA = {0}, MD = {0}, M = {0};
461  Amap_Mat_t * pMBestA = &MA, * pMBestD = &MD, * pMThis = &M, * pMBest;
462  Amap_Cut_t * pCut;
463  Amap_Set_t * pSet;
464  Amap_Nod_t * pNod;
465  int i;
466 
467  if ( fRefs )
468  pNode->EstRefs = (float)((2.0 * pNode->EstRefs + Amap_ObjRefsTotal(pNode)) / 3.0);
469  else
470  pNode->EstRefs = (float)pNode->nRefs;
471  if ( fRefs && Amap_ObjRefsTotal(pNode) > 0 )
472  Amap_CutAreaDeref( p, &pNode->Best );
473 
474  if ( fVerbose )
475  printf( "\nNode %d (%d)\n", pNode->Id, pNode->Level );
476 
477  pMBestA->pCut = pMBestD->pCut = NULL;
478  Amap_NodeForEachCut( pNode, pCut, i )
479  {
480  if ( pCut->iMat == 0 )
481  continue;
482  pNod = Amap_LibNod( p->pLib, pCut->iMat );
483  Amap_LibNodeForEachSet( pNod, pSet )
484  {
485  Amap_ManMatchStart( pMThis, pCut, pSet );
486  if ( fFlow )
487  Amap_ManMatchGetFlows( p, pMThis );
488  else
489  Amap_ManMatchGetExacts( p, pNode, pMThis );
490  if ( pMBestD->pCut == NULL || Amap_CutCompareDelay(p, pMBestD, pMThis) == 1 )
491  *pMBestD = *pMThis;
492  if ( pMBestA->pCut == NULL || Amap_CutCompareArea(p, pMBestA, pMThis) == 1 )
493  *pMBestA = *pMThis;
494 
495  if ( fVeryVerbose )
496  {
497  printf( "Cut %2d (%d) : ", i, pCut->nFans );
498  printf( "Gate %10s ", Amap_LibGate(p->pLib, pMThis->pSet->iGate)->pName );
499  printf( "%s ", pMThis->pSet->fInv ? "inv" : " " );
500  printf( "Delay %5.2f ", pMThis->Delay );
501  printf( "Area %5.2f ", pMThis->Area );
502  printf( "\n" );
503  }
504  }
505  }
506 
507  if ( Abc_AbsFloat(pMBestA->Area - pMBestD->Area) / pMBestD->Area >= p->pPars->fADratio * Abc_AbsFloat(pMBestA->Delay - pMBestD->Delay) / pMBestA->Delay )
508  pMBest = pMBestA;
509  else
510  pMBest = pMBestD;
511 
512  if ( fVerbose )
513  {
514  printf( "BEST MATCHA: " );
515  printf( "Gate %10s ", Amap_LibGate(p->pLib, pMBestA->pSet->iGate)->pName );
516  printf( "%s ", pMBestA->pSet->fInv ? "inv" : " " );
517  printf( "Delay %5.2f ", pMBestA->Delay );
518  printf( "Area %5.2f ", pMBestA->Area );
519  printf( "\n" );
520 
521  printf( "BEST MATCHD: " );
522  printf( "Gate %10s ", Amap_LibGate(p->pLib, pMBestD->pSet->iGate)->pName );
523  printf( "%s ", pMBestD->pSet->fInv ? "inv" : " " );
524  printf( "Delay %5.2f ", pMBestD->Delay );
525  printf( "Area %5.2f ", pMBestD->Area );
526  printf( "\n" );
527 
528  printf( "BEST MATCH : " );
529  printf( "Gate %10s ", Amap_LibGate(p->pLib, pMBest->pSet->iGate)->pName );
530  printf( "%s ", pMBest->pSet->fInv ? "inv" : " " );
531  printf( "Delay %5.2f ", pMBest->Delay );
532  printf( "Area %5.2f ", pMBest->Area );
533  printf( "\n" );
534  }
535 
536  pNode->fPolar = pMBest->pCut->fInv ^ pMBest->pSet->fInv;
537  pNode->Best = *pMBest;
538  pNode->Best.pCut = Amap_ManDupCut( p, pNode->Best.pCut );
539  if ( fRefs && Amap_ObjRefsTotal(pNode) > 0 )
540  Amap_CutAreaRef( p, &pNode->Best );
541 }
542 
543 /**Function*************************************************************
544 
545  Synopsis [Performs one round of mapping.]
546 
547  Description []
548 
549  SideEffects []
550 
551  SeeAlso []
552 
553 ***********************************************************************/
554 void Amap_ManMatch( Amap_Man_t * p, int fFlow, int fRefs )
555 {
556  Aig_MmFlex_t * pMemOld;
557  Amap_Obj_t * pObj;
558  float Area;
559  int i, nInvs;
560  abctime clk = Abc_Clock();
561  pMemOld = p->pMemCutBest;
563  Amap_ManForEachNode( p, pObj, i )
564  if ( pObj->pData )
565  Amap_ManMatchNode( p, pObj, fFlow, fRefs );
566  Aig_MmFlexStop( pMemOld, 0 );
567  Area = Amap_ManComputeMapping( p );
568  nInvs = Amap_ManCountInverters( p );
569 if ( p->pPars->fVerbose )
570 {
571  printf( "Area =%9.2f. Gate =%9.2f. Inv =%9.2f. (%6d.) Delay =%6.2f. ",
572  Area + nInvs * p->fAreaInv,
573  Area, nInvs * p->fAreaInv, nInvs,
574  Amap_ManMaxDelay(p) );
575 ABC_PRT( "Time ", Abc_Clock() - clk );
576 }
577  // test procedures
578 // Amap_ManForEachNode( p, pObj, i )
579 // Amap_CutAreaTest( p, pObj );
580 }
581 
582 /**Function*************************************************************
583 
584  Synopsis [Performs mapping.]
585 
586  Description []
587 
588  SideEffects []
589 
590  SeeAlso []
591 
592 ***********************************************************************/
594 {
595  int i;
596  Amap_ManMerge( p );
597  for ( i = 0; i < p->pPars->nIterFlow; i++ )
598  Amap_ManMatch( p, 1, i>0 );
599  for ( i = 0; i < p->pPars->nIterArea; i++ )
600  Amap_ManMatch( p, 0, p->pPars->nIterFlow>0||i>0 );
601 /*
602  for ( i = 0; i < p->pPars->nIterFlow; i++ )
603  Amap_ManMatch( p, 1, 1 );
604  for ( i = 0; i < p->pPars->nIterArea; i++ )
605  Amap_ManMatch( p, 0, 1 );
606 */
607  Amap_ManCleanData( p );
608 }
609 
610 ////////////////////////////////////////////////////////////////////////
611 /// END OF FILE ///
612 ////////////////////////////////////////////////////////////////////////
613 
614 
616 
char * memset()
void Amap_ManMerge(Amap_Man_t *p)
Definition: amapMerge.c:514
static Amap_Gat_t * Amap_LibGate(Amap_Lib_t *p, int i)
Definition: amapInt.h:263
float EstRefs
Definition: amapInt.h:216
static float Abc_AbsFloat(float a)
Definition: abc_global.h:242
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define Amap_NodeForEachCut(pNode, pCut, i)
Definition: amapInt.h:300
Amap_Mat_t Best
Definition: amapInt.h:218
unsigned fInv
Definition: amapInt.h:168
static Amap_Obj_t * Amap_ObjFanin0(Amap_Man_t *p, Amap_Obj_t *pObj)
Definition: amapInt.h:248
static float Amap_CutAreaDeref(Amap_Man_t *p, Amap_Mat_t *pM)
Definition: amapMatch.c:275
void Amap_ManCleanRefs(Amap_Man_t *p)
Definition: amapMatch.c:83
static int Amap_CutCompareArea(Amap_Man_t *p, Amap_Mat_t *pM0, Amap_Mat_t *pM1)
Definition: amapMatch.c:242
int nFouts[2]
Definition: amapInt.h:217
ABC_NAMESPACE_IMPL_START Amap_Cut_t * Amap_ManDupCut(Amap_Man_t *p, Amap_Cut_t *pCut)
DECLARATIONS ///.
Definition: amapMatch.c:45
#define Amap_MatchForEachFaninCompl(p, pM, pFanin, fCompl, i)
Definition: amapInt.h:309
char * Aig_MmFlexEntryFetch(Aig_MmFlex_t *p, int nBytes)
Definition: aigMem.c:366
unsigned Level
Definition: amapInt.h:206
unsigned Id
Definition: amapInt.h:201
char * memcpy()
static void Amap_CutAreaTest(Amap_Man_t *p, Amap_Obj_t *pNode)
Definition: amapMatch.c:355
int nIterArea
Definition: amap.h:48
float AveFan
Definition: amapInt.h:195
#define Amap_ManForEachObj(p, pObj, i)
Definition: amapInt.h:286
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
word M(word f1, word f2, int n)
Definition: kitPerm.c:240
Aig_MmFlex_t * pMemCutBest
Definition: amapInt.h:91
static int Amap_ObjIsPi(Amap_Obj_t *pObj)
Definition: amapInt.h:240
#define Amap_ManForEachNode(p, pObj, i)
Definition: amapInt.h:289
Amap_Cut_t * pCut
Definition: amapInt.h:192
float Amap_ManMaxDelay(Amap_Man_t *p)
Definition: amapMatch.c:102
static int Amap_ObjIsNode(Amap_Obj_t *pObj)
Definition: amapInt.h:245
static int Amap_ObjRefsTotal(Amap_Obj_t *pObj)
Definition: amapInt.h:261
int fVerbose
Definition: amap.h:55
static void Amap_ManMatchStart(Amap_Mat_t *p, Amap_Cut_t *pCut, Amap_Set_t *pSet)
Definition: amapMatch.c:65
static int Abc_LitIsCompl(int Lit)
Definition: abc_global.h:265
void * pData
Definition: amapInt.h:212
float fAreaInv
Definition: amapInt.h:82
char Ins[AMAP_MAXINS]
Definition: amapInt.h:170
int nRefs
Definition: amapInt.h:208
Amap_Lib_t * pLib
Definition: amapInt.h:79
float Delay
Definition: amapInt.h:196
void Amap_ManCleanData(Amap_Man_t *p)
Definition: amapMatch.c:123
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
if(last==0)
Definition: sparse_int.h:34
static int Amap_ObjIsConst1(Amap_Obj_t *pObj)
Definition: amapInt.h:239
static int Counter
unsigned fInv
Definition: amapInt.h:186
unsigned nPins
Definition: amapInt.h:161
float Area
Definition: amapInt.h:194
double dArea
Definition: amapInt.h:156
#define Amap_LibNodeForEachSet(pNod, pSet)
Definition: amapInt.h:305
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
static Amap_Obj_t * Amap_ManObj(Amap_Man_t *p, int i)
Definition: amapInt.h:237
unsigned nFans
Definition: amapInt.h:187
float Amap_ManComputeMapping_rec(Amap_Man_t *p, Amap_Obj_t *pObj, int fCompl)
Definition: amapMatch.c:144
static float Amap_CutAreaDerefed(Amap_Man_t *p, Amap_Obj_t *pNode, Amap_Mat_t *pM)
Definition: amapMatch.c:329
int nIterFlow
Definition: amap.h:47
Aig_MmFlex_t * Aig_MmFlexStart()
Definition: aigMem.c:305
static void Amap_ManMatchGetExacts(Amap_Man_t *p, Amap_Obj_t *pNode, Amap_Mat_t *pM)
Definition: amapMatch.c:422
Amap_Par_t * pPars
Definition: amapInt.h:78
unsigned iMat
Definition: amapInt.h:185
#define ABC_PRT(a, t)
Definition: abc_global.h:220
void Aig_MmFlexStop(Aig_MmFlex_t *p, int fVerbose)
Definition: aigMem.c:337
struct Amap_Cut_t_ Amap_Cut_t
Definition: amapInt.h:72
static int Abc_Lit2Var(int Lit)
Definition: abc_global.h:264
int Amap_ManCountInverters(Amap_Man_t *p)
Definition: amapMatch.c:201
static void Amap_ManMatchGetFlows(Amap_Man_t *p, Amap_Mat_t *pM)
Definition: amapMatch.c:385
#define Amap_MatchForEachFanin(p, pM, pFanin, i)
Definition: amapInt.h:316
unsigned iGate
Definition: amapInt.h:167
#define assert(ex)
Definition: util_old.h:213
void Amap_ManMap(Amap_Man_t *p)
Definition: amapMatch.c:593
static float Amap_CutAreaRef(Amap_Man_t *p, Amap_Mat_t *pM)
Definition: amapMatch.c:302
static int Amap_ObjFaninC0(Amap_Obj_t *pObj)
Definition: amapInt.h:251
unsigned fPolar
Definition: amapInt.h:205
Amap_Set_t * pSet
Definition: amapInt.h:193
char * pName
Definition: amapInt.h:154
static Amap_Nod_t * Amap_LibNod(Amap_Lib_t *p, int i)
Definition: amapInt.h:264
void Amap_ManMatch(Amap_Man_t *p, int fFlow, int fRefs)
Definition: amapMatch.c:554
ABC_INT64_T abctime
Definition: abc_global.h:278
void Amap_ManMatchNode(Amap_Man_t *p, Amap_Obj_t *pNode, int fFlow, int fRefs)
Definition: amapMatch.c:455
float Amap_ManComputeMapping(Amap_Man_t *p)
Definition: amapMatch.c:179
int Fans[0]
Definition: amapInt.h:188
#define Amap_ManForEachPo(p, pObj, i)
Definition: amapInt.h:283
static int Amap_CutCompareDelay(Amap_Man_t *p, Amap_Mat_t *pM0, Amap_Mat_t *pM1)
Definition: amapMatch.c:221
float fEpsilon
Definition: amap.h:53
float fEpsilonInternal
Definition: amapInt.h:81
float fADratio
Definition: amap.h:54