28 #define MAP_CO_LIST_SIZE 5
68 if ( fCollectEquiv && pNode->
pNextE )
83 for ( i = 0; i < pMan->nOutputs; i++ )
85 for ( i = 0; i < vNodes->
nSize; i++ )
107 int i, LevelsMax, LevelsCur;
110 for ( i = 0; i < pMan->nOutputs; i++ )
113 if ( LevelsMax < LevelsCur )
114 LevelsMax = LevelsCur;
116 for ( i = 0; i < pMan->nOutputs; i++ )
148 pNode->
Level = 1 + ((Level1>Level2)? Level1: Level2);
166 for ( i = 0; i < pMan->nOutputs; i++ )
239 if ( Arrival1 < Arrival2 )
241 if ( Arrival1 > Arrival2 )
260 assert( p->nOutputs >= nNodesMax );
263 for ( i = 1; i < p->nOutputs; i++ )
265 for ( k = nNodes - 1; k >= 0; k-- )
268 if ( k == nNodesMax - 1 )
270 if ( nNodes < nNodesMax )
272 for ( v = nNodes - 1; v > k+1; v-- )
273 pNodes[v] = pNodes[v-1];
294 int fPhase, Limit, i;
305 for ( i = 0; i < Limit; i++ )
306 if ( MaxNameSize < (
int)
strlen(p->ppOutputNames[pSorted[i]]) )
307 MaxNameSize =
strlen(p->ppOutputNames[pSorted[i]]);
310 for ( i = 0; i < Limit; i++ )
317 printf(
"Output %-*s : ", MaxNameSize + 3, p->ppOutputNames[pSorted[i]] );
318 printf(
"Delay = (%5.2f, %5.2f) ", (
double)pTimes->
Rise, (
double)pTimes->
Fall );
319 printf(
"%s", fPhase?
"POS" :
"NEG" );
339 for ( m = 0; m < 32; m++ )
340 for ( v = 0; v < 5; v++ )
342 uTruths[v][0] |= (1 << m);
344 for ( v = 0; v < 5; v++ )
345 uTruths[v][1] = uTruths[v][0];
365 for ( m = 0; m < 32; m++ )
366 for ( v = 0; v < 10; v++ )
369 for ( m = 0; m < 32; m++ )
370 for ( v = 0; v < 5; v++ )
373 uTruths[v][0] |= (1 << m);
377 for ( m = 0; m < 32; m++ )
378 for ( v = 0; v < 5; v++ )
379 uTruths[v][m] = uTruths[v][0];
433 for ( i = 0; i < pVec->
nSize; i++ )
439 printf(
"Primary input %d is a secondary node.\n", pNode->
Num );
444 printf(
"Constant 1 %d is a secondary node.\n", pNode->
Num );
449 printf(
"Internal node %d is a secondary node.\n", pNode->
Num );
451 printf(
"Internal node %d has first fanin that is a secondary node.\n", pNode->
Num );
453 printf(
"Internal node %d has second fanin that is a secondary node.\n", pNode->
Num );
491 float aFlowFlowTotal = 0;
493 for ( i = 0; i < p->nOutputs; i++ )
507 return aFlowFlowTotal;
589 for ( i = 0; i < vNodes->
nSize; i++ )
591 pNode = vNodes->
pArray[i];
619 for ( i = 0; i < pMan->pSuperLib->nSupersAll; i++ )
621 pSuper = pMan->pSuperLib->ppSupers[i];
622 if ( pSuper->
nGates == 1 )
626 for ( v = 0; v < nInputs; v++ )
627 if ( pSuper->
pFanins[v]->
Num != nInputs - 1 - v )
655 for ( i = 0; i < p->vMapObjs->nSize; i++ )
656 p->vMapObjs->pArray[i]->pData0 = p->vMapObjs->pArray[i]->pData1 = 0;
677 uTruth[0] &=
MAP_MASK( (1<<nVars) );
680 uTruth[1] = uTruth[0];
718 for ( i = 0; i < p->vMapObjs->nSize; i++ )
721 pNode = p->vMapObjs->pArray[i];
734 printf(
"Max arrival times with fanouts = %10.2f.\n", Result );
754 for ( i = 0; i < pMan->nOutputs; i++ )
755 nLevelMax = ((
unsigned)nLevelMax) >
Map_Regular(pMan->pOutputs[i])->Level?
774 int Level1, Level2, LevelE;
779 if ( pNode->
TravId == pMan->nTravIds )
781 pNode->
TravId = pMan->nTravIds;
791 if ( pNode->
Level < (
unsigned)LevelE )
792 pNode->
Level = LevelE;
796 if ( pNode->
Level > (
unsigned)LevelE )
797 pNode->
Level = LevelE;
800 if ( pNode->
pRepr == NULL )
801 for ( pTemp = pNode->
pNextE; pTemp; pTemp = pTemp->
pNextE )
825 for ( i = 0; i < pMan->nOutputs; i++ )
845 int nChoiceNodes, nChoices;
846 int i, LevelMax1, LevelMax2;
851 for ( i = 0; i < pMan->nOutputs; i++ )
856 nChoiceNodes = nChoices = 0;
857 for ( i = 0; i < pMan->vMapObjs->nSize; i++ )
859 pNode = pMan->vMapObjs->pArray[i];
860 if ( pNode->
pRepr == NULL && pNode->
pNextE != NULL )
863 for ( pTemp = pNode; pTemp; pTemp = pTemp->
pNextE )
867 printf(
"Maximum level: Original = %d. Reduced due to choices = %d.\n", LevelMax1, LevelMax2 );
868 printf(
"Choice stats: Choice nodes = %d. Total choices = %d.\n", nChoiceNodes, nChoices );
887 Result = vNodes->
nSize;
void Map_MappingMark_rec(Map_Node_t *pNode)
static float Map_MappingArea_rec(Map_Man_t *pMan, Map_Node_t *pNode, Map_NodeVec_t *vNodes)
int Map_NodeIsAnd(Map_Node_t *p)
Map_NodeVec_t * Map_NodeVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
int st__insert(st__table *table, const char *key, char *value)
void Map_MappingSetChoiceLevels(Map_Man_t *pMan)
int Map_CompareNodesByLevel(Map_Node_t **ppS1, Map_Node_t **ppS2)
void Map_MappingSortByLevel(Map_Man_t *pMan, Map_NodeVec_t *vNodes)
void Map_MappingUnmark_rec(Map_Node_t *pNode)
#define MAP_MASK(n)
INCLUDES ///.
int Map_CompareNodesByPointer(Map_Node_t **ppS1, Map_Node_t **ppS2)
float Map_MappingGetAreaFlow(Map_Man_t *p)
static int Map_MappingCompareOutputDelay(Map_Node_t **ppNode1, Map_Node_t **ppNode2)
static float Map_MappingSetRefsAndWire_rec(Map_Man_t *pMan, Map_Node_t *pNode)
void Map_MappingReportChoices(Map_Man_t *pMan)
void Map_MappingDfs_rec(Map_Node_t *pNode, Map_NodeVec_t *vNodes, int fCollectEquiv)
FUNCTION DEFINITIONS ///.
int Map_NodeIsConst(Map_Node_t *p)
#define Map_IsComplement(p)
GLOBAL VARIABLES ///.
static float Map_MappingSetRefsAndArea_rec(Map_Man_t *pMan, Map_Node_t *pNode)
void Map_MappingSetupMask(unsigned uMask[], int nVarsMax)
st__table * st__init_table(st__compare_func_type compare, st__hash_func_type hash)
int Mio_GateReadPinNum(Mio_Gate_t *pGate)
void Map_MappingSetupTruthTables(unsigned uTruths[][2])
int st__strhash(const char *string, int modulus)
int Map_MappingGetMaxLevel(Map_Man_t *pMan)
static void Map_MappingDfsCuts_rec(Map_Node_t *pNode, Map_NodeVec_t *vNodes)
static unsigned Map_MappingExpandTruth_rec(unsigned uTruth, int nVars)
float Map_MappingComputeDelayWithFanouts(Map_Man_t *p)
static void Map_MappingFindLatest(Map_Man_t *p, int *pNodes, int nNodesMax)
float Map_TimeComputeArrivalMax(Map_Man_t *p)
DECLARATIONS ///.
void Map_MappingSetupTruthTablesLarge(unsigned uTruths[][32])
void Map_ManCleanData(Map_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
int Map_NodeIsVar(Map_Node_t *p)
#define MAP_CO_LIST_SIZE
DECLARATIONS ///.
float Map_TimeCutComputeArrival(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase, float tWorstCaseLimit)
int Map_ManCheckConsistency(Map_Man_t *p)
Map_NodeVec_t * Map_MappingDfs(Map_Man_t *pMan, int fCollectEquiv)
static int Map_MappingCountUsedNodes(Map_Man_t *pMan, int fChoices)
#define ABC_NAMESPACE_IMPL_START
typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t
INCLUDES ///.
st__table * Map_CreateTableGate2Super(Map_Man_t *pMan)
void Map_MappingPrintOutputArrivals(Map_Man_t *p)
void Map_NodeVecFree(Map_NodeVec_t *p)
void Map_MappingUnmark(Map_Man_t *pMan)
int Map_MappingCountDoubles(Map_Man_t *pMan, Map_NodeVec_t *vNodes)
int Map_MappingNodeIsViolator(Map_Node_t *pNode, Map_Cut_t *pCut, int fPosPol)
void Map_MappingExpandTruth(unsigned uTruth[2], int nVars)
int Map_MappingCountLevels(Map_Man_t *pMan)
int Map_MappingUpdateLevel_rec(Map_Man_t *pMan, Map_Node_t *pNode, int fMaximum)
static float Map_MappingSetRefsAndSwitch_rec(Map_Man_t *pMan, Map_Node_t *pNode)
void Map_NodeVecPush(Map_NodeVec_t *p, Map_Node_t *Entry)
static int Map_MappingCountLevels_rec(Map_Node_t *pNode)