abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mapperCreate.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [mapperCreate.c]
4 
5  PackageName [MVSIS 1.3: Multi-valued logic synthesis system.]
6 
7  Synopsis [Generic technology mapping engine.]
8 
9  Author [MVSIS Group]
10 
11  Affiliation [UC Berkeley]
12 
13  Date [Ver. 2.0. Started - June 1, 2004.]
14 
15  Revision [$Id: mapperCreate.c,v 1.15 2005/02/28 05:34:26 alanmi Exp $]
16 
17 ***********************************************************************/
18 
19 #include "mapperInt.h"
20 
22 
23 
24 ////////////////////////////////////////////////////////////////////////
25 /// DECLARATIONS ///
26 ////////////////////////////////////////////////////////////////////////
27 
28 static void Map_TableCreate( Map_Man_t * p );
29 static void Map_TableResize( Map_Man_t * p );
30 
31 // hash key for the structural hash table
32 static inline unsigned Map_HashKey2( Map_Node_t * p0, Map_Node_t * p1, int TableSize ) { return (unsigned)(((ABC_PTRUINT_T)(p0) + (ABC_PTRUINT_T)(p1) * 12582917) % TableSize); }
33 
34 ////////////////////////////////////////////////////////////////////////
35 /// FUNCTION DEFINITIONS ///
36 ////////////////////////////////////////////////////////////////////////
37 
38 /**Function*************************************************************
39 
40  Synopsis [Reads parameters from the mapping manager.]
41 
42  Description []
43 
44  SideEffects []
45 
46  SeeAlso []
47 
48 ***********************************************************************/
49 int Map_ManReadInputNum( Map_Man_t * p ) { return p->nInputs; }
50 int Map_ManReadOutputNum( Map_Man_t * p ) { return p->nOutputs; }
51 int Map_ManReadBufNum( Map_Man_t * p ) { return Map_NodeVecReadSize(p->vMapBufs); }
52 Map_Node_t ** Map_ManReadInputs ( Map_Man_t * p ) { return p->pInputs; }
53 Map_Node_t ** Map_ManReadOutputs( Map_Man_t * p ) { return p->pOutputs; }
54 Map_Node_t ** Map_ManReadBufs( Map_Man_t * p ) { return Map_NodeVecReadArray(p->vMapBufs); }
55 Map_Node_t * Map_ManReadBufDriver( Map_Man_t * p, int i ) { return Map_ManReadBufs(p)[i]->p1; }
56 Map_Node_t * Map_ManReadConst1 ( Map_Man_t * p ) { return p->pConst1; }
57 Map_Time_t * Map_ManReadInputArrivals( Map_Man_t * p ) { return p->pInputArrivals; }
58 Map_Time_t * Map_ManReadOutputRequireds( Map_Man_t * p ) { return p->pOutputRequireds; }
59 Mio_Library_t * Map_ManReadGenLib ( Map_Man_t * p ) { return p->pSuperLib->pGenlib; }
60 int Map_ManReadVerbose( Map_Man_t * p ) { return p->fVerbose; }
61 float Map_ManReadAreaFinal( Map_Man_t * p ) { return p->AreaFinal; }
62 float Map_ManReadRequiredGlo( Map_Man_t * p ) { return p->fRequiredGlo; }
63 void Map_ManSetOutputNames( Map_Man_t * p, char ** ppNames ) { p->ppOutputNames = ppNames;}
64 void Map_ManSetAreaRecovery( Map_Man_t * p, int fAreaRecovery ) { p->fAreaRecovery = fAreaRecovery;}
65 void Map_ManSetDelayTarget( Map_Man_t * p, float DelayTarget ) { p->DelayTarget = DelayTarget;}
66 void Map_ManSetInputArrivals( Map_Man_t * p, Map_Time_t * pArrivals ) { p->pInputArrivals = pArrivals; }
67 void Map_ManSetOutputRequireds( Map_Man_t * p, Map_Time_t * pRequireds ) { p->pOutputRequireds = pRequireds; }
68 void Map_ManSetObeyFanoutLimits( Map_Man_t * p, int fObeyFanoutLimits ) { p->fObeyFanoutLimits = fObeyFanoutLimits; }
69 void Map_ManSetNumIterations( Map_Man_t * p, int nIterations ) { p->nIterations = nIterations; }
70 int Map_ManReadFanoutViolations( Map_Man_t * p ) { return p->nFanoutViolations; }
71 void Map_ManSetFanoutViolations( Map_Man_t * p, int nVio ) { p->nFanoutViolations = nVio; }
72 void Map_ManSetChoiceNodeNum( Map_Man_t * p, int nChoiceNodes ) { p->nChoiceNodes = nChoiceNodes; }
73 void Map_ManSetChoiceNum( Map_Man_t * p, int nChoices ) { p->nChoices = nChoices; }
74 void Map_ManSetVerbose( Map_Man_t * p, int fVerbose ) { p->fVerbose = fVerbose; }
75 void Map_ManSetSwitching( Map_Man_t * p, int fSwitching ) { p->fSwitching = fSwitching; }
76 
77 /**Function*************************************************************
78 
79  Synopsis [Reads parameters from the mapping node.]
80 
81  Description []
82 
83  SideEffects []
84 
85  SeeAlso []
86 
87 ***********************************************************************/
88 Map_Man_t * Map_NodeReadMan( Map_Node_t * p ) { return p->p; }
89 char * Map_NodeReadData( Map_Node_t * p, int fPhase ) { return fPhase? p->pData1 : p->pData0; }
90 int Map_NodeReadNum( Map_Node_t * p ) { return p->Num; }
91 int Map_NodeReadLevel( Map_Node_t * p ) { return Map_Regular(p)->Level; }
93 Map_Cut_t * Map_NodeReadCutBest( Map_Node_t * p, int fPhase ) { return p->pCutBest[fPhase]; }
94 Map_Node_t * Map_NodeReadOne( Map_Node_t * p ) { return p->p1; }
95 Map_Node_t * Map_NodeReadTwo( Map_Node_t * p ) { return p->p2; }
96 void Map_NodeSetData( Map_Node_t * p, int fPhase, char * pData ) { if (fPhase) p->pData1 = pData; else p->pData0 = pData; }
97 void Map_NodeSetNextE( Map_Node_t * p, Map_Node_t * pNextE ) { p->pNextE = pNextE; }
98 void Map_NodeSetRepr( Map_Node_t * p, Map_Node_t * pRepr ) { p->pRepr = pRepr; }
99 void Map_NodeSetSwitching( Map_Node_t * p, float Switching ) { p->Switching = Switching; }
100 
101 /**Function*************************************************************
102 
103  Synopsis [Checks the type of the node.]
104 
105  Description []
106 
107  SideEffects []
108 
109  SeeAlso []
110 
111 ***********************************************************************/
112 int Map_NodeIsConst( Map_Node_t * p ) { return (Map_Regular(p))->Num == -1; }
113 int Map_NodeIsVar( Map_Node_t * p ) { return (Map_Regular(p))->p1 == NULL && (Map_Regular(p))->Num >= 0; }
114 int Map_NodeIsBuf( Map_Node_t * p ) { return (Map_Regular(p))->p1 != NULL && (Map_Regular(p))->p2 == NULL; }
115 int Map_NodeIsAnd( Map_Node_t * p ) { return (Map_Regular(p))->p1 != NULL && (Map_Regular(p))->p2 != NULL; }
116 int Map_NodeComparePhase( Map_Node_t * p1, Map_Node_t * p2 ) { assert( !Map_IsComplement(p1) ); assert( !Map_IsComplement(p2) ); return p1->fInv ^ p2->fInv; }
117 
118 /**Function*************************************************************
119 
120  Synopsis [Reads parameters from the cut.]
121 
122  Description []
123 
124  SideEffects []
125 
126  SeeAlso []
127 
128 ***********************************************************************/
129 Map_Super_t * Map_CutReadSuperBest( Map_Cut_t * p, int fPhase ) { return p->M[fPhase].pSuperBest;}
132 int Map_CutReadLeavesNum( Map_Cut_t * p ) { return p->nLeaves; }
134 unsigned Map_CutReadPhaseBest( Map_Cut_t * p, int fPhase ) { return p->M[fPhase].uPhaseBest;}
135 unsigned Map_CutReadPhase0( Map_Cut_t * p ) { return p->M[0].uPhaseBest;}
136 unsigned Map_CutReadPhase1( Map_Cut_t * p ) { return p->M[1].uPhaseBest;}
138 
139 /**Function*************************************************************
140 
141  Synopsis [Reads parameters from the supergate.]
142 
143  Description []
144 
145  SideEffects []
146 
147  SeeAlso []
148 
149 ***********************************************************************/
150 char * Map_SuperReadFormula( Map_Super_t * p ) { return p->pFormula; }
152 int Map_SuperReadNum( Map_Super_t * p ) { return p->Num; }
157 unsigned char * Map_SuperReadPhases( Map_Super_t * p ) { return p->uPhases; }
159 
164 
165 
166 /**Function*************************************************************
167 
168  Synopsis [Create the mapping manager.]
169 
170  Description [The number of inputs and outputs is assumed to be
171  known is advance. It is much simpler to have them fixed upfront.
172  When it comes to representing the object graph in the form of
173  AIG, the resulting manager is similar to the regular AIG manager,
174  except that it does not use reference counting (and therefore
175  does not have garbage collections). It does have table resizing.
176  The data structure is more flexible to represent additional
177  information needed for mapping.]
178 
179  SideEffects []
180 
181  SeeAlso []
182 
183 ***********************************************************************/
184 Map_Man_t * Map_ManCreate( int nInputs, int nOutputs, int fVerbose )
185 {
186  Map_Man_t * p;
187  int i;
188 
189  // derive the supergate library
190  if ( Abc_FrameReadLibSuper() == NULL )
191  {
192  printf( "The supergate library is not specified. Use \"read_super\".\n" );
193  return NULL;
194  }
195 
196  // start the manager
197  p = ABC_ALLOC( Map_Man_t, 1 );
198  memset( p, 0, sizeof(Map_Man_t) );
199  p->pSuperLib = (Map_SuperLib_t *)Abc_FrameReadLibSuper();
200  p->nVarsMax = p->pSuperLib->nVarsMax;
201  p->fVerbose = fVerbose;
202  p->fEpsilon = (float)0.001;
203  assert( p->nVarsMax > 0 );
204 
205  if ( p->nVarsMax == 5 )
206  Extra_Truth4VarN( &p->uCanons, &p->uPhases, &p->pCounters, 8 );
207 
208  // start various data structures
209  Map_TableCreate( p );
210  Map_MappingSetupTruthTables( p->uTruths );
211  Map_MappingSetupTruthTablesLarge( p->uTruthsLarge );
212 // printf( "Node = %d bytes. Cut = %d bytes. Super = %d bytes.\n", sizeof(Map_Node_t), sizeof(Map_Cut_t), sizeof(Map_Super_t) );
213  p->mmNodes = Extra_MmFixedStart( sizeof(Map_Node_t) );
214  p->mmCuts = Extra_MmFixedStart( sizeof(Map_Cut_t) );
215 
216  // make sure the constant node will get index -1
217  p->nNodes = -1;
218  // create the constant node
219  p->pConst1 = Map_NodeCreate( p, NULL, NULL );
220  p->vMapObjs = Map_NodeVecAlloc( 100 );
221  p->vMapBufs = Map_NodeVecAlloc( 100 );
222  p->vVisited = Map_NodeVecAlloc( 100 );
223 
224  // create the PI nodes
225  p->nInputs = nInputs;
226  p->pInputs = ABC_ALLOC( Map_Node_t *, nInputs );
227  for ( i = 0; i < nInputs; i++ )
228  p->pInputs[i] = Map_NodeCreate( p, NULL, NULL );
229 
230  // create the place for the output nodes
231  p->nOutputs = nOutputs;
232  p->pOutputs = ABC_ALLOC( Map_Node_t *, nOutputs );
233  memset( p->pOutputs, 0, sizeof(Map_Node_t *) * nOutputs );
234  return p;
235 }
236 
237 /**Function*************************************************************
238 
239  Synopsis [Deallocates the mapping manager.]
240 
241  Description []
242 
243  SideEffects []
244 
245  SeeAlso []
246 
247 ***********************************************************************/
249 {
250 // int i;
251 // for ( i = 0; i < p->vMapObjs->nSize; i++ )
252 // Map_NodeVecFree( p->vMapObjs->pArray[i]->vFanouts );
253 // Map_NodeVecFree( p->pConst1->vFanouts );
254  Map_NodeVecFree( p->vMapObjs );
255  Map_NodeVecFree( p->vMapBufs );
256  Map_NodeVecFree( p->vVisited );
257  if ( p->uCanons ) ABC_FREE( p->uCanons );
258  if ( p->uPhases ) ABC_FREE( p->uPhases );
259  if ( p->pCounters ) ABC_FREE( p->pCounters );
260  Extra_MmFixedStop( p->mmNodes );
261  Extra_MmFixedStop( p->mmCuts );
262  ABC_FREE( p->pNodeDelays );
263  ABC_FREE( p->pInputArrivals );
264  ABC_FREE( p->pOutputRequireds );
265  ABC_FREE( p->pInputs );
266  ABC_FREE( p->pOutputs );
267  ABC_FREE( p->pBins );
268  ABC_FREE( p->ppOutputNames );
269  ABC_FREE( p );
270 }
271 
272 
273 /**Function*************************************************************
274 
275  Synopsis [Creates node delays.]
276 
277  Description []
278 
279  SideEffects []
280 
281  SeeAlso []
282 
283 ***********************************************************************/
284 void Map_ManCreateNodeDelays( Map_Man_t * p, int LogFan )
285 {
286  Map_Node_t * pNode;
287  int k;
288  assert( p->pNodeDelays == NULL );
289  p->pNodeDelays = ABC_CALLOC( float, p->vMapObjs->nSize );
290  for ( k = 0; k < p->vMapObjs->nSize; k++ )
291  {
292  pNode = p->vMapObjs->pArray[k];
293  if ( pNode->nRefs == 0 )
294  continue;
295  p->pNodeDelays[k] = 0.014426 * LogFan * p->pSuperLib->tDelayInv.Worst * log( (double)pNode->nRefs ); // 1.4426 = 1/ln(2)
296 // printf( "%d = %d (%.2f) ", k, pNode->nRefs, p->pNodeDelays[k] );
297  }
298 // printf( "\n" );
299 }
300 
301 
302 /**Function*************************************************************
303 
304  Synopsis [Deallocates the mapping manager.]
305 
306  Description []
307 
308  SideEffects []
309 
310  SeeAlso []
311 
312 ***********************************************************************/
314 {
315  printf( "N-canonical = %d. Matchings = %d. Phases = %d. ", p->nCanons, p->nMatches, p->nPhases );
316  printf( "Choice nodes = %d. Choices = %d.\n", p->nChoiceNodes, p->nChoices );
317  ABC_PRT( "ToMap", p->timeToMap );
318  ABC_PRT( "Cuts ", p->timeCuts );
319  ABC_PRT( "Truth", p->timeTruth );
320  ABC_PRT( "Match", p->timeMatch );
321  ABC_PRT( "Area ", p->timeArea );
322  ABC_PRT( "Sweep", p->timeSweep );
323  ABC_PRT( "ToNet", p->timeToNet );
324  ABC_PRT( "TOTAL", p->timeTotal );
325  if ( p->time1 ) { ABC_PRT( "time1", p->time1 ); }
326  if ( p->time2 ) { ABC_PRT( "time2", p->time2 ); }
327  if ( p->time3 ) { ABC_PRT( "time3", p->time3 ); }
328 }
329 
330 /**Function*************************************************************
331 
332  Synopsis [Prints the mapping stats.]
333 
334  Description []
335 
336  SideEffects []
337 
338  SeeAlso []
339 
340 ***********************************************************************/
341 void Map_ManPrintStatsToFile( char * pName, float Area, float Delay, abctime Time )
342 {
343  FILE * pTable;
344  pTable = fopen( "map_stats.txt", "a+" );
345  fprintf( pTable, "%s ", pName );
346  fprintf( pTable, "%4.2f ", Area );
347  fprintf( pTable, "%4.2f ", Delay );
348  fprintf( pTable, "%4.2f\n", (float)(Time)/(float)(CLOCKS_PER_SEC) );
349  fclose( pTable );
350 }
351 
352 /**Function*************************************************************
353 
354  Synopsis [Creates a new node.]
355 
356  Description [This procedure should be called to create the constant
357  node and the PI nodes first.]
358 
359  SideEffects []
360 
361  SeeAlso []
362 
363 ***********************************************************************/
365 {
366  Map_Node_t * pNode;
367  // create the node
368  pNode = (Map_Node_t *)Extra_MmFixedEntryFetch( p->mmNodes );
369  memset( pNode, 0, sizeof(Map_Node_t) );
370  pNode->tRequired[0].Rise = pNode->tRequired[0].Fall = pNode->tRequired[0].Worst = MAP_FLOAT_LARGE;
371  pNode->tRequired[1].Rise = pNode->tRequired[1].Fall = pNode->tRequired[1].Worst = MAP_FLOAT_LARGE;
372  pNode->p1 = p1;
373  pNode->p2 = p2;
374  pNode->p = p;
375  // set the number of this node
376  pNode->Num = p->nNodes++;
377  // place to store the fanouts
378 // pNode->vFanouts = Map_NodeVecAlloc( 5 );
379  // store this node in the internal array
380  if ( pNode->Num >= 0 )
381  Map_NodeVecPush( p->vMapObjs, pNode );
382  else
383  pNode->fInv = 1;
384  // set the level of this node
385  if ( p1 )
386  {
387 #ifdef MAP_ALLOCATE_FANOUT
388  // create the fanout info
389  Map_NodeAddFaninFanout( Map_Regular(p1), pNode );
390  if ( p2 )
391  Map_NodeAddFaninFanout( Map_Regular(p2), pNode );
392 #endif
393 
394  if ( p2 )
395  {
396  pNode->Level = 1 + MAP_MAX(Map_Regular(pNode->p1)->Level, Map_Regular(pNode->p2)->Level);
398  }
399  else
400  {
401  pNode->Level = Map_Regular(pNode->p1)->Level;
402  pNode->fInv = Map_NodeIsSimComplement(p1);
403  }
404  }
405  // reference the inputs (will be used to compute the number of fanouts)
406  if ( p1 ) Map_NodeRef(p1);
407  if ( p2 ) Map_NodeRef(p2);
408 
409  pNode->nRefEst[0] = pNode->nRefEst[1] = -1;
410  return pNode;
411 }
412 
413 /**Function*************************************************************
414 
415  Synopsis [Create the unique table of AND gates.]
416 
417  Description []
418 
419  SideEffects []
420 
421  SeeAlso []
422 
423 ***********************************************************************/
425 {
426  assert( pMan->pBins == NULL );
427  pMan->nBins = Abc_PrimeCudd(5000);
428  pMan->pBins = ABC_ALLOC( Map_Node_t *, pMan->nBins );
429  memset( pMan->pBins, 0, sizeof(Map_Node_t *) * pMan->nBins );
430  pMan->nNodes = 0;
431 }
432 
433 /**Function*************************************************************
434 
435  Synopsis [Looks up the AND2 node in the unique table.]
436 
437  Description [This procedure implements one-level hashing. All the nodes
438  are hashed by their children. If the node with the same children was already
439  created, it is returned by the call to this procedure. If it does not exist,
440  this procedure creates a new node with these children. ]
441 
442  SideEffects []
443 
444  SeeAlso []
445 
446 ***********************************************************************/
448 {
449  Map_Node_t * pEnt;
450  unsigned Key;
451 
452  if ( p1 == p2 )
453  return p1;
454  if ( p1 == Map_Not(p2) )
455  return Map_Not(pMan->pConst1);
456  if ( Map_NodeIsConst(p1) )
457  {
458  if ( p1 == pMan->pConst1 )
459  return p2;
460  return Map_Not(pMan->pConst1);
461  }
462  if ( Map_NodeIsConst(p2) )
463  {
464  if ( p2 == pMan->pConst1 )
465  return p1;
466  return Map_Not(pMan->pConst1);
467  }
468 
469  if ( Map_Regular(p1)->Num > Map_Regular(p2)->Num )
470  pEnt = p1, p1 = p2, p2 = pEnt;
471 
472  Key = Map_HashKey2( p1, p2, pMan->nBins );
473  for ( pEnt = pMan->pBins[Key]; pEnt; pEnt = pEnt->pNext )
474  if ( pEnt->p1 == p1 && pEnt->p2 == p2 )
475  return pEnt;
476  // resize the table
477  if ( pMan->nNodes >= 2 * pMan->nBins )
478  {
479  Map_TableResize( pMan );
480  Key = Map_HashKey2( p1, p2, pMan->nBins );
481  }
482  // create the new node
483  pEnt = Map_NodeCreate( pMan, p1, p2 );
484  // add the node to the corresponding linked list in the table
485  pEnt->pNext = pMan->pBins[Key];
486  pMan->pBins[Key] = pEnt;
487  return pEnt;
488 }
489 
490 
491 /**Function*************************************************************
492 
493  Synopsis [Resizes the table.]
494 
495  Description []
496 
497  SideEffects []
498 
499  SeeAlso []
500 
501 ***********************************************************************/
503 {
504  Map_Node_t ** pBinsNew;
505  Map_Node_t * pEnt, * pEnt2;
506  int nBinsNew, Counter, i;
507  abctime clk;
508  unsigned Key;
509 
510 clk = Abc_Clock();
511  // get the new table size
512  nBinsNew = Abc_PrimeCudd(2 * pMan->nBins);
513  // allocate a new array
514  pBinsNew = ABC_ALLOC( Map_Node_t *, nBinsNew );
515  memset( pBinsNew, 0, sizeof(Map_Node_t *) * nBinsNew );
516  // rehash the entries from the old table
517  Counter = 0;
518  for ( i = 0; i < pMan->nBins; i++ )
519  for ( pEnt = pMan->pBins[i], pEnt2 = pEnt? pEnt->pNext: NULL; pEnt;
520  pEnt = pEnt2, pEnt2 = pEnt? pEnt->pNext: NULL )
521  {
522  Key = Map_HashKey2( pEnt->p1, pEnt->p2, nBinsNew );
523  pEnt->pNext = pBinsNew[Key];
524  pBinsNew[Key] = pEnt;
525  Counter++;
526  }
527  assert( Counter == pMan->nNodes - pMan->nInputs );
528  if ( pMan->fVerbose )
529  {
530 // printf( "Increasing the unique table size from %6d to %6d. ", pMan->nBins, nBinsNew );
531 // ABC_PRT( "Time", Abc_Clock() - clk );
532  }
533  // replace the table and the parameters
534  ABC_FREE( pMan->pBins );
535  pMan->pBins = pBinsNew;
536  pMan->nBins = nBinsNew;
537 }
538 
539 
540 
541 /**Function*************************************************************
542 
543  Synopsis []
544 
545  Description []
546 
547  SideEffects []
548 
549  SeeAlso []
550 
551 ***********************************************************************/
553 {
554  Map_Node_t * pNode = Map_NodeCreate( p, p1, NULL );
555  Map_NodeVecPush( p->vMapBufs, pNode );
556  return pNode;
557 }
558 
559 /**Function*************************************************************
560 
561  Synopsis [Sets the node to be equivalent to the given one.]
562 
563  Description [This procedure is a work-around for the equivalence check.
564  Does not verify the equivalence. Use at the user's risk.]
565 
566  SideEffects []
567 
568  SeeAlso []
569 
570 ***********************************************************************/
571 void Map_NodeSetChoice( Map_Man_t * pMan, Map_Node_t * pNodeOld, Map_Node_t * pNodeNew )
572 {
573  pNodeNew->pNextE = pNodeOld->pNextE;
574  pNodeOld->pNextE = pNodeNew;
575  pNodeNew->pRepr = pNodeOld;
576 }
577 
578 
579 
580 ////////////////////////////////////////////////////////////////////////
581 /// END OF FILE ///
582 ////////////////////////////////////////////////////////////////////////
583 
585 
unsigned Map_CutReadPhase0(Map_Cut_t *p)
Definition: mapperCreate.c:135
char * memset()
void Map_NodeAddFaninFanout(Map_Node_t *pFanin, Map_Node_t *pFanout)
Map_Super_t * Map_CutReadSuper0(Map_Cut_t *p)
Definition: mapperCreate.c:130
int Map_NodeVecReadSize(Map_NodeVec_t *p)
Definition: mapperVec.c:122
float Map_SuperLibReadAreaInv(Map_SuperLib_t *p)
Definition: mapperCreate.c:161
static int Abc_PrimeCudd(unsigned int p)
Definition: abc_global.h:383
Map_Man_t * p
Definition: mapperInt.h:204
Map_Super_t * Map_CutReadSuper1(Map_Cut_t *p)
Definition: mapperCreate.c:131
Map_NodeVec_t * Map_NodeVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: mapperVec.c:45
int Map_ManReadBufNum(Map_Man_t *p)
Definition: mapperCreate.c:51
void Map_ManSetFanoutViolations(Map_Man_t *p, int nVio)
Definition: mapperCreate.c:71
Map_Node_t * pNextE
Definition: mapperInt.h:223
Map_Cut_t * Map_NodeReadCutBest(Map_Node_t *p, int fPhase)
Definition: mapperCreate.c:93
#define MAP_FLOAT_LARGE
Definition: mapperInt.h:60
void Map_ManCreateNodeDelays(Map_Man_t *p, int LogFan)
Definition: mapperCreate.c:284
int Map_CutReadLeavesNum(Map_Cut_t *p)
Definition: mapperCreate.c:132
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Node_t * pNext
Definition: mapperInt.h:205
Map_Node_t ** Map_ManReadInputs(Map_Man_t *p)
Definition: mapperCreate.c:52
static unsigned Map_HashKey2(Map_Node_t *p0, Map_Node_t *p1, int TableSize)
Definition: mapperCreate.c:32
float Map_ManReadRequiredGlo(Map_Man_t *p)
Definition: mapperCreate.c:62
Map_Time_t tRequired[2]
Definition: mapperInt.h:236
Map_Cut_t * pCutBest[2]
Definition: mapperInt.h:239
unsigned uPhaseBest
Definition: mapperInt.h:252
unsigned nFanins
Definition: mapperInt.h:280
void Extra_MmFixedStop(Extra_MmFixed_t *p)
void Map_ManSetOutputNames(Map_Man_t *p, char **ppNames)
Definition: mapperCreate.c:63
void Map_ManSetSwitching(Map_Man_t *p, int fSwitching)
Definition: mapperCreate.c:75
int Map_NodeIsVar(Map_Node_t *p)
Definition: mapperCreate.c:113
void Map_ManSetNumIterations(Map_Man_t *p, int nIterations)
Definition: mapperCreate.c:69
Map_Node_t ** Map_ManReadBufs(Map_Man_t *p)
Definition: mapperCreate.c:54
Map_Node_t ** Map_NodeVecReadArray(Map_NodeVec_t *p)
Definition: mapperVec.c:106
void Map_ManPrintStatsToFile(char *pName, float Area, float Delay, abctime Time)
Definition: mapperCreate.c:341
void Map_ManSetDelayTarget(Map_Man_t *p, float DelayTarget)
Definition: mapperCreate.c:65
Map_Time_t * Map_ManReadInputArrivals(Map_Man_t *p)
Definition: mapperCreate.c:57
Map_Node_t * Map_NodeAnd(Map_Man_t *pMan, Map_Node_t *p1, Map_Node_t *p2)
Definition: mapperCreate.c:447
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
int Map_NodeIsConst(Map_Node_t *p)
Definition: mapperCreate.c:112
unsigned char uPhases[4]
Definition: mapperInt.h:285
void Map_ManSetChoiceNodeNum(Map_Man_t *p, int nChoiceNodes)
Definition: mapperCreate.c:72
Map_Man_t * Map_ManCreate(int nInputs, int nOutputs, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: mapperCreate.c:184
Map_Super_t ** Map_SuperReadFanins(Map_Super_t *p)
Definition: mapperCreate.c:153
Map_Cut_t * pNext
Definition: mapperInt.h:262
static abctime Abc_Clock()
Definition: abc_global.h:279
void Map_NodeSetData(Map_Node_t *p, int fPhase, char *pData)
Definition: mapperCreate.c:96
Map_Man_t * Map_NodeReadMan(Map_Node_t *p)
Definition: mapperCreate.c:88
#define Map_IsComplement(p)
GLOBAL VARIABLES ///.
Definition: mapper.h:67
char * Extra_MmFixedEntryFetch(Extra_MmFixed_t *p)
Map_Super_t * pSuperBest
Definition: mapperInt.h:253
unsigned Level
Definition: mapperInt.h:214
Map_Node_t * Map_NodeReadOne(Map_Node_t *p)
Definition: mapperCreate.c:94
Map_Node_t ** Map_ManReadOutputs(Map_Man_t *p)
Definition: mapperCreate.c:53
static void Map_TableResize(Map_Man_t *p)
Definition: mapperCreate.c:502
int Map_ManReadOutputNum(Map_Man_t *p)
Definition: mapperCreate.c:50
Mio_Gate_t * pRoot
Definition: mapperInt.h:288
static ABC_NAMESPACE_IMPL_START void Map_TableCreate(Map_Man_t *p)
DECLARATIONS ///.
Definition: mapperCreate.c:424
int Map_SuperReadFaninNum(Map_Super_t *p)
Definition: mapperCreate.c:154
void Map_ManSetOutputRequireds(Map_Man_t *p, Map_Time_t *pRequireds)
Definition: mapperCreate.c:67
Map_Time_t * Map_ManReadOutputRequireds(Map_Man_t *p)
Definition: mapperCreate.c:58
#define Map_NodeRef(p)
Definition: mapperInt.h:74
Mio_Library_t * pGenlib
Definition: mapperInt.h:169
int Map_SuperLibReadVarsMax(Map_SuperLib_t *p)
Definition: mapperCreate.c:163
Map_Cut_t * pCuts
Definition: mapperInt.h:240
Map_Node_t * Map_ManReadBufDriver(Map_Man_t *p, int i)
Definition: mapperCreate.c:55
int Map_ManReadFanoutViolations(Map_Man_t *p)
Definition: mapperCreate.c:70
void Map_ManSetChoiceNum(Map_Man_t *p, int nChoices)
Definition: mapperCreate.c:73
Extra_MmFixed_t * Extra_MmFixedStart(int nEntrySize)
unsigned nFanLimit
Definition: mapperInt.h:282
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
int Map_NodeIsBuf(Map_Node_t *p)
Definition: mapperCreate.c:114
unsigned Map_CutReadPhase1(Map_Cut_t *p)
Definition: mapperCreate.c:136
void Map_NodeSetNextE(Map_Node_t *p, Map_Node_t *pNextE)
Definition: mapperCreate.c:97
ABC_DLL void * Abc_FrameReadLibSuper()
Definition: mainFrame.c:58
Map_Super_t * pFanins[6]
Definition: mapperInt.h:287
STRUCTURE DEFINITIONS ///.
Definition: mioInt.h:61
int Map_ManReadInputNum(Map_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition: mapperCreate.c:49
Map_Super_t * Map_SuperReadNext(Map_Super_t *p)
Definition: mapperCreate.c:155
static int Counter
Map_Cut_t * Map_NodeReadCuts(Map_Node_t *p)
Definition: mapperCreate.c:92
Map_Time_t Map_SuperLibReadDelayInv(Map_SuperLib_t *p)
Definition: mapperCreate.c:162
unsigned nPhases
Definition: mapperInt.h:284
int Map_NodeReadLevel(Map_Node_t *p)
Definition: mapperCreate.c:91
unsigned char * Map_SuperReadPhases(Map_Super_t *p)
Definition: mapperCreate.c:157
void Map_NodeSetRepr(Map_Node_t *p, Map_Node_t *pRepr)
Definition: mapperCreate.c:98
Map_Node_t * p2
Definition: mapperInt.h:222
void Map_ManFree(Map_Man_t *p)
Definition: mapperCreate.c:248
void Map_ManPrintTimeStats(Map_Man_t *p)
Definition: mapperCreate.c:313
Map_Node_t * p1
Definition: mapperInt.h:221
void Extra_Truth4VarN(unsigned short **puCanons, char ***puPhases, char **ppCounters, int nPhasesMax)
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
float nRefEst[3]
Definition: mapperInt.h:217
void Map_ManSetAreaRecovery(Map_Man_t *p, int fAreaRecovery)
Definition: mapperCreate.c:64
#define Map_Regular(p)
Definition: mapper.h:68
typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t
INCLUDES ///.
Definition: mapper.h:40
void Map_NodeVecFree(Map_NodeVec_t *p)
Definition: mapperVec.c:68
Map_Cut_t * Map_CutReadNext(Map_Cut_t *p)
Definition: mapperCreate.c:137
int Map_SuperReadFanoutLimit(Map_Super_t *p)
Definition: mapperCreate.c:158
int Map_NodeIsAnd(Map_Node_t *p)
Definition: mapperCreate.c:115
char * Map_SuperReadFormula(Map_Super_t *p)
Definition: mapperCreate.c:150
Map_Node_t * pRepr
Definition: mapperInt.h:224
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define ABC_PRT(a, t)
Definition: abc_global.h:220
Mio_Library_t * Map_SuperLibReadGenLib(Map_SuperLib_t *p)
Definition: mapperCreate.c:160
int Map_NodeComparePhase(Map_Node_t *p1, Map_Node_t *p2)
Definition: mapperCreate.c:116
int Map_NodeReadNum(Map_Node_t *p)
Definition: mapperCreate.c:90
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
int Map_SuperReadNumPhases(Map_Super_t *p)
Definition: mapperCreate.c:156
void Map_ManSetObeyFanoutLimits(Map_Man_t *p, int fObeyFanoutLimits)
Definition: mapperCreate.c:68
float Map_ManReadAreaFinal(Map_Man_t *p)
Definition: mapperCreate.c:61
Map_Node_t ** Map_CutReadLeaves(Map_Cut_t *p)
Definition: mapperCreate.c:133
void Map_NodeSetChoice(Map_Man_t *pMan, Map_Node_t *pNodeOld, Map_Node_t *pNodeNew)
Definition: mapperCreate.c:571
char * Map_NodeReadData(Map_Node_t *p, int fPhase)
Definition: mapperCreate.c:89
Map_Node_t * Map_NodeCreate(Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
Definition: mapperCreate.c:364
#define assert(ex)
Definition: util_old.h:213
void Map_MappingSetupTruthTablesLarge(unsigned uTruths[][32])
Definition: mapperUtils.c:361
void Map_ManSetInputArrivals(Map_Man_t *p, Map_Time_t *pArrivals)
Definition: mapperCreate.c:66
int Map_SuperReadNum(Map_Super_t *p)
Definition: mapperCreate.c:152
ABC_INT64_T abctime
Definition: abc_global.h:278
void Map_NodeSetSwitching(Map_Node_t *p, float Switching)
Definition: mapperCreate.c:99
void Map_ManSetVerbose(Map_Man_t *p, int fVerbose)
Definition: mapperCreate.c:74
unsigned Map_CutReadPhaseBest(Map_Cut_t *p, int fPhase)
Definition: mapperCreate.c:134
Mio_Gate_t * Map_SuperReadRoot(Map_Super_t *p)
Definition: mapperCreate.c:151
void Map_NodeVecPush(Map_NodeVec_t *p, Map_Node_t *Entry)
Definition: mapperVec.c:190
Map_Node_t * Map_NodeReadTwo(Map_Node_t *p)
Definition: mapperCreate.c:95
#define Map_NodeIsSimComplement(p)
Definition: mapperInt.h:83
Map_Match_t M[2]
Definition: mapperInt.h:271
Map_Super_t * Map_CutReadSuperBest(Map_Cut_t *p, int fPhase)
Definition: mapperCreate.c:129
void Map_MappingSetupTruthTables(unsigned uTruths[][2])
Definition: mapperUtils.c:335
int Map_ManReadVerbose(Map_Man_t *p)
Definition: mapperCreate.c:60
#define MAP_MAX(a, b)
Definition: mapperInt.h:57
Map_Node_t * ppLeaves[6]
Definition: mapperInt.h:265
Map_Time_t tDelayInv
Definition: mapperInt.h:189
#define Map_Not(p)
Definition: mapper.h:69
Mio_Library_t * Map_ManReadGenLib(Map_Man_t *p)
Definition: mapperCreate.c:59
Map_Node_t * Map_NodeBuf(Map_Man_t *p, Map_Node_t *p1)
Definition: mapperCreate.c:552
Map_Node_t * Map_ManReadConst1(Map_Man_t *p)
Definition: mapperCreate.c:56
Map_Super_t * pNext
Definition: mapperInt.h:295