Commit 1692c1a5 by Alan Mishchenko

Improvements to buffering and sizing.

parent a4f80c1d
...@@ -14448,8 +14448,8 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -14448,8 +14448,8 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
double AreaMulti; double AreaMulti;
double DelayMulti; double DelayMulti;
float LogFan = 0; float LogFan = 0;
float Slew = 200; float Slew = 0; // choose based on the library
float Gain = 100; float Gain = 200;
int nGatesMin = 4; int nGatesMin = 4;
int fAreaOnly; int fAreaOnly;
int fRecovery; int fRecovery;
...@@ -73,7 +73,7 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti, ...@@ -73,7 +73,7 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti,
// if the library is created here, it will be deleted when pSuperLib is deleted in Map_SuperLibFree() // if the library is created here, it will be deleted when pSuperLib is deleted in Map_SuperLibFree()
if ( Abc_FrameReadLibScl() ) if ( Abc_FrameReadLibScl() )
{ {
pLib = Abc_SclDeriveGenlib( Abc_FrameReadLibScl(), Slew, Gain, nGatesMin ); pLib = Abc_SclDeriveGenlib( Abc_FrameReadLibScl(), Slew, Gain, nGatesMin, fVerbose );
if ( Abc_FrameReadLibGen() ) if ( Abc_FrameReadLibGen() )
Mio_LibraryTransferDelays( (Mio_Library_t *)Abc_FrameReadLibGen(), pLib ); Mio_LibraryTransferDelays( (Mio_Library_t *)Abc_FrameReadLibGen(), pLib );
} }
...@@ -111,7 +111,7 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti, ...@@ -111,7 +111,7 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti,
Mio_LibraryMultiDelay( (Mio_Library_t *)Abc_FrameReadLibGen(), -DelayMulti ); Mio_LibraryMultiDelay( (Mio_Library_t *)Abc_FrameReadLibGen(), -DelayMulti );
// print a warning about choice nodes // print a warning about choice nodes
if ( Abc_NtkGetChoiceNum( pNtk ) ) if ( fVerbose && Abc_NtkGetChoiceNum( pNtk ) )
printf( "Performing mapping with choices.\n" ); printf( "Performing mapping with choices.\n" );
// compute switching activity // compute switching activity
......
...@@ -164,7 +164,7 @@ extern void Mio_LibraryTransferDelays( Mio_Library_t * pLibD, Mio_L ...@@ -164,7 +164,7 @@ extern void Mio_LibraryTransferDelays( Mio_Library_t * pLibD, Mio_L
/*=== sclUtil.c =========================================================*/ /*=== sclUtil.c =========================================================*/
extern Mio_Library_t * Abc_SclDeriveGenlibSimple( void * pScl ); extern Mio_Library_t * Abc_SclDeriveGenlibSimple( void * pScl );
extern Mio_Library_t * Abc_SclDeriveGenlib( void * pScl, float Slew, float Gain, int nGatesMin ); extern Mio_Library_t * Abc_SclDeriveGenlib( void * pScl, float Slew, float Gain, int nGatesMin, int fVerbose );
ABC_NAMESPACE_HEADER_END ABC_NAMESPACE_HEADER_END
......
...@@ -308,7 +308,7 @@ usage: ...@@ -308,7 +308,7 @@ usage:
***********************************************************************/ ***********************************************************************/
int Scl_CommandPrintLib( Abc_Frame_t * pAbc, int argc, char **argv ) int Scl_CommandPrintLib( Abc_Frame_t * pAbc, int argc, char **argv )
{ {
float Slew = 200; float Slew = 0; // use library
float Gain = 100; float Gain = 100;
int fInvOnly = 0; int fInvOnly = 0;
int fShort = 0; int fShort = 0;
...@@ -512,8 +512,8 @@ usage: ...@@ -512,8 +512,8 @@ usage:
int Scl_CommandDumpGen( Abc_Frame_t * pAbc, int argc, char **argv ) int Scl_CommandDumpGen( Abc_Frame_t * pAbc, int argc, char **argv )
{ {
char * pFileName = NULL; char * pFileName = NULL;
float Slew = 200; float Slew = 0; // use the library
float Gain = 100; float Gain = 200;
int nGatesMin = 4; int nGatesMin = 4;
int c, fVerbose = 0; int c, fVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
...@@ -871,8 +871,8 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -871,8 +871,8 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc); Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
int c; int c;
memset( pPars, 0, sizeof(SC_BusPars) ); memset( pPars, 0, sizeof(SC_BusPars) );
pPars->GainRatio = 1000; pPars->GainRatio = 250;
pPars->Slew = 100; pPars->Slew = pAbc->pLibScl ? Abc_SclComputeAverageSlew((SC_Lib *)pAbc->pLibScl) : 100;
pPars->nDegree = 10; pPars->nDegree = 10;
pPars->fSizeOnly = 0; pPars->fSizeOnly = 0;
pPars->fAddBufs = 1; pPars->fAddBufs = 1;
...@@ -881,7 +881,7 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -881,7 +881,7 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars->fVerbose = 0; pPars->fVerbose = 0;
pPars->fVeryVerbose = 0; pPars->fVeryVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "GSDsbpcvwh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "GSNsbpcvwh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -907,7 +907,7 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -907,7 +907,7 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->Slew < 0 ) if ( pPars->Slew < 0 )
goto usage; goto usage;
break; break;
case 'D': case 'N':
if ( globalUtilOptind >= argc ) if ( globalUtilOptind >= argc )
{ {
Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" ); Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
...@@ -959,7 +959,7 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -959,7 +959,7 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1; return 1;
} }
// modify the current network // modify the current network
pNtkRes = Abc_SclBufSizePerform( pNtk, (SC_Lib *)pAbc->pLibScl, pPars ); pNtkRes = Abc_SclBufferingPerform( pNtk, (SC_Lib *)pAbc->pLibScl, pPars );
if ( pNtkRes == NULL ) if ( pNtkRes == NULL )
{ {
Abc_Print( -1, "The command has failed.\n" ); Abc_Print( -1, "The command has failed.\n" );
...@@ -970,11 +970,11 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -970,11 +970,11 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0; return 0;
usage: usage:
fprintf( pAbc->Err, "usage: buffer [-GSD num] [-sbpcvwh]\n" ); fprintf( pAbc->Err, "usage: buffer [-GSN num] [-sbpcvwh]\n" );
fprintf( pAbc->Err, "\t performs buffering and sizing and mapped network\n" ); fprintf( pAbc->Err, "\t performs buffering and sizing and mapped network\n" );
fprintf( pAbc->Err, "\t-G <num> : target gain percentage [default = %d]\n", pPars->GainRatio ); fprintf( pAbc->Err, "\t-G <num> : target gain percentage [default = %d]\n", pPars->GainRatio );
fprintf( pAbc->Err, "\t-S <num> : target slew in pisoseconds [default = %d]\n", pPars->Slew ); fprintf( pAbc->Err, "\t-S <num> : target slew in pisoseconds [default = %d]\n", pPars->Slew );
fprintf( pAbc->Err, "\t-D <num> : the maximum fanout degree [default = %d]\n", pPars->nDegree ); fprintf( pAbc->Err, "\t-N <num> : the maximum fanout count [default = %d]\n", pPars->nDegree );
fprintf( pAbc->Err, "\t-s : toggle performing only sizing [default = %s]\n", pPars->fSizeOnly? "yes": "no" ); fprintf( pAbc->Err, "\t-s : toggle performing only sizing [default = %s]\n", pPars->fSizeOnly? "yes": "no" );
fprintf( pAbc->Err, "\t-b : toggle using buffers instead of inverters [default = %s]\n", pPars->fAddBufs? "yes": "no" ); fprintf( pAbc->Err, "\t-b : toggle using buffers instead of inverters [default = %s]\n", pPars->fAddBufs? "yes": "no" );
fprintf( pAbc->Err, "\t-p : toggle buffering primary inputs [default = %s]\n", pPars->fBufPis? "yes": "no" ); fprintf( pAbc->Err, "\t-p : toggle buffering primary inputs [default = %s]\n", pPars->fBufPis? "yes": "no" );
......
...@@ -394,7 +394,6 @@ void Abc_SclBufSize( Bus_Man_t * p ) ...@@ -394,7 +394,6 @@ void Abc_SclBufSize( Bus_Man_t * p )
float GainGate = (float)1.0 * GainInv; float GainGate = (float)1.0 * GainInv;
float Load, LoadNew, Cin, DeptMax = 0; float Load, LoadNew, Cin, DeptMax = 0;
int i, k, nObjOld = Abc_NtkObjNumMax(p->pNtk); int i, k, nObjOld = Abc_NtkObjNumMax(p->pNtk);
Abc_SclMioGates2SclGates( p->pLib, p->pNtk );
Abc_NtkForEachObjReverse( p->pNtk, pObj, i ) Abc_NtkForEachObjReverse( p->pNtk, pObj, i )
{ {
if ( !((Abc_ObjIsNode(pObj) && Abc_ObjFaninNum(pObj) > 0) || (Abc_ObjIsCi(pObj) && p->pPiDrive)) ) if ( !((Abc_ObjIsNode(pObj) && Abc_ObjFaninNum(pObj) > 0) || (Abc_ObjIsCi(pObj) && p->pPiDrive)) )
...@@ -470,26 +469,30 @@ void Abc_SclBufSize( Bus_Man_t * p ) ...@@ -470,26 +469,30 @@ void Abc_SclBufSize( Bus_Man_t * p )
} }
DeptMax = Abc_MaxFloat( DeptMax, DeptCur ); DeptMax = Abc_MaxFloat( DeptMax, DeptCur );
} }
Abc_SclSclGates2MioGates( p->pLib, p->pNtk );
if ( p->pPars->fVerbose ) if ( p->pPars->fVerbose )
{ {
printf( "WireLoads = %d. Degree = %d. Target gain =%5d Slew =%5d Buf = %6d Delay =%7.0f ps ", printf( "WireLoads = %d Degree = %d Target slew =%4d ps Gain2 =%5d Buf = %6d Delay =%7.0f ps ",
p->pPars->fUseWireLoads, p->pPars->nDegree, p->pPars->GainRatio, p->pPars->Slew, p->pPars->fUseWireLoads, p->pPars->nDegree, p->pPars->Slew, p->pPars->GainRatio,
Abc_NtkObjNumMax(p->pNtk) - nObjOld, DeptMax ); Abc_NtkObjNumMax(p->pNtk) - nObjOld, DeptMax );
Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
} }
} }
Abc_Ntk_t * Abc_SclBufSizePerform( Abc_Ntk_t * pNtk, SC_Lib * pLib, SC_BusPars * pPars ) Abc_Ntk_t * Abc_SclBufferingPerform( Abc_Ntk_t * pNtk, SC_Lib * pLib, SC_BusPars * pPars )
{ {
Abc_Ntk_t * pNtkNew; Abc_Ntk_t * pNtkNew;
Bus_Man_t * p; Bus_Man_t * p;
if ( !Abc_SclCheckNtk( pNtk, 0 ) ) if ( !Abc_SclCheckNtk( pNtk, 0 ) )
return NULL; return NULL;
// update gain if buffers are used
if ( pPars->fAddBufs )
pPars->GainRatio = pPars->GainRatio * pPars->GainRatio / 100;
Abc_SclReportDupFanins( pNtk ); Abc_SclReportDupFanins( pNtk );
Abc_SclMioGates2SclGates( pLib, pNtk );
p = Bus_ManStart( pNtk, pLib, pPars ); p = Bus_ManStart( pNtk, pLib, pPars );
Bus_ManReadInOutLoads( p ); Bus_ManReadInOutLoads( p );
Abc_SclBufSize( p ); Abc_SclBufSize( p );
Bus_ManStop( p ); Bus_ManStop( p );
Abc_SclSclGates2MioGates( pLib, pNtk );
if ( pNtk->vPhases ) if ( pNtk->vPhases )
Vec_IntFillExtra( pNtk->vPhases, Abc_NtkObjNumMax(pNtk), 0 ); Vec_IntFillExtra( pNtk->vPhases, Abc_NtkObjNumMax(pNtk), 0 );
pNtkNew = Abc_NtkDupDfs( pNtk ); pNtkNew = Abc_NtkDupDfs( pNtk );
......
...@@ -610,6 +610,7 @@ extern SC_Cell * Abc_SclFindInvertor( SC_Lib * p, int fFindBuff ); ...@@ -610,6 +610,7 @@ extern SC_Cell * Abc_SclFindInvertor( SC_Lib * p, int fFindBuff );
extern SC_Cell * Abc_SclFindSmallestGate( SC_Cell * p, float CinMin ); extern SC_Cell * Abc_SclFindSmallestGate( SC_Cell * p, float CinMin );
extern SC_WireLoad * Abc_SclFindWireLoadModel( SC_Lib * p, float Area ); extern SC_WireLoad * Abc_SclFindWireLoadModel( SC_Lib * p, float Area );
extern SC_WireLoad * Abc_SclFetchWireLoadModel( SC_Lib * p, char * pName ); extern SC_WireLoad * Abc_SclFetchWireLoadModel( SC_Lib * p, char * pName );
extern float Abc_SclComputeAverageSlew( SC_Lib * p );
extern void Abc_SclDumpGenlib( char * pFileName, SC_Lib * p, float Slew, float Gain, int nGatesMin ); extern void Abc_SclDumpGenlib( char * pFileName, SC_Lib * p, float Slew, float Gain, int nGatesMin );
extern void Abc_SclInstallGenlib( void * pScl, float Slew, float Gain, int nGatesMin ); extern void Abc_SclInstallGenlib( void * pScl, float Slew, float Gain, int nGatesMin );
......
...@@ -280,6 +280,30 @@ SC_WireLoad * Abc_SclFindWireLoadModel( SC_Lib * p, float Area ) ...@@ -280,6 +280,30 @@ SC_WireLoad * Abc_SclFindWireLoadModel( SC_Lib * p, float Area )
/**Function************************************************************* /**Function*************************************************************
Synopsis [Returns "average" slew.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
float Abc_SclComputeAverageSlew( SC_Lib * p )
{
SC_Cell * pCell;
SC_Timing * pTime;
Vec_Flt_t * vIndex;
pCell = Abc_SclFindInvertor(p, 0);
if ( pCell == NULL )
return 0;
pTime = Scl_CellPinTime( pCell, 0 );
vIndex = pTime->pCellRise->vIndex0; // slew
return Vec_FltEntry( vIndex, Vec_FltSize(vIndex)/3 );
}
/**Function*************************************************************
Synopsis [Compute delay parameters of pin/cell/class.] Synopsis [Compute delay parameters of pin/cell/class.]
Description [] Description []
...@@ -437,18 +461,19 @@ void Abc_SclMarkSkippedCells( SC_Lib * p ) ...@@ -437,18 +461,19 @@ void Abc_SclMarkSkippedCells( SC_Lib * p )
fclose( pFile ); fclose( pFile );
printf( "Marked %d cells for skipping in the library \"%s\".\n", nSkipped, p->pName ); printf( "Marked %d cells for skipping in the library \"%s\".\n", nSkipped, p->pName );
} }
void Abc_SclPrintCells( SC_Lib * p, float Slew, float Gain, int fInvOnly, int fShort ) void Abc_SclPrintCells( SC_Lib * p, float SlewInit, float Gain, int fInvOnly, int fShort )
{ {
SC_Cell * pCell, * pRepr; SC_Cell * pCell, * pRepr;
SC_Pin * pPin; SC_Pin * pPin;
int i, j, k, nLength = 0; int i, j, k, nLength = 0;
float Slew = (SlewInit == 0) ? Abc_SclComputeAverageSlew(p) : SlewInit;
float LD = 0, PD = 0; float LD = 0, PD = 0;
assert( Vec_PtrSize(p->vCellClasses) > 0 ); assert( Vec_PtrSize(p->vCellClasses) > 0 );
printf( "Library \"%s\" ", p->pName ); printf( "Library \"%s\" ", p->pName );
printf( "has %d cells in %d classes. ", printf( "has %d cells in %d classes. ",
Vec_PtrSize(p->vCells), Vec_PtrSize(p->vCellClasses) ); Vec_PtrSize(p->vCells), Vec_PtrSize(p->vCellClasses) );
if ( !fShort ) if ( !fShort )
printf( "Delay estimate is based on slew %.2f and gain %.2f.", Slew, Gain ); printf( "Delay estimate is based on slew %.2f ps and gain %.2f.", Slew, Gain );
printf( "\n" ); printf( "\n" );
Abc_SclMarkSkippedCells( p ); Abc_SclMarkSkippedCells( p );
// find the longest name // find the longest name
...@@ -628,7 +653,7 @@ Mio_Library_t * Abc_SclDeriveGenlibSimple( void * pScl ) ...@@ -628,7 +653,7 @@ Mio_Library_t * Abc_SclDeriveGenlibSimple( void * pScl )
Mio_Library_t * pLib = Mio_LibraryRead( p->pFileName, Vec_StrArray(vStr), NULL, 0 ); Mio_Library_t * pLib = Mio_LibraryRead( p->pFileName, Vec_StrArray(vStr), NULL, 0 );
Vec_StrFree( vStr ); Vec_StrFree( vStr );
if ( pLib ) if ( pLib )
printf( "Internally derived GENLIB library \"%s\" with %d gates.\n", p->pName, SC_LibCellNum(p) ); printf( "Derived GENLIB library \"%s\" with %d gates.\n", p->pName, SC_LibCellNum(p) );
else else
printf( "Reading library has filed.\n" ); printf( "Reading library has filed.\n" );
return pLib; return pLib;
...@@ -706,10 +731,11 @@ Vec_Str_t * Abc_SclProduceGenlibStr( SC_Lib * p, float Slew, float Gain, int nGa ...@@ -706,10 +731,11 @@ Vec_Str_t * Abc_SclProduceGenlibStr( SC_Lib * p, float Slew, float Gain, int nGa
*pnCellCount = Count; *pnCellCount = Count;
return vStr; return vStr;
} }
void Abc_SclDumpGenlib( char * pFileName, SC_Lib * p, float Slew, float Gain, int nGatesMin ) void Abc_SclDumpGenlib( char * pFileName, SC_Lib * p, float SlewInit, float Gain, int nGatesMin )
{ {
int nCellCount = 0; int nCellCount = 0;
char FileName[1000]; char FileName[1000];
float Slew = (SlewInit == 0) ? Abc_SclComputeAverageSlew(p) : SlewInit;
Vec_Str_t * vStr; Vec_Str_t * vStr;
FILE * pFile; FILE * pFile;
if ( pFileName == NULL ) if ( pFileName == NULL )
...@@ -728,17 +754,18 @@ void Abc_SclDumpGenlib( char * pFileName, SC_Lib * p, float Slew, float Gain, in ...@@ -728,17 +754,18 @@ void Abc_SclDumpGenlib( char * pFileName, SC_Lib * p, float Slew, float Gain, in
fclose( pFile ); fclose( pFile );
printf( "Written GENLIB library with %d gates into file \"%s\".\n", nCellCount, FileName ); printf( "Written GENLIB library with %d gates into file \"%s\".\n", nCellCount, FileName );
} }
Mio_Library_t * Abc_SclDeriveGenlib( void * pScl, float Slew, float Gain, int nGatesMin ) Mio_Library_t * Abc_SclDeriveGenlib( void * pScl, float SlewInit, float Gain, int nGatesMin, int fVerbose )
{ {
int nCellCount = 0; int nCellCount = 0;
SC_Lib * p = (SC_Lib *)pScl; SC_Lib * p = (SC_Lib *)pScl;
float Slew = (SlewInit == 0) ? Abc_SclComputeAverageSlew(p) : SlewInit;
Vec_Str_t * vStr = Abc_SclProduceGenlibStr( p, Slew, Gain, nGatesMin, &nCellCount ); Vec_Str_t * vStr = Abc_SclProduceGenlibStr( p, Slew, Gain, nGatesMin, &nCellCount );
Mio_Library_t * pLib = Mio_LibraryRead( p->pFileName, Vec_StrArray(vStr), NULL, 0 ); Mio_Library_t * pLib = Mio_LibraryRead( p->pFileName, Vec_StrArray(vStr), NULL, 0 );
Vec_StrFree( vStr ); Vec_StrFree( vStr );
if ( pLib ) if ( !pLib )
printf( "Internally derived GENLIB library \"%s\" with %d gates.\n", p->pName, nCellCount );
else
printf( "Reading library has filed.\n" ); printf( "Reading library has filed.\n" );
else if ( fVerbose )
printf( "Derived GENLIB library \"%s\" with %d gates using slew %.2f ps and gain %.2f.\n", p->pName, nCellCount, Slew, Gain );
return pLib; return pLib;
} }
...@@ -753,10 +780,11 @@ Mio_Library_t * Abc_SclDeriveGenlib( void * pScl, float Slew, float Gain, int nG ...@@ -753,10 +780,11 @@ Mio_Library_t * Abc_SclDeriveGenlib( void * pScl, float Slew, float Gain, int nG
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Abc_SclInstallGenlib( void * pScl, float Slew, float Gain, int nGatesMin ) void Abc_SclInstallGenlib( void * pScl, float SlewInit, float Gain, int nGatesMin )
{ {
SC_Lib * p = (SC_Lib *)pScl; SC_Lib * p = (SC_Lib *)pScl;
Vec_Str_t * vStr, * vStr2; Vec_Str_t * vStr, * vStr2;
float Slew = (SlewInit == 0) ? Abc_SclComputeAverageSlew(p) : SlewInit;
int RetValue, nGateCount = SC_LibCellNum(p); int RetValue, nGateCount = SC_LibCellNum(p);
if ( Gain == 0 ) if ( Gain == 0 )
vStr = Abc_SclProduceGenlibStrSimple(p); vStr = Abc_SclProduceGenlibStrSimple(p);
...@@ -766,10 +794,12 @@ void Abc_SclInstallGenlib( void * pScl, float Slew, float Gain, int nGatesMin ) ...@@ -766,10 +794,12 @@ void Abc_SclInstallGenlib( void * pScl, float Slew, float Gain, int nGatesMin )
RetValue = Mio_UpdateGenlib2( vStr, vStr2, p->pName, 0 ); RetValue = Mio_UpdateGenlib2( vStr, vStr2, p->pName, 0 );
Vec_StrFree( vStr ); Vec_StrFree( vStr );
Vec_StrFree( vStr2 ); Vec_StrFree( vStr2 );
if ( RetValue ) if ( !RetValue )
printf( "Internally derived GENLIB library \"%s\" with %d gates.\n", p->pName, nGateCount );
else
printf( "Reading library has filed.\n" ); printf( "Reading library has filed.\n" );
else if ( Gain != 0 )
printf( "Derived GENLIB library \"%s\" with %d gates using slew %.2f ps and gain %.2f.\n", p->pName, nGateCount, Slew, Gain );
// else
// printf( "Derived unit-delay GENLIB library \"%s\" with %d gates.\n", p->pName, nGateCount );
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
...@@ -1333,6 +1333,7 @@ SC_Lib * Abc_SclReadLiberty( char * pFileName, int fVerbose, int fVeryVerbose ) ...@@ -1333,6 +1333,7 @@ SC_Lib * Abc_SclReadLiberty( char * pFileName, int fVerbose, int fVeryVerbose )
pLib->pFileName = Abc_UtilStrsav( pFileName ); pLib->pFileName = Abc_UtilStrsav( pFileName );
Abc_SclLibNormalize( pLib ); Abc_SclLibNormalize( pLib );
Vec_StrFree( vStr ); Vec_StrFree( vStr );
// printf( "Average slew = %.2f ps\n", Abc_SclComputeAverageSlew(pLib) );
return pLib; return pLib;
} }
......
...@@ -532,14 +532,14 @@ static inline void Abc_SclDumpStats( SC_Man * p, char * pFileName, abctime Time ...@@ -532,14 +532,14 @@ static inline void Abc_SclDumpStats( SC_Man * p, char * pFileName, abctime Time
fprintf( pTable, "%.1f ", 100.0 * Abc_NtkNodeNum(p->pNtk) / nNodesOld ); fprintf( pTable, "%.1f ", 100.0 * Abc_NtkNodeNum(p->pNtk) / nNodesOld );
fprintf( pTable, "%.1f ", 100.0 * (int)p->SumArea / nAreaOld ); fprintf( pTable, "%.1f ", 100.0 * (int)p->SumArea / nAreaOld );
fprintf( pTable, "%.1f ", 100.0 * (int)p->ReportDelay / nDelayOld ); fprintf( pTable, "%.1f ", 100.0 * (int)p->ReportDelay / nDelayOld );
fprintf( pTable, "%.2f", 1.0*(Abc_Clock() - clk)/CLOCKS_PER_SEC ); fprintf( pTable, "%.2f", 1.0*(Abc_Clock() - clk)/CLOCKS_PER_SEC );
} }
fclose( pTable ); fclose( pTable );
} }
/*=== sclBufSize.c ===============================================================*/
extern Abc_Ntk_t * Abc_SclBufSizePerform( Abc_Ntk_t * pNtk, SC_Lib * pLib, SC_BusPars * pPars );
/*=== sclBuffer.c ===============================================================*/ /*=== sclBuffer.c ===============================================================*/
extern Abc_Ntk_t * Abc_SclBufferingPerform( Abc_Ntk_t * pNtk, SC_Lib * pLib, SC_BusPars * pPars );
/*=== sclBufferOld.c ===============================================================*/
extern int Abc_SclIsInv( Abc_Obj_t * pObj ); extern int Abc_SclIsInv( Abc_Obj_t * pObj );
extern void Abc_NodeInvUpdateFanPolarity( Abc_Obj_t * pObj ); extern void Abc_NodeInvUpdateFanPolarity( Abc_Obj_t * pObj );
extern void Abc_NodeInvUpdateObjFanoutPolarity( Abc_Obj_t * pObj, Abc_Obj_t * pFanout ); extern void Abc_NodeInvUpdateObjFanoutPolarity( Abc_Obj_t * pObj, Abc_Obj_t * pFanout );
......
...@@ -309,8 +309,8 @@ int Abc_SclFindBestCell( SC_Man * p, Abc_Obj_t * pObj, Vec_Int_t * vRecalcs, Vec ...@@ -309,8 +309,8 @@ int Abc_SclFindBestCell( SC_Man * p, Abc_Obj_t * pObj, Vec_Int_t * vRecalcs, Vec
} }
else if ( NoChange ) else if ( NoChange )
NoChange++; NoChange++;
// if ( NoChange == 4 ) if ( NoChange == 4 )
// break; break;
// printf( "%.2f ", dGain ); // printf( "%.2f ", dGain );
} }
// printf( "Best = %.2f ", dGainBest ); // printf( "Best = %.2f ", dGainBest );
......
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