@@ -141,7 +141,7 @@ void Scl_End( Abc_Frame_t * pAbc )
141141 SeeAlso []
142142
143143***********************************************************************/
144- SC_Lib * Scl_ReadLibraryFile ( Abc_Frame_t * pAbc , char * pFileName , int fVerbose , int fVeryVerbose , SC_DontUse dont_use )
144+ SC_Lib * Scl_ReadLibraryFile ( Abc_Frame_t * pAbc , char * pFileName , int fVerbose , int fVeryVerbose , SC_DontUse dont_use , int fSkipMultiOuts )
145145{
146146 SC_Lib * pLib ;
147147 FILE * pFile ;
@@ -152,7 +152,7 @@ SC_Lib * Scl_ReadLibraryFile( Abc_Frame_t * pAbc, char * pFileName, int fVerbose
152152 }
153153 fclose ( pFile );
154154 // read new library
155- pLib = Abc_SclReadLiberty ( pFileName , fVerbose , fVeryVerbose , dont_use );
155+ pLib = Abc_SclReadLiberty ( pFileName , fVerbose , fVeryVerbose , dont_use , fSkipMultiOuts );
156156 if ( pLib == NULL )
157157 {
158158 fprintf ( pAbc -> Err , "Reading SCL library from file \"%s\" has failed. \n" , pFileName );
@@ -186,13 +186,14 @@ int Scl_CommandReadLib( Abc_Frame_t * pAbc, int argc, char ** argv )
186186 int fMerge = 0 ;
187187 int fUsePrefix = 0 ;
188188 int fUseAll = 0 ;
189+ int fSkipMultiOuts = 0 ;
189190
190191 SC_DontUse dont_use = {0 };
191192 dont_use .dont_use_list = ABC_ALLOC (char * , argc );
192193 dont_use .size = 0 ;
193194
194195 Extra_UtilGetoptReset ();
195- while ( ( c = Extra_UtilGetopt ( argc , argv , "SGMXdnuvwmpah " ) ) != EOF )
196+ while ( ( c = Extra_UtilGetopt ( argc , argv , "SGMXdnuvwmpash " ) ) != EOF )
196197 {
197198 switch ( c )
198199 {
@@ -263,15 +264,18 @@ int Scl_CommandReadLib( Abc_Frame_t * pAbc, int argc, char ** argv )
263264 case 'a' :
264265 fUseAll ^= 1 ;
265266 break ;
267+ case 's' :
268+ fSkipMultiOuts ^= 1 ;
269+ break ;
266270 case 'h' :
267271 goto usage ;
268272 default :
269273 goto usage ;
270274 }
271275 }
272276 if ( argc == globalUtilOptind + 2 ) { // expecting two files
273- SC_Lib * pLib1 = Scl_ReadLibraryFile ( pAbc , argv [globalUtilOptind ], fVerbose , fVeryVerbose , dont_use );
274- SC_Lib * pLib2 = Scl_ReadLibraryFile ( pAbc , argv [globalUtilOptind + 1 ], fVerbose , fVeryVerbose , dont_use );
277+ SC_Lib * pLib1 = Scl_ReadLibraryFile ( pAbc , argv [globalUtilOptind ], fVerbose , fVeryVerbose , dont_use , fSkipMultiOuts );
278+ SC_Lib * pLib2 = Scl_ReadLibraryFile ( pAbc , argv [globalUtilOptind + 1 ], fVerbose , fVeryVerbose , dont_use , fSkipMultiOuts );
275279 ABC_FREE (dont_use .dont_use_list );
276280 if ( pLib1 == NULL || pLib2 == NULL ) {
277281 if (pLib1 ) Abc_SclLibFree (pLib1 );
@@ -283,7 +287,7 @@ int Scl_CommandReadLib( Abc_Frame_t * pAbc, int argc, char ** argv )
283287 Abc_SclLibFree (pLib2 );
284288 }
285289 else if ( argc == globalUtilOptind + 1 ) { // expecting one file
286- SC_Lib * pLib1 = Scl_ReadLibraryFile ( pAbc , argv [globalUtilOptind ], fVerbose , fVeryVerbose , dont_use );
290+ SC_Lib * pLib1 = Scl_ReadLibraryFile ( pAbc , argv [globalUtilOptind ], fVerbose , fVeryVerbose , dont_use , fSkipMultiOuts );
287291
288292 SC_Lib * pLib_ext = (SC_Lib * )pAbc -> pLibScl ;
289293 if ( fMerge && pLib_ext != NULL && pLib1 != NULL ) {
@@ -328,7 +332,7 @@ int Scl_CommandReadLib( Abc_Frame_t * pAbc, int argc, char ** argv )
328332 return 0 ;
329333
330334usage :
331- fprintf ( pAbc -> Err , "usage: read_lib [-SG float] [-M num] [-dnuvwmpah ] [-X cell_name] <file> <file2>\n" );
335+ fprintf ( pAbc -> Err , "usage: read_lib [-SG float] [-M num] [-dnuvwmpash ] [-X cell_name] <file> <file2>\n" );
332336 fprintf ( pAbc -> Err , "\t reads Liberty library from file\n" );
333337 fprintf ( pAbc -> Err , "\t-S float : the slew parameter used to generate the library [default = %.2f]\n" , Slew );
334338 fprintf ( pAbc -> Err , "\t-G float : the gain parameter used to generate the library [default = %.2f]\n" , Gain );
@@ -340,8 +344,9 @@ int Scl_CommandReadLib( Abc_Frame_t * pAbc, int argc, char ** argv )
340344 fprintf ( pAbc -> Err , "\t-v : toggle writing verbose information [default = %s]\n" , fVerbose ? "yes" : "no" );
341345 fprintf ( pAbc -> Err , "\t-w : toggle writing information about skipped gates [default = %s]\n" , fVeryVerbose ? "yes" : "no" );
342346 fprintf ( pAbc -> Err , "\t-m : toggle merging library with exisiting library [default = %s]\n" , fMerge ? "yes" : "no" );
343- fprintf ( pAbc -> Err , "\t-a : toggle reading all cells when using gain-based modeling [default = %s]\n" , fUseAll ? "yes" : "no" );
344347 fprintf ( pAbc -> Err , "\t-p : toggle using prefix for the cell names [default = %s]\n" , fUsePrefix ? "yes" : "no" );
348+ fprintf ( pAbc -> Err , "\t-a : toggle reading all cells when using gain-based modeling [default = %s]\n" , fUseAll ? "yes" : "no" );
349+ fprintf ( pAbc -> Err , "\t-s : toggle skipping cells with two outputs [default = %s]\n" , fSkipMultiOuts ? "yes" : "no" );
345350 fprintf ( pAbc -> Err , "\t-h : prints the command summary\n" );
346351 fprintf ( pAbc -> Err , "\t<file> : the name of a file to read\n" );
347352 fprintf ( pAbc -> Err , "\t<file2> : the name of a file to read (optional)\n" );
0 commit comments