36static int Scl_CommandReadLib (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
37static int Scl_CommandWriteLib (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
38static int Scl_CommandReadScl (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
39static int Scl_CommandWriteScl (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
40static int Scl_CommandPrintLib (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
41static int Scl_CommandLeak2Area (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
42static int Scl_CommandDumpGen (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
43static int Scl_CommandPrintGS (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
44static int Scl_CommandStime (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
45static int Scl_CommandTopo (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
46static int Scl_CommandUnBuffer (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
47static int Scl_CommandBuffer (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
48static int Scl_CommandBufferOld (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
49static int Scl_CommandMinsize (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
50static int Scl_CommandMaxsize (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
51static int Scl_CommandUpsize (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
52static int Scl_CommandDnsize (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
53static int Scl_CommandPrintBuf (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
54static int Scl_CommandReadConstr (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
55static int Scl_CommandWriteConstr(
Abc_Frame_t * pAbc,
int argc,
char ** argv );
56static int Scl_CommandPrintConstr(
Abc_Frame_t * pAbc,
int argc,
char ** argv );
57static int Scl_CommandResetConstr(
Abc_Frame_t * pAbc,
int argc,
char ** argv );
60static inline void Scl_ConFreeMan(
Abc_Frame_t * pAbc ) {
if ( pAbc->pAbcCon ) Scl_ConFree(Scl_ConGetMan(pAbc)); }
61static inline void Scl_ConUpdateMan(
Abc_Frame_t * pAbc,
Scl_Con_t *
p ) { Scl_ConFreeMan(pAbc); pAbc->pAbcCon =
p; }
83 Abc_SclLibFree( *ppScl );
104 Cmd_CommandAdd( pAbc,
"SCL mapping",
"read_lib", Scl_CommandReadLib, 0 );
105 Cmd_CommandAdd( pAbc,
"SCL mapping",
"write_lib", Scl_CommandWriteLib, 0 );
106 Cmd_CommandAdd( pAbc,
"SCL mapping",
"print_lib", Scl_CommandPrintLib, 0 );
107 Cmd_CommandAdd( pAbc,
"SCL mapping",
"leak2area", Scl_CommandLeak2Area, 0 );
108 Cmd_CommandAdd( pAbc,
"SCL mapping",
"read_scl", Scl_CommandReadScl, 0 );
109 Cmd_CommandAdd( pAbc,
"SCL mapping",
"write_scl", Scl_CommandWriteScl, 0 );
110 Cmd_CommandAdd( pAbc,
"SCL mapping",
"dump_genlib", Scl_CommandDumpGen, 0 );
111 Cmd_CommandAdd( pAbc,
"SCL mapping",
"print_gs", Scl_CommandPrintGS, 0 );
112 Cmd_CommandAdd( pAbc,
"SCL mapping",
"stime", Scl_CommandStime, 0 );
113 Cmd_CommandAdd( pAbc,
"SCL mapping",
"topo", Scl_CommandTopo, 1 );
114 Cmd_CommandAdd( pAbc,
"SCL mapping",
"unbuffer", Scl_CommandUnBuffer, 1 );
115 Cmd_CommandAdd( pAbc,
"SCL mapping",
"buffer", Scl_CommandBuffer, 1 );
117 Cmd_CommandAdd( pAbc,
"SCL mapping",
"minsize", Scl_CommandMinsize, 1 );
118 Cmd_CommandAdd( pAbc,
"SCL mapping",
"maxsize", Scl_CommandMaxsize, 1 );
119 Cmd_CommandAdd( pAbc,
"SCL mapping",
"upsize", Scl_CommandUpsize, 1 );
120 Cmd_CommandAdd( pAbc,
"SCL mapping",
"dnsize", Scl_CommandDnsize, 1 );
121 Cmd_CommandAdd( pAbc,
"SCL mapping",
"print_buf", Scl_CommandPrintBuf, 0 );
122 Cmd_CommandAdd( pAbc,
"SCL mapping",
"read_constr", Scl_CommandReadConstr, 0 );
123 Cmd_CommandAdd( pAbc,
"SCL mapping",
"write_constr", Scl_CommandWriteConstr, 0 );
124 Cmd_CommandAdd( pAbc,
"SCL mapping",
"print_constr", Scl_CommandPrintConstr, 0 );
125 Cmd_CommandAdd( pAbc,
"SCL mapping",
"reset_constr", Scl_CommandResetConstr, 0 );
130 Scl_ConUpdateMan( pAbc, NULL );
148 if ( (pFile = fopen( pFileName,
"rb" )) == NULL )
150 fprintf( pAbc->Err,
"Cannot open input file \"%s\". \n", pFileName );
155 pLib =
Abc_SclReadLiberty( pFileName, fVerbose, fVeryVerbose, dont_use, fSkipMultiOuts);
158 fprintf( pAbc->Err,
"Reading SCL library from file \"%s\" has failed. \n", pFileName );
175int Scl_CommandReadLib(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
185 int fVeryVerbose = 0;
189 int fSkipMultiOuts = 0;
203 Abc_Print( -1,
"Command line switch \"-S\" should be followed by a floating point number.\n" );
214 Abc_Print( -1,
"Command line switch \"-G\" should be followed by a floating point number.\n" );
225 Abc_Print( -1,
"Command line switch \"-M\" should be followed by a positive integer.\n" );
236 Abc_Print( -1,
"Command line switch \"-X\" should be followed by a string.\n" );
280 if ( pLib1 == NULL || pLib2 == NULL ) {
281 if (pLib1) Abc_SclLibFree(pLib1);
282 if (pLib2) Abc_SclLibFree(pLib2);
286 Abc_SclLibFree(pLib1);
287 Abc_SclLibFree(pLib2);
293 if ( fMerge && pLib_ext != NULL && pLib1 != NULL ) {
295 if (pLib1) Abc_SclLibFree(pLib1);
309 fprintf( pAbc->Err,
"Library with only %d cell classes cannot be used.\n",
Abc_SclLibClassNum(pLib) );
310 Abc_SclLibFree(pLib);
318 if ( fDump && pAbc->pLibScl )
335 fprintf( pAbc->Err,
"usage: read_lib [-SG float] [-M num] [-dnuvwmpash] [-X cell_name] <file> <file2>\n" );
336 fprintf( pAbc->Err,
"\t reads Liberty library from file\n" );
337 fprintf( pAbc->Err,
"\t-S float : the slew parameter used to generate the library [default = %.2f]\n", Slew );
338 fprintf( pAbc->Err,
"\t-G float : the gain parameter used to generate the library [default = %.2f]\n", Gain );
339 fprintf( pAbc->Err,
"\t-M num : skip gate classes whose size is less than this [default = %d]\n", nGatesMin );
340 fprintf( pAbc->Err,
"\t-X name : adds name to the list of cells ABC shouldn't use. Flag can be passed multiple times\n");
341 fprintf( pAbc->Err,
"\t-d : toggle dumping the parsed library into file \"*_temp.lib\" [default = %s]\n", fDump?
"yes":
"no" );
342 fprintf( pAbc->Err,
"\t-n : toggle replacing gate/pin names by short strings [default = %s]\n", fShortNames?
"yes":
"no" );
343 fprintf( pAbc->Err,
"\t-u : toggle setting unit area for all cells [default = %s]\n", fUnit?
"yes":
"no" );
344 fprintf( pAbc->Err,
"\t-v : toggle writing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
345 fprintf( pAbc->Err,
"\t-w : toggle writing information about skipped gates [default = %s]\n", fVeryVerbose?
"yes":
"no" );
346 fprintf( pAbc->Err,
"\t-m : toggle merging library with exisiting library [default = %s]\n", fMerge?
"yes":
"no" );
347 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" );
350 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
351 fprintf( pAbc->Err,
"\t<file> : the name of a file to read\n" );
352 fprintf( pAbc->Err,
"\t<file2> : the name of a file to read (optional)\n" );
367int Scl_CommandWriteLib(
Abc_Frame_t * pAbc,
int argc,
char **argv )
386 if ( pAbc->pLibScl == NULL )
388 fprintf( pAbc->Err,
"There is no Liberty library available.\n" );
393 if ( (pFile = fopen( pFileName,
"wb" )) == NULL )
395 fprintf( pAbc->Err,
"Cannot open output file \"%s\". \n", pFileName );
405 fprintf( pAbc->Err,
"usage: write_lib [-h] <file>\n" );
406 fprintf( pAbc->Err,
"\t write current Liberty library into file\n" );
407 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
408 fprintf( pAbc->Err,
"\t<file> : the name of the file to write\n" );
423int Scl_CommandPrintLib(
Abc_Frame_t * pAbc,
int argc,
char **argv )
438 Abc_Print( -1,
"Command line switch \"-S\" should be followed by a floating point number.\n" );
449 Abc_Print( -1,
"Command line switch \"-G\" should be followed by a floating point number.\n" );
469 if ( pAbc->pLibScl == NULL )
471 fprintf( pAbc->Err,
"There is no Liberty library available.\n" );
480 fprintf( pAbc->Err,
"usage: print_lib [-SG float] [-ish]\n" );
481 fprintf( pAbc->Err,
"\t prints statistics of Liberty library\n" );
482 fprintf( pAbc->Err,
"\t-S float : the slew parameter used to generate the library [default = %.2f]\n", Slew );
483 fprintf( pAbc->Err,
"\t-G float : the gain parameter used to generate the library [default = %.2f]\n", Gain );
484 fprintf( pAbc->Err,
"\t-i : toggle printing invs/bufs only [default = %s]\n", fInvOnly?
"yes":
"no" );
485 fprintf( pAbc->Err,
"\t-s : toggle printing in short format [default = %s]\n", fShort?
"yes":
"no" );
486 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
501int Scl_CommandLeak2Area(
Abc_Frame_t * pAbc,
int argc,
char **argv )
513 Abc_Print( -1,
"Command line switch \"-A\" should be followed by a floating point number.\n" );
524 Abc_Print( -1,
"Command line switch \"-B\" should be followed by a floating point number.\n" );
541 if ( pAbc->pLibScl == NULL )
543 fprintf( pAbc->Err,
"There is no Liberty library available.\n" );
551 fprintf( pAbc->Err,
"usage: leak2area [-AB float] [-v]\n" );
552 fprintf( pAbc->Err,
"\t converts leakage into area: Area = A * Area + B * Leakage\n" );
553 fprintf( pAbc->Err,
"\t-A float : the multiplicative coefficient to transform area [default = %.2f]\n", A );
554 fprintf( pAbc->Err,
"\t-B float : the multiplicative coefficient to transform leakage [default = %.2f]\n", B );
555 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
556 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
573int Scl_CommandReadScl(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
599 if ( (pFile = fopen( pFileName,
"rb" )) == NULL )
601 fprintf( pAbc->Err,
"Cannot open input file \"%s\". \n", pFileName );
610 fprintf( pAbc->Err,
"Reading SCL library from file \"%s\" has failed. \n", pFileName );
625 fprintf( pAbc->Err,
"usage: read_scl [-dh] <file>\n" );
626 fprintf( pAbc->Err,
"\t reads extracted Liberty library from file\n" );
627 fprintf( pAbc->Err,
"\t-d : toggle dumping the parsed library into file \"*_temp.lib\" [default = %s]\n", fDump?
"yes":
"no" );
628 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
629 fprintf( pAbc->Err,
"\t<file> : the name of a file to read\n" );
644int Scl_CommandWriteScl(
Abc_Frame_t * pAbc,
int argc,
char **argv )
663 if ( pAbc->pLibScl == NULL )
665 fprintf( pAbc->Err,
"There is no Liberty library available.\n" );
670 if ( (pFile = fopen( pFileName,
"wb" )) == NULL )
672 fprintf( pAbc->Err,
"Cannot open output file \"%s\". \n", pFileName );
682 fprintf( pAbc->Err,
"usage: write_scl [-h] <file>\n" );
683 fprintf( pAbc->Err,
"\t write extracted Liberty library into file\n" );
684 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
685 fprintf( pAbc->Err,
"\t<file> : the name of the file to write\n" );
700int Scl_CommandDumpGen(
Abc_Frame_t * pAbc,
int argc,
char **argv )
702 char * pFileName = NULL;
715 Abc_Print( -1,
"Command line switch \"-S\" should be followed by a floating point number.\n" );
726 Abc_Print( -1,
"Command line switch \"-G\" should be followed by a floating point number.\n" );
737 Abc_Print( -1,
"Command line switch \"-M\" should be followed by a positive integer.\n" );
754 if ( pAbc->pLibScl == NULL )
756 fprintf( pAbc->Err,
"There is no Liberty library available.\n" );
765 fprintf( pAbc->Err,
"usage: dump_genlib [-SG float] [-M num] [-vh] <file>\n" );
766 fprintf( pAbc->Err,
"\t writes GENLIB file for SCL library\n" );
767 fprintf( pAbc->Err,
"\t-S float : the slew parameter used to generate the library [default = %.2f]\n", Slew );
768 fprintf( pAbc->Err,
"\t-G float : the gain parameter used to generate the library [default = %.2f]\n", Gain );
769 fprintf( pAbc->Err,
"\t-M num : skip gate classes whose size is less than this [default = %d]\n", nGatesMin );
770 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
771 fprintf( pAbc->Err,
"\t-h : print the command usage\n");
772 fprintf( pAbc->Err,
"\t<file> : optional GENLIB file name\n");
787int Scl_CommandPrintGS(
Abc_Frame_t * pAbc,
int argc,
char **argv )
804 fprintf( pAbc->Err,
"There is no current network.\n" );
809 fprintf( pAbc->Err,
"The current network is not mapped.\n" );
812 if ( pAbc->pLibScl == NULL )
814 fprintf( pAbc->Err,
"There is no Liberty library available.\n" );
823 fprintf( pAbc->Err,
"usage: print_gs [-h]\n" );
824 fprintf( pAbc->Err,
"\t prints gate sizes in the current mapping\n" );
825 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
840int Scl_CommandStime(
Abc_Frame_t * pAbc,
int argc,
char **argv )
844 int fUseWireLoads = 0;
857 Abc_Print( -1,
"Command line switch \"-X\" should be followed by a positive integer.\n" );
862 if ( nTreeCRatio < 0 )
886 fprintf( pAbc->Err,
"There is no current network.\n" );
891 fprintf( pAbc->Err,
"The current network is not mapped.\n" );
896 fprintf( pAbc->Err,
"The current network is not in a topo order (run \"topo\").\n" );
899 if ( pAbc->pLibScl == NULL )
901 fprintf( pAbc->Err,
"There is no Liberty library available.\n" );
909 fprintf( pAbc->Err,
"usage: stime [-X num] [-capdth]\n" );
910 fprintf( pAbc->Err,
"\t performs STA using Liberty library\n" );
911 fprintf( pAbc->Err,
"\t-X : min Cout/Cave ratio for tree estimations [default = %d]\n", nTreeCRatio );
912 fprintf( pAbc->Err,
"\t-c : toggle using wire-loads if specified [default = %s]\n", fUseWireLoads?
"yes":
"no" );
913 fprintf( pAbc->Err,
"\t-a : display timing information for all nodes [default = %s]\n", fShowAll?
"yes":
"no" );
914 fprintf( pAbc->Err,
"\t-p : display timing information for critical path [default = %s]\n", fPrintPath?
"yes":
"no" );
915 fprintf( pAbc->Err,
"\t-d : toggle dumping statistics into a file [default = %s]\n", fDumpStats?
"yes":
"no" );
916 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
931int Scl_CommandTopo(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
953 Abc_Print( -1,
"Empty network.\n" );
956 if ( !Abc_NtkIsLogic(pNtk) )
958 Abc_Print( -1,
"This command can only be applied to a logic network.\n" );
964 if ( pNtkRes == NULL )
966 Abc_Print( -1,
"The command has failed.\n" );
974 fprintf( pAbc->Err,
"usage: topo [-vh]\n" );
975 fprintf( pAbc->Err,
"\t rearranges nodes to be in a topological order\n" );
976 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
977 fprintf( pAbc->Err,
"\t-h : print the command usage\n");
992int Scl_CommandUnBuffer(
Abc_Frame_t * pAbc,
int argc,
char **argv )
995 int c, fRemInv = 0, fVerbose = 0;
1016 fprintf( pAbc->Err,
"There is no current network.\n" );
1019 if ( !Abc_NtkIsLogic(pNtk) )
1021 fprintf( pAbc->Err,
"The current network is not a logic network.\n" );
1028 if ( pNtkRes == NULL )
1030 Abc_Print( -1,
"The command has failed.\n" );
1037 fprintf( pAbc->Err,
"usage: unbuffer [-ivh]\n" );
1038 fprintf( pAbc->Err,
"\t collapses buffer/inverter trees\n" );
1039 fprintf( pAbc->Err,
"\t-i : toggle removing interters [default = %s]\n", fRemInv?
"yes":
"no" );
1040 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1041 fprintf( pAbc->Err,
"\t-h : print the command usage\n");
1056int Scl_CommandBuffer(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1079 Abc_Print( -1,
"Command line switch \"-G\" should be followed by a positive integer.\n" );
1090 Abc_Print( -1,
"Command line switch \"-S\" should be followed by a positive integer.\n" );
1095 if ( pPars->
Slew < 0 )
1101 Abc_Print( -1,
"Command line switch \"-N\" should be followed by a positive integer.\n" );
1136 Abc_Print( -1,
"Empty network.\n" );
1139 if ( !Abc_NtkIsLogic(pNtk) )
1141 Abc_Print( -1,
"This command can only be applied to a logic network.\n" );
1146 Abc_Print( -1,
"Fanin phase information is not available.\n" );
1151 Abc_Print( -1,
"Library delay info is not available.\n" );
1156 if ( pNtkRes == NULL )
1158 Abc_Print( -1,
"The command has failed.\n" );
1166 fprintf( pAbc->Err,
"usage: buffer [-GSN num] [-sbpcvwh]\n" );
1167 fprintf( pAbc->Err,
"\t performs buffering and sizing on mapped network\n" );
1168 fprintf( pAbc->Err,
"\t-G <num> : target gain percentage [default = %d]\n", pPars->
GainRatio );
1169 fprintf( pAbc->Err,
"\t-S <num> : target slew in picoseconds [default = %d]\n", pPars->
Slew );
1170 fprintf( pAbc->Err,
"\t-N <num> : the maximum fanout count [default = %d]\n", pPars->
nDegree );
1171 fprintf( pAbc->Err,
"\t-s : toggle performing only sizing [default = %s]\n", pPars->
fSizeOnly?
"yes":
"no" );
1172 fprintf( pAbc->Err,
"\t-b : toggle using buffers instead of inverters [default = %s]\n", pPars->
fAddBufs?
"yes":
"no" );
1173 fprintf( pAbc->Err,
"\t-p : toggle buffering primary inputs [default = %s]\n", pPars->
fBufPis?
"yes":
"no" );
1174 fprintf( pAbc->Err,
"\t-c : toggle using wire-loads if specified [default = %s]\n", pPars->
fUseWireLoads?
"yes":
"no" );
1175 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", pPars->
fVerbose?
"yes":
"no" );
1176 fprintf( pAbc->Err,
"\t-w : toggle printing more verbose information [default = %s]\n", pPars->
fVeryVerbose?
"yes":
"no" );
1177 fprintf( pAbc->Err,
"\t-h : print the command usage\n");
1192int Scl_CommandBufferOld(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1196 int FanMin, FanMax, FanMaxR, fAddInvs, fUseInvs, fBufPis, fSkipDup;
1215 Abc_Print( -1,
"Command line switch \"-N\" should be followed by a positive integer.\n" );
1226 Abc_Print( -1,
"Command line switch \"-M\" should be followed by a positive integer.\n" );
1237 Abc_Print( -1,
"Command line switch \"-R\" should be followed by a positive integer.\n" );
1272 Abc_Print( -1,
"Empty network.\n" );
1275 if ( !Abc_NtkIsLogic(pNtk) )
1277 Abc_Print( -1,
"This command can only be applied to a logic network.\n" );
1280 if ( fAddInvs && pNtk->
vPhases == NULL )
1282 Abc_Print( -1,
"Fanin phase information is not available.\n" );
1287 Abc_Print( -1,
"Library delay info is not available.\n" );
1294 else if ( fOldAlgo )
1297 pNtkRes =
Abc_SclBufPerform( pNtk, FanMin, FanMax, fBufPis, fSkipDup, fVerbose );
1298 if ( pNtkRes == NULL )
1300 Abc_Print( -1,
"The command has failed.\n" );
1308 fprintf( pAbc->Err,
"usage: _buffer [-NMR num] [-aixpdvh]\n" );
1309 fprintf( pAbc->Err,
"\t performs buffering of the mapped network\n" );
1310 fprintf( pAbc->Err,
"\t-N <num> : the min fanout considered by the algorithm [default = %d]\n", FanMin );
1311 fprintf( pAbc->Err,
"\t-M <num> : the max allowed fanout count of node/buffer [default = %d]\n", FanMax );
1312 fprintf( pAbc->Err,
"\t-R <num> : the max allowed fanout count of root node [default = %d]\n", FanMaxR );
1313 fprintf( pAbc->Err,
"\t-a : toggle using old algorithm [default = %s]\n", fOldAlgo?
"yes":
"no" );
1314 fprintf( pAbc->Err,
"\t-i : toggle adding interters instead of buffering [default = %s]\n", fAddInvs?
"yes":
"no" );
1315 fprintf( pAbc->Err,
"\t-x : toggle using interters instead of buffers [default = %s]\n", fUseInvs?
"yes":
"no" );
1316 fprintf( pAbc->Err,
"\t-p : toggle buffering primary inputs [default = %s]\n", fBufPis?
"yes":
"no" );
1317 fprintf( pAbc->Err,
"\t-d : toggle disabling gate duplication [default = %s]\n", fSkipDup?
"yes":
"no" );
1318 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1319 fprintf( pAbc->Err,
"\t-h : print the command usage\n");
1334int Scl_CommandMinsize(
Abc_Frame_t * pAbc,
int argc,
char **argv )
1337 int c, fVerbose = 0;
1355 fprintf( pAbc->Err,
"There is no current network.\n" );
1360 fprintf( pAbc->Err,
"The current network is not mapped.\n" );
1365 fprintf( pAbc->Err,
"The current network is not in a topo order (run \"topo\").\n" );
1368 if ( pAbc->pLibScl == NULL )
1370 fprintf( pAbc->Err,
"There is no Liberty library available.\n" );
1378 fprintf( pAbc->Err,
"usage: minsize [-vh]\n" );
1379 fprintf( pAbc->Err,
"\t downsizes all gates to their minimum size\n" );
1380 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1381 fprintf( pAbc->Err,
"\t-h : print the command usage\n");
1396int Scl_CommandMaxsize(
Abc_Frame_t * pAbc,
int argc,
char **argv )
1399 int c, fVerbose = 0;
1417 fprintf( pAbc->Err,
"There is no current network.\n" );
1422 fprintf( pAbc->Err,
"The current network is not mapped.\n" );
1427 fprintf( pAbc->Err,
"The current network is not in a topo order (run \"topo\").\n" );
1430 if ( pAbc->pLibScl == NULL )
1432 fprintf( pAbc->Err,
"There is no Liberty library available.\n" );
1440 fprintf( pAbc->Err,
"usage: maxsize [-vh]\n" );
1441 fprintf( pAbc->Err,
"\t upsizes all gates to their maximum size\n" );
1442 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1443 fprintf( pAbc->Err,
"\t-h : print the command usage\n");
1458int Scl_CommandUpsize(
Abc_Frame_t * pAbc,
int argc,
char **argv )
1480 while ( ( c =
Extra_UtilGetopt( argc, argv,
"IJWRNDGTXBcsdvwh" ) ) != EOF )
1487 Abc_Print( -1,
"Command line switch \"-I\" should be followed by a positive integer.\n" );
1498 Abc_Print( -1,
"Command line switch \"-J\" should be followed by a positive integer.\n" );
1509 Abc_Print( -1,
"Command line switch \"-W\" should be followed by a positive integer.\n" );
1520 Abc_Print( -1,
"Command line switch \"-R\" should be followed by a positive integer.\n" );
1525 if ( pPars->
Ratio < 0 )
1531 Abc_Print( -1,
"Command line switch \"-N\" should be followed by a positive integer.\n" );
1542 Abc_Print( -1,
"Command line switch \"-D\" should be followed by a positive integer.\n" );
1553 Abc_Print( -1,
"Command line switch \"-G\" should be followed by a positive integer.\n" );
1562 Abc_Print( -1,
"Command line switch \"-T\" should be followed by a positive integer.\n" );
1573 Abc_Print( -1,
"Command line switch \"-X\" should be followed by a positive integer.\n" );
1584 Abc_Print( -1,
"Command line switch \"-B\" should be followed by a positive integer.\n" );
1616 fprintf( pAbc->Err,
"There is no current network.\n" );
1621 fprintf( pAbc->Err,
"The current network is not mapped.\n" );
1626 fprintf( pAbc->Err,
"The current network is not in a topo order (run \"topo\").\n" );
1631 Abc_Print( -1,
"Library delay info is not available.\n" );
1639 fprintf( pAbc->Err,
"usage: upsize [-IJWRNDGTXB num] [-csdvwh]\n" );
1640 fprintf( pAbc->Err,
"\t selectively increases gate sizes on the critical path\n" );
1641 fprintf( pAbc->Err,
"\t-I <num> : the number of upsizing iterations to perform [default = %d]\n", pPars->
nIters );
1642 fprintf( pAbc->Err,
"\t-J <num> : the number of iterations without improvement to stop [default = %d]\n", pPars->
nIterNoChange );
1643 fprintf( pAbc->Err,
"\t-W <num> : delay window (in percent) of near-critical COs [default = %d]\n", pPars->
Window );
1644 fprintf( pAbc->Err,
"\t-R <num> : ratio of critical nodes (in percent) to update [default = %d]\n", pPars->
Ratio );
1645 fprintf( pAbc->Err,
"\t-N <num> : limit on discrete upsizing steps at a node [default = %d]\n", pPars->
Notches );
1646 fprintf( pAbc->Err,
"\t-D <num> : delay target set by the user, in picoseconds [default = %d]\n", pPars->
DelayUser );
1647 fprintf( pAbc->Err,
"\t-G <num> : delay gap during updating, in picoseconds [default = %d]\n", pPars->
DelayGap );
1648 fprintf( pAbc->Err,
"\t-T <num> : approximate timeout in seconds [default = %d]\n", pPars->
TimeOut );
1649 fprintf( pAbc->Err,
"\t-X <num> : ratio for buffer tree estimation [default = %d]\n", pPars->
BuffTreeEst );
1650 fprintf( pAbc->Err,
"\t-B <num> : frequency of bypass transforms [default = %d]\n", pPars->
BypassFreq );
1651 fprintf( pAbc->Err,
"\t-c : toggle using wire-loads if specified [default = %s]\n", pPars->
fUseWireLoads?
"yes":
"no" );
1652 fprintf( pAbc->Err,
"\t-s : toggle using slack based on departure times [default = %s]\n", pPars->
fUseDept?
"yes":
"no" );
1653 fprintf( pAbc->Err,
"\t-d : toggle dumping statistics into a file [default = %s]\n", pPars->
fDumpStats?
"yes":
"no" );
1654 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", pPars->
fVerbose?
"yes":
"no" );
1655 fprintf( pAbc->Err,
"\t-w : toggle printing more verbose information [default = %s]\n", pPars->
fVeryVerbose?
"yes":
"no" );
1656 fprintf( pAbc->Err,
"\t-h : print the command usage\n");
1671int Scl_CommandDnsize(
Abc_Frame_t * pAbc,
int argc,
char **argv )
1697 Abc_Print( -1,
"Command line switch \"-I\" should be followed by a positive integer.\n" );
1708 Abc_Print( -1,
"Command line switch \"-J\" should be followed by a positive integer.\n" );
1719 Abc_Print( -1,
"Command line switch \"-N\" should be followed by a positive integer.\n" );
1730 Abc_Print( -1,
"Command line switch \"-D\" should be followed by a positive integer.\n" );
1741 Abc_Print( -1,
"Command line switch \"-G\" should be followed by a positive integer.\n" );
1750 Abc_Print( -1,
"Command line switch \"-T\" should be followed by a positive integer.\n" );
1761 Abc_Print( -1,
"Command line switch \"-X\" should be followed by a positive integer.\n" );
1793 fprintf( pAbc->Err,
"There is no current network.\n" );
1798 fprintf( pAbc->Err,
"The current network is not mapped.\n" );
1803 fprintf( pAbc->Err,
"The current network is not in a topo order (run \"topo\").\n" );
1808 Abc_Print( -1,
"Library delay info is not available.\n" );
1816 fprintf( pAbc->Err,
"usage: dnsize [-IJNDGTX num] [-csdvwh]\n" );
1817 fprintf( pAbc->Err,
"\t selectively decreases gate sizes while maintaining delay\n" );
1818 fprintf( pAbc->Err,
"\t-I <num> : the number of downsizing iterations to perform [default = %d]\n", pPars->
nIters );
1819 fprintf( pAbc->Err,
"\t-J <num> : the number of iterations without improvement to stop [default = %d]\n", pPars->
nIterNoChange );
1820 fprintf( pAbc->Err,
"\t-N <num> : limit on discrete downsizing steps at a node [default = %d]\n", pPars->
Notches );
1821 fprintf( pAbc->Err,
"\t-D <num> : delay target set by the user, in picoseconds [default = %d]\n", pPars->
DelayUser );
1822 fprintf( pAbc->Err,
"\t-G <num> : delay gap during updating, in picoseconds [default = %d]\n", pPars->
DelayGap );
1823 fprintf( pAbc->Err,
"\t-T <num> : approximate timeout in seconds [default = %d]\n", pPars->
TimeOut );
1824 fprintf( pAbc->Err,
"\t-X <num> : ratio for buffer tree estimation [default = %d]\n", pPars->
BuffTreeEst );
1825 fprintf( pAbc->Err,
"\t-c : toggle using wire-loads if specified [default = %s]\n", pPars->
fUseWireLoads?
"yes":
"no" );
1826 fprintf( pAbc->Err,
"\t-s : toggle using slack based on departure times [default = %s]\n", pPars->
fUseDept?
"yes":
"no" );
1827 fprintf( pAbc->Err,
"\t-d : toggle dumping statistics into a file [default = %s]\n", pPars->
fDumpStats?
"yes":
"no" );
1828 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", pPars->
fVerbose?
"yes":
"no" );
1829 fprintf( pAbc->Err,
"\t-w : toggle printing more verbose information [default = %s]\n", pPars->
fVeryVerbose?
"yes":
"no" );
1830 fprintf( pAbc->Err,
"\t-h : print the command usage\n");
1845int Scl_CommandPrintBuf(
Abc_Frame_t * pAbc,
int argc,
char **argv )
1848 int c, fVerbose = 0;
1866 fprintf( pAbc->Err,
"There is no current network.\n" );
1871 fprintf( pAbc->Err,
"The current network is not mapped.\n" );
1876 fprintf( pAbc->Err,
"The current network is not in a topo order (run \"topo\").\n" );
1881 Abc_Print( -1,
"Library delay info is not available.\n" );
1889 fprintf( pAbc->Err,
"usage: print_buf [-vh]\n" );
1890 fprintf( pAbc->Err,
"\t prints buffers trees of the current design\n" );
1891 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1892 fprintf( pAbc->Err,
"\t-h : print the command usage\n");
1907int Scl_CommandReadConstr(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1914 int fUseNewFormat = 0;
1915 int c, fVerbose = 0;
1939 if ( (pFile = fopen( pFileName,
"rb" )) == NULL )
1941 fprintf( pAbc->Err,
"Cannot open input file \"%s\". \n", pFileName );
1946 if ( !fUseNewFormat )
1952 fprintf( pAbc->Err,
"There is no current network.\n" );
1959 if ( pCon ) Scl_ConUpdateMan( pAbc, pCon );
1965 fprintf( pAbc->Err,
"usage: read_constr [-nvh] <file>\n" );
1966 fprintf( pAbc->Err,
"\t read file with timing constraints for standard-cell designs\n" );
1967 fprintf( pAbc->Err,
"\t-n : toggle using new constraint file format [default = %s]\n", fUseNewFormat?
"yes":
"no" );
1968 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1969 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1970 fprintf( pAbc->Err,
"\t<file> : the name of a file to read\n" );
1985int Scl_CommandWriteConstr(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1987 Scl_Con_t * pCon = Scl_ConGetMan( pAbc );
1988 char * pFileName = NULL;
1989 int c, fVerbose = 0;
2006 Abc_Print( 1,
"Scl_CommandWriteConstr(): There is no constraint manager.\n" );
2015 printf(
"Output file name should be given on the command line.\n" );
2020 Scl_ConWrite( pCon, pFileName );
2023 printf(
"Scl_CommandWriteConstr(): Unrecognized output file extension.\n" );
2029 fprintf( pAbc->Err,
"usage: write_constr [-vh] <file>\n" );
2030 fprintf( pAbc->Err,
"\t writes current timing constraints into a file\n" );
2031 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
2032 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
2033 fprintf( pAbc->Err,
"\t<file> : the name of a file to read\n" );
2048int Scl_CommandPrintConstr(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
2050 Scl_Con_t * pCon = Scl_ConGetMan( pAbc );
2051 int c, fVerbose = 0;
2069 if ( pCon ) Scl_ConWrite( pCon, NULL );
2073 fprintf( pAbc->Err,
"usage: print_constr [-vh] <file>\n" );
2074 fprintf( pAbc->Err,
"\t prints current timing constraints\n" );
2075 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
2076 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
2077 fprintf( pAbc->Err,
"\t<file> : the name of a file to read\n" );
2092int Scl_CommandResetConstr(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
2094 int c, fVerbose = 0;
2112 Scl_ConUpdateMan( pAbc, NULL );
2116 fprintf( pAbc->Err,
"usage: reset_constr [-vh] <file>\n" );
2117 fprintf( pAbc->Err,
"\t removes current timing constraints\n" );
2118 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
2119 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
2120 fprintf( pAbc->Err,
"\t<file> : the name of a file to read\n" );
Abc_Nam_t * Abc_NtkNameMan(Abc_Ntk_t *p, int fOuts)
ABC_DLL Abc_Ntk_t * Abc_NtkDupDfs(Abc_Ntk_t *pNtk)
struct Abc_Ntk_t_ Abc_Ntk_t
#define ABC_ALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
ABC_DLL Abc_Frame_t * Abc_FrameGetGlobalFrame()
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
ABC_DLL void Abc_FrameSetDrivingCell(char *pName)
ABC_DLL void Abc_FrameSetMaxLoad(float Load)
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
void Cmd_CommandAdd(Abc_Frame_t *pAbc, const char *sGroup, const char *sName, Cmd_CommandFuncType pFunc, int fChanges)
void Mio_LibraryTransferCellIds()
Abc_Ntk_t * Abc_SclBufferingPerform(Abc_Ntk_t *pNtk, SC_Lib *pLib, SC_BusPars *pPars)
Abc_Ntk_t * Abc_SclUnBufferPerform(Abc_Ntk_t *pNtk, int fVerbose)
Abc_Ntk_t * Abc_SclBufPerform(Abc_Ntk_t *pNtk, int FanMin, int FanMax, int fBufPis, int fSkipDup, int fVerbose)
Abc_Ntk_t * Abc_SclUnBufferPhase(Abc_Ntk_t *pNtk, int fVerbose)
int Abc_SclCheckNtk(Abc_Ntk_t *p, int fVerbose)
Abc_Ntk_t * Abc_SclBufferPhase(Abc_Ntk_t *pNtk, int fVerbose)
Abc_Ntk_t * Abc_SclPerformBuffering(Abc_Ntk_t *p, int DegreeR, int Degree, int fUseInvs, int fVerbose)
typedefABC_NAMESPACE_HEADER_START struct Scl_Con_t_ Scl_Con_t
DECLARATIONS ///.
void Abc_SclDnsizePerform(SC_Lib *pLib, Abc_Ntk_t *pNtk, SC_SizePars *pPars, void *pFuncFanin)
void Abc_SclWriteScl(char *pFileName, SC_Lib *p)
struct SC_SizePars_ SC_SizePars
#define SC_LibForEachCell(p, pCell, i)
int Abc_SclLibClassNum(SC_Lib *pLib)
struct SC_DontUse_ SC_DontUse
SC_Lib * Abc_SclMergeLibraries(SC_Lib *pLib1, SC_Lib *pLib2, int fUsePrefix)
struct SC_BusPars_ SC_BusPars
void Abc_SclWriteLiberty(char *pFileName, SC_Lib *p)
void Abc_SclShortNames(SC_Lib *p)
void Abc_SclConvertLeakageIntoArea(SC_Lib *p, float A, float B)
SC_Lib * Abc_SclReadFromFile(char *pFileName)
void Abc_SclPrintCells(SC_Lib *p, float Slew, float Gain, int fInvOnly, int fShort)
float Abc_SclComputeAverageSlew(SC_Lib *p)
void Abc_SclInstallGenlib(void *pScl, float Slew, float Gain, int fUseAll, int nGatesMin)
int Abc_SclHasDelayInfo(void *pScl)
void Abc_SclDumpGenlib(char *pFileName, SC_Lib *p, float Slew, float Gain, int nGatesMin)
SC_Lib * Abc_SclReadLiberty(char *pFileName, int fVerbose, int fVeryVerbose, SC_DontUse dont_use, int fSkipMultiOuts)
void Abc_SclPrintBuffers(SC_Lib *pLib, Abc_Ntk_t *pNtk, int fVerbose)
void Abc_SclTimePerform(SC_Lib *pLib, Abc_Ntk_t *pNtk, int nTreeCRatio, int fUseWireLoads, int fShowAll, int fPrintPath, int fDumpStats)
void Abc_SclUpsizePerform(SC_Lib *pLib, Abc_Ntk_t *pNtk, SC_SizePars *pPars, void *pFuncFanin)
void Abc_SclPrintGateSizes(SC_Lib *pLib, Abc_Ntk_t *p)
void Abc_SclMinsizePerform(SC_Lib *pLib, Abc_Ntk_t *p, int fUseMax, int fVerbose)
void Abc_SclReadTimingConstr(Abc_Frame_t *pAbc, char *pFileName, int fVerbose)
void Scl_Init(Abc_Frame_t *pAbc)
Scl_Con_t * Scl_ConReadMan()
void Abc_SclLoad(SC_Lib *pLib, SC_Lib **ppScl)
FUNCTION DEFINITIONS ///.
SC_Lib * Scl_ReadLibraryFile(Abc_Frame_t *pAbc, char *pFileName, int fVerbose, int fVeryVerbose, SC_DontUse dont_use, int fSkipMultiOuts)
void Scl_End(Abc_Frame_t *pAbc)
typedefABC_NAMESPACE_HEADER_START struct Abc_Nam_t_ Abc_Nam_t
INCLUDES ///.