184 int fUseFileInterface = 0;
220 if ( (pFile =
Io_FileOpen( pFileName,
"open_path",
"r", 0 )) == NULL )
222 fprintf( pErr,
"Cannot open input file \"%s\". ", pFileName );
224 fprintf( pErr,
"Did you mean \"%s\"?", pFileName );
225 fprintf( pErr,
"\n" );
230 if ( fUseFileInterface )
250 printf(
"Reading library has filed.\n" );
255 fprintf( pErr,
"usage: read_liberty [-vh]\n");
256 fprintf( pErr,
"\t read standard cell library in Liberty format\n" );
257 fprintf( pErr,
"\t (if the library contains more than one gate\n" );
258 fprintf( pErr,
"\t with the same Boolean function, only the gate\n" );
259 fprintf( pErr,
"\t with the smallest area will be used)\n" );
260 fprintf( pErr,
"\t-v : toggle verbose printout [default = %s]\n", fVerbose?
"yes":
"no" );
261 fprintf( pErr,
"\t-h : enable verbose output\n");
284 char * pExcludeFile = NULL;
304 Abc_Print( -1,
"Command line switch \"-W\" should be followed by a floating point number.\n" );
309 if ( WireDelay <= 0.0 )
313 if ( globalUtilOptind >= argc )
315 Abc_Print( -1,
"Command line switch \"-E\" should be followed by a file name.\n" );
338 if ( (pFile =
Io_FileOpen( pFileName,
"open_path",
"r", 0 )) == NULL )
340 fprintf( pErr,
"Cannot open input file \"%s\". ", pFileName );
342 fprintf( pErr,
"Did you mean \"%s\"?", pFileName );
343 fprintf( pErr,
"\n" );
352 fprintf( pErr,
"Reading genlib library has failed.\n" );
356 printf(
"Entered genlib library with %d gates from file \"%s\".\n",
Mio_LibraryReadGateNum(pLib), pFileName );
359 if ( WireDelay != 0.0 )
369 fprintf( pErr,
"Reading second genlib library has failed.\n" );
376 fprintf( pErr,
"usage: read_genlib [-W float] [-E filename] [-vh]\n");
377 fprintf( pErr,
"\t read the library from a genlib file\n" );
378 fprintf( pErr,
"\t (if the library contains more than one gate\n" );
379 fprintf( pErr,
"\t with the same Boolean function, only the gate\n" );
380 fprintf( pErr,
"\t with the smallest area will be used)\n" );
381 fprintf( pErr,
"\t-W float : wire delay (added to pin-to-pin gate delays) [default = %g]\n", WireDelay );
382 fprintf( pErr,
"\t-E file : the file name with gates to be excluded [default = none]\n" );
383 fprintf( pErr,
"\t-v : toggle verbose printout [default = %s]\n", fVerbose?
"yes":
"no" );
384 fprintf( pErr,
"\t-h : enable verbose output\n");
401 FILE * pOut, * pErr, * pFile;
430 printf(
"Library is not available.\n" );
435 printf(
"The file name is not given.\n" );
440 pFile = fopen( pFileName,
"w" );
443 printf(
"Error! Cannot open file \"%s\" for writing the library.\n", pFileName );
448 printf(
"The current genlib library is written into file \"%s\".\n", pFileName );
452 fprintf( pErr,
"\nusage: write_genlib [-vh] <file>\n");
453 fprintf( pErr,
"\t writes the current genlib library into a file\n" );
454 fprintf( pErr,
"\t-v : toggles enabling of verbose output [default = %s]\n", fVerbose?
"yes" :
"no" );
455 fprintf( pErr,
"\t-h : print the command usage\n");
456 fprintf( pErr,
"\t<file> : optional file name to write the library\n");
501 printf(
"Library is not available.\n" );
508 fprintf( pErr,
"\nusage: print_genlib [-vh]\n");
509 fprintf( pErr,
"\t print the current genlib library\n" );
510 fprintf( pErr,
"\t-v : toggles enabling of verbose output [default = %s]\n", fVerbose?
"yes" :
"no" );
511 fprintf( pErr,
"\t-h : print the command usage\n");
FILE * Io_FileOpen(const char *FileName, const char *PathVar, const char *Mode, int fVerbose)
ABC_DLL void Abc_FrameSetLibSuper(void *pLib)
void Map_SuperLibFree(Map_SuperLib_t *p)
ABC_DLL void * Abc_FrameReadLibGen()
Mio_Library_t * Mio_LibraryRead(char *FileName, char *pBuffer, char *ExcludeFile, int fVerbose)
ABC_DLL void * Abc_FrameReadLibGen2()
void Mio_LibraryDelete(Mio_Library_t *pLib)
DECLARATIONS ///.
void Mio_End(Abc_Frame_t *pAbc)
int Cmd_CommandExecute(void *pAbc, char *pCommandLine)
static char * Vec_StrArray(Vec_Str_t *p)
void Mio_LibraryShiftDelay(Mio_Library_t *pLib, double Shift)
void Cmd_CommandAdd(Abc_Frame_t *pAbc, const char *sGroup, const char *sName, Cmd_CommandFuncType pFunc, int fChanges)
int Amap_LibertyParse(char *pFileName, int fVerbose)
ABC_DLL void Abc_FrameSetLibGen2(void *pLib)
Amap_Lib_t * Amap_LibReadAndPrepare(char *pFileName, char *pBuffer, int fVerbose, int fVeryVerbose)
Vec_Str_t * Amap_LibertyParseStr(char *pFileName, int fVerbose)
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
void Mio_Init(Abc_Frame_t *pAbc)
FUNCTION DEFINITIONS ///.
static void Vec_StrFree(Vec_Str_t *p)
void Amap_LibFree(Amap_Lib_t *p)
#define ABC_NAMESPACE_IMPL_END
ABC_DLL void * Abc_FrameReadLibSuper()
int Mio_UpdateGenlib2(Vec_Str_t *vStr, Vec_Str_t *vStr2, char *pFileName, int fVerbose)
STRUCTURE DEFINITIONS ///.
static void Abc_Print(int level, const char *format,...)
static int Mio_CommandPrintGenlib(Abc_Frame_t *pAbc, int argc, char **argv)
void Mio_WriteLibrary(FILE *pFile, Mio_Library_t *pLib, int fPrintSops)
#define ABC_NAMESPACE_IMPL_START
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
typedefABC_NAMESPACE_HEADER_START struct Amap_Lib_t_ Amap_Lib_t
INCLUDES ///.
static int Mio_CommandReadGenlib(Abc_Frame_t *pAbc, int argc, char **argv)
static ABC_NAMESPACE_IMPL_START int Mio_CommandReadLiberty(Abc_Frame_t *pAbc, int argc, char **argv)
DECLARATIONS ///.
void Mio_UpdateGenlib(Mio_Library_t *pLib)
FUNCTION DEFINITIONS ///.
ABC_DLL FILE * Abc_FrameReadErr(Abc_Frame_t *p)
static int Mio_CommandWriteGenlib(Abc_Frame_t *pAbc, int argc, char **argv)
ABC_DLL void Abc_FrameSetLibGen(void *pLib)
ABC_DLL FILE * Abc_FrameReadOut(Abc_Frame_t *p)
static Vec_Str_t * Vec_StrDup(Vec_Str_t *pVec)
int Mio_LibraryReadGateNum(Mio_Library_t *pLib)