Commit f392645d by Alan Mishchenko

Generating GENLIB library from SCL.

parent fd28deef
......@@ -39,6 +39,7 @@ static int Scl_CommandUpsize ( Abc_Frame_t * pAbc, int argc, char **argv );
static int Scl_CommandDnsize ( Abc_Frame_t * pAbc, int argc, char **argv );
static int Scl_CommandMinsize ( Abc_Frame_t * pAbc, int argc, char **argv );
static int Scl_CommandPrintBuf( Abc_Frame_t * pAbc, int argc, char **argv );
static int Scl_CommandDumpGen ( Abc_Frame_t * pAbc, int argc, char **argv );
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
......@@ -57,17 +58,18 @@ static int Scl_CommandPrintBuf( Abc_Frame_t * pAbc, int argc, char **argv );
***********************************************************************/
void Scl_Init( Abc_Frame_t * pAbc )
{
Cmd_CommandAdd( pAbc, "SCL mapping", "read_scl", Scl_CommandRead, 0 );
Cmd_CommandAdd( pAbc, "SCL mapping", "write_scl", Scl_CommandWrite, 0 );
Cmd_CommandAdd( pAbc, "SCL mapping", "print_scl", Scl_CommandPrint, 0 );
Cmd_CommandAdd( pAbc, "SCL mapping", "print_gs", Scl_CommandPrintGS, 0 );
Cmd_CommandAdd( pAbc, "SCL mapping", "stime", Scl_CommandStime, 0 );
Cmd_CommandAdd( pAbc, "SCL mapping", "topo", Scl_CommandTopo, 1 );
Cmd_CommandAdd( pAbc, "SCL mapping", "buffer", Scl_CommandBuffer, 1 );
Cmd_CommandAdd( pAbc, "SCL mapping", "minsize", Scl_CommandMinsize, 1 );
Cmd_CommandAdd( pAbc, "SCL mapping", "upsize", Scl_CommandUpsize, 1 );
Cmd_CommandAdd( pAbc, "SCL mapping", "dnsize", Scl_CommandDnsize, 1 );
Cmd_CommandAdd( pAbc, "SCL mapping", "print_buf", Scl_CommandPrintBuf, 1 );
Cmd_CommandAdd( pAbc, "SCL mapping", "read_scl", Scl_CommandRead, 0 );
Cmd_CommandAdd( pAbc, "SCL mapping", "write_scl", Scl_CommandWrite, 0 );
Cmd_CommandAdd( pAbc, "SCL mapping", "print_scl", Scl_CommandPrint, 0 );
Cmd_CommandAdd( pAbc, "SCL mapping", "print_gs", Scl_CommandPrintGS, 0 );
Cmd_CommandAdd( pAbc, "SCL mapping", "stime", Scl_CommandStime, 0 );
Cmd_CommandAdd( pAbc, "SCL mapping", "topo", Scl_CommandTopo, 1 );
Cmd_CommandAdd( pAbc, "SCL mapping", "buffer", Scl_CommandBuffer, 1 );
Cmd_CommandAdd( pAbc, "SCL mapping", "minsize", Scl_CommandMinsize, 1 );
Cmd_CommandAdd( pAbc, "SCL mapping", "upsize", Scl_CommandUpsize, 1 );
Cmd_CommandAdd( pAbc, "SCL mapping", "dnsize", Scl_CommandDnsize, 1 );
Cmd_CommandAdd( pAbc, "SCL mapping", "print_buf", Scl_CommandPrintBuf, 0 );
Cmd_CommandAdd( pAbc, "SCL mapping", "dump_genlib", Scl_CommandDumpGen, 0 );
}
void Scl_End( Abc_Frame_t * pAbc )
{
......@@ -977,6 +979,81 @@ usage:
return 1;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Scl_CommandDumpGen( Abc_Frame_t * pAbc, int argc, char **argv )
{
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
char * pFileName;
float Slew = 100;
float Gain = 2;
int c, fVerbose = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "SGvh" ) ) != EOF )
{
switch ( c )
{
case 'S':
if ( globalUtilOptind >= argc )
{
Abc_Print( -1, "Command line switch \"-S\" should be followed by a floating point number.\n" );
goto usage;
}
Slew = (float)atof(argv[globalUtilOptind]);
globalUtilOptind++;
if ( Slew <= 0.0 )
goto usage;
break;
case 'G':
if ( globalUtilOptind >= argc )
{
Abc_Print( -1, "Command line switch \"-G\" should be followed by a floating point number.\n" );
goto usage;
}
Gain = (float)atof(argv[globalUtilOptind]);
globalUtilOptind++;
if ( Gain <= 0.0 )
goto usage;
break;
case 'v':
fVerbose ^= 1;
break;
case 'h':
goto usage;
default:
goto usage;
}
}
if ( pAbc->pLibScl == NULL )
{
fprintf( pAbc->Err, "There is no Liberty library available.\n" );
goto usage;
}
if ( argc != globalUtilOptind + 1 )
goto usage;
pFileName = argv[globalUtilOptind];
Abc_SclDumpGenlib( pFileName, (SC_Lib *)pAbc->pLibScl, Slew, Gain );
return 0;
usage:
fprintf( pAbc->Err, "usage: dump_genlib [-SG float] [-vh]\n" );
fprintf( pAbc->Err, "\t writes GENLIB file for SCL library\n" );
fprintf( pAbc->Err, "\t-S float : the slew parameter used to generate the library [default = %.2f]\n", Slew );
fprintf( pAbc->Err, "\t-G float : the gain parameter used to generate the library [default = %.2f]\n", Gain );
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
fprintf( pAbc->Err, "\t-h : print the command usage\n");
return 1;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
......
......@@ -207,12 +207,17 @@ struct SC_Lib_
static inline SC_Cell * SC_LibCell( SC_Lib * p, int i ) { return (SC_Cell *)Vec_PtrEntry(p->vCells, i); }
static inline SC_Pin * SC_CellPin( SC_Cell * p, int i ) { return (SC_Pin *)Vec_PtrEntry(p->vPins, i); }
static inline Vec_Wrd_t * SC_CellFunc( SC_Cell * p ) { return SC_CellPin(p, p->n_inputs)->vFunc; }
static inline float SC_CellPinCap( SC_Cell * p, int i ) { return 0.5 * (SC_CellPin(p, i)->rise_cap + SC_CellPin(p, i)->fall_cap); }
static inline char * SC_CellPinOutFunc( SC_Cell * p, int i ) { return SC_CellPin(p, p->n_inputs + i)->func_text; }
static inline char * SC_CellPinName( SC_Cell * p, int i ) { return SC_CellPin(p, i)->pName; }
static inline double SC_LibCapFf( SC_Lib * p, double cap ) { return cap * p->unit_cap_fst * pow(10.0, 15 - p->unit_cap_snd); }
static inline double SC_LibCapFromFf( SC_Lib * p, double cap ) { return cap / p->unit_cap_fst / pow(10.0, 15 - p->unit_cap_snd); }
static inline double SC_LibTimePs( SC_Lib * p, double time ) { return time * pow(10.0, 12 - p->unit_time); }
static inline double SC_LibTimeFromPs( SC_Lib * p, double ps ) { return ps / pow(10.0, 12 - p->unit_time); }
#define SC_LibForEachCell( p, pCell, i ) Vec_PtrForEachEntry( SC_Cell *, p->vCells, pCell, i )
#define SC_LibForEachCellClass( p, pCell, i ) Vec_PtrForEachEntry( SC_Cell *, p->vCellClasses, pCell, i )
#define SC_LibForEachWireLoad( p, pWL, i ) Vec_PtrForEachEntry( SC_WireLoad *, p->vWireLoads, pWL, i )
......@@ -436,6 +441,101 @@ static inline void Abc_SclLibFree( SC_Lib * p )
}
/**Function*************************************************************
Synopsis [Lookup table delay computation.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static inline float Scl_LibLookup( SC_Surface * p, float slew, float load )
{
float * pIndex0, * pIndex1, * pDataS, * pDataS1;
float sfrac, lfrac, p0, p1;
int s, l;
// Find closest sample points in surface:
pIndex0 = Vec_FltArray(p->vIndex0);
for ( s = 1; s < Vec_FltSize(p->vIndex0)-1; s++ )
if ( pIndex0[s] > slew )
break;
s--;
pIndex1 = Vec_FltArray(p->vIndex1);
for ( l = 1; l < Vec_FltSize(p->vIndex1)-1; l++ )
if ( pIndex1[l] > load )
break;
l--;
// Interpolate (or extrapolate) function value from sample points:
sfrac = (slew - pIndex0[s]) / (pIndex0[s+1] - pIndex0[s]);
lfrac = (load - pIndex1[l]) / (pIndex1[l+1] - pIndex1[l]);
pDataS = Vec_FltArray( (Vec_Flt_t *)Vec_PtrEntry(p->vData, s) );
pDataS1 = Vec_FltArray( (Vec_Flt_t *)Vec_PtrEntry(p->vData, s+1) );
p0 = pDataS [l] + lfrac * (pDataS [l+1] - pDataS [l]);
p1 = pDataS1[l] + lfrac * (pDataS1[l+1] - pDataS1[l]);
return p0 + sfrac * (p1 - p0); // <<== multiply result with K factor here
}
static inline void Scl_LibPinArrival( SC_Timing * pTime, SC_Pair * pArrIn, SC_Pair * pSlewIn, SC_Pair * pLoad, SC_Pair * pArrOut, SC_Pair * pSlewOut )
{
if (pTime->tsense == sc_ts_Pos || pTime->tsense == sc_ts_Non)
{
pArrOut->rise = Abc_MaxFloat( pArrOut->rise, pArrIn->rise + Scl_LibLookup(pTime->pCellRise, pSlewIn->rise, pLoad->rise) );
pArrOut->fall = Abc_MaxFloat( pArrOut->fall, pArrIn->fall + Scl_LibLookup(pTime->pCellFall, pSlewIn->fall, pLoad->fall) );
pSlewOut->rise = Abc_MaxFloat( pSlewOut->rise, Scl_LibLookup(pTime->pRiseTrans, pSlewIn->rise, pLoad->rise) );
pSlewOut->fall = Abc_MaxFloat( pSlewOut->fall, Scl_LibLookup(pTime->pFallTrans, pSlewIn->fall, pLoad->fall) );
}
if (pTime->tsense == sc_ts_Neg || pTime->tsense == sc_ts_Non)
{
pArrOut->rise = Abc_MaxFloat( pArrOut->rise, pArrIn->fall + Scl_LibLookup(pTime->pCellRise, pSlewIn->fall, pLoad->rise) );
pArrOut->fall = Abc_MaxFloat( pArrOut->fall, pArrIn->rise + Scl_LibLookup(pTime->pCellFall, pSlewIn->rise, pLoad->fall) );
pSlewOut->rise = Abc_MaxFloat( pSlewOut->rise, Scl_LibLookup(pTime->pRiseTrans, pSlewIn->fall, pLoad->rise) );
pSlewOut->fall = Abc_MaxFloat( pSlewOut->fall, Scl_LibLookup(pTime->pFallTrans, pSlewIn->rise, pLoad->fall) );
}
}
static inline void Scl_LibPinDeparture( SC_Timing * pTime, SC_Pair * pDepIn, SC_Pair * pSlewIn, SC_Pair * pLoad, SC_Pair * pDepOut )
{
if (pTime->tsense == sc_ts_Pos || pTime->tsense == sc_ts_Non)
{
pDepIn->rise = Abc_MaxFloat( pDepIn->rise, pDepOut->rise + Scl_LibLookup(pTime->pCellRise, pSlewIn->rise, pLoad->rise) );
pDepIn->fall = Abc_MaxFloat( pDepIn->fall, pDepOut->fall + Scl_LibLookup(pTime->pCellFall, pSlewIn->fall, pLoad->fall) );
}
if (pTime->tsense == sc_ts_Neg || pTime->tsense == sc_ts_Non)
{
pDepIn->fall = Abc_MaxFloat( pDepIn->fall, pDepOut->rise + Scl_LibLookup(pTime->pCellRise, pSlewIn->fall, pLoad->rise) );
pDepIn->rise = Abc_MaxFloat( pDepIn->rise, pDepOut->fall + Scl_LibLookup(pTime->pCellFall, pSlewIn->rise, pLoad->fall) );
}
}
/**Function*************************************************************
Synopsis [Computes input capacitance.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static inline float Abc_SclGatePinCapAve( SC_Lib * p, SC_Cell * pCell )
{
SC_Pin * pPin;
int k;
float Cap = 0.0;
SC_CellForEachPinIn( pCell, pPin, k )
Cap += 0.5 * (pPin->rise_cap + pPin->fall_cap);
return Cap / pCell->n_inputs;
}
/*=== sclLib.c ===============================================================*/
extern SC_Lib * Abc_SclRead( char * pFileName );
extern void Abc_SclWrite( char * pFileName, SC_Lib * p );
......@@ -447,7 +547,7 @@ extern int Abc_SclCellFind( SC_Lib * p, char * pName );
extern void Abc_SclLinkCells( SC_Lib * p );
extern void Abc_SclPrintCells( SC_Lib * p );
extern SC_WireLoad * Abc_SclFindWireLoadModel( SC_Lib * p, float Area );
extern void Abc_SclDumpGenlib( char * pFileName, SC_Lib * p, float Slew, float Gain );
ABC_NAMESPACE_HEADER_END
......
......@@ -107,17 +107,19 @@ Abc_Obj_t * Abc_SclFindMostCriticalFanin( SC_Man * p, int * pfRise, Abc_Obj_t *
***********************************************************************/
static inline void Abc_SclTimeNodePrint( SC_Man * p, Abc_Obj_t * pObj, int fRise, int Length, float maxDelay )
{
SC_Cell * pCell = Abc_ObjIsNode(pObj) ? Abc_SclObjCell(p, pObj) : NULL;
printf( "%6d : ", Abc_ObjId(pObj) );
printf( "%d ", Abc_ObjFaninNum(pObj) );
printf( "%2d ", Abc_ObjFanoutNum(pObj) );
printf( "%-*s ", Length, Abc_ObjIsNode(pObj) ? Abc_SclObjCell(p, pObj)->pName : "pi" );
printf( "%-*s ", Length, pCell ? pCell->pName : "pi" );
if ( fRise >= 0 )
printf( "(%s) ", fRise ? "rise" : "fall" );
printf( "A =%7.2f ", Abc_ObjIsNode(pObj) ? Abc_SclObjCell(p, pObj)->area : 0.0 );
printf( "A =%7.2f ", pCell ? pCell->area : 0.0 );
printf( "D = (" );
printf( "%8.2f ps", Abc_SclObjTimePs(p, pObj, 1) );
printf( "%8.2f ps ) ", Abc_SclObjTimePs(p, pObj, 0) );
printf( "L =%7.2f ff ", Abc_SclObjLoadFf(p, pObj, fRise >= 0 ? fRise : 0 ) );
printf( "G =%5.2f ", pCell ? Abc_SclObjLoadAve(p, pObj) / SC_CellPinCap(pCell, 0) : 0.0 );
printf( "S =%7.2f ps ", Abc_SclObjSlewPs(p, pObj, fRise >= 0 ? fRise : 0 ) );
printf( "SL =%6.2f ps", Abc_SclObjSlack(p, pObj) );
printf( "\n" );
......@@ -181,77 +183,22 @@ void Abc_SclTimeNtkPrint( SC_Man * p, int fShowAll, int fShort )
SeeAlso []
***********************************************************************/
static inline float Abc_SclLookup( SC_Surface * p, float slew, float load )
{
float * pIndex0, * pIndex1, * pDataS, * pDataS1;
float sfrac, lfrac, p0, p1;
int s, l;
// Find closest sample points in surface:
pIndex0 = Vec_FltArray(p->vIndex0);
for ( s = 1; s < Vec_FltSize(p->vIndex0)-1; s++ )
if ( pIndex0[s] > slew )
break;
s--;
pIndex1 = Vec_FltArray(p->vIndex1);
for ( l = 1; l < Vec_FltSize(p->vIndex1)-1; l++ )
if ( pIndex1[l] > load )
break;
l--;
// Interpolate (or extrapolate) function value from sample points:
sfrac = (slew - pIndex0[s]) / (pIndex0[s+1] - pIndex0[s]);
lfrac = (load - pIndex1[l]) / (pIndex1[l+1] - pIndex1[l]);
pDataS = Vec_FltArray( (Vec_Flt_t *)Vec_PtrEntry(p->vData, s) );
pDataS1 = Vec_FltArray( (Vec_Flt_t *)Vec_PtrEntry(p->vData, s+1) );
p0 = pDataS [l] + lfrac * (pDataS [l+1] - pDataS [l]);
p1 = pDataS1[l] + lfrac * (pDataS1[l+1] - pDataS1[l]);
return p0 + sfrac * (p1 - p0); // <<== multiply result with K factor here
}
void Abc_SclTimeFanin( SC_Man * p, SC_Timing * pTime, Abc_Obj_t * pObj, Abc_Obj_t * pFanin )
static inline void Abc_SclTimeFanin( SC_Man * p, SC_Timing * pTime, Abc_Obj_t * pObj, Abc_Obj_t * pFanin )
{
SC_Pair * pArrIn = Abc_SclObjTime( p, pFanin );
SC_Pair * pSlewIn = Abc_SclObjSlew( p, pFanin );
SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
SC_Pair * pArrOut = Abc_SclObjTime( p, pObj ); // modified
SC_Pair * pSlewOut = Abc_SclObjSlew( p, pObj ); // modified
if (pTime->tsense == sc_ts_Pos || pTime->tsense == sc_ts_Non)
{
pArrOut->rise = Abc_MaxFloat( pArrOut->rise, pArrIn->rise + Abc_SclLookup(pTime->pCellRise, pSlewIn->rise, pLoad->rise) );
pArrOut->fall = Abc_MaxFloat( pArrOut->fall, pArrIn->fall + Abc_SclLookup(pTime->pCellFall, pSlewIn->fall, pLoad->fall) );
pSlewOut->rise = Abc_MaxFloat( pSlewOut->rise, Abc_SclLookup(pTime->pRiseTrans, pSlewIn->rise, pLoad->rise) );
pSlewOut->fall = Abc_MaxFloat( pSlewOut->fall, Abc_SclLookup(pTime->pFallTrans, pSlewIn->fall, pLoad->fall) );
}
if (pTime->tsense == sc_ts_Neg || pTime->tsense == sc_ts_Non)
{
pArrOut->rise = Abc_MaxFloat( pArrOut->rise, pArrIn->fall + Abc_SclLookup(pTime->pCellRise, pSlewIn->fall, pLoad->rise) );
pArrOut->fall = Abc_MaxFloat( pArrOut->fall, pArrIn->rise + Abc_SclLookup(pTime->pCellFall, pSlewIn->rise, pLoad->fall) );
pSlewOut->rise = Abc_MaxFloat( pSlewOut->rise, Abc_SclLookup(pTime->pRiseTrans, pSlewIn->fall, pLoad->rise) );
pSlewOut->fall = Abc_MaxFloat( pSlewOut->fall, Abc_SclLookup(pTime->pFallTrans, pSlewIn->rise, pLoad->fall) );
}
Scl_LibPinArrival( pTime, pArrIn, pSlewIn, pLoad, pArrOut, pSlewOut );
}
void Abc_SclDeptFanin( SC_Man * p, SC_Timing * pTime, Abc_Obj_t * pObj, Abc_Obj_t * pFanin )
static inline void Abc_SclDeptFanin( SC_Man * p, SC_Timing * pTime, Abc_Obj_t * pObj, Abc_Obj_t * pFanin )
{
SC_Pair * pDepIn = Abc_SclObjDept( p, pFanin ); // modified
SC_Pair * pSlewIn = Abc_SclObjSlew( p, pFanin );
SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
SC_Pair * pDepOut = Abc_SclObjDept( p, pObj );
if (pTime->tsense == sc_ts_Pos || pTime->tsense == sc_ts_Non)
{
pDepIn->rise = Abc_MaxFloat( pDepIn->rise, pDepOut->rise + Abc_SclLookup(pTime->pCellRise, pSlewIn->rise, pLoad->rise) );
pDepIn->fall = Abc_MaxFloat( pDepIn->fall, pDepOut->fall + Abc_SclLookup(pTime->pCellFall, pSlewIn->fall, pLoad->fall) );
}
if (pTime->tsense == sc_ts_Neg || pTime->tsense == sc_ts_Non)
{
pDepIn->fall = Abc_MaxFloat( pDepIn->fall, pDepOut->rise + Abc_SclLookup(pTime->pCellRise, pSlewIn->fall, pLoad->rise) );
pDepIn->rise = Abc_MaxFloat( pDepIn->rise, pDepOut->fall + Abc_SclLookup(pTime->pCellFall, pSlewIn->rise, pLoad->fall) );
}
Scl_LibPinDeparture( pTime, pDepIn, pSlewIn, pLoad, pDepOut );
}
void Abc_SclTimeNode( SC_Man * p, Abc_Obj_t * pObj, int fDept )
{
......
......@@ -106,6 +106,7 @@ static inline float Abc_SclObjGetSlack( SC_Man * p, Abc_Obj_t * pObj, float
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_SclObjSlack( SC_Man * p, Abc_Obj_t * pObj ) { return p->pSlack[Abc_ObjId(pObj)]; }
static inline float Abc_SclObjLoadAve( SC_Man * p, Abc_Obj_t * pObj ) { return 0.5 * (Abc_SclObjLoad(p, pObj)->rise + Abc_SclObjLoad(p, pObj)->fall); }
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_SclObjGain( SC_Man * p, Abc_Obj_t * pObj ) { return 0.5*((Abc_SclObjTime2(p, pObj)->rise - Abc_SclObjTime(p, pObj)->rise) + (Abc_SclObjTime2(p, pObj)->fall - Abc_SclObjTime(p, pObj)->fall)); }
......
......@@ -205,80 +205,26 @@ static inline void Scl_ConeClear( SC_Time * p, Vec_Int_t * vCone )
SeeAlso []
***********************************************************************/
static inline float Scl_Lookup( SC_Surface * p, float slew, float load )
{
float * pIndex0, * pIndex1, * pDataS, * pDataS1;
float sfrac, lfrac, p0, p1;
int s, l;
// Find closest sample points in surface:
pIndex0 = Vec_FltArray(p->vIndex0);
for ( s = 1; s < Vec_FltSize(p->vIndex0)-1; s++ )
if ( pIndex0[s] > slew )
break;
s--;
pIndex1 = Vec_FltArray(p->vIndex1);
for ( l = 1; l < Vec_FltSize(p->vIndex1)-1; l++ )
if ( pIndex1[l] > load )
break;
l--;
// Interpolate (or extrapolate) function value from sample points:
sfrac = (slew - pIndex0[s]) / (pIndex0[s+1] - pIndex0[s]);
lfrac = (load - pIndex1[l]) / (pIndex1[l+1] - pIndex1[l]);
pDataS = Vec_FltArray( (Vec_Flt_t *)Vec_PtrEntry(p->vData, s) );
pDataS1 = Vec_FltArray( (Vec_Flt_t *)Vec_PtrEntry(p->vData, s+1) );
p0 = pDataS [l] + lfrac * (pDataS [l+1] - pDataS [l]);
p1 = pDataS1[l] + lfrac * (pDataS1[l+1] - pDataS1[l]);
return p0 + sfrac * (p1 - p0); // <<== multiply result with K factor here
}
static inline void Scl_TimeFanin( SC_Time * p, SC_Timing * pTime, int iObj, int iFanin )
static inline void Scl_PinTimeArrival( SC_Time * p, SC_Timing * pTime, int iObj, int iFanin )
{
SC_Pair * pArrIn = Scl_ObjTime( p, iFanin );
SC_Pair * pSlewIn = Scl_ObjSlew( p, iFanin );
SC_Pair * pLoad = Scl_ObjLoad( p, iObj );
SC_Pair * pArrOut = Scl_ObjTime( p, iObj ); // modified
SC_Pair * pSlewOut = Scl_ObjSlew( p, iObj ); // modified
if (pTime->tsense == sc_ts_Pos || pTime->tsense == sc_ts_Non)
{
pArrOut->rise = Abc_MaxFloat( pArrOut->rise, pArrIn->rise + Scl_Lookup(pTime->pCellRise, pSlewIn->rise, pLoad->rise) );
pArrOut->fall = Abc_MaxFloat( pArrOut->fall, pArrIn->fall + Scl_Lookup(pTime->pCellFall, pSlewIn->fall, pLoad->fall) );
pSlewOut->rise = Abc_MaxFloat( pSlewOut->rise, Scl_Lookup(pTime->pRiseTrans, pSlewIn->rise, pLoad->rise) );
pSlewOut->fall = Abc_MaxFloat( pSlewOut->fall, Scl_Lookup(pTime->pFallTrans, pSlewIn->fall, pLoad->fall) );
}
if (pTime->tsense == sc_ts_Neg || pTime->tsense == sc_ts_Non)
{
pArrOut->rise = Abc_MaxFloat( pArrOut->rise, pArrIn->fall + Scl_Lookup(pTime->pCellRise, pSlewIn->fall, pLoad->rise) );
pArrOut->fall = Abc_MaxFloat( pArrOut->fall, pArrIn->rise + Scl_Lookup(pTime->pCellFall, pSlewIn->rise, pLoad->fall) );
pSlewOut->rise = Abc_MaxFloat( pSlewOut->rise, Scl_Lookup(pTime->pRiseTrans, pSlewIn->fall, pLoad->rise) );
pSlewOut->fall = Abc_MaxFloat( pSlewOut->fall, Scl_Lookup(pTime->pFallTrans, pSlewIn->rise, pLoad->fall) );
}
Scl_LibPinArrival( pTime, pArrIn, pSlewIn, pLoad, pArrOut, pSlewOut );
}
static inline void Scl_DeptFanin( SC_Time * p, SC_Timing * pTime, int iObj, int iFanin )
static inline void Scl_PinTimeDeparture( SC_Time * p, SC_Timing * pTime, int iObj, int iFanin )
{
SC_Pair * pDepIn = Scl_ObjDept( p, iFanin ); // modified
SC_Pair * pSlewIn = Scl_ObjSlew( p, iFanin );
SC_Pair * pLoad = Scl_ObjLoad( p, iObj );
SC_Pair * pDepOut = Scl_ObjDept( p, iObj );
if (pTime->tsense == sc_ts_Pos || pTime->tsense == sc_ts_Non)
{
pDepIn->rise = Abc_MaxFloat( pDepIn->rise, pDepOut->rise + Scl_Lookup(pTime->pCellRise, pSlewIn->rise, pLoad->rise) );
pDepIn->fall = Abc_MaxFloat( pDepIn->fall, pDepOut->fall + Scl_Lookup(pTime->pCellFall, pSlewIn->fall, pLoad->fall) );
}
if (pTime->tsense == sc_ts_Neg || pTime->tsense == sc_ts_Non)
{
pDepIn->fall = Abc_MaxFloat( pDepIn->fall, pDepOut->rise + Scl_Lookup(pTime->pCellRise, pSlewIn->fall, pLoad->rise) );
pDepIn->rise = Abc_MaxFloat( pDepIn->rise, pDepOut->fall + Scl_Lookup(pTime->pCellFall, pSlewIn->rise, pLoad->fall) );
}
Scl_LibPinDeparture( pTime, pDepIn, pSlewIn, pLoad, pDepOut );
}
ABC_NAMESPACE_HEADER_END
#endif
......
......@@ -468,7 +468,7 @@ void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * pPars
Vec_Int_t * vPathNodes = NULL; // critical nodes and PIs
Vec_Int_t * vTFO;
abctime clk, nRuntimeLimit = pPars->TimeOut ? pPars->TimeOut * CLOCKS_PER_SEC + Abc_Clock() : 0;
int i, win, nUpsizes = -1, nFramesNoChange = 0;
int i = 0, win, nUpsizes = -1, nFramesNoChange = 0;
int nAllPos, nAllNodes, nAllTfos, nAllUpsizes;
if ( pPars->fVerbose )
......
......@@ -20,6 +20,7 @@
#include "sclSize.h"
#include "map/mio/mio.h"
#include "base/main/main.h"
ABC_NAMESPACE_IMPL_START
......@@ -175,6 +176,25 @@ void Abc_SclMinsizePerform( SC_Lib * pLib, Abc_Ntk_t * p, int fUseMax, int fVerb
Vec_IntFree( vGates );
}
/**Function*************************************************************
Synopsis [Returns gate formula by name.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
char * Abc_SclFindGateFormula( char * pGateName, char * pOutName )
{
Mio_Library_t * pLib = (Mio_Library_t *)Abc_FrameReadLibGen();
Mio_Gate_t * pGate = Mio_LibraryReadGateByName( pLib, pGateName, pOutName );
return Mio_GateReadForm(pGate);
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
......
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