ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
mapperCreate.c File Reference
#include "mapperInt.h"
Include dependency graph for mapperCreate.c:

Go to the source code of this file.

Functions

int Map_ManReadInputNum (Map_Man_t *p)
 FUNCTION DEFINITIONS ///.
 
int Map_ManReadOutputNum (Map_Man_t *p)
 
int Map_ManReadBufNum (Map_Man_t *p)
 
Map_Node_t ** Map_ManReadInputs (Map_Man_t *p)
 
Map_Node_t ** Map_ManReadOutputs (Map_Man_t *p)
 
Map_Node_t ** Map_ManReadBufs (Map_Man_t *p)
 
Map_Node_tMap_ManReadBufDriver (Map_Man_t *p, int i)
 
Map_Node_tMap_ManReadConst1 (Map_Man_t *p)
 
Map_Time_tMap_ManReadInputArrivals (Map_Man_t *p)
 
Map_Time_tMap_ManReadOutputRequireds (Map_Man_t *p)
 
Mio_Library_tMap_ManReadGenLib (Map_Man_t *p)
 
int Map_ManReadVerbose (Map_Man_t *p)
 
float Map_ManReadAreaFinal (Map_Man_t *p)
 
float Map_ManReadRequiredGlo (Map_Man_t *p)
 
void Map_ManSetOutputNames (Map_Man_t *p, char **ppNames)
 
void Map_ManSetAreaRecovery (Map_Man_t *p, int fAreaRecovery)
 
void Map_ManSetDelayTarget (Map_Man_t *p, float DelayTarget)
 
void Map_ManSetInputArrivals (Map_Man_t *p, Map_Time_t *pArrivals)
 
void Map_ManSetOutputRequireds (Map_Man_t *p, Map_Time_t *pRequireds)
 
void Map_ManSetObeyFanoutLimits (Map_Man_t *p, int fObeyFanoutLimits)
 
void Map_ManSetNumIterations (Map_Man_t *p, int nIterations)
 
int Map_ManReadFanoutViolations (Map_Man_t *p)
 
void Map_ManSetFanoutViolations (Map_Man_t *p, int nVio)
 
void Map_ManSetChoiceNodeNum (Map_Man_t *p, int nChoiceNodes)
 
void Map_ManSetChoiceNum (Map_Man_t *p, int nChoices)
 
void Map_ManSetVerbose (Map_Man_t *p, int fVerbose)
 
void Map_ManSetSwitching (Map_Man_t *p, int fSwitching)
 
void Map_ManSetSkipFanout (Map_Man_t *p, int fSkipFanout)
 
void Map_ManSetUseProfile (Map_Man_t *p)
 
void Map_ManCreateAigIds (Map_Man_t *p, int nObjs)
 
Map_Man_tMap_NodeReadMan (Map_Node_t *p)
 
char * Map_NodeReadData (Map_Node_t *p, int fPhase)
 
int Map_NodeReadNum (Map_Node_t *p)
 
int Map_NodeReadLevel (Map_Node_t *p)
 
int Map_NodeReadAigId (Map_Node_t *p)
 
Map_Cut_tMap_NodeReadCuts (Map_Node_t *p)
 
Map_Cut_tMap_NodeReadCutBest (Map_Node_t *p, int fPhase)
 
Map_Node_tMap_NodeReadOne (Map_Node_t *p)
 
Map_Node_tMap_NodeReadTwo (Map_Node_t *p)
 
void Map_NodeSetData (Map_Node_t *p, int fPhase, char *pData)
 
void Map_NodeSetNextE (Map_Node_t *p, Map_Node_t *pNextE)
 
void Map_NodeSetRepr (Map_Node_t *p, Map_Node_t *pRepr)
 
void Map_NodeSetSwitching (Map_Node_t *p, float Switching)
 
void Map_NodeSetAigId (Map_Node_t *p, int Id)
 
int Map_NodeIsConst (Map_Node_t *p)
 
int Map_NodeIsVar (Map_Node_t *p)
 
int Map_NodeIsBuf (Map_Node_t *p)
 
int Map_NodeIsAnd (Map_Node_t *p)
 
int Map_NodeComparePhase (Map_Node_t *p1, Map_Node_t *p2)
 
Map_Super_tMap_CutReadSuperBest (Map_Cut_t *p, int fPhase)
 
Map_Super_tMap_CutReadSuper0 (Map_Cut_t *p)
 
Map_Super_tMap_CutReadSuper1 (Map_Cut_t *p)
 
int Map_CutReadLeavesNum (Map_Cut_t *p)
 
Map_Node_t ** Map_CutReadLeaves (Map_Cut_t *p)
 
unsigned Map_CutReadPhaseBest (Map_Cut_t *p, int fPhase)
 
unsigned Map_CutReadPhase0 (Map_Cut_t *p)
 
unsigned Map_CutReadPhase1 (Map_Cut_t *p)
 
Map_Cut_tMap_CutReadNext (Map_Cut_t *p)
 
char * Map_SuperReadFormula (Map_Super_t *p)
 
Mio_Gate_tMap_SuperReadRoot (Map_Super_t *p)
 
int Map_SuperReadNum (Map_Super_t *p)
 
Map_Super_t ** Map_SuperReadFanins (Map_Super_t *p)
 
int Map_SuperReadFaninNum (Map_Super_t *p)
 
Map_Super_tMap_SuperReadNext (Map_Super_t *p)
 
int Map_SuperReadNumPhases (Map_Super_t *p)
 
unsigned char * Map_SuperReadPhases (Map_Super_t *p)
 
int Map_SuperReadFanoutLimit (Map_Super_t *p)
 
Mio_Library_tMap_SuperLibReadGenLib (Map_SuperLib_t *p)
 
float Map_SuperLibReadAreaInv (Map_SuperLib_t *p)
 
Map_Time_t Map_SuperLibReadDelayInv (Map_SuperLib_t *p)
 
int Map_SuperLibReadVarsMax (Map_SuperLib_t *p)
 
Map_Man_tMap_ManCreate (int nInputs, int nOutputs, int fVerbose)
 FUNCTION DEFINITIONS ///.
 
void Map_ManFree (Map_Man_t *p)
 
void Map_ManCreateNodeDelays (Map_Man_t *p, int LogFan)
 
void Map_ManPrintTimeStats (Map_Man_t *p)
 
void Map_ManPrintStatsToFile (char *pName, float Area, float Delay, abctime Time)
 
Map_Node_tMap_NodeCreate (Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
 
Map_Node_tMap_NodeAnd (Map_Man_t *pMan, Map_Node_t *p1, Map_Node_t *p2)
 
Map_Node_tMap_NodeBuf (Map_Man_t *p, Map_Node_t *p1)
 
void Map_NodeSetChoice (Map_Man_t *pMan, Map_Node_t *pNodeOld, Map_Node_t *pNodeNew)
 

Function Documentation

◆ Map_CutReadLeaves()

Map_Node_t ** Map_CutReadLeaves ( Map_Cut_t * p)

Definition at line 141 of file mapperCreate.c.

141{ return p->ppLeaves; }
Cube * p
Definition exorList.c:222

◆ Map_CutReadLeavesNum()

int Map_CutReadLeavesNum ( Map_Cut_t * p)

Definition at line 140 of file mapperCreate.c.

140{ return p->nLeaves; }

◆ Map_CutReadNext()

Map_Cut_t * Map_CutReadNext ( Map_Cut_t * p)

Definition at line 145 of file mapperCreate.c.

145{ return p->pNext; }

◆ Map_CutReadPhase0()

unsigned Map_CutReadPhase0 ( Map_Cut_t * p)

Definition at line 143 of file mapperCreate.c.

143{ return p->M[0].uPhaseBest;}

◆ Map_CutReadPhase1()

unsigned Map_CutReadPhase1 ( Map_Cut_t * p)

Definition at line 144 of file mapperCreate.c.

144{ return p->M[1].uPhaseBest;}

◆ Map_CutReadPhaseBest()

unsigned Map_CutReadPhaseBest ( Map_Cut_t * p,
int fPhase )

Definition at line 142 of file mapperCreate.c.

142{ return p->M[fPhase].uPhaseBest;}

◆ Map_CutReadSuper0()

Map_Super_t * Map_CutReadSuper0 ( Map_Cut_t * p)

Definition at line 138 of file mapperCreate.c.

138{ return p->M[0].pSuperBest;}

◆ Map_CutReadSuper1()

Map_Super_t * Map_CutReadSuper1 ( Map_Cut_t * p)

Definition at line 139 of file mapperCreate.c.

139{ return p->M[1].pSuperBest;}

◆ Map_CutReadSuperBest()

Map_Super_t * Map_CutReadSuperBest ( Map_Cut_t * p,
int fPhase )

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

Synopsis [Reads parameters from the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 137 of file mapperCreate.c.

137{ return p->M[fPhase].pSuperBest;}

◆ Map_ManCreate()

Map_Man_t * Map_ManCreate ( int nInputs,
int nOutputs,
int fVerbose )

FUNCTION DEFINITIONS ///.

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

Synopsis [Create the mapping manager.]

Description [The number of inputs and outputs is assumed to be known is advance. It is much simpler to have them fixed upfront. When it comes to representing the object graph in the form of AIG, the resulting manager is similar to the regular AIG manager, except that it does not use reference counting (and therefore does not have garbage collections). It does have table resizing. The data structure is more flexible to represent additional information needed for mapping.]

SideEffects []

SeeAlso []

Definition at line 192 of file mapperCreate.c.

193{
194 Map_Man_t * p;
195 int i;
196
197 // derive the supergate library
198 if ( Abc_FrameReadLibSuper() == NULL )
199 {
200 printf( "The supergate library is not specified. Use \"read_super\".\n" );
201 return NULL;
202 }
203
204 // start the manager
205 p = ABC_ALLOC( Map_Man_t, 1 );
206 memset( p, 0, sizeof(Map_Man_t) );
207 p->pSuperLib = (Map_SuperLib_t *)Abc_FrameReadLibSuper();
208 p->nVarsMax = p->pSuperLib->nVarsMax;
209 p->fVerbose = fVerbose;
210 p->fEpsilon = (float)0.001;
211 assert( p->nVarsMax > 0 );
212
213 if ( p->nVarsMax == 5 )
214 Extra_Truth4VarN( &p->uCanons, &p->uPhases, &p->pCounters, 8 );
215
216 // start various data structures
217 Map_TableCreate( p );
218 Map_MappingSetupTruthTables( p->uTruths );
219 Map_MappingSetupTruthTablesLarge( p->uTruthsLarge );
220// printf( "Node = %d bytes. Cut = %d bytes. Super = %d bytes.\n", sizeof(Map_Node_t), sizeof(Map_Cut_t), sizeof(Map_Super_t) );
221 p->mmNodes = Extra_MmFixedStart( sizeof(Map_Node_t) );
222 p->mmCuts = Extra_MmFixedStart( sizeof(Map_Cut_t) );
223
224 // make sure the constant node will get index -1
225 p->nNodes = -1;
226 // create the constant node
227 p->pConst1 = Map_NodeCreate( p, NULL, NULL );
228 p->vMapObjs = Map_NodeVecAlloc( 100 );
229 p->vMapBufs = Map_NodeVecAlloc( 100 );
230 p->vVisited = Map_NodeVecAlloc( 100 );
231
232 // create the PI nodes
233 p->nInputs = nInputs;
234 p->pInputs = ABC_ALLOC( Map_Node_t *, nInputs );
235 for ( i = 0; i < nInputs; i++ )
236 p->pInputs[i] = Map_NodeCreate( p, NULL, NULL );
237
238 // create the place for the output nodes
239 p->nOutputs = nOutputs;
240 p->pOutputs = ABC_ALLOC( Map_Node_t *, nOutputs );
241 memset( p->pOutputs, 0, sizeof(Map_Node_t *) * nOutputs );
242 return p;
243}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
ABC_DLL void * Abc_FrameReadLibSuper()
Definition mainFrame.c:61
Extra_MmFixed_t * Extra_MmFixedStart(int nEntrySize)
void Extra_Truth4VarN(unsigned short **puCanons, char ***puPhases, char **ppCounters, int nPhasesMax)
Map_Node_t * Map_NodeCreate(Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
Map_NodeVec_t * Map_NodeVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition mapperVec.c:45
void Map_MappingSetupTruthTablesLarge(unsigned uTruths[][32])
typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t
INCLUDES ///.
Definition mapper.h:40
struct Map_CutStruct_t_ Map_Cut_t
Definition mapper.h:43
Map_Node_t * Map_NodeCreate(Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
struct Map_SuperLibStruct_t_ Map_SuperLib_t
Definition mapper.h:46
void Map_MappingSetupTruthTables(unsigned uTruths[][2])
struct Map_NodeStruct_t_ Map_Node_t
Definition mapper.h:41
#define assert(ex)
Definition util_old.h:213
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_ManCreateAigIds()

void Map_ManCreateAigIds ( Map_Man_t * p,
int nObjs )

Definition at line 78 of file mapperCreate.c.

78{ p->pAigNodeIDs = ABC_CALLOC( int, nObjs ); }
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
Here is the caller graph for this function:

◆ Map_ManCreateNodeDelays()

void Map_ManCreateNodeDelays ( Map_Man_t * p,
int LogFan )

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

Synopsis [Creates node delays.]

Description []

SideEffects []

SeeAlso []

Definition at line 293 of file mapperCreate.c.

294{
295 Map_Node_t * pNode;
296 int k;
297 assert( p->pNodeDelays == NULL );
298 p->pNodeDelays = ABC_CALLOC( float, p->vMapObjs->nSize );
299 for ( k = 0; k < p->vMapObjs->nSize; k++ )
300 {
301 pNode = p->vMapObjs->pArray[k];
302 if ( pNode->nRefs == 0 )
303 continue;
304 p->pNodeDelays[k] = 0.014426 * LogFan * p->pSuperLib->tDelayInv.Worst * log( (double)pNode->nRefs ); // 1.4426 = 1/ln(2)
305// printf( "%d = %d (%.2f) ", k, pNode->nRefs, p->pNodeDelays[k] );
306 }
307// printf( "\n" );
308}
Here is the caller graph for this function:

◆ Map_ManFree()

void Map_ManFree ( Map_Man_t * p)

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

Synopsis [Deallocates the mapping manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 256 of file mapperCreate.c.

257{
258// int i;
259// for ( i = 0; i < p->vMapObjs->nSize; i++ )
260// Map_NodeVecFree( p->vMapObjs->pArray[i]->vFanouts );
261// Map_NodeVecFree( p->pConst1->vFanouts );
262 Map_NodeVecFree( p->vMapObjs );
263 Map_NodeVecFree( p->vMapBufs );
264 Map_NodeVecFree( p->vVisited );
265 if ( p->uCanons ) ABC_FREE( p->uCanons );
266 if ( p->uPhases ) ABC_FREE( p->uPhases );
267 if ( p->pCounters ) ABC_FREE( p->pCounters );
268 Extra_MmFixedStop( p->mmNodes );
269 Extra_MmFixedStop( p->mmCuts );
270 ABC_FREE( p->pAigNodeIDs );
271 ABC_FREE( p->pNodeDelays );
272 ABC_FREE( p->pInputArrivals );
273 ABC_FREE( p->pOutputRequireds );
274 ABC_FREE( p->pInputs );
275 ABC_FREE( p->pOutputs );
276 ABC_FREE( p->pBins );
277 ABC_FREE( p->ppOutputNames );
278 ABC_FREE( p );
279}
#define ABC_FREE(obj)
Definition abc_global.h:267
void Extra_MmFixedStop(Extra_MmFixed_t *p)
void Map_NodeVecFree(Map_NodeVec_t *p)
Definition mapperVec.c:68
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_ManPrintStatsToFile()

void Map_ManPrintStatsToFile ( char * pName,
float Area,
float Delay,
abctime Time )

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

Synopsis [Prints the mapping stats.]

Description []

SideEffects []

SeeAlso []

Definition at line 350 of file mapperCreate.c.

351{
352 FILE * pTable;
353 pTable = fopen( "map_stats.txt", "a+" );
354 fprintf( pTable, "%s ", pName );
355 fprintf( pTable, "%4.2f ", Area );
356 fprintf( pTable, "%4.2f ", Delay );
357 fprintf( pTable, "%4.2f\n", (float)(Time)/(float)(CLOCKS_PER_SEC) );
358 fclose( pTable );
359}

◆ Map_ManPrintTimeStats()

void Map_ManPrintTimeStats ( Map_Man_t * p)

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

Synopsis [Deallocates the mapping manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 322 of file mapperCreate.c.

323{
324 printf( "N-canonical = %d. Matchings = %d. Phases = %d. ", p->nCanons, p->nMatches, p->nPhases );
325 printf( "Choice nodes = %d. Choices = %d.\n", p->nChoiceNodes, p->nChoices );
326 ABC_PRT( "ToMap", p->timeToMap );
327 ABC_PRT( "Cuts ", p->timeCuts );
328 ABC_PRT( "Truth", p->timeTruth );
329 ABC_PRT( "Match", p->timeMatch );
330 ABC_PRT( "Area ", p->timeArea );
331 ABC_PRT( "Sweep", p->timeSweep );
332 ABC_PRT( "ToNet", p->timeToNet );
333 ABC_PRT( "TOTAL", p->timeTotal );
334 if ( p->time1 ) { ABC_PRT( "time1", p->time1 ); }
335 if ( p->time2 ) { ABC_PRT( "time2", p->time2 ); }
336 if ( p->time3 ) { ABC_PRT( "time3", p->time3 ); }
337}
#define ABC_PRT(a, t)
Definition abc_global.h:255

◆ Map_ManReadAreaFinal()

float Map_ManReadAreaFinal ( Map_Man_t * p)

Definition at line 61 of file mapperCreate.c.

61{ return p->AreaFinal; }

◆ Map_ManReadBufDriver()

Map_Node_t * Map_ManReadBufDriver ( Map_Man_t * p,
int i )

Definition at line 55 of file mapperCreate.c.

55{ return Map_ManReadBufs(p)[i]->p1; }
Map_Node_t ** Map_ManReadBufs(Map_Man_t *p)
Map_Node_t * p1
Definition mapperInt.h:225
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_ManReadBufNum()

int Map_ManReadBufNum ( Map_Man_t * p)

Definition at line 51 of file mapperCreate.c.

51{ return Map_NodeVecReadSize(p->vMapBufs); }
int Map_NodeVecReadSize(Map_NodeVec_t *p)
Definition mapperVec.c:122
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_ManReadBufs()

Map_Node_t ** Map_ManReadBufs ( Map_Man_t * p)

Definition at line 54 of file mapperCreate.c.

54{ return Map_NodeVecReadArray(p->vMapBufs); }
Map_Node_t ** Map_NodeVecReadArray(Map_NodeVec_t *p)
Definition mapperVec.c:106
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_ManReadConst1()

Map_Node_t * Map_ManReadConst1 ( Map_Man_t * p)

Definition at line 56 of file mapperCreate.c.

56{ return p->pConst1; }
Here is the caller graph for this function:

◆ Map_ManReadFanoutViolations()

int Map_ManReadFanoutViolations ( Map_Man_t * p)

Definition at line 70 of file mapperCreate.c.

70{ return p->nFanoutViolations; }

◆ Map_ManReadGenLib()

Mio_Library_t * Map_ManReadGenLib ( Map_Man_t * p)

Definition at line 59 of file mapperCreate.c.

59{ return p->pSuperLib->pGenlib; }

◆ Map_ManReadInputArrivals()

Map_Time_t * Map_ManReadInputArrivals ( Map_Man_t * p)

Definition at line 57 of file mapperCreate.c.

57{ return p->pInputArrivals; }

◆ Map_ManReadInputNum()

int Map_ManReadInputNum ( Map_Man_t * p)

FUNCTION DEFINITIONS ///.

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

Synopsis [Reads parameters from the mapping manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 49 of file mapperCreate.c.

49{ return p->nInputs; }

◆ Map_ManReadInputs()

Map_Node_t ** Map_ManReadInputs ( Map_Man_t * p)

Definition at line 52 of file mapperCreate.c.

52{ return p->pInputs; }
Here is the caller graph for this function:

◆ Map_ManReadOutputNum()

int Map_ManReadOutputNum ( Map_Man_t * p)

Definition at line 50 of file mapperCreate.c.

50{ return p->nOutputs; }

◆ Map_ManReadOutputRequireds()

Map_Time_t * Map_ManReadOutputRequireds ( Map_Man_t * p)

Definition at line 58 of file mapperCreate.c.

58{ return p->pOutputRequireds; }

◆ Map_ManReadOutputs()

Map_Node_t ** Map_ManReadOutputs ( Map_Man_t * p)

Definition at line 53 of file mapperCreate.c.

53{ return p->pOutputs; }
Here is the caller graph for this function:

◆ Map_ManReadRequiredGlo()

float Map_ManReadRequiredGlo ( Map_Man_t * p)

Definition at line 62 of file mapperCreate.c.

62{ return p->fRequiredGlo; }

◆ Map_ManReadVerbose()

int Map_ManReadVerbose ( Map_Man_t * p)

Definition at line 60 of file mapperCreate.c.

60{ return p->fVerbose; }

◆ Map_ManSetAreaRecovery()

void Map_ManSetAreaRecovery ( Map_Man_t * p,
int fAreaRecovery )

Definition at line 64 of file mapperCreate.c.

64{ p->fAreaRecovery = fAreaRecovery;}
Here is the caller graph for this function:

◆ Map_ManSetChoiceNodeNum()

void Map_ManSetChoiceNodeNum ( Map_Man_t * p,
int nChoiceNodes )

Definition at line 72 of file mapperCreate.c.

72{ p->nChoiceNodes = nChoiceNodes; }

◆ Map_ManSetChoiceNum()

void Map_ManSetChoiceNum ( Map_Man_t * p,
int nChoices )

Definition at line 73 of file mapperCreate.c.

73{ p->nChoices = nChoices; }

◆ Map_ManSetDelayTarget()

void Map_ManSetDelayTarget ( Map_Man_t * p,
float DelayTarget )

Definition at line 65 of file mapperCreate.c.

65{ p->DelayTarget = DelayTarget;}
Here is the caller graph for this function:

◆ Map_ManSetFanoutViolations()

void Map_ManSetFanoutViolations ( Map_Man_t * p,
int nVio )

Definition at line 71 of file mapperCreate.c.

71{ p->nFanoutViolations = nVio; }

◆ Map_ManSetInputArrivals()

void Map_ManSetInputArrivals ( Map_Man_t * p,
Map_Time_t * pArrivals )

Definition at line 66 of file mapperCreate.c.

66{ p->pInputArrivals = pArrivals; }
Here is the caller graph for this function:

◆ Map_ManSetNumIterations()

void Map_ManSetNumIterations ( Map_Man_t * p,
int nIterations )

Definition at line 69 of file mapperCreate.c.

69{ p->nIterations = nIterations; }

◆ Map_ManSetObeyFanoutLimits()

void Map_ManSetObeyFanoutLimits ( Map_Man_t * p,
int fObeyFanoutLimits )

Definition at line 68 of file mapperCreate.c.

68{ p->fObeyFanoutLimits = fObeyFanoutLimits; }

◆ Map_ManSetOutputNames()

void Map_ManSetOutputNames ( Map_Man_t * p,
char ** ppNames )

Definition at line 63 of file mapperCreate.c.

63{ p->ppOutputNames = ppNames;}
Here is the caller graph for this function:

◆ Map_ManSetOutputRequireds()

void Map_ManSetOutputRequireds ( Map_Man_t * p,
Map_Time_t * pRequireds )

Definition at line 67 of file mapperCreate.c.

67{ p->pOutputRequireds = pRequireds; }
Here is the caller graph for this function:

◆ Map_ManSetSkipFanout()

void Map_ManSetSkipFanout ( Map_Man_t * p,
int fSkipFanout )

Definition at line 76 of file mapperCreate.c.

76{ p->fSkipFanout = fSkipFanout; }
Here is the caller graph for this function:

◆ Map_ManSetSwitching()

void Map_ManSetSwitching ( Map_Man_t * p,
int fSwitching )

Definition at line 75 of file mapperCreate.c.

75{ p->fSwitching = fSwitching; }
Here is the caller graph for this function:

◆ Map_ManSetUseProfile()

void Map_ManSetUseProfile ( Map_Man_t * p)

Definition at line 77 of file mapperCreate.c.

77{ p->fUseProfile = 1; }
Here is the caller graph for this function:

◆ Map_ManSetVerbose()

void Map_ManSetVerbose ( Map_Man_t * p,
int fVerbose )

Definition at line 74 of file mapperCreate.c.

74{ p->fVerbose = fVerbose; }

◆ Map_NodeAnd()

Map_Node_t * Map_NodeAnd ( Map_Man_t * pMan,
Map_Node_t * p1,
Map_Node_t * p2 )

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

Synopsis [Looks up the AND2 node in the unique table.]

Description [This procedure implements one-level hashing. All the nodes are hashed by their children. If the node with the same children was already created, it is returned by the call to this procedure. If it does not exist, this procedure creates a new node with these children. ]

SideEffects []

SeeAlso []

Definition at line 456 of file mapperCreate.c.

457{
458 Map_Node_t * pEnt;
459 unsigned Key;
460
461 if ( p1 == p2 )
462 return p1;
463 if ( p1 == Map_Not(p2) )
464 return Map_Not(pMan->pConst1);
465 if ( Map_NodeIsConst(p1) )
466 {
467 if ( p1 == pMan->pConst1 )
468 return p2;
469 return Map_Not(pMan->pConst1);
470 }
471 if ( Map_NodeIsConst(p2) )
472 {
473 if ( p2 == pMan->pConst1 )
474 return p1;
475 return Map_Not(pMan->pConst1);
476 }
477
478 if ( Map_Regular(p1)->Num > Map_Regular(p2)->Num )
479 pEnt = p1, p1 = p2, p2 = pEnt;
480
481 Key = Map_HashKey2( p1, p2, pMan->nBins );
482 for ( pEnt = pMan->pBins[Key]; pEnt; pEnt = pEnt->pNext )
483 if ( pEnt->p1 == p1 && pEnt->p2 == p2 )
484 return pEnt;
485 // resize the table
486 if ( pMan->nNodes >= 2 * pMan->nBins )
487 {
488 Map_TableResize( pMan );
489 Key = Map_HashKey2( p1, p2, pMan->nBins );
490 }
491 // create the new node
492 pEnt = Map_NodeCreate( pMan, p1, p2 );
493 // add the node to the corresponding linked list in the table
494 pEnt->pNext = pMan->pBins[Key];
495 pMan->pBins[Key] = pEnt;
496 return pEnt;
497}
int Map_NodeIsConst(Map_Node_t *p)
#define Map_Not(p)
Definition mapper.h:69
#define Map_Regular(p)
Definition mapper.h:68
Map_Node_t * pNext
Definition mapperInt.h:209
Map_Node_t * p2
Definition mapperInt.h:226
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_NodeBuf()

Map_Node_t * Map_NodeBuf ( Map_Man_t * p,
Map_Node_t * p1 )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 561 of file mapperCreate.c.

562{
563 Map_Node_t * pNode = Map_NodeCreate( p, p1, NULL );
564 Map_NodeVecPush( p->vMapBufs, pNode );
565 return pNode;
566}
void Map_NodeVecPush(Map_NodeVec_t *p, Map_Node_t *Entry)
Definition mapperVec.c:190
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_NodeComparePhase()

int Map_NodeComparePhase ( Map_Node_t * p1,
Map_Node_t * p2 )

Definition at line 124 of file mapperCreate.c.

124{ assert( !Map_IsComplement(p1) ); assert( !Map_IsComplement(p2) ); return p1->fInv ^ p2->fInv; }
#define Map_IsComplement(p)
GLOBAL VARIABLES ///.
Definition mapper.h:67

◆ Map_NodeCreate()

Map_Node_t * Map_NodeCreate ( Map_Man_t * p,
Map_Node_t * p1,
Map_Node_t * p2 )

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

Synopsis [Creates a new node.]

Description [This procedure should be called to create the constant node and the PI nodes first.]

SideEffects []

SeeAlso []

Definition at line 373 of file mapperCreate.c.

374{
375 Map_Node_t * pNode;
376 // create the node
377 pNode = (Map_Node_t *)Extra_MmFixedEntryFetch( p->mmNodes );
378 memset( pNode, 0, sizeof(Map_Node_t) );
379 pNode->tRequired[0].Rise = pNode->tRequired[0].Fall = pNode->tRequired[0].Worst = MAP_FLOAT_LARGE;
380 pNode->tRequired[1].Rise = pNode->tRequired[1].Fall = pNode->tRequired[1].Worst = MAP_FLOAT_LARGE;
381 pNode->p1 = p1;
382 pNode->p2 = p2;
383 pNode->p = p;
384 // set the number of this node
385 pNode->Num = p->nNodes++;
386 // place to store the fanouts
387// pNode->vFanouts = Map_NodeVecAlloc( 5 );
388 // store this node in the internal array
389 if ( pNode->Num >= 0 )
390 Map_NodeVecPush( p->vMapObjs, pNode );
391 else
392 pNode->fInv = 1;
393 // set the level of this node
394 if ( p1 )
395 {
396#ifdef MAP_ALLOCATE_FANOUT
397 // create the fanout info
399 if ( p2 )
401#endif
402
403 if ( p2 )
404 {
405 pNode->Level = 1 + MAP_MAX(Map_Regular(pNode->p1)->Level, Map_Regular(pNode->p2)->Level);
407 }
408 else
409 {
410 pNode->Level = Map_Regular(pNode->p1)->Level;
411 pNode->fInv = Map_NodeIsSimComplement(p1);
412 }
413 }
414 // reference the inputs (will be used to compute the number of fanouts)
415 if ( p1 ) Map_NodeRef(p1);
416 if ( p2 ) Map_NodeRef(p2);
417
418 pNode->nRefEst[0] = pNode->nRefEst[1] = -1;
419 return pNode;
420}
char * Extra_MmFixedEntryFetch(Extra_MmFixed_t *p)
#define MAP_MAX(a, b)
Definition mapperInt.h:58
#define Map_NodeRef(p)
Definition mapperInt.h:75
#define Map_NodeIsSimComplement(p)
Definition mapperInt.h:84
void Map_NodeAddFaninFanout(Map_Node_t *pFanin, Map_Node_t *pFanout)
#define MAP_FLOAT_LARGE
Definition mapperInt.h:61
Map_Time_t tRequired[2]
Definition mapperInt.h:240
Map_Man_t * p
Definition mapperInt.h:208
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_NodeIsAnd()

int Map_NodeIsAnd ( Map_Node_t * p)

Definition at line 123 of file mapperCreate.c.

123{ return (Map_Regular(p))->p1 != NULL && (Map_Regular(p))->p2 != NULL; }
Here is the caller graph for this function:

◆ Map_NodeIsBuf()

int Map_NodeIsBuf ( Map_Node_t * p)

Definition at line 122 of file mapperCreate.c.

122{ return (Map_Regular(p))->p1 != NULL && (Map_Regular(p))->p2 == NULL; }
Here is the caller graph for this function:

◆ Map_NodeIsConst()

int Map_NodeIsConst ( Map_Node_t * p)

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

Synopsis [Checks the type of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 120 of file mapperCreate.c.

120{ return (Map_Regular(p))->Num == -1; }
Here is the caller graph for this function:

◆ Map_NodeIsVar()

int Map_NodeIsVar ( Map_Node_t * p)

Definition at line 121 of file mapperCreate.c.

121{ return (Map_Regular(p))->p1 == NULL && (Map_Regular(p))->Num >= 0; }
Here is the caller graph for this function:

◆ Map_NodeReadAigId()

int Map_NodeReadAigId ( Map_Node_t * p)

Definition at line 95 of file mapperCreate.c.

95{ return p->p->pAigNodeIDs[p->Num]; }

◆ Map_NodeReadCutBest()

Map_Cut_t * Map_NodeReadCutBest ( Map_Node_t * p,
int fPhase )

Definition at line 97 of file mapperCreate.c.

97{ return p->pCutBest[fPhase]; }

◆ Map_NodeReadCuts()

Map_Cut_t * Map_NodeReadCuts ( Map_Node_t * p)

Definition at line 96 of file mapperCreate.c.

96{ return p->pCuts; }

◆ Map_NodeReadData()

char * Map_NodeReadData ( Map_Node_t * p,
int fPhase )

Definition at line 92 of file mapperCreate.c.

92{ return fPhase? p->pData1 : p->pData0; }

◆ Map_NodeReadLevel()

int Map_NodeReadLevel ( Map_Node_t * p)

Definition at line 94 of file mapperCreate.c.

94{ return Map_Regular(p)->Level; }

◆ Map_NodeReadMan()

Map_Man_t * Map_NodeReadMan ( Map_Node_t * p)

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

Synopsis [Reads parameters from the mapping node.]

Description []

SideEffects []

SeeAlso []

Definition at line 91 of file mapperCreate.c.

91{ return p->p; }

◆ Map_NodeReadNum()

int Map_NodeReadNum ( Map_Node_t * p)

Definition at line 93 of file mapperCreate.c.

93{ return p->Num; }

◆ Map_NodeReadOne()

Map_Node_t * Map_NodeReadOne ( Map_Node_t * p)

Definition at line 98 of file mapperCreate.c.

98{ return p->p1; }

◆ Map_NodeReadTwo()

Map_Node_t * Map_NodeReadTwo ( Map_Node_t * p)

Definition at line 99 of file mapperCreate.c.

99{ return p->p2; }

◆ Map_NodeSetAigId()

void Map_NodeSetAigId ( Map_Node_t * p,
int Id )

Definition at line 104 of file mapperCreate.c.

104{ p->p->pAigNodeIDs[p->Num] = Id; }
Here is the caller graph for this function:

◆ Map_NodeSetChoice()

void Map_NodeSetChoice ( Map_Man_t * pMan,
Map_Node_t * pNodeOld,
Map_Node_t * pNodeNew )

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

Synopsis [Sets the node to be equivalent to the given one.]

Description [This procedure is a work-around for the equivalence check. Does not verify the equivalence. Use at the user's risk.]

SideEffects []

SeeAlso []

Definition at line 580 of file mapperCreate.c.

581{
582 pNodeNew->pNextE = pNodeOld->pNextE;
583 pNodeOld->pNextE = pNodeNew;
584 pNodeNew->pRepr = pNodeOld;
585}
Map_Node_t * pNextE
Definition mapperInt.h:227
Map_Node_t * pRepr
Definition mapperInt.h:228

◆ Map_NodeSetData()

void Map_NodeSetData ( Map_Node_t * p,
int fPhase,
char * pData )

Definition at line 100 of file mapperCreate.c.

100{ if (fPhase) p->pData1 = pData; else p->pData0 = pData; }
Here is the caller graph for this function:

◆ Map_NodeSetNextE()

void Map_NodeSetNextE ( Map_Node_t * p,
Map_Node_t * pNextE )

Definition at line 101 of file mapperCreate.c.

101{ p->pNextE = pNextE; }
Here is the caller graph for this function:

◆ Map_NodeSetRepr()

void Map_NodeSetRepr ( Map_Node_t * p,
Map_Node_t * pRepr )

Definition at line 102 of file mapperCreate.c.

102{ p->pRepr = pRepr; }
Here is the caller graph for this function:

◆ Map_NodeSetSwitching()

void Map_NodeSetSwitching ( Map_Node_t * p,
float Switching )

Definition at line 103 of file mapperCreate.c.

103{ p->Switching = Switching; }
Here is the caller graph for this function:

◆ Map_SuperLibReadAreaInv()

float Map_SuperLibReadAreaInv ( Map_SuperLib_t * p)

Definition at line 169 of file mapperCreate.c.

169{ return p->AreaInv; }

◆ Map_SuperLibReadDelayInv()

Map_Time_t Map_SuperLibReadDelayInv ( Map_SuperLib_t * p)

Definition at line 170 of file mapperCreate.c.

170{ return p->tDelayInv;}

◆ Map_SuperLibReadGenLib()

Mio_Library_t * Map_SuperLibReadGenLib ( Map_SuperLib_t * p)

Definition at line 168 of file mapperCreate.c.

168{ return p->pGenlib; }

◆ Map_SuperLibReadVarsMax()

int Map_SuperLibReadVarsMax ( Map_SuperLib_t * p)

Definition at line 171 of file mapperCreate.c.

171{ return p->nVarsMax; }

◆ Map_SuperReadFaninNum()

int Map_SuperReadFaninNum ( Map_Super_t * p)

Definition at line 162 of file mapperCreate.c.

162{ return p->nFanins; }
Here is the caller graph for this function:

◆ Map_SuperReadFanins()

Map_Super_t ** Map_SuperReadFanins ( Map_Super_t * p)

Definition at line 161 of file mapperCreate.c.

161{ return p->pFanins; }
Here is the caller graph for this function:

◆ Map_SuperReadFanoutLimit()

int Map_SuperReadFanoutLimit ( Map_Super_t * p)

Definition at line 166 of file mapperCreate.c.

166{ return p->nFanLimit;}

◆ Map_SuperReadFormula()

char * Map_SuperReadFormula ( Map_Super_t * p)

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

Synopsis [Reads parameters from the supergate.]

Description []

SideEffects []

SeeAlso []

Definition at line 158 of file mapperCreate.c.

158{ return p->pFormula; }

◆ Map_SuperReadNext()

Map_Super_t * Map_SuperReadNext ( Map_Super_t * p)

Definition at line 163 of file mapperCreate.c.

163{ return p->pNext; }

◆ Map_SuperReadNum()

int Map_SuperReadNum ( Map_Super_t * p)

Definition at line 160 of file mapperCreate.c.

160{ return p->Num; }
Here is the caller graph for this function:

◆ Map_SuperReadNumPhases()

int Map_SuperReadNumPhases ( Map_Super_t * p)

Definition at line 164 of file mapperCreate.c.

164{ return p->nPhases; }

◆ Map_SuperReadPhases()

unsigned char * Map_SuperReadPhases ( Map_Super_t * p)

Definition at line 165 of file mapperCreate.c.

165{ return p->uPhases; }

◆ Map_SuperReadRoot()

Mio_Gate_t * Map_SuperReadRoot ( Map_Super_t * p)

Definition at line 159 of file mapperCreate.c.

159{ return p->pRoot; }
Here is the caller graph for this function: