67 for ( i = 0; i < 3; i++ )
69 for ( i = 0; i < 4; i++ )
71 for ( i = 0; i < 6; i++ )
80 Abc_Print( -1,
"Wrong version of the SCL file.\n" );
147 for ( j = 0; j < pCell->
n_inputs; j++ )
209 for ( k = 0; k < pCell->
n_inputs; k++ )
254 pFile = fopen( pFileName,
"rb" );
257 printf(
"Cannot open file \"%s\" for reading.\n", pFileName );
262 nFileSize = ftell( pFile );
310 for ( i = 0; i < 3; i++ )
312 for ( i = 0; i < 4; i++ )
314 for ( i = 0; i < 6; i++ )
451 FILE * pFile = fopen( pFileName,
"wb" );
453 printf(
"Cannot open file \"%s\" for writing.\n", pFileName );
481 fprintf( s,
" index_1(\"" );
484 fprintf( s,
"\");\n" );
486 fprintf( s,
" index_2(\"" );
489 fprintf( s,
"\");\n" );
491 fprintf( s,
" values (\"" );
500 fprintf( s,
"\\\n" );
529 fprintf( s,
"/* This Liberty file was generated by ABC on %s */\n",
Extra_TimeStamp() );
530 fprintf( s,
"/* The original unabridged library came from file \"%s\".*/\n\n", p->
pFileName );
533 fprintf( s,
"library(%s) {\n\n", p->
pName );
541 fprintf( s,
" time_unit : \"1ns\";\n" );
543 fprintf( s,
" time_unit : \"100ps\";\n" );
545 fprintf( s,
" time_unit : \"10ps\";\n" );
547 fprintf( s,
" time_unit : \"1ps\";\n" );
555 fprintf( s,
" wire_load(\"%s\") {\n", pWL->
pName );
556 fprintf( s,
" capacitance : %f;\n", pWL->
cap );
557 fprintf( s,
" slope : %f;\n", pWL->
slope );
560 fprintf( s,
" }\n\n" );
566 fprintf( s,
" wire_load_selection(\"%s\") {\n", pWLS->
pName );
568 fprintf( s,
" wire_load_from_area( %f, %f, %s );\n",
572 fprintf( s,
" }\n\n" );
587 fprintf( s,
" cell(%s) {\n", pCell->
pName );
588 fprintf( s,
" /* n_inputs = %d n_outputs = %d */\n", pCell->
n_inputs, pCell->
n_outputs );
589 fprintf( s,
" area : %f;\n", pCell->
area );
590 fprintf( s,
" cell_leakage_power : %f;\n", pCell->
leakage );
596 fprintf( s,
" pin(%s) {\n", pPin->
pName );
597 fprintf( s,
" direction : %s;\n",
"input" );
598 fprintf( s,
" fall_capacitance : %f;\n", pPin->
fall_cap );
599 fprintf( s,
" rise_capacitance : %f;\n", pPin->
rise_cap );
600 fprintf( s,
" }\n" );
608 fprintf( s,
" pin(%s) {\n", pPin->
pName );
609 fprintf( s,
" direction : %s;\n",
"output" );
610 fprintf( s,
" max_capacitance : %f;\n", pPin->
max_out_cap );
611 fprintf( s,
" max_transition : %f;\n", pPin->
max_out_slew );
613 fprintf( s,
" /* truth table = " );
615 fprintf( s,
" */\n" );
624 fprintf( s,
" timing() {\n" );
625 fprintf( s,
" related_pin : \"%s\"\n", pRTime->
pName );
627 fprintf( s,
" timing_sense : positive_unate;\n" );
629 fprintf( s,
" timing_sense : negative_unate;\n" );
631 fprintf( s,
" timing_sense : non_unate;\n" );
634 fprintf( s,
" cell_rise() {\n" );
636 fprintf( s,
" }\n" );
638 fprintf( s,
" cell_fall() {\n" );
640 fprintf( s,
" }\n" );
642 fprintf( s,
" rise_transition() {\n" );
644 fprintf( s,
" }\n" );
646 fprintf( s,
" fall_transition() {\n" );
648 fprintf( s,
" }\n" );
649 fprintf( s,
" }\n" );
654 fprintf( s,
" }\n" );
656 fprintf( s,
" }\n" );
658 fprintf( s,
"}\n\n" );
662 FILE * pFile = fopen( pFileName,
"wb" );
664 printf(
"Cannot open text file \"%s\" for writing.\n", pFileName );
669 printf(
"Dumped internal library into Liberty file \"%s\".\n", pFileName );
static void Vec_WrdGrow(Vec_Wrd_t *p, int nCapMin)
static int SC_LibCellNum(SC_Lib *p)
#define Vec_FltForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static word Vec_StrGetW(Vec_Str_t *vOut, int *pPos)
static SC_WireLoad * Abc_SclWireLoadAlloc()
FUNCTION DEFINITIONS ///.
#define SC_CellForEachPinIn(p, pPin, i)
static void Vec_StrPutW(Vec_Str_t *vOut, word Val)
static char * Vec_StrArray(Vec_Str_t *p)
static int Abc_Truth6WordNum(int nVars)
static void Vec_WrdPush(Vec_Wrd_t *p, word Entry)
static float Vec_StrGetF(Vec_Str_t *vOut, int *pPos)
static int Vec_WrdCap(Vec_Wrd_t *p)
Vec_Wrd_t * Mio_ParseFormulaTruth(char *pFormInit, char **ppVarNames, int nVars)
static int Abc_SclReadLibrary(Vec_Str_t *vOut, int *pPos, SC_Lib *p)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static Vec_Flt_t * Vec_FltAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Vec_Ptr_t * vWireLoadModel
static Vec_Str_t * Vec_StrAlloc(int nCap)
static int Vec_PtrSize(Vec_Ptr_t *p)
static int Vec_WrdSize(Vec_Wrd_t *p)
#define Vec_WrdForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static void Vec_FltPush(Vec_Flt_t *p, float Entry)
static SC_Timings * Abc_SclTimingsAlloc()
static ABC_NAMESPACE_IMPL_START void Abc_SclReadSurface(Vec_Str_t *vOut, int *pPos, SC_Surface *p)
DECLARATIONS ///.
static SC_Lib * Abc_SclLibAlloc()
#define SC_LibForEachWireLoadSel(p, pWLS, i)
static SC_Pin * Abc_SclPinAlloc()
static SC_Cell * Abc_SclCellAlloc()
static void Vec_StrFree(Vec_Str_t *p)
static void Abc_SclWriteSurfaceText(FILE *s, SC_Surface *p)
static SC_WireLoadSel * Abc_SclWireLoadSelAlloc()
static int Vec_IntEntry(Vec_Int_t *p, int i)
unsigned __int64 word
DECLARATIONS ///.
float default_max_out_slew
#define ABC_NAMESPACE_IMPL_END
static void Vec_WrdFree(Vec_Wrd_t *p)
static SC_Timing * Abc_SclTimingAlloc()
static void Vec_StrPutS(Vec_Str_t *vOut, char *pStr)
static void Abc_SclWriteLibrary(Vec_Str_t *vOut, SC_Lib *p)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static char * Vec_StrGetS(Vec_Str_t *vOut, int *pPos)
void Abc_SclWriteLiberty(char *pFileName, SC_Lib *p)
static void Abc_Print(int level, const char *format,...)
SC_Lib * Abc_SclReadFromStr(Vec_Str_t *vOut)
static void Vec_StrPutF(Vec_Str_t *vOut, float Val)
static void Abc_SclWriteLibraryText(FILE *s, SC_Lib *p)
#define ABC_NAMESPACE_IMPL_START
#define ABC_SCL_CUR_VERSION
INCLUDES ///.
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static int Vec_StrSize(Vec_Str_t *p)
void Abc_SclWriteScl(char *pFileName, SC_Lib *p)
static int Vec_IntSize(Vec_Int_t *p)
static word * Vec_WrdArray(Vec_Wrd_t *p)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define SC_CellForEachPinOut(p, pPin, i)
void Abc_SclLinkCells(SC_Lib *p)
static word Vec_WrdEntry(Vec_Wrd_t *p, int i)
static void Vec_StrPutI(Vec_Str_t *vOut, int Val)
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
#define SC_LibForEachWireLoad(p, pWL, i)
SC_Lib * Abc_SclReadFromFile(char *pFileName)
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)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
void Abc_SclLibNormalize(SC_Lib *p)
static int Vec_FltSize(Vec_Flt_t *p)
char * Abc_UtilStrsav(char *s)
static void Abc_SclWriteSurface(Vec_Str_t *vOut, SC_Surface *p)
static int Vec_StrGetI(Vec_Str_t *vOut, int *pPos)
static void ** Vec_PtrArray(Vec_Ptr_t *p)
char * default_wire_load_sel
#define SC_LibForEachCell(p, pCell, i)
static void Vec_PtrFree(Vec_Ptr_t *p)