mirror of https://github.com/YosysHQ/abc.git
Improvements to gate-sizing.
This commit is contained in:
parent
d3595d230f
commit
513dc14a1a
|
|
@ -649,7 +649,8 @@ usage:
|
|||
int Scl_CommandUpsize( Abc_Frame_t * pAbc, int argc, char **argv )
|
||||
{
|
||||
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
||||
int nIters = 300;
|
||||
int nIters = 1000;
|
||||
int nIterNoChange = 50;
|
||||
int Window = 2;
|
||||
int Ratio = 10;
|
||||
int Notches = 10;
|
||||
|
|
@ -658,7 +659,7 @@ int Scl_CommandUpsize( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
int c, fVerbose = 0;
|
||||
int fVeryVerbose = 0;
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "IWRNTdvwh" ) ) != EOF )
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "IJWRNTdvwh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -668,6 +669,17 @@ int Scl_CommandUpsize( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
|
||||
goto usage;
|
||||
}
|
||||
nIterNoChange = atoi(argv[globalUtilOptind]);
|
||||
globalUtilOptind++;
|
||||
if ( nIterNoChange < 0 )
|
||||
goto usage;
|
||||
break;
|
||||
case 'J':
|
||||
if ( globalUtilOptind >= argc )
|
||||
{
|
||||
Abc_Print( -1, "Command line switch \"-J\" should be followed by a positive integer.\n" );
|
||||
goto usage;
|
||||
}
|
||||
nIters = atoi(argv[globalUtilOptind]);
|
||||
globalUtilOptind++;
|
||||
if ( nIters < 0 )
|
||||
|
|
@ -754,13 +766,14 @@ int Scl_CommandUpsize( Abc_Frame_t * pAbc, int argc, char **argv )
|
|||
return 1;
|
||||
}
|
||||
|
||||
Abc_SclUpsizePerform( (SC_Lib *)pAbc->pLibScl, pNtk, nIters, Window, Ratio, Notches, TimeOut, fDumpStats, fVerbose, fVeryVerbose );
|
||||
Abc_SclUpsizePerform( (SC_Lib *)pAbc->pLibScl, pNtk, nIters, nIterNoChange, Window, Ratio, Notches, TimeOut, fDumpStats, fVerbose, fVeryVerbose );
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
fprintf( pAbc->Err, "usage: upsize [-IWRNT num] [-dvwh]\n" );
|
||||
fprintf( pAbc->Err, "usage: upsize [-IJWRNT num] [-dvwh]\n" );
|
||||
fprintf( pAbc->Err, "\t selectively increases gate sizes in timing-critical regions\n" );
|
||||
fprintf( pAbc->Err, "\t-I <num> : the number of upsizing iterations to perform [default = %d]\n", nIters );
|
||||
fprintf( pAbc->Err, "\t-J <num> : the number of iterations without improvement [default = %d]\n", nIterNoChange );
|
||||
fprintf( pAbc->Err, "\t-W <num> : delay window (in percents) of near-critical COs [default = %d]\n", Window );
|
||||
fprintf( pAbc->Err, "\t-R <num> : ratio of critical nodes (in percents) to update [default = %d]\n", Ratio );
|
||||
fprintf( pAbc->Err, "\t-N <num> : limit on discrete upsizing steps at a node [default = %d]\n", Notches );
|
||||
|
|
|
|||
|
|
@ -439,7 +439,7 @@ extern void Abc_SclTimePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fU
|
|||
/*=== sclSize.c ===============================================================*/
|
||||
extern void Abc_SclSizingPerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * p );
|
||||
/*=== sclUpsize.c ===============================================================*/
|
||||
extern void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int nIters, int Window, int Ratio, int Notches, int TimeOut, int fDumpStats, int fVerbose, int fVeryVerbose );
|
||||
extern void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int nIters, int nIterNoChange, int Window, int Ratio, int Notches, int TimeOut, int fDumpStats, int fVerbose, int fVeryVerbose );
|
||||
/*=== sclUtil.c ===============================================================*/
|
||||
extern void Abc_SclHashCells( SC_Lib * p );
|
||||
extern int Abc_SclCellFind( SC_Lib * p, char * pName );
|
||||
|
|
|
|||
|
|
@ -437,8 +437,8 @@ void Abc_SclUpsizePrint( SC_Man * p, int Iter, int win, int nPathPos, int nPathN
|
|||
printf( "(%+5.1f %%) ", 100.0 * (p->MaxDelay - p->MaxDelay0)/ p->MaxDelay0 );
|
||||
printf( "A: " );
|
||||
printf( "%.2f ", p->SumArea );
|
||||
printf( "(%+5.1f %%) ", 100.0 * (p->SumArea - p->SumArea0)/ p->SumArea0 );
|
||||
ABC_PRTn( "T", clock() - p->timeTotal );
|
||||
printf( "(%+5.1f %%)", 100.0 * (p->SumArea - p->SumArea0)/ p->SumArea0 );
|
||||
printf( "%8.2f", 1.0*(clock() - p->timeTotal)/(CLOCKS_PER_SEC) );
|
||||
printf( " " );
|
||||
printf( "%c", fVerbose ? '\n' : '\r' );
|
||||
}
|
||||
|
|
@ -454,13 +454,13 @@ void Abc_SclUpsizePrint( SC_Man * p, int Iter, int win, int nPathPos, int nPathN
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int nIters, int Window, int Ratio, int Notches, int TimeOut, int fDumpStats, int fVerbose, int fVeryVerbose )
|
||||
void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int nIters, int nIterNoChange, int Window, int Ratio, int Notches, int TimeOut, int fDumpStats, int fVerbose, int fVeryVerbose )
|
||||
{
|
||||
SC_Man * p;
|
||||
Vec_Int_t * vPathPos = NULL; // critical POs
|
||||
Vec_Int_t * vPathNodes = NULL; // critical nodes and PIs
|
||||
Vec_Int_t * vTFO;
|
||||
int i, win, nUpsizes = -1;
|
||||
int i, win, nUpsizes = -1, nFramesNoChange = 0;
|
||||
int nAllPos, nAllNodes, nAllTfos, nAllUpsizes;
|
||||
clock_t clk;
|
||||
|
||||
|
|
@ -525,7 +525,12 @@ void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int nIters, int Wind
|
|||
{
|
||||
p->BestDelay = p->MaxDelay;
|
||||
Abc_SclApplyUpdateToBest( p->vGates, p->vGatesBest, p->vUpdates );
|
||||
nFramesNoChange = 0;
|
||||
}
|
||||
else
|
||||
nFramesNoChange++;
|
||||
if ( nFramesNoChange > nIterNoChange )
|
||||
break;
|
||||
|
||||
// report and cleanup
|
||||
Abc_SclUpsizePrint( p, i, win, Vec_IntSize(vPathPos), Vec_IntSize(vPathNodes), nUpsizes, Vec_IntSize(vTFO), fVeryVerbose ); //|| (i == nIters-1) );
|
||||
|
|
|
|||
Loading…
Reference in New Issue