32static 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); }
200 printf(
"The supergate library is not specified. Use \"read_super\".\n" );
208 p->nVarsMax =
p->pSuperLib->nVarsMax;
209 p->fVerbose = fVerbose;
210 p->fEpsilon = (float)0.001;
213 if (
p->nVarsMax == 5 )
217 Map_TableCreate(
p );
233 p->nInputs = nInputs;
235 for ( i = 0; i < nInputs; i++ )
239 p->nOutputs = nOutputs;
297 assert(
p->pNodeDelays == NULL );
298 p->pNodeDelays =
ABC_CALLOC(
float,
p->vMapObjs->nSize );
299 for ( k = 0; k <
p->vMapObjs->nSize; k++ )
301 pNode =
p->vMapObjs->pArray[k];
302 if ( pNode->
nRefs == 0 )
304 p->pNodeDelays[k] = 0.014426 * LogFan *
p->pSuperLib->tDelayInv.Worst * log( (
double)pNode->
nRefs );
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 );
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 ); }
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) );
385 pNode->
Num =
p->nNodes++;
389 if ( pNode->
Num >= 0 )
396#ifdef MAP_ALLOCATE_FANOUT
435 assert( pMan->pBins == NULL );
436 pMan->nBins = Abc_PrimeCudd(5000);
467 if ( p1 == pMan->pConst1 )
473 if ( p2 == pMan->pConst1 )
479 pEnt = p1, p1 = p2, p2 = pEnt;
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 )
486 if ( pMan->nNodes >= 2 * pMan->nBins )
488 Map_TableResize( pMan );
489 Key = Map_HashKey2( p1, p2, pMan->nBins );
494 pEnt->
pNext = pMan->pBins[Key];
495 pMan->pBins[Key] = pEnt;
515 int nBinsNew, Counter, i;
521 nBinsNew = Abc_PrimeCudd(2 * pMan->nBins);
527 for ( i = 0; i < pMan->nBins; i++ )
528 for ( pEnt = pMan->pBins[i], pEnt2 = pEnt? pEnt->
pNext: NULL; pEnt;
529 pEnt = pEnt2, pEnt2 = pEnt? pEnt->
pNext: NULL )
531 Key = Map_HashKey2( pEnt->
p1, pEnt->
p2, nBinsNew );
532 pEnt->
pNext = pBinsNew[Key];
533 pBinsNew[Key] = pEnt;
536 assert( Counter == pMan->nNodes - pMan->nInputs );
537 if ( pMan->fVerbose )
544 pMan->pBins = pBinsNew;
545 pMan->nBins = nBinsNew;
583 pNodeOld->
pNextE = pNodeNew;
584 pNodeNew->
pRepr = pNodeOld;
#define ABC_ALLOC(type, num)
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
ABC_DLL void * Abc_FrameReadLibSuper()
void Map_ManSetOutputNames(Map_Man_t *p, char **ppNames)
Mio_Library_t * Map_ManReadGenLib(Map_Man_t *p)
unsigned char * Map_SuperReadPhases(Map_Super_t *p)
int Map_NodeReadNum(Map_Node_t *p)
unsigned Map_CutReadPhaseBest(Map_Cut_t *p, int fPhase)
void Map_NodeSetData(Map_Node_t *p, int fPhase, char *pData)
int Map_ManReadVerbose(Map_Man_t *p)
Map_Super_t * Map_CutReadSuper1(Map_Cut_t *p)
Map_Super_t * Map_SuperReadNext(Map_Super_t *p)
unsigned Map_CutReadPhase0(Map_Cut_t *p)
float Map_ManReadAreaFinal(Map_Man_t *p)
void Map_NodeSetChoice(Map_Man_t *pMan, Map_Node_t *pNodeOld, Map_Node_t *pNodeNew)
int Map_NodeComparePhase(Map_Node_t *p1, Map_Node_t *p2)
Map_Cut_t * Map_NodeReadCutBest(Map_Node_t *p, int fPhase)
void Map_ManSetOutputRequireds(Map_Man_t *p, Map_Time_t *pRequireds)
int Map_ManReadFanoutViolations(Map_Man_t *p)
void Map_ManPrintTimeStats(Map_Man_t *p)
Map_Node_t * Map_NodeReadTwo(Map_Node_t *p)
int Map_ManReadInputNum(Map_Man_t *p)
FUNCTION DEFINITIONS ///.
void Map_ManSetVerbose(Map_Man_t *p, int fVerbose)
int Map_NodeIsBuf(Map_Node_t *p)
void Map_NodeSetRepr(Map_Node_t *p, Map_Node_t *pRepr)
int Map_NodeReadAigId(Map_Node_t *p)
void Map_ManSetUseProfile(Map_Man_t *p)
int Map_NodeReadLevel(Map_Node_t *p)
int Map_CutReadLeavesNum(Map_Cut_t *p)
int Map_SuperReadFaninNum(Map_Super_t *p)
int Map_NodeIsConst(Map_Node_t *p)
Map_Cut_t * Map_NodeReadCuts(Map_Node_t *p)
Map_Time_t * Map_ManReadOutputRequireds(Map_Man_t *p)
void Map_ManSetSwitching(Map_Man_t *p, int fSwitching)
Mio_Gate_t * Map_SuperReadRoot(Map_Super_t *p)
Mio_Library_t * Map_SuperLibReadGenLib(Map_SuperLib_t *p)
Map_Node_t ** Map_ManReadOutputs(Map_Man_t *p)
void Map_ManSetObeyFanoutLimits(Map_Man_t *p, int fObeyFanoutLimits)
int Map_ManReadBufNum(Map_Man_t *p)
Map_Node_t * Map_ManReadConst1(Map_Man_t *p)
Map_Node_t ** Map_ManReadInputs(Map_Man_t *p)
Map_Super_t * Map_CutReadSuper0(Map_Cut_t *p)
unsigned Map_CutReadPhase1(Map_Cut_t *p)
Map_Node_t * Map_NodeCreate(Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
Map_Node_t ** Map_ManReadBufs(Map_Man_t *p)
Map_Node_t * Map_ManReadBufDriver(Map_Man_t *p, int i)
void Map_ManSetChoiceNodeNum(Map_Man_t *p, int nChoiceNodes)
int Map_NodeIsVar(Map_Node_t *p)
int Map_SuperReadNumPhases(Map_Super_t *p)
Map_Node_t * Map_NodeAnd(Map_Man_t *pMan, Map_Node_t *p1, Map_Node_t *p2)
void Map_ManCreateNodeDelays(Map_Man_t *p, int LogFan)
void Map_NodeSetSwitching(Map_Node_t *p, float Switching)
Map_Super_t * Map_CutReadSuperBest(Map_Cut_t *p, int fPhase)
int Map_SuperReadNum(Map_Super_t *p)
Map_Node_t * Map_NodeBuf(Map_Man_t *p, Map_Node_t *p1)
void Map_ManSetAreaRecovery(Map_Man_t *p, int fAreaRecovery)
char * Map_SuperReadFormula(Map_Super_t *p)
Map_Man_t * Map_NodeReadMan(Map_Node_t *p)
void Map_ManSetSkipFanout(Map_Man_t *p, int fSkipFanout)
char * Map_NodeReadData(Map_Node_t *p, int fPhase)
Map_Man_t * Map_ManCreate(int nInputs, int nOutputs, int fVerbose)
FUNCTION DEFINITIONS ///.
Map_Node_t * Map_NodeReadOne(Map_Node_t *p)
void Map_ManSetChoiceNum(Map_Man_t *p, int nChoices)
void Map_ManSetFanoutViolations(Map_Man_t *p, int nVio)
void Map_ManFree(Map_Man_t *p)
float Map_SuperLibReadAreaInv(Map_SuperLib_t *p)
void Map_NodeSetAigId(Map_Node_t *p, int Id)
void Map_ManSetInputArrivals(Map_Man_t *p, Map_Time_t *pArrivals)
void Map_ManPrintStatsToFile(char *pName, float Area, float Delay, abctime Time)
void Map_NodeSetNextE(Map_Node_t *p, Map_Node_t *pNextE)
Map_Cut_t * Map_CutReadNext(Map_Cut_t *p)
int Map_SuperLibReadVarsMax(Map_SuperLib_t *p)
Map_Super_t ** Map_SuperReadFanins(Map_Super_t *p)
int Map_SuperReadFanoutLimit(Map_Super_t *p)
Map_Node_t ** Map_CutReadLeaves(Map_Cut_t *p)
int Map_NodeIsAnd(Map_Node_t *p)
Map_Time_t Map_SuperLibReadDelayInv(Map_SuperLib_t *p)
void Map_ManSetDelayTarget(Map_Man_t *p, float DelayTarget)
int Map_ManReadOutputNum(Map_Man_t *p)
void Map_ManCreateAigIds(Map_Man_t *p, int nObjs)
Map_Time_t * Map_ManReadInputArrivals(Map_Man_t *p)
void Map_ManSetNumIterations(Map_Man_t *p, int nIterations)
float Map_ManReadRequiredGlo(Map_Man_t *p)
Map_NodeVec_t * Map_NodeVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Map_NodeVecFree(Map_NodeVec_t *p)
int Map_NodeVecReadSize(Map_NodeVec_t *p)
#define Map_NodeIsSimComplement(p)
void Map_NodeVecPush(Map_NodeVec_t *p, Map_Node_t *Entry)
void Map_NodeAddFaninFanout(Map_Node_t *pFanin, Map_Node_t *pFanout)
Map_Node_t ** Map_NodeVecReadArray(Map_NodeVec_t *p)
void Map_MappingSetupTruthTablesLarge(unsigned uTruths[][32])
typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t
INCLUDES ///.
struct Map_CutStruct_t_ Map_Cut_t
struct Map_SuperStruct_t_ Map_Super_t
Map_Node_t * Map_NodeCreate(Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
struct Map_SuperLibStruct_t_ Map_SuperLib_t
struct Map_TimeStruct_t_ Map_Time_t
void Map_MappingSetupTruthTables(unsigned uTruths[][2])
#define Map_IsComplement(p)
GLOBAL VARIABLES ///.
struct Map_NodeStruct_t_ Map_Node_t
struct Mio_LibraryStruct_t_ Mio_Library_t
struct Mio_GateStruct_t_ Mio_Gate_t