mirror of
https://github.com/YosysHQ/abc.git
synced 2026-09-02 10:47:31 +02:00
Parametrizing standard-cell mapper to account for the fanout delay.
This commit is contained in:
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
@@ -274,6 +275,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.]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
+12
-10
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user