85 int nVarsMax, nLevels;
108 nLevels = atoi(argv[globalUtilOptind]);
129 fprintf( pErr,
"usage: super2 [-IL num] [-vh]\n");
130 fprintf( pErr,
"\t precomputes the supergates composed of AND2s and INVs\n" );
131 fprintf( pErr,
"\t-I num : the max number of inputs to the supergate [default = %d]\n", nVarsMax );
132 fprintf( pErr,
"\t-L num : the max number of logic levels of gates [default = %d]\n", nLevels );
133 fprintf( pErr,
"\t-v : enable verbose output\n");
134 fprintf( pErr,
"\t-h : print the help message\n");
155 char * FileName, * ExcludeFile;
160 int nVarsMax, nLevels, nGatesMax, TimeLimit;
191 nLevels = atoi(argv[globalUtilOptind]);
197 nGatesMax = atoi(argv[globalUtilOptind]);
203 TimeLimit = atoi(argv[globalUtilOptind]);
209 DelayLimit = (float)
atof(argv[globalUtilOptind]);
211 if ( DelayLimit <= 0.0 )
215 AreaLimit = (float)
atof(argv[globalUtilOptind]);
217 if ( AreaLimit <= 0.0 )
222 if ( ExcludeFile == 0 )
230 fWriteOldFormat ^= 1;
246 fprintf( pErr,
"The genlib library file should be given on the command line.\n" );
250 if ( nVarsMax < 2 || nVarsMax > 6 )
252 fprintf( pErr,
"The max number of variables (%d) should be more than 1 and less than 7.\n", nVarsMax );
258 if ( (pFile =
Io_FileOpen( FileName,
"open_path",
"r", 0 )) == NULL )
261 fprintf( pErr,
"Cannot open input file \"%s\". ", FileName );
263 fprintf( pErr,
"Did you mean \"%s\"?", FileName );
264 fprintf( pErr,
"\n" );
273 fprintf( pErr,
"Reading library has failed.\n" );
279 Super_Precompute( pLib, nVarsMax, nLevels, nGatesMax, DelayLimit, AreaLimit, TimeLimit, fSkipInvs, fVerbose, FileName );
286 fprintf( pErr,
"usage: super [-ILNT num] [-DA float] [-E file] [-sovh] <genlib_file>\n");
287 fprintf( pErr,
"\t precomputes the supergates for the given genlib library\n" );
288 fprintf( pErr,
"\t-I num : the max number of supergate inputs [default = %d]\n", nVarsMax );
289 fprintf( pErr,
"\t-L num : the max number of levels of gates [default = %d]\n", nLevels );
290 fprintf( pErr,
"\t-N num : the limit on the number of considered supergates [default = %d]\n", nGatesMax );
291 fprintf( pErr,
"\t-T num : the approximate runtime limit in seconds [default = %d]\n", TimeLimit );
292 fprintf( pErr,
"\t-D float : the max delay of the supergates [default = %.2f]\n", DelayLimit );
293 fprintf( pErr,
"\t-A float : the max area of the supergates [default = %.2f]\n", AreaLimit );
294 fprintf( pErr,
"\t-E file : file contains list of genlib gates to exclude\n" );
295 fprintf( pErr,
"\t-s : toggle the use of inverters at the inputs [default = %s]\n", (fSkipInvs?
"no":
"yes") );
296 fprintf( pErr,
"\t-o : toggle dumping the supergate library in old format [default = %s]\n", (fWriteOldFormat?
"yes":
"no") );
297 fprintf( pErr,
"\t-v : enable verbose output [default = %s]\n", (fVerbose?
"yes" :
"no") );
298 fprintf( pErr,
"\t-h : print the help message\n");
299 fprintf( pErr,
"\n");
300 fprintf( pErr,
"\tHere is a piece of advice on precomputing supergate libraries:\n");
301 fprintf( pErr,
"\t\n");
302 fprintf( pErr,
"\tStart with the number of inputs equal to 5 (-I 5), the number of \n");
303 fprintf( pErr,
"\tlevels equal to 2 (-L 2), the delay equal to 2-3 delays of inverter, \n");
304 fprintf( pErr,
"\tthe area equal to 2-3 areas of two input NAND, and runtime limit equal \n");
305 fprintf( pErr,
"\tto 10 seconds (-T 10). Run precomputation and learn from the result.\n");
306 fprintf( pErr,
"\tDetermine what parameter is most constraining and try to increase \n");
307 fprintf( pErr,
"\tthe value of that parameter. The goal is to have a well-balanced\n");
308 fprintf( pErr,
"\tset of constraints and the resulting supergate library containing\n");
309 fprintf( pErr,
"\tapproximately 5K-20K supergates. Typically, it is better to increase\n");
310 fprintf( pErr,
"\tdelay limit rather than area limit, because having large-area supergates\n");
311 fprintf( pErr,
"\tmay result in a considerable increase in area.\n");
312 fprintf( pErr,
"\t\n");
313 fprintf( pErr,
"\tNote that a good supergate library for experiments typically can be \n");
314 fprintf( pErr,
"\tprecomputed in 30 sec or less. Increasing runtime limit makes sense when\n");
315 fprintf( pErr,
"\tother parameters are well-balanced and it is needed to enumerate more\n");
316 fprintf( pErr,
"\tchoices to have a good result. In the end, to compute the final library\n");
317 fprintf( pErr,
"\tthe runtime can be set to 300 sec to ensure the ultimate quality.\n");
318 fprintf( pErr,
"\tIn some cases, the runtime has to be reduced if the supergate library\n");
319 fprintf( pErr,
"\tcontains too many supergates (> 500K).\n");
320 fprintf( pErr,
"\t\n");
321 fprintf( pErr,
"\tWhen precomputing libraries of 6 inputs (-i 6), start with even more \n");
322 fprintf( pErr,
"\trestricted parameters and gradually increase them until the goal is met.\n");
323 fprintf( pErr,
"\t\n");
ABC_NAMESPACE_HEADER_START void Super2_Precompute(int nInputs, int nLevels, int fVerbose)
INCLUDES ///.
FILE * Io_FileOpen(const char *FileName, const char *PathVar, const char *Mode, int fVerbose)
Mio_Library_t * Mio_LibraryRead(char *FileName, char *pBuffer, char *ExcludeFile, int fVerbose)
void Mio_LibraryDelete(Mio_Library_t *pLib)
DECLARATIONS ///.
void Super_Precompute(Mio_Library_t *pLibGen, int nVarsMax, int nLevels, int nGatesMax, float tDelayMax, float tAreaMax, int TimeLimit, int fSkipInv, int fVerbose, char *pFileName)
FUNCTION DEFINITIONS ///.
void Cmd_CommandAdd(Abc_Frame_t *pAbc, const char *sGroup, const char *sName, Cmd_CommandFuncType pFunc, int fChanges)
char * Mio_LibraryReadName(Mio_Library_t *pLib)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
#define ABC_NAMESPACE_IMPL_END
static ABC_NAMESPACE_IMPL_START int Super_CommandSupergates(Abc_Frame_t *pAbc, int argc, char **argv)
DECLARATIONS ///.
STRUCTURE DEFINITIONS ///.
#define ABC_NAMESPACE_IMPL_START
static int Super_CommandSupergatesAnd(Abc_Frame_t *pAbc, int argc, char **argv)
ABC_DLL FILE * Abc_FrameReadErr(Abc_Frame_t *p)
ABC_DLL FILE * Abc_FrameReadOut(Abc_Frame_t *p)
void Super_End(Abc_Frame_t *pAbc)
void Super_Init(Abc_Frame_t *pAbc)
FUNCTION DEFINITIONS ///.