diff options
Diffstat (limited to 'src/map/mapper')
-rw-r--r-- | src/map/mapper/mapper.h | 1 | ||||
-rw-r--r-- | src/map/mapper/mapperCreate.c | 30 | ||||
-rw-r--r-- | src/map/mapper/mapperInt.h | 1 | ||||
-rw-r--r-- | src/map/mapper/mapperMatch.c | 3 | ||||
-rw-r--r-- | src/map/mapper/mapperTime.c | 22 |
5 files changed, 47 insertions, 10 deletions
diff --git a/src/map/mapper/mapper.h b/src/map/mapper/mapper.h index e444b837..fa468234 100644 --- a/src/map/mapper/mapper.h +++ b/src/map/mapper/mapper.h @@ -76,6 +76,7 @@ struct Map_TimeStruct_t_ /*=== mapperCreate.c =============================================================*/ extern Map_Man_t * Map_ManCreate( int nInputs, int nOutputs, int fVerbose ); extern Map_Node_t * Map_NodeCreate( Map_Man_t * p, Map_Node_t * p1, Map_Node_t * p2 ); +extern void Map_ManCreateNodeDelays( Map_Man_t * p, int LogFan ); extern void Map_ManFree( Map_Man_t * pMan ); extern void Map_ManPrintTimeStats( Map_Man_t * p ); extern void Map_ManPrintStatsToFile( char * pName, float Area, float Delay, abctime Time ); diff --git a/src/map/mapper/mapperCreate.c b/src/map/mapper/mapperCreate.c index 3d64bfee..baf21858 100644 --- a/src/map/mapper/mapperCreate.c +++ b/src/map/mapper/mapperCreate.c @@ -264,6 +264,7 @@ void Map_ManFree( Map_Man_t * p ) if ( p->pCounters ) ABC_FREE( p->pCounters ); Extra_MmFixedStop( p->mmNodes ); Extra_MmFixedStop( p->mmCuts ); + ABC_FREE( p->pNodeDelays ); ABC_FREE( p->pInputArrivals ); ABC_FREE( p->pOutputRequireds ); ABC_FREE( p->pInputs ); @@ -276,6 +277,35 @@ void Map_ManFree( Map_Man_t * p ) /**Function************************************************************* + Synopsis [Creates node delays.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Map_ManCreateNodeDelays( Map_Man_t * p, int LogFan ) +{ + Map_Node_t * pNode; + int k; + assert( p->pNodeDelays == NULL ); + p->pNodeDelays = ABC_CALLOC( float, p->vNodesAll->nSize ); + for ( k = 0; k < p->vNodesAll->nSize; k++ ) + { + pNode = p->vNodesAll->pArray[k]; + if ( pNode->nRefs == 0 ) + continue; + p->pNodeDelays[k] = 0.014426 * LogFan * p->pSuperLib->tDelayInv.Worst * log( (double)pNode->nRefs ); // 1.4426 = 1/ln(2) +// printf( "%d = %d (%.2f) ", k, pNode->nRefs, p->pNodeDelays[k] ); + } +// printf( "\n" ); +} + + +/**Function************************************************************* + Synopsis [Deallocates the mapping manager.] Description [] diff --git a/src/map/mapper/mapperInt.h b/src/map/mapper/mapperInt.h index c65b8a00..e6dbab97 100644 --- a/src/map/mapper/mapperInt.h +++ b/src/map/mapper/mapperInt.h @@ -102,6 +102,7 @@ struct Map_ManStruct_t_ Map_NodeVec_t * vNodesAll; // the array of all nodes Map_NodeVec_t * vNodesTemp; // the array of all nodes Map_NodeVec_t * vMapping; // the array of internal nodes used in the mapping + float * pNodeDelays; // the array of node delays // info about the original circuit char ** ppOutputNames; // the primary output names diff --git a/src/map/mapper/mapperMatch.c b/src/map/mapper/mapperMatch.c index f062e4da..ad559d6a 100644 --- a/src/map/mapper/mapperMatch.c +++ b/src/map/mapper/mapperMatch.c @@ -450,6 +450,9 @@ void Map_MappingSetPiArrivalTimes( Map_Man_t * p ) pNode = p->pInputs[i]; // set the arrival time of the positive phase pNode->tArrival[1] = p->pInputArrivals[i]; + pNode->tArrival[1].Rise += p->pNodeDelays ? p->pNodeDelays[pNode->Num] : 0; + pNode->tArrival[1].Fall += p->pNodeDelays ? p->pNodeDelays[pNode->Num] : 0; + pNode->tArrival[1].Worst += p->pNodeDelays ? p->pNodeDelays[pNode->Num] : 0; // set the arrival time of the negative phase pNode->tArrival[0].Rise = pNode->tArrival[1].Fall + p->pSuperLib->tDelayInv.Rise; pNode->tArrival[0].Fall = pNode->tArrival[1].Rise + p->pSuperLib->tDelayInv.Fall; diff --git a/src/map/mapper/mapperTime.c b/src/map/mapper/mapperTime.c index 45de8309..ce909e24 100644 --- a/src/map/mapper/mapperTime.c +++ b/src/map/mapper/mapperTime.c @@ -100,9 +100,10 @@ float Map_TimeCutComputeArrival( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhas Map_Time_t * ptArrRes = &pM->tArrive; Map_Time_t * ptArrIn; int fPinPhase; - float tDelay; + float tDelay, tExtra; int i; + tExtra = pNode->p->pNodeDelays ? pNode->p->pNodeDelays[pNode->Num] : 0; ptArrRes->Rise = ptArrRes->Fall = 0.0; ptArrRes->Worst = MAP_FLOAT_LARGE; for ( i = pCut->nLeaves - 1; i >= 0; i-- ) @@ -114,7 +115,7 @@ float Map_TimeCutComputeArrival( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhas // get the rise of the output due to rise of the inputs if ( pSuper->tDelaysR[i].Rise > 0 ) { - tDelay = ptArrIn->Rise + pSuper->tDelaysR[i].Rise; + tDelay = ptArrIn->Rise + pSuper->tDelaysR[i].Rise + tExtra; if ( tDelay > tWorstLimit ) return MAP_FLOAT_LARGE; if ( ptArrRes->Rise < tDelay ) @@ -124,7 +125,7 @@ float Map_TimeCutComputeArrival( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhas // get the rise of the output due to fall of the inputs if ( pSuper->tDelaysR[i].Fall > 0 ) { - tDelay = ptArrIn->Fall + pSuper->tDelaysR[i].Fall; + tDelay = ptArrIn->Fall + pSuper->tDelaysR[i].Fall + tExtra; if ( tDelay > tWorstLimit ) return MAP_FLOAT_LARGE; if ( ptArrRes->Rise < tDelay ) @@ -134,7 +135,7 @@ float Map_TimeCutComputeArrival( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhas // get the fall of the output due to rise of the inputs if ( pSuper->tDelaysF[i].Rise > 0 ) { - tDelay = ptArrIn->Rise + pSuper->tDelaysF[i].Rise; + tDelay = ptArrIn->Rise + pSuper->tDelaysF[i].Rise + tExtra; if ( tDelay > tWorstLimit ) return MAP_FLOAT_LARGE; if ( ptArrRes->Fall < tDelay ) @@ -144,7 +145,7 @@ float Map_TimeCutComputeArrival( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhas // get the fall of the output due to fall of the inputs if ( pSuper->tDelaysF[i].Fall > 0 ) { - tDelay = ptArrIn->Fall + pSuper->tDelaysF[i].Fall; + tDelay = ptArrIn->Fall + pSuper->tDelaysF[i].Fall + tExtra; if ( tDelay > tWorstLimit ) return MAP_FLOAT_LARGE; if ( ptArrRes->Fall < tDelay ) @@ -383,10 +384,11 @@ void Map_TimePropagateRequiredPhase( Map_Man_t * p, Map_Node_t * pNode, int fPha Map_Time_t * ptReqIn, * ptReqOut; Map_Cut_t * pCut; Map_Super_t * pSuper; - float tNewReqTime; + float tNewReqTime, tExtra; unsigned uPhase; int fPinPhase, i; + tExtra = pNode->p->pNodeDelays ? pNode->p->pNodeDelays[pNode->Num] : 0; // get the cut to be propagated pCut = pNode->pCutBest[fPhase]; assert( pCut != NULL ); @@ -408,7 +410,7 @@ void Map_TimePropagateRequiredPhase( Map_Man_t * p, Map_Node_t * pNode, int fPha // ptArrOut->Rise = ptArrIn->Rise + pSuper->tDelaysR[i].Rise; if ( pSuper->tDelaysR[i].Rise > 0 ) { - tNewReqTime = ptReqOut->Rise - pSuper->tDelaysR[i].Rise; + tNewReqTime = ptReqOut->Rise - pSuper->tDelaysR[i].Rise - tExtra; ptReqIn->Rise = MAP_MIN( ptReqIn->Rise, tNewReqTime ); } @@ -417,7 +419,7 @@ void Map_TimePropagateRequiredPhase( Map_Man_t * p, Map_Node_t * pNode, int fPha // ptArrOut->Rise = ptArrIn->Fall + pSuper->tDelaysR[i].Fall; if ( pSuper->tDelaysR[i].Fall > 0 ) { - tNewReqTime = ptReqOut->Rise - pSuper->tDelaysR[i].Fall; + tNewReqTime = ptReqOut->Rise - pSuper->tDelaysR[i].Fall - tExtra; ptReqIn->Fall = MAP_MIN( ptReqIn->Fall, tNewReqTime ); } @@ -426,7 +428,7 @@ void Map_TimePropagateRequiredPhase( Map_Man_t * p, Map_Node_t * pNode, int fPha // ptArrOut->Fall = ptArrIn->Rise + pSuper->tDelaysF[i].Rise; if ( pSuper->tDelaysF[i].Rise > 0 ) { - tNewReqTime = ptReqOut->Fall - pSuper->tDelaysF[i].Rise; + tNewReqTime = ptReqOut->Fall - pSuper->tDelaysF[i].Rise - tExtra; ptReqIn->Rise = MAP_MIN( ptReqIn->Rise, tNewReqTime ); } @@ -435,7 +437,7 @@ void Map_TimePropagateRequiredPhase( Map_Man_t * p, Map_Node_t * pNode, int fPha // ptArrOut->Fall = ptArrIn->Fall + pSuper->tDelaysF[i].Fall; if ( pSuper->tDelaysF[i].Fall > 0 ) { - tNewReqTime = ptReqOut->Fall - pSuper->tDelaysF[i].Fall; + tNewReqTime = ptReqOut->Fall - pSuper->tDelaysF[i].Fall - tExtra; ptReqIn->Fall = MAP_MIN( ptReqIn->Fall, tNewReqTime ); } } |