add library merging flag to read_lib

Signed-off-by: Peter Gadfort <gadfort@zeroasic.com>
This commit is contained in:
Peter Gadfort 2024-04-12 13:27:58 -04:00
parent b10d000c7a
commit 1d90cafd54
1 changed files with 15 additions and 2 deletions

View File

@ -183,13 +183,14 @@ int Scl_CommandReadLib( Abc_Frame_t * pAbc, int argc, char ** argv )
int fUnit = 0;
int fVerbose = 1;
int fVeryVerbose = 0;
int fMerge = 0;
SC_DontUse dont_use = {0};
dont_use.dont_use_list = ABC_ALLOC(char *, argc);
dont_use.size = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "SGMXdnuvwh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "SGMXdnuvwmh" ) ) != EOF )
{
switch ( c )
{
@ -251,6 +252,9 @@ int Scl_CommandReadLib( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'w':
fVeryVerbose ^= 1;
break;
case 'm':
fMerge ^= 1;
break;
case 'h':
goto usage;
default:
@ -271,7 +275,15 @@ int Scl_CommandReadLib( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_SclLibFree(pLib2);
}
else if ( argc == globalUtilOptind + 1 ) { // expecting one file
pLib = Scl_ReadLibraryFile( pAbc, argv[globalUtilOptind], fVerbose, fVeryVerbose, dont_use );
SC_Lib * pLib1 = Scl_ReadLibraryFile( pAbc, argv[globalUtilOptind], fVerbose, fVeryVerbose, dont_use );
SC_Lib * pLib_ext = (SC_Lib *)pAbc->pLibScl;
if ( fMerge && pLib_ext != NULL && pLib1 != NULL ) {
pLib = Abc_SclMergeLibraries( pLib_ext, pLib1 );
if (pLib1) Abc_SclLibFree(pLib1);
} else {
pLib = pLib1;
}
ABC_FREE(dont_use.dont_use_list);
}
else {
@ -319,6 +331,7 @@ usage:
fprintf( pAbc->Err, "\t-u : toggle setting unit area for all cells [default = %s]\n", fUnit? "yes": "no" );
fprintf( pAbc->Err, "\t-v : toggle writing verbose information [default = %s]\n", fVerbose? "yes": "no" );
fprintf( pAbc->Err, "\t-w : toggle writing information about skipped gates [default = %s]\n", fVeryVerbose? "yes": "no" );
fprintf( pAbc->Err, "\t-m : toggle merging library with exisiting library [default = %s]\n", fMerge? "yes": "no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
fprintf( pAbc->Err, "\t<file> : the name of a file to read\n" );
fprintf( pAbc->Err, "\t<file2> : the name of a file to read (optional)\n" );