21 #ifndef ABC__map__scl__sclLib_h
22 #define ABC__map__scl__sclLib_h
43 #define ABC_SCL_CUR_VERSION 8
248 #define SC_LibForEachCell( p, pCell, i ) Vec_PtrForEachEntry( SC_Cell *, p->vCells, pCell, i )
249 #define SC_LibForEachCellClass( p, pCell, i ) Vec_PtrForEachEntry( SC_Cell *, p->vCellClasses, pCell, i )
250 #define SC_LibForEachWireLoad( p, pWL, i ) Vec_PtrForEachEntry( SC_WireLoad *, p->vWireLoads, pWL, i )
251 #define SC_LibForEachWireLoadSel( p, pWLS, i ) Vec_PtrForEachEntry( SC_WireLoadSel *, p->vWireLoadSels, pWLS, i )
252 #define SC_LibForEachTempl( p, pTempl, i ) Vec_PtrForEachEntry( SC_TableTempl *, p->vTempls, pTempl, i )
253 #define SC_CellForEachPin( p, pPin, i ) Vec_PtrForEachEntry( SC_Pin *, p->vPins, pPin, i )
254 #define SC_CellForEachPinIn( p, pPin, i ) Vec_PtrForEachEntryStop( SC_Pin *, p->vPins, pPin, i, p->n_inputs )
255 #define SC_CellForEachPinOut( p, pPin, i ) Vec_PtrForEachEntryStart( SC_Pin *, p->vPins, pPin, i, p->n_inputs )
256 #define SC_RingForEachCell( pRing, pCell, i ) for ( i = 0, pCell = pRing; i == 0 || pCell != pRing; pCell = pCell->pNext, i++ )
257 #define SC_RingForEachCellRev( pRing, pCell, i ) for ( i = 0, pCell = pRing; i == 0 || pCell != pRing; pCell = pCell->pPrev, i++ )
258 #define SC_PinForEachRTiming( p, pRTime, i ) Vec_PtrForEachEntry( SC_Timings *, p->vRTimings, pRTime, i )
485 float * pIndex0, * pIndex1, * pDataS, * pDataS1;
486 float sfrac, lfrac, p0, p1;
501 if ( pIndex0[s] > slew )
507 if ( pIndex1[l] > load )
512 sfrac = (slew - pIndex0[s]) / (pIndex0[s+1] - pIndex0[s]);
513 lfrac = (load - pIndex1[l]) / (pIndex1[l+1] - pIndex1[l]);
518 p0 = pDataS [l] + lfrac * (pDataS [l+1] - pDataS [l]);
519 p1 = pDataS1[l] + lfrac * (pDataS1[l+1] - pDataS1[l]);
521 return p0 + sfrac * (p1 - p0);
569 assert( iPin >= 0 && iPin < pCell->n_inputs );
580 SC_Pair LoadIn = { Load, Load };
584 SC_Pair SlewOut = { 0.0, 0.0 };
589 return 0.5 * ArrOut.
fall + 0.5 * ArrOut.
rise;
596 SC_Pair ArrOut0 = { 0.0, 0.0 };
597 SC_Pair ArrOut1 = { 0.0, 0.0 };
598 SC_Pair SlewOut = { 0.0, 0.0 };
599 pSlewOut->
fall = pSlewOut->
rise = 0;
static float SC_PairMin(SC_Pair *d)
static SC_Timing * Scl_CellPinTime(SC_Cell *pCell, int iPin)
static int SC_LibCellNum(SC_Lib *p)
static void Abc_SclSurfaceFree(SC_Surface *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define SC_CellForEachPin(p, pPin, i)
static float Abc_MinFloat(float a, float b)
SC_Lib * Abc_SclReadFromFile(char *pFileName)
static SC_WireLoad * Abc_SclWireLoadAlloc()
FUNCTION DEFINITIONS ///.
static void SC_PairDup(SC_Pair *d, SC_Pair *s)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
static void Abc_SclTableTemplFree(SC_TableTempl *p)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static SC_TableTempl * Abc_SclTableTemplAlloc()
static SC_Surface * Abc_SclSurfaceAlloc()
SC_Lib * Abc_SclReadLiberty(char *pFileName, int fVerbose, int fVeryVerbose)
static void Vec_FltFree(Vec_Flt_t *p)
static void Vec_PtrFreeFree(Vec_Ptr_t *p)
static void Scl_LibPinDeparture(SC_Timing *pTime, SC_Pair *pDepIn, SC_Pair *pSlewIn, SC_Pair *pLoad, SC_Pair *pDepOut)
static Vec_Flt_t * Vec_FltAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Vec_Ptr_t * vWireLoadModel
static float * Vec_FltArray(Vec_Flt_t *p)
static float SC_CellPinCapAve(SC_Cell *p)
static int Abc_MaxInt(int a, int b)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_VecFree(Vec_Vec_t *p)
static float Abc_MaxFloat(float a, float b)
static SC_Timings * Abc_SclTimingsAlloc()
static void Abc_SclWireLoadFree(SC_WireLoad *p)
static SC_Lib * Abc_SclLibAlloc()
#define SC_LibForEachWireLoadSel(p, pWLS, i)
SC_WireLoad * Abc_SclFindWireLoadModel(SC_Lib *p, float Area)
static SC_Pin * Abc_SclPinAlloc()
static SC_Cell * Abc_SclCellAlloc()
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void SC_PairClean(SC_Pair *d)
GLOBAL VARIABLES ///.
void Abc_SclWriteLiberty(char *pFileName, SC_Lib *p)
static float Scl_LibLookup(SC_Surface *p, float slew, float load)
SC_Lib * Abc_SclReadFromStr(Vec_Str_t *vOut)
static SC_WireLoadSel * Abc_SclWireLoadSelAlloc()
float default_max_out_slew
static void Vec_WrdFree(Vec_Wrd_t *p)
static SC_Timing * Abc_SclTimingAlloc()
static void Abc_SclTimingsFree(SC_Timings *p)
SC_Cell * Abc_SclFindSmallestGate(SC_Cell *p, float CinMin)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
static char * SC_CellPinName(SC_Cell *p, int i)
static SC_Pin * SC_CellPin(SC_Cell *p, int i)
static int SC_PairEqual(SC_Pair *d, SC_Pair *s)
static SC_Cell * SC_LibCell(SC_Lib *p, int i)
void Abc_SclPrintCells(SC_Lib *p, float Slew, float Gain, int fInvOnly, int fShort)
int Abc_SclLibClassNum(SC_Lib *pLib)
#define ABC_NAMESPACE_HEADER_END
void Abc_SclWriteScl(char *pFileName, SC_Lib *p)
static void Abc_SclTimingFree(SC_Timing *p)
static Vec_Wrd_t * SC_CellFunc(SC_Cell *p)
static void SC_PairAdd(SC_Pair *d, SC_Pair *s)
static float SC_PairAve(SC_Pair *d)
static Vec_Wrd_t * Vec_WrdAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Abc_SclInstallGenlib(void *pScl, float Slew, float Gain, int nGatesMin)
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
SC_Cell * Abc_SclFindInvertor(SC_Lib *p, int fFindBuff)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int SC_PairEqualE(SC_Pair *d, SC_Pair *s, float E)
static float SC_CellPinCap(SC_Cell *p, int i)
int Abc_SclCellFind(SC_Lib *p, char *pName)
static float SC_PairMax(SC_Pair *d)
SC_WireLoad * Abc_SclFetchWireLoadModel(SC_Lib *p, char *pName)
static void Abc_SclPinFree(SC_Pin *p)
void Abc_SclLinkCells(SC_Lib *p)
int Abc_SclHasDelayInfo(void *pScl)
static void Scl_LibPinArrival(SC_Timing *pTime, SC_Pair *pArrIn, SC_Pair *pSlewIn, SC_Pair *pLoad, SC_Pair *pArrOut, SC_Pair *pSlewOut)
#define ABC_CALLOC(type, num)
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
#define SC_LibForEachWireLoad(p, pWL, i)
static void Abc_SclCellFree(SC_Cell *p)
static char * SC_CellPinOutFunc(SC_Cell *p, int i)
void Abc_SclHashCells(SC_Lib *p)
static float Vec_FltEntry(Vec_Flt_t *p, int i)
Vec_Ptr_t * vWireLoadSels
#define SC_PinForEachRTiming(p, pRTime, i)
static void SC_PairMove(SC_Pair *d, SC_Pair *s)
float Abc_SclComputeAverageSlew(SC_Lib *p)
#define SC_LibForEachTempl(p, pTempl, i)
static float Scl_LibPinArrivalEstimate(SC_Cell *pCell, int iPin, float Slew, float Load)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static void Abc_SclLibFree(SC_Lib *p)
void Abc_SclLibNormalize(SC_Lib *p)
static int Vec_FltSize(Vec_Flt_t *p)
void Abc_SclDumpGenlib(char *pFileName, SC_Lib *p, float Slew, float Gain, int nGatesMin)
typedefABC_NAMESPACE_HEADER_START struct Vec_Wrd_t_ Vec_Wrd_t
INCLUDES ///.
static void Abc_SclWireLoadSelFree(SC_WireLoadSel *p)
char * default_wire_load_sel
int Abc_SclClassCellNum(SC_Cell *pClass)
#define SC_LibForEachCell(p, pCell, i)
static void Vec_PtrFree(Vec_Ptr_t *p)
static void Scl_LibHandleInputDriver(SC_Cell *pCell, SC_Pair *pLoadIn, SC_Pair *pArrOut, SC_Pair *pSlewOut)
void Abc_SclConvertLeakageIntoArea(SC_Lib *p, float A, float B)