Commit e70adbcd by Alan Mishchenko

Improvements to the standard cell flow.

parent 5021909c
...@@ -14474,7 +14474,7 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -14474,7 +14474,7 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
double DelayMulti; double DelayMulti;
float LogFan = 0; float LogFan = 0;
float Slew = 0; // choose based on the library float Slew = 0; // choose based on the library
float Gain = 200; float Gain = 250;
int nGatesMin = 4; int nGatesMin = 4;
int fAreaOnly; int fAreaOnly;
int fRecovery; int fRecovery;
...@@ -76,6 +76,9 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti, ...@@ -76,6 +76,9 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti,
pLib = Abc_SclDeriveGenlib( Abc_FrameReadLibScl(), Slew, Gain, nGatesMin, fVerbose ); 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 );
// remove supergate library
Map_SuperLibFree( (Map_SuperLib_t *)Abc_FrameReadLibSuper() );
Abc_FrameSetLibSuper( NULL );
} }
// quit if there is no library // quit if there is no library
if ( pLib == NULL ) if ( pLib == NULL )
......
...@@ -871,7 +871,7 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -871,7 +871,7 @@ 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 = 250; pPars->GainRatio = 300;
pPars->Slew = pAbc->pLibScl ? Abc_SclComputeAverageSlew((SC_Lib *)pAbc->pLibScl) : 100; pPars->Slew = pAbc->pLibScl ? Abc_SclComputeAverageSlew((SC_Lib *)pAbc->pLibScl) : 100;
pPars->nDegree = 10; pPars->nDegree = 10;
pPars->fSizeOnly = 0; pPars->fSizeOnly = 0;
......
...@@ -384,16 +384,15 @@ Abc_Obj_t * Abc_SclAddOneInv( Bus_Man_t * p, Abc_Obj_t * pObj, Vec_Ptr_t * vFano ...@@ -384,16 +384,15 @@ Abc_Obj_t * Abc_SclAddOneInv( Bus_Man_t * p, Abc_Obj_t * pObj, Vec_Ptr_t * vFano
Abc_NodeInvUpdateFanPolarity( pInv ); Abc_NodeInvUpdateFanPolarity( pInv );
return pInv; return pInv;
} }
void Abc_SclBufSize( Bus_Man_t * p ) void Abc_SclBufSize( Bus_Man_t * p, float Gain )
{ {
SC_Cell * pCell, * pCellNew; SC_Cell * pCell, * pCellNew;
Abc_Obj_t * pObj, * pFanout; Abc_Obj_t * pObj, * pFanout;
abctime clk = Abc_Clock(); abctime clk = Abc_Clock();
int nObjsOld = Abc_NtkObjNumMax(p->pNtk); int i, k, nObjsOld = Abc_NtkObjNumMax(p->pNtk);
float GainInv = 0.01 * p->pPars->GainRatio; float GainGate, GainInv, Load, LoadNew, Cin, DeptMax = 0;
float GainGate = (float)1.0 * GainInv; GainGate = p->pPars->fAddBufs ? pow( Gain, 2.0 ) : Gain;
float Load, LoadNew, Cin, DeptMax = 0; GainInv = p->pPars->fAddBufs ? pow( Gain, 2.0 ) : Gain;
int i, k, nObjOld = Abc_NtkObjNumMax(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)) )
...@@ -473,7 +472,7 @@ void Abc_SclBufSize( Bus_Man_t * p ) ...@@ -473,7 +472,7 @@ void Abc_SclBufSize( Bus_Man_t * p )
{ {
printf( "WireLoads = %d Degree = %d Target slew =%4d ps Gain2 =%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->Slew, p->pPars->GainRatio, p->pPars->fUseWireLoads, p->pPars->nDegree, p->pPars->Slew, p->pPars->GainRatio,
Abc_NtkObjNumMax(p->pNtk) - nObjOld, DeptMax ); Abc_NtkObjNumMax(p->pNtk) - nObjsOld, DeptMax );
Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
} }
} }
...@@ -483,14 +482,11 @@ Abc_Ntk_t * Abc_SclBufferingPerform( Abc_Ntk_t * pNtk, SC_Lib * pLib, SC_BusPars ...@@ -483,14 +482,11 @@ Abc_Ntk_t * Abc_SclBufferingPerform( Abc_Ntk_t * pNtk, SC_Lib * pLib, SC_BusPars
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 ); 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, 0.01 * pPars->GainRatio );
Bus_ManStop( p ); Bus_ManStop( p );
Abc_SclSclGates2MioGates( pLib, pNtk ); Abc_SclSclGates2MioGates( pLib, pNtk );
if ( pNtk->vPhases ) if ( pNtk->vPhases )
......
...@@ -517,7 +517,7 @@ static inline void Abc_SclDumpStats( SC_Man * p, char * pFileName, abctime Time ...@@ -517,7 +517,7 @@ static inline void Abc_SclDumpStats( SC_Man * p, char * pFileName, abctime Time
{ {
sprintf( FileNameOld, "%s", p->pNtk->pName ); sprintf( FileNameOld, "%s", p->pNtk->pName );
fprintf( pTable, "\n" ); fprintf( pTable, "\n" );
fprintf( pTable, "%s ", p->pNtk->pName ); fprintf( pTable, "%s ", Extra_FileNameWithoutPath(p->pNtk->pName) );
fprintf( pTable, "%d ", Abc_NtkPiNum(p->pNtk) ); fprintf( pTable, "%d ", Abc_NtkPiNum(p->pNtk) );
fprintf( pTable, "%d ", Abc_NtkPoNum(p->pNtk) ); fprintf( pTable, "%d ", Abc_NtkPoNum(p->pNtk) );
fprintf( pTable, "%d ", (nNodesOld = Abc_NtkNodeNum(p->pNtk)) ); fprintf( pTable, "%d ", (nNodesOld = Abc_NtkNodeNum(p->pNtk)) );
......
...@@ -103,6 +103,7 @@ extern char * Extra_FileNameExtension( char * FileName ); ...@@ -103,6 +103,7 @@ extern char * Extra_FileNameExtension( char * FileName );
extern char * Extra_FileNameAppend( char * pBase, char * pSuffix ); extern char * Extra_FileNameAppend( char * pBase, char * pSuffix );
extern char * Extra_FileNameGeneric( char * FileName ); extern char * Extra_FileNameGeneric( char * FileName );
extern char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix ); extern char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix );
extern char * Extra_FileNameWithoutPath( char * FileName );
extern int Extra_FileCheck( char * pFileName ); extern int Extra_FileCheck( char * pFileName );
extern int Extra_FileSize( char * pFileName ); extern int Extra_FileSize( char * pFileName );
extern char * Extra_FileRead( FILE * pFile ); extern char * Extra_FileRead( FILE * pFile );
......
...@@ -196,6 +196,26 @@ char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix ) ...@@ -196,6 +196,26 @@ char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix )
/**Function************************************************************* /**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
char * Extra_FileNameWithoutPath( char * FileName )
{
char * pRes;
for ( pRes = FileName + strlen(FileName) - 1; pRes >= FileName; pRes-- )
if ( *pRes == '\\' || *pRes == '/' )
return pRes + 1;
return FileName;
}
/**Function*************************************************************
Synopsis [Returns the file size.] Synopsis [Returns the file size.]
Description [The file should be closed.] Description [The file should be closed.]
......
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