Commit 8e753fc3 by Alan Mishchenko

Improvements to gate sizing.

parent 9cbe102b
......@@ -321,6 +321,32 @@ static inline SC_Cell * Abc_SclObjResiable( SC_Man * p, Abc_Obj_t * pObj, int fU
return pOld->pPrev->Order < pOld->Order ? pOld->pPrev : NULL;
}
/**Function*************************************************************
Synopsis [Dumps timing results into a file.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static inline void Abc_SclDumpStats( SC_Man * p, char * pFileName, clock_t Time )
{
FILE * pTable;
pTable = fopen( pFileName, "a+" );
fprintf( pTable, "%s ", p->pNtk->pName );
fprintf( pTable, "%d ", Abc_NtkPiNum(p->pNtk) );
fprintf( pTable, "%d ", Abc_NtkPoNum(p->pNtk) );
fprintf( pTable, "%d ", Abc_NtkNodeNum(p->pNtk) );
fprintf( pTable, "%d ", (int)p->SumArea0 );
fprintf( pTable, "%d ", (int)p->MaxDelay0 );
fprintf( pTable, "%.2f ", 1.0*Time/CLOCKS_PER_SEC );
fprintf( pTable, "\n" );
fclose( pTable );
}
/*=== sclTime.c =============================================================*/
extern Abc_Obj_t * Abc_SclFindCriticalCo( SC_Man * p, int * pfRise );
......
......@@ -336,9 +336,12 @@ SC_Man * Abc_SclManStart( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fUseWireLoads )
***********************************************************************/
void Abc_SclTimePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fUseWireLoads, int fShowAll, int fShort )
{
int fDumpStats = 0;
SC_Man * p;
p = Abc_SclManStart( pLib, pNtk, fUseWireLoads );
Abc_SclTimeNtkPrint( p, fShowAll, fShort );
if ( fDumpStats )
Abc_SclDumpStats( p, "stats.txt", 0 );
Abc_SclManFree( p );
}
......
......@@ -436,10 +436,9 @@ void Abc_SclUpsizePrint( SC_Man * p, int Iter, int win, int nPathPos, int nPathN
printf( "A: " );
printf( "%.2f ", p->SumArea );
printf( "(%+5.1f %%) ", 100.0 * (p->SumArea - p->SumArea0)/ p->SumArea0 );
if ( fVerbose )
ABC_PRT( "T", clock() - p->timeTotal );
else
ABC_PRTr( "T", clock() - p->timeTotal );
ABC_PRTn( "T", clock() - p->timeTotal );
printf( " " );
printf( "%c", fVerbose ? '\n' : '\r' );
}
/**Function*************************************************************
......@@ -538,12 +537,12 @@ void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int nIters, int Wind
}
// update for best gates and recompute timing
ABC_SWAP( Vec_Int_t *, p->vGatesBest, p->vGates );
Abc_SclTimeNtkRecompute( p, &p->SumArea, &p->MaxDelay, 0 );
p->timeTotal = clock() - p->timeTotal;
if ( fVerbose )
{
Abc_SclTimeNtkRecompute( p, &p->SumArea, &p->MaxDelay, 0 );
Abc_SclUpsizePrint( p, i, Window, nAllPos/i, nAllNodes/i, nAllUpsizes/i, nAllTfos/i, 1 );
// report runtime
p->timeTotal = clock() - p->timeTotal;
p->timeOther = p->timeTotal - p->timeCone - p->timeSize - p->timeTime;
ABC_PRTP( "Runtime: Critical path", p->timeCone, p->timeTotal );
ABC_PRTP( "Runtime: Sizing eval ", p->timeSize, p->timeTotal );
......@@ -551,6 +550,7 @@ void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int nIters, int Wind
ABC_PRTP( "Runtime: Other ", p->timeOther, p->timeTotal );
ABC_PRTP( "Runtime: TOTAL ", p->timeTotal, p->timeTotal );
}
// Abc_SclDumpStats( p, "stats2.txt", p->timeTotal );
// save the result and quit
Abc_SclManSetGates( pLib, pNtk, p->vGates ); // updates gate pointers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment