abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mapperInt.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [mapperInt.h]
4 
5  PackageName [MVSIS 2.0: 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: mapperInt.h,v 1.8 2004/09/30 21:18:10 satrajit Exp $]
16 
17 ***********************************************************************/
18 
19 #ifndef ABC__map__mapper__mapperInt_h
20 #define ABC__map__mapper__mapperInt_h
21 
22 
23 ////////////////////////////////////////////////////////////////////////
24 /// INCLUDES ///
25 ////////////////////////////////////////////////////////////////////////
26 
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30 #include <float.h>
31 #include "base/main/main.h"
32 #include "map/mio/mio.h"
33 #include "mapper.h"
34 #include "misc/extra/extraBdd.h"
35 
37 
38 
39 ////////////////////////////////////////////////////////////////////////
40 /// PARAMETERS ///
41 ////////////////////////////////////////////////////////////////////////
42 
43 // uncomment to have fanouts represented in the mapping graph
44 //#define MAP_ALLOCATE_FANOUT 1
45 
46 ////////////////////////////////////////////////////////////////////////
47 /// MACRO DEFINITIONS ///
48 ////////////////////////////////////////////////////////////////////////
49 
50 // the bit masks
51 #define MAP_MASK(n) ((~((unsigned)0)) >> (32-(n)))
52 #define MAP_FULL (~((unsigned)0))
53 #define MAP_NO_VAR (-9999.0)
54 
55 // maximum/minimum operators
56 #define MAP_MIN(a,b) (((a) < (b))? (a) : (b))
57 #define MAP_MAX(a,b) (((a) > (b))? (a) : (b))
58 
59 // the small and large numbers (min/max float are 1.17e-38/3.40e+38)
60 #define MAP_FLOAT_LARGE ((float)(FLT_MAX/10))
61 #define MAP_FLOAT_SMALL ((float)1.0e-03)
62 
63 // generating random unsigned (#define RAND_MAX 0x7fff)
64 #define MAP_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand()))
65 
66 // internal macros to work with cuts
67 #define Map_CutIsComplement(p) (((int)((ABC_PTRUINT_T) (p) & 01)))
68 #define Map_CutRegular(p) ((Map_Cut_t *)((ABC_PTRUINT_T)(p) & ~01))
69 #define Map_CutNot(p) ((Map_Cut_t *)((ABC_PTRUINT_T)(p) ^ 01))
70 #define Map_CutNotCond(p,c) ((Map_Cut_t *)((ABC_PTRUINT_T)(p) ^ (c)))
71 
72 // internal macros for referencing of nodes
73 #define Map_NodeReadRef(p) ((Map_Regular(p))->nRefs)
74 #define Map_NodeRef(p) ((Map_Regular(p))->nRefs++)
75 
76 // macros to get hold of the bits in the support info
77 #define Map_InfoSetVar(p,i) (p[(i)>>5] |= (1<<((i) & 31)))
78 #define Map_InfoRemVar(p,i) (p[(i)>>5] &= ~(1<<((i) & 31)))
79 #define Map_InfoFlipVar(p,i) (p[(i)>>5] ^= (1<<((i) & 31)))
80 #define Map_InfoReadVar(p,i) ((p[(i)>>5] & (1<<((i) & 31))) > 0)
81 
82 // returns the complemented attribute of the node
83 #define Map_NodeIsSimComplement(p) (Map_IsComplement(p)? !(Map_Regular(p)->fInv) : (p)->fInv)
84 
85 ////////////////////////////////////////////////////////////////////////
86 /// STRUCTURE DEFINITIONS ///
87 ////////////////////////////////////////////////////////////////////////
88 
89 // the mapping manager
91 {
92  // the mapping graph
93  Map_Node_t ** pBins; // the table of nodes hashed by their children
94  int nBins; // the size of the table
95  Map_Node_t ** pInputs; // the array of inputs
96  int nInputs; // the number of inputs
97  Map_Node_t ** pOutputs; // the array of outputs
98  int nOutputs; // the number of outputs
99  int nNodes; // the total number of nodes
100  Map_Node_t * pConst1; // the constant 1 node
101  Map_NodeVec_t * vMapObjs; // the array of all nodes
102  Map_NodeVec_t * vMapBufs; // the array of all nodes
103  float * pNodeDelays; // the array of node delays
104 
105  // info about the original circuit
106  char ** ppOutputNames; // the primary output names
107  Map_Time_t * pInputArrivals;// the PI arrival times
108  Map_Time_t * pOutputRequireds;// the PI arrival times
109 
110  // mapping parameters
111  int nVarsMax; // the max number of variables
112  int fAreaRecovery; // the flag to enable area recovery
113  int fVerbose; // the verbosiness flag
114  int fMappingMode; // set to 1 when doing area
115  float fRequiredGlo; // the global required times
116  float fEpsilon; // the epsilon used to compare floats
117  float AreaBase; // the area after delay-oriented mapping
118  float AreaFinal; // the area after delay-oriented mapping
119  int nIterations; // How many matching passes to do
120  int fObeyFanoutLimits;// Should mapper try to obey fanout limits or not
121  float DelayTarget; // the required times set by the user
122  int nTravIds; // the traversal counter
123  int fSwitching; // Should mapper try to obey fanout limits or not
124 
125  // the supergate library
126  Map_SuperLib_t * pSuperLib; // the current supergate library
127  unsigned uTruths[6][2]; // the elementary truth tables
128  unsigned uTruthsLarge[10][32]; // the elementary truth tables
129  int nCounts[32]; // the counter of minterms
130  int nCountsBest[32];// the counter of minterms
131  Map_NodeVec_t * vVisited; // the visited cuts during cut computation
132 
133  // the memory managers
134  Extra_MmFixed_t * mmNodes; // the memory manager for nodes
135  Extra_MmFixed_t * mmCuts; // the memory manager for cuts
136 
137  // precomputed N-canonical forms
138  unsigned short * uCanons; // N-canonical forms
139  char ** uPhases; // N-canonical phases
140  char * pCounters; // counters of phases
141 
142  // various statistical variables
143  int nChoiceNodes; // the number of choice nodes
144  int nChoices; // the number of all choices
145  int nCanons; // the number of times N-canonical form was computed
146  int nMatches; // the number of times supergate matching was performed
147  int nPhases; // the number of phases considered during matching
148  int nFanoutViolations; // the number of nodes in mapped circuit violating fanout
149 
150  // runtime statistics
151  abctime timeToMap; // time to transfer to the mapping structure
152  abctime timeCuts; // time to compute k-feasible cuts
153  abctime timeTruth; // time to compute the truth table for each cut
154  abctime timeMatch; // time to perform matching for each node
155  abctime timeArea; // time to recover area after delay oriented mapping
156  abctime timeSweep; // time to perform technology dependent sweep
157  abctime timeToNet; // time to transfer back to the network
158  abctime timeTotal; // the total mapping time
159  abctime time1; // time to transfer to the mapping structure
160  abctime time2; // time to transfer to the mapping structure
161  abctime time3; // time to transfer to the mapping structure
162 };
163 
164 // the supergate library
166 {
167  // general info
168  char * pName; // the name of the supergate library
169  Mio_Library_t * pGenlib; // the generic library
170 
171  // other info
172  int nVarsMax; // the max number of variables
173  int nSupersAll; // the total number of supergates
174  int nSupersReal; // the total number of supergates
175  int nLines; // the total number of lines in the supergate file
176  int fVerbose; // the verbosity flag
177 
178  // hash tables
179  Map_Super_t ** ppSupers; // the array of supergates
180  Map_HashTable_t * tTableC; // the table mapping N-canonical forms into supergates
181  Map_HashTable_t * tTable; // the table mapping truth tables into supergates
182 
183  // data structures for N-canonical form computation
184  unsigned uTruths[6][2]; // the elementary truth tables
185  unsigned uMask[2]; // the mask for the truth table
186 
187  // the invertor
188  Mio_Gate_t * pGateInv; // the pointer to the intertor gate
189  Map_Time_t tDelayInv; // the delay of the inverter
190  float AreaInv; // the area of the inverter
191  float AreaBuf; // the area of the buffer
192  Map_Super_t * pSuperInv; // the supergate representing the inverter
193 
194  // the memory manager for the internal table
195  Extra_MmFixed_t * mmSupers; // the mamory manager for supergates
196  Extra_MmFixed_t * mmEntries; // the memory manager for the entries
197  Extra_MmFlex_t * mmForms; // the memory manager for formulas
198 };
199 
200 // the mapping node
202 {
203  // general information about the node
204  Map_Man_t * p; // the mapping manager
205  Map_Node_t * pNext; // the next node in the hash table
206  int Num; // the unique number of this node
207  int TravId; // the traversal ID (use to avoid cleaning marks)
208  int nRefs; // the number of references (fanouts) of the given node
209  unsigned fMark0 : 1; // the mark used for traversals
210  unsigned fMark1 : 1; // the mark used for traversals
211  unsigned fUsed : 1; // the mark to mark the node or its fanins
212  unsigned fInv : 1; // the complemented attribute for the equivalent nodes
213  unsigned fInvert: 1; // the flag to denote the use of interter
214  unsigned Level :16; // the level of the given node
215  unsigned NumTemp:10; // the level of the given node
216  int nRefAct[3]; // estimated fanout for current covering phase, neg and pos and sum
217  float nRefEst[3]; // actual fanout for previous covering phase, neg and pos and sum
218  float Switching; // the probability of switching
219 
220  // connectivity
221  Map_Node_t * p1; // the first child
222  Map_Node_t * p2; // the second child
223  Map_Node_t * pNextE; // the next functionally equivalent node
224  Map_Node_t * pRepr; // the representative of the functionally equivalent class
225 
226 #ifdef MAP_ALLOCATE_FANOUT
227  // representation of node's fanouts
228  Map_Node_t * pFanPivot; // the first fanout of this node
229  Map_Node_t * pFanFanin1; // the next fanout of p1
230  Map_Node_t * pFanFanin2; // the next fanout of p2
231 // Map_NodeVec_t * vFanouts; // the array of fanouts of the gate
232 #endif
233 
234  // the delay information
235  Map_Time_t tArrival[2]; // the best arrival time of the neg (0) and pos (1) phases
236  Map_Time_t tRequired[2]; // the required time of the neg (0) and pos (1) phases
237 
238  // misc information
239  Map_Cut_t * pCutBest[2]; // the best mapping for neg and pos phase
240  Map_Cut_t * pCuts; // mapping choices for the node (elementary comes first)
241  char * pData0; // temporary storage for the corresponding network node
242  char * pData1; // temporary storage for the corresponding network node
243 };
244 
245 // the match of the cut
247 {
248  // information used for matching
250  unsigned uPhase;
251  // information about the best selected match
252  unsigned uPhaseBest; // the best phase (the EXOR of match's phase and gate's phase)
253  Map_Super_t * pSuperBest; // the best supergate matched
254  // the parameters of the match
255  Map_Time_t tArrive; // the arrival time of this match
256  float AreaFlow; // the area flow or area of this match
257 };
258 
259 // the cuts used for matching
261 {
262  Map_Cut_t * pNext; // the pointer to the next cut in the list
263  Map_Cut_t * pOne; // the father of this cut
264  Map_Cut_t * pTwo; // the mother of this cut
265  Map_Node_t * ppLeaves[6]; // the leaves of this cut
266  unsigned uTruth; // truth table for five-input cuts
267  char nLeaves; // the number of leaves
268  char nVolume; // the volume of this cut
269  char fMark; // the mark to denote visited cut
270  char Phase; // the mark to denote complemented cut
271  Map_Match_t M[2]; // the matches for positive/negative phase
272 };
273 
274 // the supergate internally represented
276 {
277  int Num; // the ID of the supergate
278  unsigned fSuper : 1; // the flag to distinquish a real super from a fake one
279  unsigned fExclude: 1; // the flag if set causes gate to be excluded from being used for mapping
280  unsigned nFanins : 3; // the number of inputs
281  unsigned nGates : 3; // the number of gates inside this supergate
282  unsigned nFanLimit: 4; // the max number of fanout count
283  unsigned nSupers : 16; // the number of supergates in the list
284  unsigned nPhases : 4; // the number of phases for matching with canonical form
285  unsigned char uPhases[4]; // the maximum of 4 phases for matching with canonical form
286  int nUsed; // the number of times the supergate is used
287  Map_Super_t * pFanins[6]; // the fanins of the gate
288  Mio_Gate_t * pRoot; // the root gate
289  unsigned uTruth[2]; // the truth table
290  Map_Time_t tDelaysR[6]; // the pin-to-pin delay constraints for the rise of the output
291  Map_Time_t tDelaysF[6]; // the pin-to-pin delay constraints for the rise of the output
292  Map_Time_t tDelayMax; // the maximum delay
293  float Area; // the area
294  char * pFormula; // the symbolic formula
295  Map_Super_t * pNext; // the pointer to the next super in the list
296 };
297 
298 // the vector of nodes
300 {
301  Map_Node_t ** pArray; // the array of nodes
302  int nSize; // the number of entries in the array
303  int nCap; // the number of allocated entries
304 };
305 
306 // the hash table
308 {
309  Map_HashEntry_t ** pBins; // the table bins
310  int nBins; // the size of the table
311  int nEntries; // the total number of entries in the table
312  Extra_MmFixed_t * mmMan; // the memory manager for entries
313 };
314 
315 // the entry in the hash table
317 {
318  unsigned uTruth[2]; // the truth table for 6-var function
319  unsigned uPhase; // the phase to tranform it into the canonical form
320  Map_Super_t * pGates; // the linked list of matching supergates
321  Map_HashEntry_t * pNext; // the next entry in the hash table
322 };
323 
324 // getting hold of the next fanout of the node
325 #define Map_NodeReadNextFanout( pNode, pFanout ) \
326  ( ( pFanout == NULL )? NULL : \
327  ((Map_Regular((pFanout)->p1) == (pNode))? \
328  (pFanout)->pFanFanin1 : (pFanout)->pFanFanin2) )
329 
330 // getting hold of the place where the next fanout will be attached
331 #define Map_NodeReadNextFanoutPlace( pNode, pFanout ) \
332  ( (Map_Regular((pFanout)->p1) == (pNode))? \
333  &(pFanout)->pFanFanin1 : &(pFanout)->pFanFanin2 )
334 
335 // iterator through the fanouts of the node
336 #define Map_NodeForEachFanout( pNode, pFanout ) \
337  for ( pFanout = (pNode)->pFanPivot; pFanout; \
338  pFanout = Map_NodeReadNextFanout(pNode, pFanout) )
339 
340 // safe iterator through the fanouts of the node
341 #define Map_NodeForEachFanoutSafe( pNode, pFanout, pFanout2 ) \
342  for ( pFanout = (pNode)->pFanPivot, \
343  pFanout2 = Map_NodeReadNextFanout(pNode, pFanout); \
344  pFanout; \
345  pFanout = pFanout2, \
346  pFanout2 = Map_NodeReadNextFanout(pNode, pFanout) )
347 
348 ////////////////////////////////////////////////////////////////////////
349 /// GLOBAL VARIABLES ///
350 ////////////////////////////////////////////////////////////////////////
351 
352 ////////////////////////////////////////////////////////////////////////
353 /// FUNCTION DEFINITIONS ///
354 ////////////////////////////////////////////////////////////////////////
355 
356 /*=== mapperCanon.c =============================================================*/
357 /*=== mapperCut.c ===============================================================*/
358 extern void Map_MappingCuts( Map_Man_t * p );
359 /*=== mapperCutUtils.c ===============================================================*/
360 extern Map_Cut_t * Map_CutAlloc( Map_Man_t * p );
361 extern void Map_CutFree( Map_Man_t * p, Map_Cut_t * pCut );
362 extern void Map_CutPrint( Map_Man_t * p, Map_Node_t * pRoot, Map_Cut_t * pCut, int fPhase );
363 extern float Map_CutGetRootArea( Map_Cut_t * pCut, int fPhase );
364 extern int Map_CutGetLeafPhase( Map_Cut_t * pCut, int fPhase, int iLeaf );
365 extern int Map_NodeGetLeafPhase( Map_Node_t * pNode, int fPhase, int iLeaf );
366 extern Map_Cut_t * Map_CutListAppend( Map_Cut_t * pSetAll, Map_Cut_t * pSets );
367 extern void Map_CutListRecycle( Map_Man_t * p, Map_Cut_t * pSetList, Map_Cut_t * pSave );
368 extern int Map_CutListCount( Map_Cut_t * pSets );
369 extern void Map_CutRemoveFanouts( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhase );
370 extern void Map_CutInsertFanouts( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhase );
371 /*=== mapperFanout.c =============================================================*/
372 extern void Map_NodeAddFaninFanout( Map_Node_t * pFanin, Map_Node_t * pFanout );
373 extern void Map_NodeRemoveFaninFanout( Map_Node_t * pFanin, Map_Node_t * pFanoutToRemove );
374 extern int Map_NodeGetFanoutNum( Map_Node_t * pNode );
375 /*=== mapperLib.c ============================================================*/
376 extern Map_SuperLib_t * Map_SuperLibCreate( Mio_Library_t * pGenlib, Vec_Str_t * vStr, char * pFileName, char * pExcludeFile, int fAlgorithm, int fVerbose );
377 extern void Map_SuperLibFree( Map_SuperLib_t * p );
378 /*=== mapperMatch.c ===============================================================*/
379 extern int Map_MappingMatches( Map_Man_t * p );
380 /*=== mapperRefs.c =============================================================*/
381 extern void Map_MappingEstimateRefsInit( Map_Man_t * p );
382 extern void Map_MappingEstimateRefs( Map_Man_t * p );
383 extern float Map_CutGetAreaFlow( Map_Cut_t * pCut, int fPhase );
384 extern float Map_CutGetAreaRefed( Map_Cut_t * pCut, int fPhase );
385 extern float Map_CutGetAreaDerefed( Map_Cut_t * pCut, int fPhase );
386 extern float Map_CutRef( Map_Cut_t * pCut, int fPhase );
387 extern float Map_CutDeref( Map_Cut_t * pCut, int fPhase );
388 extern void Map_MappingSetRefs( Map_Man_t * pMan );
389 extern float Map_MappingGetArea( Map_Man_t * pMan );
390 /*=== mapperSwitch.c =============================================================*/
391 extern float Map_SwitchCutGetDerefed( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhase );
392 extern float Map_SwitchCutRef( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhase );
393 extern float Map_SwitchCutDeref( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhase );
394 extern float Map_MappingGetSwitching( Map_Man_t * pMan );
395 /*=== mapperTree.c ===============================================================*/
396 extern int Map_LibraryDeriveGateInfo( Map_SuperLib_t * pLib, st__table * tExcludeGate );
397 extern int Map_LibraryReadFileTreeStr( Map_SuperLib_t * pLib, Mio_Library_t * pGenlib, Vec_Str_t * vStr, char * pFileName );
398 extern int Map_LibraryReadTree( Map_SuperLib_t * pLib, Mio_Library_t * pGenlib, char * pFileName, char * pExcludeFile );
399 extern void Map_LibraryPrintTree( Map_SuperLib_t * pLib );
400 /*=== mapperSuper.c ===============================================================*/
401 extern int Map_LibraryRead( Map_SuperLib_t * p, char * pFileName );
402 extern void Map_LibraryPrintSupergate( Map_Super_t * pGate );
403 /*=== mapperTable.c ============================================================*/
405 extern void Map_SuperTableFree( Map_HashTable_t * p );
406 extern int Map_SuperTableInsertC( Map_HashTable_t * pLib, unsigned uTruthC[], Map_Super_t * pGate );
407 extern int Map_SuperTableInsert( Map_HashTable_t * pLib, unsigned uTruth[], Map_Super_t * pGate, unsigned uPhase );
408 extern Map_Super_t * Map_SuperTableLookup( Map_HashTable_t * p, unsigned uTruth[], unsigned * puPhase );
409 extern void Map_SuperTableSortSupergates( Map_HashTable_t * p, int nSupersMax );
410 extern void Map_SuperTableSortSupergatesByDelay( Map_HashTable_t * p, int nSupersMax );
411 /*=== mapperTime.c =============================================================*/
412 extern float Map_TimeCutComputeArrival( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhase, float tWorstCaseLimit );
413 extern float Map_TimeComputeArrivalMax( Map_Man_t * p );
414 extern void Map_TimeComputeRequiredGlobal( Map_Man_t * p );
415 /*=== mapperTruth.c ===============================================================*/
416 extern void Map_MappingTruths( Map_Man_t * pMan );
417 extern int Map_TruthsCutDontCare( Map_Man_t * pMan, Map_Cut_t * pCut, unsigned * uTruthDc );
418 extern int Map_TruthCountOnes( unsigned * uTruth, int nLeaves );
419 extern int Map_TruthDetectTwoFirst( unsigned * uTruth, int nLeaves );
420 /*=== mapperUtils.c ===============================================================*/
421 extern Map_NodeVec_t * Map_MappingDfs( Map_Man_t * pMan, int fCollectEquiv );
422 extern int Map_MappingCountLevels( Map_Man_t * pMan );
423 extern void Map_MappingUnmark( Map_Man_t * pMan );
424 extern void Map_MappingMark_rec( Map_Node_t * pNode );
425 extern void Map_MappingUnmark_rec( Map_Node_t * pNode );
427 extern void Map_MappingSetupMask( unsigned uMask[], int nVarsMax );
428 extern int Map_MappingNodeIsViolator( Map_Node_t * pNode, Map_Cut_t * pCut, int fPosPol );
429 extern float Map_MappingGetAreaFlow( Map_Man_t * p );
430 extern void Map_MappingSortByLevel( Map_Man_t * pMan, Map_NodeVec_t * vNodes );
431 extern int Map_MappingCountDoubles( Map_Man_t * pMan, Map_NodeVec_t * vNodes );
432 extern void Map_MappingExpandTruth( unsigned uTruth[2], int nVars );
433 extern float Map_MappingPrintSwitching( Map_Man_t * pMan );
434 extern void Map_MappingSetPlacementInfo( Map_Man_t * p );
435 extern float Map_MappingPrintWirelength( Map_Man_t * p );
436 extern void Map_MappingWireReport( Map_Man_t * p );
438 extern int Map_MappingGetMaxLevel( Map_Man_t * pMan );
439 extern void Map_MappingSetChoiceLevels( Map_Man_t * pMan );
440 extern void Map_MappingReportChoices( Map_Man_t * pMan );
441 /*=== mapperVec.c =============================================================*/
442 extern Map_NodeVec_t * Map_NodeVecAlloc( int nCap );
443 extern void Map_NodeVecFree( Map_NodeVec_t * p );
446 extern int Map_NodeVecReadSize( Map_NodeVec_t * p );
447 extern void Map_NodeVecGrow( Map_NodeVec_t * p, int nCapMin );
448 extern void Map_NodeVecShrink( Map_NodeVec_t * p, int nSizeNew );
449 extern void Map_NodeVecClear( Map_NodeVec_t * p );
450 extern void Map_NodeVecPush( Map_NodeVec_t * p, Map_Node_t * Entry );
451 extern int Map_NodeVecPushUnique( Map_NodeVec_t * p, Map_Node_t * Entry );
453 extern void Map_NodeVecRemove( Map_NodeVec_t * p, Map_Node_t * Entry );
454 extern void Map_NodeVecWriteEntry( Map_NodeVec_t * p, int i, Map_Node_t * Entry );
455 extern Map_Node_t * Map_NodeVecReadEntry( Map_NodeVec_t * p, int i );
456 extern void Map_NodeVecSortByLevel( Map_NodeVec_t * p );
457 
458 
459 
461 
462 #endif
463 
464 ////////////////////////////////////////////////////////////////////////
465 /// END OF FILE ///
466 ////////////////////////////////////////////////////////////////////////
Map_HashEntry_t * pNext
Definition: mapperInt.h:321
void Map_LibraryPrintTree(Map_SuperLib_t *pLib)
Definition: mapperTree.c:979
void Map_NodeAddFaninFanout(Map_Node_t *pFanin, Map_Node_t *pFanout)
void Map_SuperTableSortSupergatesByDelay(Map_HashTable_t *p, int nSupersMax)
Definition: mapperTable.c:362
int Map_NodeVecReadSize(Map_NodeVec_t *p)
Definition: mapperVec.c:122
Map_NodeVec_t * vMapObjs
Definition: mapperInt.h:101
float Map_CutDeref(Map_Cut_t *pCut, int fPhase)
Definition: mapperRefs.c:384
Map_Man_t * p
Definition: mapperInt.h:204
char ** uPhases
Definition: mapperInt.h:139
int Map_LibraryDeriveGateInfo(Map_SuperLib_t *pLib, st__table *tExcludeGate)
Definition: mapperTree.c:586
abctime timeCuts
Definition: mapperInt.h:152
Map_Node_t * pConst1
Definition: mapperInt.h:100
void Map_NodeVecWriteEntry(Map_NodeVec_t *p, int i, Map_Node_t *Entry)
Definition: mapperVec.c:273
void Map_NodeVecSortByLevel(Map_NodeVec_t *p)
Definition: mapperVec.c:307
Map_NodeVec_t * Map_NodeVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: mapperVec.c:45
float Map_MappingGetSwitching(Map_Man_t *pMan)
Definition: mapperSwitch.c:187
Map_NodeVec_t * vVisited
Definition: mapperInt.h:131
float Map_CutGetAreaRefed(Map_Cut_t *pCut, int fPhase)
Definition: mapperRefs.c:328
Map_Node_t * pNextE
Definition: mapperInt.h:223
void Map_MappingMark_rec(Map_Node_t *pNode)
Definition: mapperUtils.c:207
float Map_SwitchCutRef(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
Definition: mapperSwitch.c:66
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_SuperTableSortSupergates(Map_HashTable_t *p, int nSupersMax)
Definition: mapperTable.c:315
void Map_MappingSetRefs(Map_Man_t *pMan)
Definition: mapperRefs.c:441
Map_Node_t * pNext
Definition: mapperInt.h:205
Map_Time_t tRequired[2]
Definition: mapperInt.h:236
Map_Cut_t * pCutBest[2]
Definition: mapperInt.h:239
void Map_CutInsertFanouts(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
unsigned uPhaseBest
Definition: mapperInt.h:252
unsigned fUsed
Definition: mapperInt.h:211
void Map_CutPrint(Map_Man_t *p, Map_Node_t *pRoot, Map_Cut_t *pCut, int fPhase)
unsigned nFanins
Definition: mapperInt.h:280
Map_Super_t * pSuperInv
Definition: mapperInt.h:192
void Map_MappingExpandTruth(unsigned uTruth[2], int nVars)
Definition: mapperUtils.c:670
abctime timeTruth
Definition: mapperInt.h:153
unsigned nSupers
Definition: mapperInt.h:283
int Map_MappingMatches(Map_Man_t *p)
Definition: mapperMatch.c:553
void Map_CutRemoveFanouts(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
Map_Node_t ** Map_NodeVecReadArray(Map_NodeVec_t *p)
Definition: mapperVec.c:106
Map_NodeVec_t * vMapBufs
Definition: mapperInt.h:102
int Map_TruthCountOnes(unsigned *uTruth, int nLeaves)
Map_Time_t tDelaysF[6]
Definition: mapperInt.h:291
unsigned fInvert
Definition: mapperInt.h:213
unsigned short * uCanons
Definition: mapperInt.h:138
Map_HashEntry_t ** pBins
Definition: mapperInt.h:309
unsigned char uPhases[4]
Definition: mapperInt.h:285
void Map_CutFree(Map_Man_t *p, Map_Cut_t *pCut)
int Map_NodeGetFanoutNum(Map_Node_t *pNode)
float Map_CutGetRootArea(Map_Cut_t *pCut, int fPhase)
void Map_MappingUnmark(Map_Man_t *pMan)
Definition: mapperUtils.c:163
Map_Time_t tArrival[2]
Definition: mapperInt.h:235
Map_Cut_t * pNext
Definition: mapperInt.h:262
void Map_MappingWireReport(Map_Man_t *p)
Map_Super_t * pSupers
Definition: mapperInt.h:249
Map_Super_t ** ppSupers
Definition: mapperInt.h:179
float Map_CutGetAreaDerefed(Map_Cut_t *pCut, int fPhase)
Definition: mapperRefs.c:348
unsigned uTruthsLarge[10][32]
Definition: mapperInt.h:128
unsigned uTruth
Definition: mapperInt.h:266
void Map_MappingTruths(Map_Man_t *pMan)
FUNCTION DEFINITIONS ///.
Definition: mapperTruth.c:47
Map_Super_t * pSuperBest
Definition: mapperInt.h:253
void Map_MappingSetChoiceLevels(Map_Man_t *pMan)
Definition: mapperUtils.c:821
Map_Time_t tDelayMax
Definition: mapperInt.h:292
unsigned Level
Definition: mapperInt.h:214
void Map_SuperLibFree(Map_SuperLib_t *p)
Definition: mapperLib.c:167
Extra_MmFixed_t * mmCuts
Definition: mapperInt.h:135
float Map_CutRef(Map_Cut_t *pCut, int fPhase)
Definition: mapperRefs.c:368
Map_Time_t tArrive
Definition: mapperInt.h:255
int Map_LibraryReadTree(Map_SuperLib_t *pLib, Mio_Library_t *pGenlib, char *pFileName, char *pExcludeFile)
Definition: mapperTree.c:525
int Map_MappingGetMaxLevel(Map_Man_t *pMan)
Definition: mapperUtils.c:750
unsigned uTruths[6][2]
Definition: mapperInt.h:184
Map_SuperLib_t * pSuperLib
Definition: mapperInt.h:126
Mio_Gate_t * pRoot
Definition: mapperInt.h:288
Map_Node_t ** pInputs
Definition: mapperInt.h:95
int nCountsBest[32]
Definition: mapperInt.h:130
unsigned uTruth[2]
Definition: mapperInt.h:289
float fRequiredGlo
Definition: mapperInt.h:115
void Map_NodeVecShrink(Map_NodeVec_t *p, int nSizeNew)
Definition: mapperVec.c:157
unsigned NumTemp
Definition: mapperInt.h:215
void Map_MappingEstimateRefs(Map_Man_t *p)
Definition: mapperRefs.c:151
int Map_NodeVecPushUnique(Map_NodeVec_t *p, Map_Node_t *Entry)
Definition: mapperVec.c:213
float Map_TimeComputeArrivalMax(Map_Man_t *p)
DECLARATIONS ///.
Definition: mapperTime.c:42
abctime timeToMap
Definition: mapperInt.h:151
abctime timeToNet
Definition: mapperInt.h:157
Definition: st.h:52
Mio_Library_t * pGenlib
Definition: mapperInt.h:169
void Map_MappingCuts(Map_Man_t *p)
GLOBAL VARIABLES ///.
Definition: mapperCut.c:172
Map_Cut_t * pCuts
Definition: mapperInt.h:240
Map_Cut_t * Map_CutListAppend(Map_Cut_t *pSetAll, Map_Cut_t *pSets)
Map_HashTable_t * Map_SuperTableCreate(Map_SuperLib_t *pLib)
FUNCTION DEFINITIONS ///.
Definition: mapperTable.c:48
Map_Time_t * pInputArrivals
Definition: mapperInt.h:107
Map_Node_t ** pArray
Definition: mapperInt.h:301
Map_Cut_t * pOne
Definition: mapperInt.h:263
void Map_NodeVecGrow(Map_NodeVec_t *p, int nCapMin)
Definition: mapperVec.c:138
Map_Node_t ** pOutputs
Definition: mapperInt.h:97
unsigned fExclude
Definition: mapperInt.h:279
Extra_MmFixed_t * mmNodes
Definition: mapperInt.h:134
unsigned nFanLimit
Definition: mapperInt.h:282
int Map_LibraryRead(Map_SuperLib_t *p, char *pFileName)
FUNCTION DEFINITIONS ///.
Definition: mapperSuper.c:50
unsigned uTruth[2]
Definition: mapperInt.h:318
void Map_MappingEstimateRefsInit(Map_Man_t *p)
Definition: mapperRefs.c:126
int Map_CutGetLeafPhase(Map_Cut_t *pCut, int fPhase, int iLeaf)
Extra_MmFixed_t * mmSupers
Definition: mapperInt.h:195
float Map_MappingComputeDelayWithFanouts(Map_Man_t *p)
Definition: mapperUtils.c:713
int Map_MappingNodeIsViolator(Map_Node_t *pNode, Map_Cut_t *pCut, int fPosPol)
Definition: mapperUtils.c:471
Map_Time_t * pOutputRequireds
Definition: mapperInt.h:108
Map_Super_t * pFanins[6]
Definition: mapperInt.h:287
STRUCTURE DEFINITIONS ///.
Definition: mioInt.h:61
float Map_TimeCutComputeArrival(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase, float tWorstCaseLimit)
Definition: mapperTime.c:72
int Map_MappingCountDoubles(Map_Man_t *pMan, Map_NodeVec_t *vNodes)
Definition: mapperUtils.c:583
abctime timeTotal
Definition: mapperInt.h:158
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
Map_Super_t * Map_SuperTableLookup(Map_HashTable_t *p, unsigned uTruth[], unsigned *puPhase)
Definition: mapperTable.c:208
unsigned nPhases
Definition: mapperInt.h:284
abctime timeArea
Definition: mapperInt.h:155
Map_Node_t * p2
Definition: mapperInt.h:222
Map_HashTable_t * tTable
Definition: mapperInt.h:181
Map_Cut_t * Map_CutAlloc(Map_Man_t *p)
DECLARATIONS ///.
Mio_Gate_t * pGateInv
Definition: mapperInt.h:188
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
Map_Cut_t * pTwo
Definition: mapperInt.h:264
int nCounts[32]
Definition: mapperInt.h:129
Extra_MmFixed_t * mmEntries
Definition: mapperInt.h:196
int Map_CutListCount(Map_Cut_t *pSets)
Map_Node_t * Map_NodeVecReadEntry(Map_NodeVec_t *p, int i)
Definition: mapperVec.c:290
Map_Node_t * p1
Definition: mapperInt.h:221
float Map_SwitchCutDeref(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
Definition: mapperSwitch.c:82
float nRefEst[3]
Definition: mapperInt.h:217
float Map_MappingGetAreaFlow(Map_Man_t *p)
Definition: mapperUtils.c:487
void Map_MappingUnmark_rec(Map_Node_t *pNode)
Definition: mapperUtils.c:181
typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t
INCLUDES ///.
Definition: mapper.h:40
void Map_NodeVecClear(Map_NodeVec_t *p)
Definition: mapperVec.c:174
unsigned uMask[2]
Definition: mapperInt.h:185
unsigned fMark1
Definition: mapperInt.h:210
void Map_TimeComputeRequiredGlobal(Map_Man_t *p)
Definition: mapperTime.c:381
void Map_NodeVecFree(Map_NodeVec_t *p)
Definition: mapperVec.c:68
Map_NodeVec_t * Map_MappingDfs(Map_Man_t *pMan, int fCollectEquiv)
Definition: mapperUtils.c:77
void Map_MappingSortByLevel(Map_Man_t *pMan, Map_NodeVec_t *vNodes)
Definition: mapperUtils.c:544
int Map_TruthsCutDontCare(Map_Man_t *pMan, Map_Cut_t *pCut, unsigned *uTruthDc)
int Map_TruthDetectTwoFirst(unsigned *uTruth, int nLeaves)
float Map_CutGetAreaFlow(Map_Cut_t *pCut, int fPhase)
Definition: mapperRefs.c:179
Map_Node_t * pRepr
Definition: mapperInt.h:224
Map_NodeVec_t * Map_NodeVecDup(Map_NodeVec_t *p)
Definition: mapperVec.c:87
int Map_MappingCountLevels(Map_Man_t *pMan)
Definition: mapperUtils.c:105
void Map_MappingReportChoices(Map_Man_t *pMan)
Definition: mapperUtils.c:842
float Map_MappingGetArea(Map_Man_t *pMan)
Definition: mapperRefs.c:474
Map_Super_t * pGates
Definition: mapperInt.h:320
char * pCounters
Definition: mapperInt.h:140
void Map_LibraryPrintSupergate(Map_Super_t *pGate)
Definition: mapperSuper.c:403
void Map_NodeVecRemove(Map_NodeVec_t *p, Map_Node_t *Entry)
Definition: mapperVec.c:250
float Map_MappingPrintWirelength(Map_Man_t *p)
unsigned uTruths[6][2]
Definition: mapperInt.h:127
void Map_MappingSetupMask(unsigned uMask[], int nVarsMax)
Definition: mapperUtils.c:402
void Map_SuperTableFree(Map_HashTable_t *p)
Definition: mapperTable.c:74
Extra_MmFixed_t * mmMan
Definition: mapperInt.h:312
float Map_SwitchCutGetDerefed(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
FUNCTION DEFINITIONS ///.
Definition: mapperSwitch.c:45
int Map_NodeGetLeafPhase(Map_Node_t *pNode, int fPhase, int iLeaf)
void Map_MappingSetPlacementInfo(Map_Man_t *p)
abctime timeSweep
Definition: mapperInt.h:156
void Map_CutListRecycle(Map_Man_t *p, Map_Cut_t *pSetList, Map_Cut_t *pSave)
unsigned fMark0
Definition: mapperInt.h:209
STRUCTURE DEFINITIONS ///.
Definition: mapperInt.h:90
Map_Time_t tDelaysR[6]
Definition: mapperInt.h:290
int Map_SuperTableInsertC(Map_HashTable_t *pLib, unsigned uTruthC[], Map_Super_t *pGate)
Definition: mapperTable.c:92
int Map_LibraryReadFileTreeStr(Map_SuperLib_t *pLib, Mio_Library_t *pGenlib, Vec_Str_t *vStr, char *pFileName)
Definition: mapperTree.c:391
Map_HashTable_t * tTableC
Definition: mapperInt.h:180
char ** ppOutputNames
Definition: mapperInt.h:106
ABC_INT64_T abctime
Definition: abc_global.h:278
void Map_NodeVecPush(Map_NodeVec_t *p, Map_Node_t *Entry)
Definition: mapperVec.c:190
void Map_MappingPrintOutputArrivals(Map_Man_t *p)
Definition: mapperUtils.c:289
abctime timeMatch
Definition: mapperInt.h:154
void Map_NodeRemoveFaninFanout(Map_Node_t *pFanin, Map_Node_t *pFanoutToRemove)
Map_Node_t * Map_NodeVecPop(Map_NodeVec_t *p)
Definition: mapperVec.c:234
Extra_MmFlex_t * mmForms
Definition: mapperInt.h:197
Map_SuperLib_t * Map_SuperLibCreate(Mio_Library_t *pGenlib, Vec_Str_t *vStr, char *pFileName, char *pExcludeFile, int fAlgorithm, int fVerbose)
DECLARATIONS ///.
Definition: mapperLib.c:58
Map_Match_t M[2]
Definition: mapperInt.h:271
Map_Node_t ** pBins
Definition: mapperInt.h:93
Map_Node_t * ppLeaves[6]
Definition: mapperInt.h:265
float Map_MappingPrintSwitching(Map_Man_t *pMan)
Map_Time_t tDelayInv
Definition: mapperInt.h:189
int Map_SuperTableInsert(Map_HashTable_t *pLib, unsigned uTruth[], Map_Super_t *pGate, unsigned uPhase)
Definition: mapperTable.c:137
float * pNodeDelays
Definition: mapperInt.h:103
Map_Super_t * pNext
Definition: mapperInt.h:295