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); }
192 printf(
"The supergate library is not specified. Use \"read_super\".\n" );
200 p->nVarsMax = p->pSuperLib->nVarsMax;
201 p->fVerbose = fVerbose;
202 p->fEpsilon = (float)0.001;
203 assert( p->nVarsMax > 0 );
205 if ( p->nVarsMax == 5 )
225 p->nInputs = nInputs;
227 for ( i = 0; i < nInputs; i++ )
231 p->nOutputs = nOutputs;
257 if ( p->uCanons )
ABC_FREE( p->uCanons );
258 if ( p->uPhases )
ABC_FREE( p->uPhases );
259 if ( p->pCounters )
ABC_FREE( p->pCounters );
288 assert( p->pNodeDelays == NULL );
289 p->pNodeDelays =
ABC_CALLOC(
float, p->vMapObjs->nSize );
290 for ( k = 0; k < p->vMapObjs->nSize; k++ )
292 pNode = p->vMapObjs->pArray[k];
293 if ( pNode->
nRefs == 0 )
295 p->pNodeDelays[k] = 0.014426 * LogFan * p->pSuperLib->tDelayInv.Worst * log( (
double)pNode->
nRefs );
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 ); }
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) );
376 pNode->
Num = p->nNodes++;
380 if ( pNode->
Num >= 0 )
387 #ifdef MAP_ALLOCATE_FANOUT
426 assert( pMan->pBins == NULL );
458 if ( p1 == pMan->pConst1 )
464 if ( p2 == pMan->pConst1 )
470 pEnt = p1, p1 = p2, p2 = pEnt;
473 for ( pEnt = pMan->pBins[Key]; pEnt; pEnt = pEnt->
pNext )
474 if ( pEnt->
p1 == p1 && pEnt->
p2 == p2 )
477 if ( pMan->nNodes >= 2 * pMan->nBins )
485 pEnt->
pNext = pMan->pBins[Key];
486 pMan->pBins[Key] = pEnt;
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 )
523 pEnt->
pNext = pBinsNew[Key];
524 pBinsNew[Key] = pEnt;
527 assert( Counter == pMan->nNodes - pMan->nInputs );
528 if ( pMan->fVerbose )
535 pMan->pBins = pBinsNew;
536 pMan->nBins = nBinsNew;
574 pNodeOld->
pNextE = pNodeNew;
575 pNodeNew->
pRepr = pNodeOld;
unsigned Map_CutReadPhase0(Map_Cut_t *p)
void Map_NodeAddFaninFanout(Map_Node_t *pFanin, Map_Node_t *pFanout)
Map_Super_t * Map_CutReadSuper0(Map_Cut_t *p)
int Map_NodeVecReadSize(Map_NodeVec_t *p)
float Map_SuperLibReadAreaInv(Map_SuperLib_t *p)
static int Abc_PrimeCudd(unsigned int p)
Map_Super_t * Map_CutReadSuper1(Map_Cut_t *p)
Map_NodeVec_t * Map_NodeVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
int Map_ManReadBufNum(Map_Man_t *p)
void Map_ManSetFanoutViolations(Map_Man_t *p, int nVio)
Map_Cut_t * Map_NodeReadCutBest(Map_Node_t *p, int fPhase)
void Map_ManCreateNodeDelays(Map_Man_t *p, int LogFan)
int Map_CutReadLeavesNum(Map_Cut_t *p)
Map_Node_t ** Map_ManReadInputs(Map_Man_t *p)
static unsigned Map_HashKey2(Map_Node_t *p0, Map_Node_t *p1, int TableSize)
float Map_ManReadRequiredGlo(Map_Man_t *p)
void Map_ManSetOutputNames(Map_Man_t *p, char **ppNames)
void Map_ManSetSwitching(Map_Man_t *p, int fSwitching)
int Map_NodeIsVar(Map_Node_t *p)
void Map_ManSetNumIterations(Map_Man_t *p, int nIterations)
Map_Node_t ** Map_ManReadBufs(Map_Man_t *p)
Map_Node_t ** Map_NodeVecReadArray(Map_NodeVec_t *p)
void Map_ManPrintStatsToFile(char *pName, float Area, float Delay, abctime Time)
void Map_ManSetDelayTarget(Map_Man_t *p, float DelayTarget)
Map_Time_t * Map_ManReadInputArrivals(Map_Man_t *p)
Map_Node_t * Map_NodeAnd(Map_Man_t *pMan, Map_Node_t *p1, Map_Node_t *p2)
#define ABC_ALLOC(type, num)
int Map_NodeIsConst(Map_Node_t *p)
void Map_ManSetChoiceNodeNum(Map_Man_t *p, int nChoiceNodes)
Map_Man_t * Map_ManCreate(int nInputs, int nOutputs, int fVerbose)
FUNCTION DEFINITIONS ///.
Map_Super_t ** Map_SuperReadFanins(Map_Super_t *p)
static abctime Abc_Clock()
void Map_NodeSetData(Map_Node_t *p, int fPhase, char *pData)
Map_Man_t * Map_NodeReadMan(Map_Node_t *p)
#define Map_IsComplement(p)
GLOBAL VARIABLES ///.
Map_Node_t * Map_NodeReadOne(Map_Node_t *p)
Map_Node_t ** Map_ManReadOutputs(Map_Man_t *p)
static void Map_TableResize(Map_Man_t *p)
int Map_ManReadOutputNum(Map_Man_t *p)
static ABC_NAMESPACE_IMPL_START void Map_TableCreate(Map_Man_t *p)
DECLARATIONS ///.
int Map_SuperReadFaninNum(Map_Super_t *p)
void Map_ManSetOutputRequireds(Map_Man_t *p, Map_Time_t *pRequireds)
Map_Time_t * Map_ManReadOutputRequireds(Map_Man_t *p)
int Map_SuperLibReadVarsMax(Map_SuperLib_t *p)
Map_Node_t * Map_ManReadBufDriver(Map_Man_t *p, int i)
int Map_ManReadFanoutViolations(Map_Man_t *p)
void Map_ManSetChoiceNum(Map_Man_t *p, int nChoices)
#define ABC_NAMESPACE_IMPL_END
int Map_NodeIsBuf(Map_Node_t *p)
unsigned Map_CutReadPhase1(Map_Cut_t *p)
void Map_NodeSetNextE(Map_Node_t *p, Map_Node_t *pNextE)
ABC_DLL void * Abc_FrameReadLibSuper()
STRUCTURE DEFINITIONS ///.
int Map_ManReadInputNum(Map_Man_t *p)
FUNCTION DEFINITIONS ///.
Map_Super_t * Map_SuperReadNext(Map_Super_t *p)
Map_Cut_t * Map_NodeReadCuts(Map_Node_t *p)
Map_Time_t Map_SuperLibReadDelayInv(Map_SuperLib_t *p)
int Map_NodeReadLevel(Map_Node_t *p)
unsigned char * Map_SuperReadPhases(Map_Super_t *p)
void Map_NodeSetRepr(Map_Node_t *p, Map_Node_t *pRepr)
void Map_ManFree(Map_Man_t *p)
void Map_ManPrintTimeStats(Map_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
void Map_ManSetAreaRecovery(Map_Man_t *p, int fAreaRecovery)
typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t
INCLUDES ///.
void Map_NodeVecFree(Map_NodeVec_t *p)
Map_Cut_t * Map_CutReadNext(Map_Cut_t *p)
int Map_SuperReadFanoutLimit(Map_Super_t *p)
int Map_NodeIsAnd(Map_Node_t *p)
char * Map_SuperReadFormula(Map_Super_t *p)
Mio_Library_t * Map_SuperLibReadGenLib(Map_SuperLib_t *p)
int Map_NodeComparePhase(Map_Node_t *p1, Map_Node_t *p2)
int Map_NodeReadNum(Map_Node_t *p)
#define ABC_CALLOC(type, num)
int Map_SuperReadNumPhases(Map_Super_t *p)
void Map_ManSetObeyFanoutLimits(Map_Man_t *p, int fObeyFanoutLimits)
float Map_ManReadAreaFinal(Map_Man_t *p)
Map_Node_t ** Map_CutReadLeaves(Map_Cut_t *p)
void Map_NodeSetChoice(Map_Man_t *pMan, Map_Node_t *pNodeOld, Map_Node_t *pNodeNew)
char * Map_NodeReadData(Map_Node_t *p, int fPhase)
Map_Node_t * Map_NodeCreate(Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
void Map_MappingSetupTruthTablesLarge(unsigned uTruths[][32])
void Map_ManSetInputArrivals(Map_Man_t *p, Map_Time_t *pArrivals)
int Map_SuperReadNum(Map_Super_t *p)
void Map_NodeSetSwitching(Map_Node_t *p, float Switching)
void Map_ManSetVerbose(Map_Man_t *p, int fVerbose)
unsigned Map_CutReadPhaseBest(Map_Cut_t *p, int fPhase)
Mio_Gate_t * Map_SuperReadRoot(Map_Super_t *p)
void Map_NodeVecPush(Map_NodeVec_t *p, Map_Node_t *Entry)
Map_Node_t * Map_NodeReadTwo(Map_Node_t *p)
#define Map_NodeIsSimComplement(p)
Map_Super_t * Map_CutReadSuperBest(Map_Cut_t *p, int fPhase)
void Map_MappingSetupTruthTables(unsigned uTruths[][2])
int Map_ManReadVerbose(Map_Man_t *p)
Mio_Library_t * Map_ManReadGenLib(Map_Man_t *p)
Map_Node_t * Map_NodeBuf(Map_Man_t *p, Map_Node_t *p1)
Map_Node_t * Map_ManReadConst1(Map_Man_t *p)