summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/base/abc/abc.h1
-rw-r--r--src/base/abc/abcUtil.c11
-rw-r--r--src/map/scl/sclBufSize.c2
-rw-r--r--src/map/scl/sclLib.h4
-rw-r--r--src/map/scl/sclLibScl.c88
-rw-r--r--src/map/scl/sclLiberty.c6
-rw-r--r--src/map/scl/sclLoad.c38
-rw-r--r--src/map/scl/sclSize.c32
-rw-r--r--src/map/scl/sclSize.h15
9 files changed, 110 insertions, 87 deletions
diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h
index 5bc3e0e4..0e9199f9 100644
--- a/src/base/abc/abc.h
+++ b/src/base/abc/abc.h
@@ -965,6 +965,7 @@ extern ABC_DLL int Abc_NtkGetMuxNum( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkGetBufNum( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkGetChoiceNum( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkGetFaninMax( Abc_Ntk_t * pNtk );
+extern ABC_DLL int Abc_NtkGetFanoutMax( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkGetTotalFanins( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkCleanCopy( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkCleanData( Abc_Ntk_t * pNtk );
diff --git a/src/base/abc/abcUtil.c b/src/base/abc/abcUtil.c
index 1fb6dbab..b3b37da0 100644
--- a/src/base/abc/abcUtil.c
+++ b/src/base/abc/abcUtil.c
@@ -459,6 +459,17 @@ int Abc_NtkGetFaninMax( Abc_Ntk_t * pNtk )
}
return nFaninsMax;
}
+int Abc_NtkGetFanoutMax( Abc_Ntk_t * pNtk )
+{
+ Abc_Obj_t * pNode;
+ int i, nFaninsMax = 0;
+ Abc_NtkForEachNode( pNtk, pNode, i )
+ {
+ if ( nFaninsMax < Abc_ObjFanoutNum(pNode) )
+ nFaninsMax = Abc_ObjFanoutNum(pNode);
+ }
+ return nFaninsMax;
+}
/**Function*************************************************************
diff --git a/src/map/scl/sclBufSize.c b/src/map/scl/sclBufSize.c
index aca87673..41db0f5a 100644
--- a/src/map/scl/sclBufSize.c
+++ b/src/map/scl/sclBufSize.c
@@ -94,7 +94,7 @@ Bus_Man_t * Bus_ManStart( Abc_Ntk_t * pNtk, SC_Lib * pLib, SC_BusPars * pPars )
p->pWLoadUsed = Abc_SclFetchWireLoadModel( pLib, pNtk->pWLoadUsed );
}
if ( p->pWLoadUsed )
- p->vWireCaps = Abc_SclFindWireCaps( p->pWLoadUsed );
+ p->vWireCaps = Abc_SclFindWireCaps( p->pWLoadUsed, Abc_NtkGetFanoutMax(pNtk) );
p->vFanouts = Vec_PtrAlloc( 100 );
p->vCins = Vec_FltAlloc( 2*Abc_NtkObjNumMax(pNtk) + 1000 );
p->vETimes = Vec_FltAlloc( 2*Abc_NtkObjNumMax(pNtk) + 1000 );
diff --git a/src/map/scl/sclLib.h b/src/map/scl/sclLib.h
index a4d553fa..b8ac624a 100644
--- a/src/map/scl/sclLib.h
+++ b/src/map/scl/sclLib.h
@@ -40,7 +40,7 @@ ABC_NAMESPACE_HEADER_START
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
-#define ABC_SCL_CUR_VERSION 6
+#define ABC_SCL_CUR_VERSION 7
typedef enum
{
@@ -117,8 +117,8 @@ typedef struct SC_Lib_ SC_Lib;
struct SC_WireLoad_
{
char * pName;
- float res; // (currently not used)
float cap; // }- multiply estimation in 'fanout_len[].snd' with this value
+ float slope; // used to extrapolate wireload for large fanout count
Vec_Int_t * vFanout; // Vec<Pair<uint,float> > -- pairs '(#fanouts, est-wire-len)'
Vec_Flt_t * vLen;
};
diff --git a/src/map/scl/sclLibScl.c b/src/map/scl/sclLibScl.c
index bd0bb5dc..7947d8a3 100644
--- a/src/map/scl/sclLibScl.c
+++ b/src/map/scl/sclLibScl.c
@@ -71,11 +71,16 @@ static void Abc_SclReadSurface( Vec_Str_t * vOut, int * pPos, SC_Surface * p )
for ( i = 0; i < 6; i++ )
p->approx[2][i] = Vec_StrGetF( vOut, pPos );
}
-static void Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
+static int Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
{
int i, j, k, n;
int version = Vec_StrGetI( vOut, pPos );
- assert( version == 5 || version == ABC_SCL_CUR_VERSION ); // wrong version of the file
+ if ( version != ABC_SCL_CUR_VERSION )
+ {
+ Abc_Print( -1, "Wrong version of the SCL file.\n" );
+ return 0;
+ }
+ assert( version == ABC_SCL_CUR_VERSION ); // wrong version of the file
// Read non-composite fields:
p->pName = Vec_StrGetS(vOut, pPos);
@@ -94,8 +99,8 @@ static void Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
Vec_PtrPush( p->vWireLoads, pWL );
pWL->pName = Vec_StrGetS(vOut, pPos);
- pWL->res = Vec_StrGetF(vOut, pPos);
- pWL->cap = Vec_StrGetF(vOut, pPos);
+ pWL->cap = Vec_StrGetF(vOut, pPos);
+ pWL->slope = Vec_StrGetF(vOut, pPos);
for ( j = Vec_StrGetI(vOut, pPos); j != 0; j-- )
{
@@ -163,9 +168,14 @@ static void Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
assert( k == pCell->n_inputs );
// read function
- if ( version == 5 )
- {
- // formula is not given
+ // (possibly empty) formula is always given
+ assert( version == ABC_SCL_CUR_VERSION );
+ assert( pPin->func_text == NULL );
+ pPin->func_text = Vec_StrGetS(vOut, pPos);
+ if ( pPin->func_text[0] == 0 )
+ {
+ // formula is not given - read truth table
+ ABC_FREE( pPin->func_text );
assert( Vec_WrdSize(pPin->vFunc) == 0 );
Vec_WrdGrow( pPin->vFunc, Abc_Truth6WordNum(pCell->n_inputs) );
for ( k = 0; k < Vec_WrdCap(pPin->vFunc); k++ )
@@ -173,40 +183,24 @@ static void Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
}
else
{
- // (possibly empty) formula is always given
- assert( version == ABC_SCL_CUR_VERSION );
- assert( pPin->func_text == NULL );
- pPin->func_text = Vec_StrGetS(vOut, pPos);
- if ( pPin->func_text[0] == 0 )
- {
- // formula is not given - read truth table
- ABC_FREE( pPin->func_text );
- assert( Vec_WrdSize(pPin->vFunc) == 0 );
- Vec_WrdGrow( pPin->vFunc, Abc_Truth6WordNum(pCell->n_inputs) );
- for ( k = 0; k < Vec_WrdCap(pPin->vFunc); k++ )
- Vec_WrdPush( pPin->vFunc, Vec_StrGetW(vOut, pPos) );
- }
- else
+ // formula is given - derive truth table
+ SC_Pin * pPin2;
+ Vec_Ptr_t * vNames;
+ // collect input names
+ vNames = Vec_PtrAlloc( pCell->n_inputs );
+ SC_CellForEachPinIn( pCell, pPin2, n )
+ Vec_PtrPush( vNames, pPin2->pName );
+ // derive truth table
+ assert( Vec_WrdSize(pPin->vFunc) == 0 );
+ Vec_WrdFree( pPin->vFunc );
+ pPin->vFunc = Mio_ParseFormulaTruth( pPin->func_text, (char **)Vec_PtrArray(vNames), pCell->n_inputs );
+ Vec_PtrFree( vNames );
+ // skip truth table
+ assert( Vec_WrdSize(pPin->vFunc) == Abc_Truth6WordNum(pCell->n_inputs) );
+ for ( k = 0; k < Vec_WrdSize(pPin->vFunc); k++ )
{
- // formula is given - derive truth table
- SC_Pin * pPin2;
- Vec_Ptr_t * vNames;
- // collect input names
- vNames = Vec_PtrAlloc( pCell->n_inputs );
- SC_CellForEachPinIn( pCell, pPin2, n )
- Vec_PtrPush( vNames, pPin2->pName );
- // derive truth table
- assert( Vec_WrdSize(pPin->vFunc) == 0 );
- Vec_WrdFree( pPin->vFunc );
- pPin->vFunc = Mio_ParseFormulaTruth( pPin->func_text, (char **)Vec_PtrArray(vNames), pCell->n_inputs );
- Vec_PtrFree( vNames );
- // skip truth table
- assert( Vec_WrdSize(pPin->vFunc) == Abc_Truth6WordNum(pCell->n_inputs) );
- for ( k = 0; k < Vec_WrdSize(pPin->vFunc); k++ )
- {
- word Value = Vec_StrGetW(vOut, pPos);
- assert( Value == Vec_WrdEntry(pPin->vFunc, k) );
- }
+ word Value = Vec_StrGetW(vOut, pPos);
+ assert( Value == Vec_WrdEntry(pPin->vFunc, k) );
}
}
@@ -234,6 +228,7 @@ static void Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
}
}
}
+ return 1;
}
SC_Lib * Abc_SclReadFromStr( Vec_Str_t * vOut )
{
@@ -241,7 +236,8 @@ SC_Lib * Abc_SclReadFromStr( Vec_Str_t * vOut )
int Pos = 0;
// read the library
p = Abc_SclLibAlloc();
- Abc_SclReadLibrary( vOut, &Pos, p );
+ if ( !Abc_SclReadLibrary( vOut, &Pos, p ) )
+ return NULL;
assert( Pos == Vec_StrSize(vOut) );
// hash gates by name
Abc_SclHashCells( p );
@@ -273,8 +269,10 @@ SC_Lib * Abc_SclReadFromFile( char * pFileName )
fclose( pFile );
// read the library
p = Abc_SclReadFromStr( vOut );
- p->pFileName = Abc_UtilStrsav( pFileName );
- Abc_SclLibNormalize( p );
+ if ( p != NULL )
+ p->pFileName = Abc_UtilStrsav( pFileName );
+ if ( p != NULL )
+ Abc_SclLibNormalize( p );
Vec_StrFree( vOut );
return p;
}
@@ -343,8 +341,8 @@ static void Abc_SclWriteLibrary( Vec_Str_t * vOut, SC_Lib * p )
SC_LibForEachWireLoad( p, pWL, i )
{
Vec_StrPutS( vOut, pWL->pName );
- Vec_StrPutF( vOut, pWL->res );
Vec_StrPutF( vOut, pWL->cap );
+ Vec_StrPutF( vOut, pWL->slope );
Vec_StrPutI( vOut, Vec_IntSize(pWL->vFanout) );
for ( j = 0; j < Vec_IntSize(pWL->vFanout); j++ )
@@ -553,8 +551,8 @@ static void Abc_SclWriteLibraryText( FILE * s, SC_Lib * p )
SC_LibForEachWireLoad( p, pWL, i )
{
fprintf( s, " wire_load(\"%s\") {\n", pWL->pName );
- fprintf( s, " resistance : %f;\n", pWL->res );
fprintf( s, " capacitance : %f;\n", pWL->cap );
+ fprintf( s, " slope : %f;\n", pWL->slope );
for ( j = 0; j < Vec_IntSize(pWL->vFanout); j++ )
fprintf( s, " fanout_length( %d, %f );\n", Vec_IntEntry(pWL->vFanout, j), Vec_FltEntry(pWL->vLen, j) );
fprintf( s, " }\n\n" );
diff --git a/src/map/scl/sclLiberty.c b/src/map/scl/sclLiberty.c
index 56ff2998..7342a008 100644
--- a/src/map/scl/sclLiberty.c
+++ b/src/map/scl/sclLiberty.c
@@ -811,10 +811,10 @@ void Scl_LibertyReadWireLoad( Scl_Tree_t * p, Vec_Str_t * vOut )
Scl_ItemForEachChildName( p, Scl_LibertyRoot(p), pItem, "wire_load" )
{
Vec_StrPutS_( vOut, Scl_LibertyReadString(p, pItem->Head) );
- Scl_ItemForEachChildName( p, pItem, pChild, "resistance" )
- Vec_StrPutF_( vOut, atof(Scl_LibertyReadString(p, pChild->Head)) );
Scl_ItemForEachChildName( p, pItem, pChild, "capacitance" )
Vec_StrPutF_( vOut, atof(Scl_LibertyReadString(p, pChild->Head)) );
+ Scl_ItemForEachChildName( p, pItem, pChild, "slope" )
+ Vec_StrPutF_( vOut, atof(Scl_LibertyReadString(p, pChild->Head)) );
Vec_StrPut_( vOut );
Vec_StrPutI_( vOut, Scl_LibertyItemNum(p, pItem, "fanout_length") );
Vec_StrPut_( vOut );
@@ -1575,6 +1575,8 @@ SC_Lib * Abc_SclReadLiberty( char * pFileName, int fVerbose, int fVeryVerbose )
Scl_LibertyStop( p, fVeryVerbose );
// construct SCL data-structure
pLib = Abc_SclReadFromStr( vStr );
+ if ( pLib == NULL )
+ return NULL;
pLib->pFileName = Abc_UtilStrsav( pFileName );
Abc_SclLibNormalize( pLib );
Vec_StrFree( vStr );
diff --git a/src/map/scl/sclLoad.c b/src/map/scl/sclLoad.c
index 033750cb..f23bf7f9 100644
--- a/src/map/scl/sclLoad.c
+++ b/src/map/scl/sclLoad.c
@@ -42,29 +42,41 @@ ABC_NAMESPACE_IMPL_START
SeeAlso []
***********************************************************************/
-Vec_Flt_t * Abc_SclFindWireCaps( SC_WireLoad * pWL )
+Vec_Flt_t * Abc_SclFindWireCaps( SC_WireLoad * pWL, int nFanoutMax )
{
Vec_Flt_t * vCaps = NULL;
- float EntryPrev, EntryCur;
- int i, Entry, EntryMax;
+ float EntryPrev, EntryCur, Slope;
+ int i, iPrev, k, Entry, EntryMax;
assert( pWL != NULL );
- // find the biggest fanout
+ // find the biggest fanout count
EntryMax = 0;
Vec_IntForEachEntry( pWL->vFanout, Entry, i )
EntryMax = Abc_MaxInt( EntryMax, Entry );
// create the array
- vCaps = Vec_FltStart( EntryMax + 1 );
+ vCaps = Vec_FltStart( Abc_MaxInt(nFanoutMax, EntryMax) + 1 );
Vec_IntForEachEntry( pWL->vFanout, Entry, i )
Vec_FltWriteEntry( vCaps, Entry, Vec_FltEntry(pWL->vLen, i) * pWL->cap );
- // reformat
- EntryPrev = 0;
- Vec_FltForEachEntry( vCaps, EntryCur, i )
+ // interpolate between the values
+ assert( Vec_FltEntry(vCaps, 1) != 0 );
+ iPrev = 1;
+ EntryPrev = Vec_FltEntry(vCaps, 1);
+ Vec_FltForEachEntryStart( vCaps, EntryCur, i, 2 )
{
- if ( EntryCur )
- EntryPrev = EntryCur;
- else
- Vec_FltWriteEntry( vCaps, i, EntryPrev );
+ if ( EntryCur == 0 )
+ continue;
+ Slope = (EntryCur - EntryPrev) / (i - iPrev);
+ for ( k = iPrev + 1; k < i; k++ )
+ Vec_FltWriteEntry( vCaps, k, EntryPrev + Slope * (k - iPrev) );
+ EntryPrev = EntryCur;
+ iPrev = i;
}
+ // extrapolate after the largest value
+ Slope = pWL->cap * pWL->slope;
+ for ( k = iPrev + 1; k < i; k++ )
+ Vec_FltWriteEntry( vCaps, k, EntryPrev + Slope * (k - iPrev) );
+ // show
+// Vec_FltForEachEntry( vCaps, EntryCur, i )
+// printf( "%3d : %f\n", i, EntryCur );
return vCaps;
}
@@ -126,7 +138,7 @@ void Abc_SclComputeLoad( SC_Man * p )
if ( p->pWLoadUsed != NULL )
{
if ( p->vWireCaps == NULL )
- p->vWireCaps = Abc_SclFindWireCaps( p->pWLoadUsed );
+ p->vWireCaps = Abc_SclFindWireCaps( p->pWLoadUsed, Abc_NtkGetFanoutMax(p->pNtk) );
Abc_NtkForEachNode1( p->pNtk, pObj, i )
Abc_SclAddWireLoad( p, pObj, 0 );
Abc_NtkForEachPi( p->pNtk, pObj, i )
diff --git a/src/map/scl/sclSize.c b/src/map/scl/sclSize.c
index 54ed72bc..d5710af8 100644
--- a/src/map/scl/sclSize.c
+++ b/src/map/scl/sclSize.c
@@ -116,14 +116,14 @@ static inline void Abc_SclTimeNodePrint( SC_Man * p, Abc_Obj_t * pObj, int fRise
printf( "%-*s ", Length, pCell ? pCell->pName : "pi" );
printf( "A =%7.2f ", pCell ? pCell->area : 0.0 );
printf( "D%s =", fRise ? "r" : "f" );
- printf( "%6.1f", Abc_MaxFloat(Abc_SclObjTimePs(p, pObj, 0), Abc_SclObjTimePs(p, pObj, 1)) );
- printf( "%7.1f ps ", -Abc_AbsFloat(Abc_SclObjTimePs(p, pObj, 0) - Abc_SclObjTimePs(p, pObj, 1)) );
- printf( "S =%6.1f ps ", Abc_SclObjSlewPs(p, pObj, fRise >= 0 ? fRise : 0) );
+ printf( "%6.1f", Abc_SclObjTimeMax(p, pObj) );
+ printf( "%7.1f ps ", -Abc_AbsFloat(Abc_SclObjTimeOne(p, pObj, 0) - Abc_SclObjTimeOne(p, pObj, 1)) );
+ printf( "S =%6.1f ps ", Abc_SclObjSlewMax(p, pObj) );
printf( "Cin =%5.1f ff ", pCell ? SC_CellPinCapAve(pCell) : 0.0 );
- printf( "Cout =%6.1f ff ", Abc_SclObjLoadFf(p, pObj, fRise >= 0 ? fRise : 0) );
+ printf( "Cout =%6.1f ff ", Abc_SclObjLoadMax(p, pObj) );
printf( "Cmax =%6.1f ff ", pCell ? SC_CellPin(pCell, pCell->n_inputs)->max_out_cap : 0.0 );
printf( "G =%5d ", pCell ? (int)(100.0 * Abc_SclObjLoadAve(p, pObj) / SC_CellPinCapAve(pCell)) : 0 );
-// printf( "SL =%6.1f ps", Abc_SclObjSlackPs(p, pObj, p->MaxDelay0) );
+// printf( "SL =%6.1f ps", Abc_SclObjSlackMax(p, pObj, p->MaxDelay0) );
printf( "\n" );
}
void Abc_SclTimeNtkPrint( SC_Man * p, int fShowAll, int fPrintPath )
@@ -131,7 +131,7 @@ void Abc_SclTimeNtkPrint( SC_Man * p, int fShowAll, int fPrintPath )
int fReversePath = 1;
int i, nLength = 0, fRise = 0;
Abc_Obj_t * pObj, * pPivot = Abc_SclFindCriticalCo( p, &fRise );
- float maxDelay = Abc_SclObjTimePs(p, pPivot, fRise);
+ float maxDelay = Abc_SclObjTimeOne( p, pPivot, fRise );
p->ReportDelay = maxDelay;
printf( "WireLoad = \"%s\" ", p->pWLoadUsed ? p->pWLoadUsed->pName : "none" );
@@ -362,10 +362,10 @@ void Abc_SclTimeCone( SC_Man * p, Vec_Int_t * vCone )
if ( fVerbose && Abc_ObjIsNode(pObj) )
printf( " Updating node %d with gate %s\n", Abc_ObjId(pObj), Abc_SclObjCell(pObj)->pName );
if ( fVerbose && Abc_ObjIsNode(pObj) )
- printf( " before (%6.1f ps %6.1f ps) ", Abc_SclObjTimePs(p, pObj, 1), Abc_SclObjTimePs(p, pObj, 0) );
+ printf( " before (%6.1f ps %6.1f ps) ", Abc_SclObjTimeOne(p, pObj, 1), Abc_SclObjTimeOne(p, pObj, 0) );
Abc_SclTimeNode( p, pObj, 0 );
if ( fVerbose && Abc_ObjIsNode(pObj) )
- printf( "after (%6.1f ps %6.1f ps)\n", Abc_SclObjTimePs(p, pObj, 1), Abc_SclObjTimePs(p, pObj, 0) );
+ printf( "after (%6.1f ps %6.1f ps)\n", Abc_SclObjTimeOne(p, pObj, 1), Abc_SclObjTimeOne(p, pObj, 0) );
}
}
void Abc_SclTimeNtkRecompute( SC_Man * p, float * pArea, float * pDelay, int fReverse, float DUser )
@@ -750,7 +750,7 @@ float Abc_SclCountNonBufferDelayInt( SC_Man * p, Abc_Obj_t * pObj )
float Delay = 0;
int i;
if ( !Abc_ObjIsBuffer(pObj) )
- return Abc_SclObjTimePs(p, pObj, 1);
+ return Abc_SclObjTimeMax(p, pObj);
Abc_ObjForEachFanout( pObj, pFanout, i )
Delay += Abc_SclCountNonBufferDelayInt( p, pFanout );
return Delay;
@@ -802,17 +802,17 @@ void Abc_SclPrintBuffersOne( SC_Man * p, Abc_Obj_t * pObj, int nOffset )
printf( " " );
printf( "a =%5.2f ", Abc_ObjIsPi(pObj) ? 0 : Abc_SclObjCell(pObj)->area );
printf( "d = (" );
- printf( "%6.0f ps; ", Abc_SclObjTimePs(p, pObj, 1) );
- printf( "%6.0f ps) ", Abc_SclObjTimePs(p, pObj, 0) );
- printf( "l =%5.0f ff ", Abc_SclObjLoadFf(p, pObj, 0 ) );
- printf( "s =%5.0f ps ", Abc_SclObjSlewPs(p, pObj, 0 ) );
- printf( "sl =%5.0f ps ", Abc_SclObjSlackPs(p, pObj, p->MaxDelay0) );
+ printf( "%6.0f ps; ", Abc_SclObjTimeOne(p, pObj, 1) );
+ printf( "%6.0f ps) ", Abc_SclObjTimeOne(p, pObj, 0) );
+ printf( "l =%5.0f ff ", Abc_SclObjLoadMax(p, pObj) );
+ printf( "s =%5.0f ps ", Abc_SclObjSlewMax(p, pObj) );
+ printf( "sl =%5.0f ps ", Abc_SclObjSlackMax(p, pObj, p->MaxDelay0) );
if ( nOffset == 0 )
{
printf( "L =%5.0f ff ", Abc_SclCountNonBufferLoad(p, pObj) );
printf( "Lx =%5.0f ff ", 100.0*Abc_SclCountNonBufferLoad(p, pObj)/p->EstLoadAve );
- printf( "Dx =%5.0f ps ", Abc_SclCountNonBufferDelay(p, pObj)/Abc_SclCountNonBufferFanouts(pObj) - Abc_SclObjTimePs(p, pObj, 1) );
- printf( "Cx =%5.0f ps", (Abc_SclCountNonBufferDelay(p, pObj)/Abc_SclCountNonBufferFanouts(pObj) - Abc_SclObjTimePs(p, pObj, 1))/log(Abc_SclCountNonBufferLoad(p, pObj)/p->EstLoadAve) );
+ printf( "Dx =%5.0f ps ", Abc_SclCountNonBufferDelay(p, pObj)/Abc_SclCountNonBufferFanouts(pObj) - Abc_SclObjTimeOne(p, pObj, 1) );
+ printf( "Cx =%5.0f ps", (Abc_SclCountNonBufferDelay(p, pObj)/Abc_SclCountNonBufferFanouts(pObj) - Abc_SclObjTimeOne(p, pObj, 1))/log(Abc_SclCountNonBufferLoad(p, pObj)/p->EstLoadAve) );
}
printf( "\n" );
}
diff --git a/src/map/scl/sclSize.h b/src/map/scl/sclSize.h
index 1087651e..2e5beaaa 100644
--- a/src/map/scl/sclSize.h
+++ b/src/map/scl/sclSize.h
@@ -114,20 +114,19 @@ static inline SC_Pair * Abc_SclObjDept( SC_Man * p, Abc_Obj_t * pObj )
static inline SC_Pair * Abc_SclObjTime( SC_Man * p, Abc_Obj_t * pObj ) { return p->pTimes + Abc_ObjId(pObj); }
static inline SC_Pair * Abc_SclObjSlew( SC_Man * p, Abc_Obj_t * pObj ) { return p->pSlews + Abc_ObjId(pObj); }
+static inline double Abc_SclObjLoadMax( SC_Man * p, Abc_Obj_t * pObj ) { return Abc_MaxFloat(Abc_SclObjLoad(p, pObj)->rise, Abc_SclObjLoad(p, pObj)->fall); }
+static inline float Abc_SclObjLoadAve( SC_Man * p, Abc_Obj_t * pObj ) { return 0.5 * Abc_SclObjLoad(p, pObj)->rise + 0.5 * Abc_SclObjLoad(p, pObj)->fall; }
+static inline double Abc_SclObjTimeOne( SC_Man * p, Abc_Obj_t * pObj, int fRise ){ return fRise ? Abc_SclObjTime(p, pObj)->rise : Abc_SclObjTime(p, pObj)->fall; }
static inline float Abc_SclObjTimeMax( SC_Man * p, Abc_Obj_t * pObj ) { return Abc_MaxFloat(Abc_SclObjTime(p, pObj)->rise, Abc_SclObjTime(p, pObj)->fall); }
-static inline float Abc_SclObjDepthMax( SC_Man * p, Abc_Obj_t * pObj ) { return Abc_MaxFloat(Abc_SclObjDept(p, pObj)->rise, Abc_SclObjDept(p, pObj)->fall); }
-static inline float Abc_SclObjGetSlack( SC_Man * p, Abc_Obj_t * pObj, float D ) { return D - Abc_MaxFloat(Abc_SclObjTime(p, pObj)->rise + Abc_SclObjDept(p, pObj)->rise, Abc_SclObjTime(p, pObj)->fall + Abc_SclObjDept(p, pObj)->fall); }
+static inline double Abc_SclObjSlewMax( SC_Man * p, Abc_Obj_t * pObj ) { return Abc_MaxFloat(Abc_SclObjSlew(p, pObj)->rise, Abc_SclObjSlew(p, pObj)->fall); }
static inline float Abc_SclObjGetSlackR( SC_Man * p, Abc_Obj_t * pObj, float D ){ return D - (Abc_SclObjTime(p, pObj)->rise + Abc_SclObjDept(p, pObj)->rise); }
static inline float Abc_SclObjGetSlackF( SC_Man * p, Abc_Obj_t * pObj, float D ){ return D - (Abc_SclObjTime(p, pObj)->fall + Abc_SclObjDept(p, pObj)->fall); }
-static inline float Abc_SclObjLoadAve( SC_Man * p, Abc_Obj_t * pObj ) { return 0.5 * Abc_SclObjLoad(p, pObj)->rise + 0.5 * Abc_SclObjLoad(p, pObj)->fall; }
+static inline float Abc_SclObjGetSlack( SC_Man * p, Abc_Obj_t * pObj, float D ) { return D - Abc_MaxFloat(Abc_SclObjTime(p, pObj)->rise + Abc_SclObjDept(p, pObj)->rise, Abc_SclObjTime(p, pObj)->fall + Abc_SclObjDept(p, pObj)->fall); }
+static inline double Abc_SclObjSlackMax( SC_Man * p, Abc_Obj_t * pObj, float D ) { return Abc_SclObjGetSlack(p, pObj, D); }
static inline void Abc_SclObjDupFanin( SC_Man * p, Abc_Obj_t * pObj ) { assert( Abc_ObjIsCo(pObj) ); *Abc_SclObjTime(p, pObj) = *Abc_SclObjTime(p, Abc_ObjFanin0(pObj)); }
static inline float Abc_SclObjInDrive( SC_Man * p, Abc_Obj_t * pObj ) { return Vec_FltEntry( p->vInDrive, pObj->iData ); }
static inline void Abc_SclObjSetInDrive( SC_Man * p, Abc_Obj_t * pObj, float c){ Vec_FltWriteEntry( p->vInDrive, pObj->iData, c ); }
-static inline double Abc_SclObjLoadFf( SC_Man * p, Abc_Obj_t * pObj, int fRise ) { return fRise ? Abc_SclObjLoad(p, pObj)->rise : Abc_SclObjLoad(p, pObj)->fall; }
-static inline double Abc_SclObjTimePs( SC_Man * p, Abc_Obj_t * pObj, int fRise ) { return fRise ? Abc_SclObjTime(p, pObj)->rise : Abc_SclObjTime(p, pObj)->fall; }
-static inline double Abc_SclObjSlewPs( SC_Man * p, Abc_Obj_t * pObj, int fRise ) { return fRise ? Abc_SclObjSlew(p, pObj)->rise : Abc_SclObjSlew(p, pObj)->fall; }
-static inline double Abc_SclObjSlackPs( SC_Man * p, Abc_Obj_t * pObj, float D ) { return Abc_SclObjGetSlack(p, pObj, D); }
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -553,7 +552,7 @@ extern Abc_Ntk_t * Abc_SclBufPerform( Abc_Ntk_t * pNtk, int FanMin, int FanMax
/*=== sclDnsize.c ===============================================================*/
extern void Abc_SclDnsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * pPars );
/*=== sclLoad.c ===============================================================*/
-extern Vec_Flt_t * Abc_SclFindWireCaps( SC_WireLoad * pWL );
+extern Vec_Flt_t * Abc_SclFindWireCaps( SC_WireLoad * pWL, int nFanoutMax );
extern float Abc_SclFindWireLoad( Vec_Flt_t * vWireCaps, int nFans );
extern void Abc_SclAddWireLoad( SC_Man * p, Abc_Obj_t * pObj, int fSubtr );
extern void Abc_SclComputeLoad( SC_Man * p );