2012-08-25 06:31:46 +02:00
|
|
|
/**CFile****************************************************************
|
|
|
|
|
|
|
|
|
|
FileName [scl.c]
|
|
|
|
|
|
|
|
|
|
SystemName [ABC: Logic synthesis and verification system.]
|
|
|
|
|
|
2012-08-30 01:20:39 +02:00
|
|
|
PackageName [Standard-cell library representation.]
|
|
|
|
|
|
|
|
|
|
Synopsis [Relevant command handlers.]
|
2012-08-25 06:31:46 +02:00
|
|
|
|
|
|
|
|
Author [Alan Mishchenko, Niklas Een]
|
|
|
|
|
|
|
|
|
|
Affiliation [UC Berkeley]
|
|
|
|
|
|
|
|
|
|
Date [Ver. 1.0. Started - August 24, 2012.]
|
|
|
|
|
|
|
|
|
|
Revision [$Id: scl.c,v 1.0 2012/08/24 00:00:00 alanmi Exp $]
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
2013-07-22 02:55:15 +02:00
|
|
|
#include "sclSize.h"
|
2012-08-25 06:31:46 +02:00
|
|
|
#include "base/main/mainInt.h"
|
|
|
|
|
|
|
|
|
|
ABC_NAMESPACE_IMPL_START
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// DECLARATIONS ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2012-09-20 21:01:04 +02:00
|
|
|
static int Scl_CommandRead ( Abc_Frame_t * pAbc, int argc, char **argv );
|
|
|
|
|
static int Scl_CommandWrite ( Abc_Frame_t * pAbc, int argc, char **argv );
|
2013-07-24 01:15:03 +02:00
|
|
|
static int Scl_CommandPrintScl( Abc_Frame_t * pAbc, int argc, char **argv );
|
2013-07-24 03:02:17 +02:00
|
|
|
static int Scl_CommandDumpGen ( Abc_Frame_t * pAbc, int argc, char **argv );
|
2012-09-20 21:01:04 +02:00
|
|
|
static int Scl_CommandPrintGS ( Abc_Frame_t * pAbc, int argc, char **argv );
|
|
|
|
|
static int Scl_CommandStime ( Abc_Frame_t * pAbc, int argc, char **argv );
|
|
|
|
|
static int Scl_CommandTopo ( Abc_Frame_t * pAbc, int argc, char **argv );
|
|
|
|
|
static int Scl_CommandBuffer ( Abc_Frame_t * pAbc, int argc, char **argv );
|
2013-07-30 06:01:05 +02:00
|
|
|
static int Scl_CommandUnBuffer( Abc_Frame_t * pAbc, int argc, char **argv );
|
2012-09-20 21:01:04 +02:00
|
|
|
static int Scl_CommandUpsize ( Abc_Frame_t * pAbc, int argc, char **argv );
|
2013-07-21 04:11:29 +02:00
|
|
|
static int Scl_CommandDnsize ( Abc_Frame_t * pAbc, int argc, char **argv );
|
2012-09-20 21:01:04 +02:00
|
|
|
static int Scl_CommandMinsize ( Abc_Frame_t * pAbc, int argc, char **argv );
|
2013-07-30 06:01:05 +02:00
|
|
|
static int Scl_CommandMaxsize ( Abc_Frame_t * pAbc, int argc, char **argv );
|
2013-07-21 04:11:29 +02:00
|
|
|
static int Scl_CommandPrintBuf( Abc_Frame_t * pAbc, int argc, char **argv );
|
2012-08-29 04:42:53 +02:00
|
|
|
|
2012-08-25 06:31:46 +02:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// FUNCTION DEFINITIONS ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
void Scl_Init( Abc_Frame_t * pAbc )
|
|
|
|
|
{
|
2013-07-22 22:25:51 +02:00
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "read_scl", Scl_CommandRead, 0 );
|
|
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "write_scl", Scl_CommandWrite, 0 );
|
2013-07-24 01:15:03 +02:00
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "print_scl", Scl_CommandPrintScl, 0 );
|
|
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "dump_genlib", Scl_CommandDumpGen, 0 );
|
2013-07-22 22:25:51 +02:00
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "print_gs", Scl_CommandPrintGS, 0 );
|
|
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "stime", Scl_CommandStime, 0 );
|
|
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "topo", Scl_CommandTopo, 1 );
|
|
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "buffer", Scl_CommandBuffer, 1 );
|
2013-07-30 06:01:05 +02:00
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "unbuffer", Scl_CommandUnBuffer, 1 );
|
2013-07-22 22:25:51 +02:00
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "minsize", Scl_CommandMinsize, 1 );
|
2013-07-30 06:01:05 +02:00
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "maxsize", Scl_CommandMaxsize, 1 );
|
2013-07-22 22:25:51 +02:00
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "upsize", Scl_CommandUpsize, 1 );
|
|
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "dnsize", Scl_CommandDnsize, 1 );
|
|
|
|
|
Cmd_CommandAdd( pAbc, "SCL mapping", "print_buf", Scl_CommandPrintBuf, 0 );
|
2012-08-25 06:31:46 +02:00
|
|
|
}
|
|
|
|
|
void Scl_End( Abc_Frame_t * pAbc )
|
|
|
|
|
{
|
2012-08-29 09:48:36 +02:00
|
|
|
Abc_SclLoad( NULL, (SC_Lib **)&pAbc->pLibScl );
|
2012-08-25 06:31:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|
|
|
|
{
|
|
|
|
|
char * pFileName;
|
|
|
|
|
FILE * pFile;
|
2012-09-04 21:22:59 +02:00
|
|
|
int c, fVerbose = 0;
|
2012-08-25 06:31:46 +02:00
|
|
|
|
|
|
|
|
Extra_UtilGetoptReset();
|
2012-09-04 21:22:59 +02:00
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
|
2012-08-25 06:31:46 +02:00
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
2012-09-04 21:22:59 +02:00
|
|
|
case 'v':
|
|
|
|
|
fVerbose ^= 1;
|
|
|
|
|
break;
|
2012-08-25 06:31:46 +02:00
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( argc != globalUtilOptind + 1 )
|
|
|
|
|
goto usage;
|
|
|
|
|
|
|
|
|
|
// get the input file name
|
|
|
|
|
pFileName = argv[globalUtilOptind];
|
2012-08-25 21:34:54 +02:00
|
|
|
if ( (pFile = fopen( pFileName, "rb" )) == NULL )
|
2012-08-25 06:31:46 +02:00
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "Cannot open input file \"%s\". \n", pFileName );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
fclose( pFile );
|
|
|
|
|
|
2012-08-25 21:34:54 +02:00
|
|
|
// read new library
|
2012-08-29 09:48:36 +02:00
|
|
|
Abc_SclLoad( pFileName, (SC_Lib **)&pAbc->pLibScl );
|
2012-09-04 21:22:59 +02:00
|
|
|
if ( fVerbose )
|
2012-10-04 06:49:18 +02:00
|
|
|
Abc_SclWriteText( "scl_out.txt", (SC_Lib *)pAbc->pLibScl );
|
2012-08-25 06:31:46 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
2012-09-04 21:22:59 +02:00
|
|
|
fprintf( pAbc->Err, "usage: read_scl [-vh] <file>\n" );
|
2012-08-25 06:31:46 +02:00
|
|
|
fprintf( pAbc->Err, "\t reads Liberty library from file\n" );
|
2012-09-04 21:22:59 +02:00
|
|
|
fprintf( pAbc->Err, "\t-v : toggle writing the result into file \"scl_out.txt\" [default = %s]\n", fVerbose? "yes": "no" );
|
2012-08-25 06:31:46 +02:00
|
|
|
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t<file> : the name of a file to read\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandWrite( Abc_Frame_t * pAbc, int argc, char **argv )
|
|
|
|
|
{
|
2012-08-25 21:34:54 +02:00
|
|
|
FILE * pFile;
|
2012-08-25 06:31:46 +02:00
|
|
|
char * pFileName;
|
|
|
|
|
int c;
|
|
|
|
|
|
|
|
|
|
Extra_UtilGetoptReset();
|
|
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
|
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
|
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( argc != globalUtilOptind + 1 )
|
|
|
|
|
goto usage;
|
|
|
|
|
if ( pAbc->pLibScl == NULL )
|
|
|
|
|
{
|
2012-08-27 02:32:22 +02:00
|
|
|
fprintf( pAbc->Err, "There is no Liberty library available.\n" );
|
2012-08-25 06:31:46 +02:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
// get the input file name
|
|
|
|
|
pFileName = argv[globalUtilOptind];
|
2012-08-25 21:34:54 +02:00
|
|
|
if ( (pFile = fopen( pFileName, "wb" )) == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "Cannot open output file \"%s\". \n", pFileName );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
fclose( pFile );
|
|
|
|
|
|
|
|
|
|
// save current library
|
2012-08-29 09:48:36 +02:00
|
|
|
Abc_SclSave( pFileName, (SC_Lib *)pAbc->pLibScl );
|
2012-08-25 06:31:46 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
|
|
|
|
fprintf( pAbc->Err, "usage: write_scl [-h] <file>\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t write Liberty library into file\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t<file> : the name of the file to write\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-28 04:58:15 +02:00
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
2013-07-24 01:15:03 +02:00
|
|
|
int Scl_CommandPrintScl( Abc_Frame_t * pAbc, int argc, char **argv )
|
2012-08-28 04:58:15 +02:00
|
|
|
{
|
2013-07-24 01:15:03 +02:00
|
|
|
float Slew = 200;
|
|
|
|
|
float Gain = 100;
|
2012-08-28 04:58:15 +02:00
|
|
|
int c;
|
|
|
|
|
Extra_UtilGetoptReset();
|
2013-07-24 01:15:03 +02:00
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "SGh" ) ) != EOF )
|
2012-08-28 04:58:15 +02:00
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
2013-07-24 01:15:03 +02:00
|
|
|
case 'S':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-S\" should be followed by a floating point number.\n" );
|
2012-08-28 04:58:15 +02:00
|
|
|
goto usage;
|
2013-07-24 01:15:03 +02:00
|
|
|
}
|
|
|
|
|
Slew = (float)atof(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
if ( Slew <= 0.0 )
|
2012-08-28 04:58:15 +02:00
|
|
|
goto usage;
|
2013-07-24 01:15:03 +02:00
|
|
|
break;
|
|
|
|
|
case 'G':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-G\" should be followed by a floating point number.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
Gain = (float)atof(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
if ( Gain <= 0.0 )
|
|
|
|
|
goto usage;
|
|
|
|
|
break;
|
|
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
2012-08-28 04:58:15 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( pAbc->pLibScl == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no Liberty library available.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// save current library
|
2013-07-24 01:15:03 +02:00
|
|
|
Abc_SclPrintCells( (SC_Lib *)pAbc->pLibScl, Slew, Gain );
|
2012-08-28 04:58:15 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
2013-07-24 01:15:03 +02:00
|
|
|
fprintf( pAbc->Err, "usage: print_scl [-SG float] [-h]\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t prints statistics of Liberty library\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-S float : the slew parameter used to generate the library [default = %.2f]\n", Slew );
|
|
|
|
|
fprintf( pAbc->Err, "\t-G float : the gain parameter used to generate the library [default = %.2f]\n", Gain );
|
|
|
|
|
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandDumpGen( Abc_Frame_t * pAbc, int argc, char **argv )
|
|
|
|
|
{
|
|
|
|
|
char * pFileName = NULL;
|
2013-07-24 03:02:17 +02:00
|
|
|
float Slew = 200;
|
|
|
|
|
float Gain = 100;
|
2013-07-24 01:15:03 +02:00
|
|
|
int nGatesMin = 4;
|
|
|
|
|
int c, fVerbose = 0;
|
|
|
|
|
Extra_UtilGetoptReset();
|
|
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "SGMvh" ) ) != EOF )
|
|
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
|
|
|
|
case 'S':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-S\" should be followed by a floating point number.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
Slew = (float)atof(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
if ( Slew <= 0.0 )
|
|
|
|
|
goto usage;
|
|
|
|
|
break;
|
|
|
|
|
case 'G':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-G\" should be followed by a floating point number.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
Gain = (float)atof(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
if ( Gain <= 0.0 )
|
|
|
|
|
goto usage;
|
|
|
|
|
break;
|
|
|
|
|
case 'M':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
nGatesMin = atoi(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
if ( nGatesMin < 0 )
|
|
|
|
|
goto usage;
|
|
|
|
|
break;
|
|
|
|
|
case 'v':
|
|
|
|
|
fVerbose ^= 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( pAbc->pLibScl == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no Liberty library available.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
if ( argc == globalUtilOptind + 1 )
|
|
|
|
|
pFileName = argv[globalUtilOptind];
|
|
|
|
|
Abc_SclDumpGenlib( pFileName, (SC_Lib *)pAbc->pLibScl, Slew, Gain, nGatesMin );
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
|
|
|
|
fprintf( pAbc->Err, "usage: dump_genlib [-SG float] [-M num] [-vh] <file>\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t writes GENLIB file for SCL library\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-S float : the slew parameter used to generate the library [default = %.2f]\n", Slew );
|
|
|
|
|
fprintf( pAbc->Err, "\t-G float : the gain parameter used to generate the library [default = %.2f]\n", Gain );
|
|
|
|
|
fprintf( pAbc->Err, "\t-M num : skip gate classes whose size is less than this [default = %d]\n", nGatesMin );
|
|
|
|
|
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-h : print the command usage\n");
|
|
|
|
|
fprintf( pAbc->Err, "\t<file> : optional GENLIB file name\n");
|
2012-08-28 04:58:15 +02:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-31 18:26:26 +02:00
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandPrintGS( Abc_Frame_t * pAbc, int argc, char **argv )
|
|
|
|
|
{
|
|
|
|
|
int c;
|
|
|
|
|
|
|
|
|
|
Extra_UtilGetoptReset();
|
|
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
|
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
|
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( Abc_FrameReadNtk(pAbc) == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no current network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_NtkHasMapping(Abc_FrameReadNtk(pAbc)) )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "The current network is not mapped.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( pAbc->pLibScl == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no Liberty library available.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// save current library
|
2012-10-04 06:49:18 +02:00
|
|
|
Abc_SclPrintGateSizes( (SC_Lib *)pAbc->pLibScl, Abc_FrameReadNtk(pAbc) );
|
2012-08-31 18:26:26 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
|
|
|
|
fprintf( pAbc->Err, "usage: print_gs [-h]\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t prints gate sizes in the current mapping\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-26 04:00:26 +02:00
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandStime( Abc_Frame_t * pAbc, int argc, char **argv )
|
|
|
|
|
{
|
|
|
|
|
int c;
|
2013-07-21 04:11:29 +02:00
|
|
|
int fShowAll = 0;
|
2012-09-04 21:22:59 +02:00
|
|
|
int fUseWireLoads = 1;
|
2013-07-24 01:15:03 +02:00
|
|
|
int fPrintPath = 0;
|
2013-07-21 04:11:29 +02:00
|
|
|
int fDumpStats = 0;
|
2012-08-26 04:00:26 +02:00
|
|
|
|
|
|
|
|
Extra_UtilGetoptReset();
|
2013-07-24 01:15:03 +02:00
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "capdh" ) ) != EOF )
|
2012-08-26 04:00:26 +02:00
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
2012-09-04 21:22:59 +02:00
|
|
|
case 'c':
|
|
|
|
|
fUseWireLoads ^= 1;
|
|
|
|
|
break;
|
2012-08-30 01:20:39 +02:00
|
|
|
case 'a':
|
|
|
|
|
fShowAll ^= 1;
|
|
|
|
|
break;
|
2013-07-24 01:15:03 +02:00
|
|
|
case 'p':
|
|
|
|
|
fPrintPath ^= 1;
|
2012-09-17 06:40:20 +02:00
|
|
|
break;
|
2012-10-09 20:19:58 +02:00
|
|
|
case 'd':
|
|
|
|
|
fDumpStats ^= 1;
|
|
|
|
|
break;
|
2012-08-26 04:00:26 +02:00
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Abc_FrameReadNtk(pAbc) == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no current network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_NtkHasMapping(Abc_FrameReadNtk(pAbc)) )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "The current network is not mapped.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2012-08-29 04:42:53 +02:00
|
|
|
if ( !Abc_SclCheckNtk(Abc_FrameReadNtk(pAbc), 0) )
|
|
|
|
|
{
|
2013-05-25 07:35:22 +02:00
|
|
|
fprintf( pAbc->Err, "The current network is not in a topo order (run \"topo\").\n" );
|
2012-08-29 04:42:53 +02:00
|
|
|
return 1;
|
|
|
|
|
}
|
2012-08-26 04:00:26 +02:00
|
|
|
if ( pAbc->pLibScl == NULL )
|
|
|
|
|
{
|
2012-08-27 02:32:22 +02:00
|
|
|
fprintf( pAbc->Err, "There is no Liberty library available.\n" );
|
2012-08-26 04:00:26 +02:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-24 01:15:03 +02:00
|
|
|
Abc_SclTimePerform( (SC_Lib *)pAbc->pLibScl, Abc_FrameReadNtk(pAbc), fUseWireLoads, fShowAll, fPrintPath, fDumpStats );
|
2012-08-26 04:00:26 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
2013-07-24 01:15:03 +02:00
|
|
|
fprintf( pAbc->Err, "usage: stime [-capdh]\n" );
|
2012-08-26 04:00:26 +02:00
|
|
|
fprintf( pAbc->Err, "\t performs STA using Liberty library\n" );
|
2012-09-04 21:22:59 +02:00
|
|
|
fprintf( pAbc->Err, "\t-c : toggle using wire-loads if specified [default = %s]\n", fUseWireLoads? "yes": "no" );
|
2012-08-30 01:20:39 +02:00
|
|
|
fprintf( pAbc->Err, "\t-a : display timing information for all nodes [default = %s]\n", fShowAll? "yes": "no" );
|
2013-07-24 01:15:03 +02:00
|
|
|
fprintf( pAbc->Err, "\t-p : display timing information for critical path [default = %s]\n", fPrintPath? "yes": "no" );
|
2012-10-09 20:19:58 +02:00
|
|
|
fprintf( pAbc->Err, "\t-d : toggle dumping statistics into a file [default = %s]\n", fDumpStats? "yes": "no" );
|
2012-08-26 04:00:26 +02:00
|
|
|
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-04 21:22:59 +02:00
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandTopo( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|
|
|
|
{
|
|
|
|
|
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
|
|
|
|
Abc_Ntk_t * pNtkRes;
|
|
|
|
|
int c, fVerbose = 0;
|
|
|
|
|
Extra_UtilGetoptReset();
|
|
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
|
|
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
|
|
|
|
case 'v':
|
|
|
|
|
fVerbose ^= 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( pNtk == NULL )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Empty network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_NtkIsLogic(pNtk) )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "This command can only be applied to a logic network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// modify the current network
|
|
|
|
|
pNtkRes = Abc_NtkDupDfs( pNtk );
|
|
|
|
|
if ( pNtkRes == NULL )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "The command has failed.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
// replace the current network
|
|
|
|
|
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
|
|
|
|
fprintf( pAbc->Err, "usage: topo [-vh]\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t rearranges nodes to be in a topological order\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-h : print the command usage\n");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-29 04:24:13 +02:00
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|
|
|
|
{
|
|
|
|
|
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
|
|
|
|
Abc_Ntk_t * pNtkRes;
|
2013-08-03 08:23:45 +02:00
|
|
|
int FanMin, FanMax, fUseInvs, fBufPis;
|
2012-08-29 04:24:13 +02:00
|
|
|
int c, fVerbose;
|
2013-07-29 19:10:21 +02:00
|
|
|
int fOldAlgo = 0;
|
2013-07-30 03:55:13 +02:00
|
|
|
FanMin = 6;
|
|
|
|
|
FanMax = 14;
|
|
|
|
|
fUseInvs = 0;
|
2013-08-03 08:23:45 +02:00
|
|
|
fBufPis = 0;
|
2013-07-30 03:55:13 +02:00
|
|
|
fVerbose = 0;
|
2012-08-29 04:24:13 +02:00
|
|
|
Extra_UtilGetoptReset();
|
2013-08-03 08:23:45 +02:00
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "NMaipvh" ) ) != EOF )
|
2012-08-29 04:24:13 +02:00
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
|
|
|
|
case 'N':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
2013-07-30 03:55:13 +02:00
|
|
|
FanMin = atoi(argv[globalUtilOptind]);
|
2012-08-29 04:24:13 +02:00
|
|
|
globalUtilOptind++;
|
2013-07-30 03:55:13 +02:00
|
|
|
if ( FanMin < 0 )
|
|
|
|
|
goto usage;
|
|
|
|
|
break;
|
|
|
|
|
case 'M':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
FanMax = atoi(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
if ( FanMax < 0 )
|
2012-08-29 04:24:13 +02:00
|
|
|
goto usage;
|
|
|
|
|
break;
|
2013-07-29 19:10:21 +02:00
|
|
|
case 'a':
|
|
|
|
|
fOldAlgo ^= 1;
|
|
|
|
|
break;
|
2013-07-24 01:15:03 +02:00
|
|
|
case 'i':
|
|
|
|
|
fUseInvs ^= 1;
|
|
|
|
|
break;
|
2013-08-03 08:23:45 +02:00
|
|
|
case 'p':
|
|
|
|
|
fBufPis ^= 1;
|
|
|
|
|
break;
|
2012-08-29 04:24:13 +02:00
|
|
|
case 'v':
|
|
|
|
|
fVerbose ^= 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( pNtk == NULL )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Empty network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_NtkIsLogic(pNtk) )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "This command can only be applied to a logic network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// modify the current network
|
2013-07-29 19:10:21 +02:00
|
|
|
if ( fOldAlgo )
|
2013-07-30 03:55:13 +02:00
|
|
|
pNtkRes = Abc_SclPerformBuffering( pNtk, FanMax, fUseInvs, fVerbose );
|
2013-07-29 19:10:21 +02:00
|
|
|
else
|
2013-08-03 08:23:45 +02:00
|
|
|
pNtkRes = Abc_SclBufPerform( pNtk, FanMin, FanMax, fBufPis, fVerbose );
|
2012-08-29 04:24:13 +02:00
|
|
|
if ( pNtkRes == NULL )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "The command has failed.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
// replace the current network
|
|
|
|
|
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
2013-08-03 08:23:45 +02:00
|
|
|
fprintf( pAbc->Err, "usage: buffer [-NM num] [-aipvh]\n" );
|
2012-08-29 09:48:36 +02:00
|
|
|
fprintf( pAbc->Err, "\t performs buffering of the mapped network\n" );
|
2013-07-30 03:55:13 +02:00
|
|
|
fprintf( pAbc->Err, "\t-N <num> : the min fanout considered by the algorithm [default = %d]\n", FanMin );
|
|
|
|
|
fprintf( pAbc->Err, "\t-M <num> : the max allowed fanout count of node/buffer [default = %d]\n", FanMax );
|
2013-07-29 19:10:21 +02:00
|
|
|
fprintf( pAbc->Err, "\t-a : toggle using old algorithm [default = %s]\n", fOldAlgo? "yes": "no" );
|
2013-07-24 01:15:03 +02:00
|
|
|
fprintf( pAbc->Err, "\t-i : toggle using interters instead of buffers [default = %s]\n", fUseInvs? "yes": "no" );
|
2013-08-03 08:23:45 +02:00
|
|
|
fprintf( pAbc->Err, "\t-p : toggle buffering primary inputs [default = %s]\n", fBufPis? "yes": "no" );
|
2012-08-30 01:20:39 +02:00
|
|
|
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
|
2012-08-29 09:48:36 +02:00
|
|
|
fprintf( pAbc->Err, "\t-h : print the command usage\n");
|
2012-08-29 04:24:13 +02:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-30 06:01:05 +02:00
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandUnBuffer( Abc_Frame_t * pAbc, int argc, char **argv )
|
|
|
|
|
{
|
|
|
|
|
Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
|
|
|
|
|
int c, fVerbose = 0;
|
|
|
|
|
Extra_UtilGetoptReset();
|
|
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
|
|
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
|
|
|
|
case 'v':
|
|
|
|
|
fVerbose ^= 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( pNtk == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no current network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_NtkIsLogic(pNtk) )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "The current network is not a logic network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
pNtkRes = Abc_SclUnBufferPerform( pNtk, fVerbose );
|
|
|
|
|
if ( pNtkRes == NULL )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "The command has failed.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
|
|
|
|
fprintf( pAbc->Err, "usage: unbuffer [-vh]\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t collapses buffer/inverter trees\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-h : print the command usage\n");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-10-10 06:14:32 +02:00
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandMinsize( Abc_Frame_t * pAbc, int argc, char **argv )
|
|
|
|
|
{
|
|
|
|
|
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
2013-07-30 06:01:05 +02:00
|
|
|
int c, fVerbose = 0;
|
2012-10-10 06:14:32 +02:00
|
|
|
Extra_UtilGetoptReset();
|
2013-07-30 06:01:05 +02:00
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
|
2012-10-10 06:14:32 +02:00
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
2013-07-30 06:01:05 +02:00
|
|
|
case 'v':
|
|
|
|
|
fVerbose ^= 1;
|
2013-07-21 08:19:28 +02:00
|
|
|
break;
|
2013-07-30 06:01:05 +02:00
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Abc_FrameReadNtk(pAbc) == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no current network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_NtkHasMapping(Abc_FrameReadNtk(pAbc)) )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "The current network is not mapped.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_SclCheckNtk(Abc_FrameReadNtk(pAbc), 0) )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "The current network is not in a topo order (run \"topo\").\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( pAbc->pLibScl == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no Liberty library available.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Abc_SclMinsizePerform( (SC_Lib *)pAbc->pLibScl, pNtk, 0, fVerbose );
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
|
|
|
|
fprintf( pAbc->Err, "usage: minsize [-vh]\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t downsizes all gates to their minimum size\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-h : print the command usage\n");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandMaxsize( Abc_Frame_t * pAbc, int argc, char **argv )
|
|
|
|
|
{
|
|
|
|
|
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
|
|
|
|
int c, fVerbose = 0;
|
|
|
|
|
Extra_UtilGetoptReset();
|
|
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
|
|
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
2012-10-10 06:14:32 +02:00
|
|
|
case 'v':
|
|
|
|
|
fVerbose ^= 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Abc_FrameReadNtk(pAbc) == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no current network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_NtkHasMapping(Abc_FrameReadNtk(pAbc)) )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "The current network is not mapped.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_SclCheckNtk(Abc_FrameReadNtk(pAbc), 0) )
|
|
|
|
|
{
|
2013-05-25 07:35:22 +02:00
|
|
|
fprintf( pAbc->Err, "The current network is not in a topo order (run \"topo\").\n" );
|
2012-10-10 06:14:32 +02:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( pAbc->pLibScl == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no Liberty library available.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-30 06:01:05 +02:00
|
|
|
Abc_SclMinsizePerform( (SC_Lib *)pAbc->pLibScl, pNtk, 1, fVerbose );
|
2012-10-10 06:14:32 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
2013-07-30 06:01:05 +02:00
|
|
|
fprintf( pAbc->Err, "usage: maxsize [-vh]\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t upsizes all gates to their maximum size\n" );
|
2012-10-10 06:14:32 +02:00
|
|
|
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-h : print the command usage\n");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-12 23:39:50 +02:00
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandUpsize( Abc_Frame_t * pAbc, int argc, char **argv )
|
|
|
|
|
{
|
2013-07-21 23:56:30 +02:00
|
|
|
SC_SizePars Pars, * pPars = &Pars;
|
2012-09-12 23:39:50 +02:00
|
|
|
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
2012-10-10 06:14:32 +02:00
|
|
|
int c;
|
2013-07-21 23:56:30 +02:00
|
|
|
memset( pPars, 0, sizeof(SC_SizePars) );
|
2012-10-10 06:14:32 +02:00
|
|
|
pPars->nIters = 1000;
|
|
|
|
|
pPars->nIterNoChange = 50;
|
|
|
|
|
pPars->Window = 2;
|
|
|
|
|
pPars->Ratio = 10;
|
2013-07-21 23:56:30 +02:00
|
|
|
pPars->Notches = 1000;
|
|
|
|
|
pPars->DelayUser = 0;
|
|
|
|
|
pPars->DelayGap = 0;
|
2012-10-10 06:14:32 +02:00
|
|
|
pPars->TimeOut = 0;
|
|
|
|
|
pPars->fUseDept = 1;
|
2013-07-21 08:19:28 +02:00
|
|
|
pPars->fUseWireLoads = 1;
|
2012-10-10 06:14:32 +02:00
|
|
|
pPars->fDumpStats = 0;
|
|
|
|
|
pPars->fVerbose = 0;
|
|
|
|
|
pPars->fVeryVerbose = 0;
|
2012-09-12 23:39:50 +02:00
|
|
|
Extra_UtilGetoptReset();
|
2013-07-21 23:56:30 +02:00
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "IJWRNDGTcsdvwh" ) ) != EOF )
|
2012-09-12 23:39:50 +02:00
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
2012-10-09 06:20:13 +02:00
|
|
|
case 'I':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
2012-10-10 06:14:32 +02:00
|
|
|
pPars->nIters = atoi(argv[globalUtilOptind]);
|
2012-10-09 23:27:49 +02:00
|
|
|
globalUtilOptind++;
|
2012-10-10 06:14:32 +02:00
|
|
|
if ( pPars->nIters < 0 )
|
2012-10-09 23:27:49 +02:00
|
|
|
goto usage;
|
|
|
|
|
break;
|
|
|
|
|
case 'J':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-J\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
2012-10-10 06:14:32 +02:00
|
|
|
pPars->nIterNoChange = atoi(argv[globalUtilOptind]);
|
2012-10-09 06:20:13 +02:00
|
|
|
globalUtilOptind++;
|
2012-10-10 06:14:32 +02:00
|
|
|
if ( pPars->nIterNoChange < 0 )
|
2012-10-09 06:20:13 +02:00
|
|
|
goto usage;
|
|
|
|
|
break;
|
2012-09-18 22:23:58 +02:00
|
|
|
case 'W':
|
2012-09-12 23:39:50 +02:00
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
2012-09-18 22:23:58 +02:00
|
|
|
Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
|
2012-09-12 23:39:50 +02:00
|
|
|
goto usage;
|
|
|
|
|
}
|
2012-10-10 06:14:32 +02:00
|
|
|
pPars->Window = atoi(argv[globalUtilOptind]);
|
2012-09-12 23:39:50 +02:00
|
|
|
globalUtilOptind++;
|
2012-10-10 06:14:32 +02:00
|
|
|
if ( pPars->Window < 0 )
|
2012-09-12 23:39:50 +02:00
|
|
|
goto usage;
|
|
|
|
|
break;
|
2012-09-18 22:23:58 +02:00
|
|
|
case 'R':
|
2012-09-12 23:39:50 +02:00
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
2012-09-18 22:23:58 +02:00
|
|
|
Abc_Print( -1, "Command line switch \"-R\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
2012-10-10 06:14:32 +02:00
|
|
|
pPars->Ratio = atoi(argv[globalUtilOptind]);
|
2012-09-18 22:23:58 +02:00
|
|
|
globalUtilOptind++;
|
2012-10-10 06:14:32 +02:00
|
|
|
if ( pPars->Ratio < 0 )
|
2012-09-18 22:23:58 +02:00
|
|
|
goto usage;
|
|
|
|
|
break;
|
2012-10-09 06:20:13 +02:00
|
|
|
case 'N':
|
2012-09-18 22:23:58 +02:00
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
2012-10-09 06:20:13 +02:00
|
|
|
Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
|
2012-09-12 23:39:50 +02:00
|
|
|
goto usage;
|
|
|
|
|
}
|
2012-10-10 06:14:32 +02:00
|
|
|
pPars->Notches = atoi(argv[globalUtilOptind]);
|
2012-09-12 23:39:50 +02:00
|
|
|
globalUtilOptind++;
|
2012-10-10 06:14:32 +02:00
|
|
|
if ( pPars->Notches < 0 )
|
2012-10-09 06:20:13 +02:00
|
|
|
goto usage;
|
|
|
|
|
break;
|
2013-07-21 23:56:30 +02:00
|
|
|
case 'D':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-D\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
pPars->DelayUser = atoi(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
if ( pPars->DelayUser < 0 )
|
|
|
|
|
goto usage;
|
|
|
|
|
break;
|
|
|
|
|
case 'G':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-G\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
pPars->DelayGap = atoi(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
break;
|
2012-10-09 06:20:13 +02:00
|
|
|
case 'T':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-T\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
2012-10-10 06:14:32 +02:00
|
|
|
pPars->TimeOut = atoi(argv[globalUtilOptind]);
|
2012-10-09 06:20:13 +02:00
|
|
|
globalUtilOptind++;
|
2012-10-10 06:14:32 +02:00
|
|
|
if ( pPars->TimeOut < 0 )
|
2012-09-12 23:39:50 +02:00
|
|
|
goto usage;
|
|
|
|
|
break;
|
2013-07-21 08:19:28 +02:00
|
|
|
case 'c':
|
|
|
|
|
pPars->fUseWireLoads ^= 1;
|
|
|
|
|
break;
|
2012-10-10 06:14:32 +02:00
|
|
|
case 's':
|
|
|
|
|
pPars->fUseDept ^= 1;
|
|
|
|
|
break;
|
2012-10-09 20:19:58 +02:00
|
|
|
case 'd':
|
2012-10-10 06:14:32 +02:00
|
|
|
pPars->fDumpStats ^= 1;
|
2012-10-09 20:19:58 +02:00
|
|
|
break;
|
2012-09-12 23:39:50 +02:00
|
|
|
case 'v':
|
2012-10-10 06:14:32 +02:00
|
|
|
pPars->fVerbose ^= 1;
|
2012-09-12 23:39:50 +02:00
|
|
|
break;
|
2012-10-09 06:20:13 +02:00
|
|
|
case 'w':
|
2012-10-10 06:14:32 +02:00
|
|
|
pPars->fVeryVerbose ^= 1;
|
2012-10-09 06:20:13 +02:00
|
|
|
break;
|
2012-09-12 23:39:50 +02:00
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Abc_FrameReadNtk(pAbc) == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no current network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_NtkHasMapping(Abc_FrameReadNtk(pAbc)) )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "The current network is not mapped.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_SclCheckNtk(Abc_FrameReadNtk(pAbc), 0) )
|
|
|
|
|
{
|
2013-05-25 07:35:22 +02:00
|
|
|
fprintf( pAbc->Err, "The current network is not in a topo order (run \"topo\").\n" );
|
2012-09-12 23:39:50 +02:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( pAbc->pLibScl == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no Liberty library available.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-10-10 06:14:32 +02:00
|
|
|
Abc_SclUpsizePerform( (SC_Lib *)pAbc->pLibScl, pNtk, pPars );
|
2012-09-12 23:39:50 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
2013-07-21 23:56:30 +02:00
|
|
|
fprintf( pAbc->Err, "usage: upsize [-IJWRNDGT num] [-csdvwh]\n" );
|
2012-10-10 06:14:32 +02:00
|
|
|
fprintf( pAbc->Err, "\t selectively increases gate sizes on the critical path\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-I <num> : the number of upsizing iterations to perform [default = %d]\n", pPars->nIters );
|
|
|
|
|
fprintf( pAbc->Err, "\t-J <num> : the number of iterations without improvement to stop [default = %d]\n", pPars->nIterNoChange );
|
|
|
|
|
fprintf( pAbc->Err, "\t-W <num> : delay window (in percent) of near-critical COs [default = %d]\n", pPars->Window );
|
|
|
|
|
fprintf( pAbc->Err, "\t-R <num> : ratio of critical nodes (in percent) to update [default = %d]\n", pPars->Ratio );
|
|
|
|
|
fprintf( pAbc->Err, "\t-N <num> : limit on discrete upsizing steps at a node [default = %d]\n", pPars->Notches );
|
2013-07-21 23:56:30 +02:00
|
|
|
fprintf( pAbc->Err, "\t-D <num> : delay target set by the user, in picoseconds [default = %d]\n", pPars->DelayUser );
|
|
|
|
|
fprintf( pAbc->Err, "\t-G <num> : delay gap during updating, in picoseconds [default = %d]\n", pPars->DelayGap );
|
2012-10-10 06:14:32 +02:00
|
|
|
fprintf( pAbc->Err, "\t-T <num> : approximate timeout in seconds [default = %d]\n", pPars->TimeOut );
|
2013-07-21 08:19:28 +02:00
|
|
|
fprintf( pAbc->Err, "\t-c : toggle using wire-loads if specified [default = %s]\n", pPars->fUseWireLoads? "yes": "no" );
|
2012-10-10 06:14:32 +02:00
|
|
|
fprintf( pAbc->Err, "\t-s : toggle using slack based on departure times [default = %s]\n", pPars->fUseDept? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-d : toggle dumping statistics into a file [default = %s]\n", pPars->fDumpStats? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-w : toggle printing more verbose information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
|
2012-09-20 21:01:04 +02:00
|
|
|
fprintf( pAbc->Err, "\t-h : print the command usage\n");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-21 04:11:29 +02:00
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandDnsize( Abc_Frame_t * pAbc, int argc, char **argv )
|
|
|
|
|
{
|
2013-07-21 23:56:30 +02:00
|
|
|
SC_SizePars Pars, * pPars = &Pars;
|
2013-07-21 04:11:29 +02:00
|
|
|
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
|
|
|
|
int c;
|
2013-07-21 23:56:30 +02:00
|
|
|
memset( pPars, 0, sizeof(SC_SizePars) );
|
2013-07-21 04:11:29 +02:00
|
|
|
pPars->nIters = 5;
|
|
|
|
|
pPars->nIterNoChange = 50;
|
2013-07-21 23:56:30 +02:00
|
|
|
pPars->Notches = 1000;
|
|
|
|
|
pPars->DelayUser = 0;
|
|
|
|
|
pPars->DelayGap = 1000;
|
2013-07-21 04:11:29 +02:00
|
|
|
pPars->TimeOut = 0;
|
|
|
|
|
pPars->fUseDept = 1;
|
2013-07-21 08:19:28 +02:00
|
|
|
pPars->fUseWireLoads = 1;
|
2013-07-21 04:11:29 +02:00
|
|
|
pPars->fDumpStats = 0;
|
|
|
|
|
pPars->fVerbose = 0;
|
|
|
|
|
pPars->fVeryVerbose = 0;
|
|
|
|
|
Extra_UtilGetoptReset();
|
2013-07-21 23:56:30 +02:00
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "IJNDGTcsdvwh" ) ) != EOF )
|
2013-07-21 04:11:29 +02:00
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
|
|
|
|
case 'I':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
pPars->nIters = atoi(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
if ( pPars->nIters < 0 )
|
|
|
|
|
goto usage;
|
|
|
|
|
break;
|
|
|
|
|
case 'J':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-J\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
pPars->nIterNoChange = atoi(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
if ( pPars->nIterNoChange < 0 )
|
|
|
|
|
goto usage;
|
|
|
|
|
break;
|
2013-07-21 23:56:30 +02:00
|
|
|
case 'N':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
pPars->Notches = atoi(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
if ( pPars->Notches < 0 )
|
|
|
|
|
goto usage;
|
|
|
|
|
break;
|
|
|
|
|
case 'D':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-D\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
pPars->DelayUser = atoi(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
if ( pPars->DelayUser < 0 )
|
|
|
|
|
goto usage;
|
|
|
|
|
break;
|
|
|
|
|
case 'G':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-G\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
pPars->DelayGap = atoi(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
break;
|
2013-07-21 04:11:29 +02:00
|
|
|
case 'T':
|
|
|
|
|
if ( globalUtilOptind >= argc )
|
|
|
|
|
{
|
|
|
|
|
Abc_Print( -1, "Command line switch \"-T\" should be followed by a positive integer.\n" );
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
pPars->TimeOut = atoi(argv[globalUtilOptind]);
|
|
|
|
|
globalUtilOptind++;
|
|
|
|
|
if ( pPars->TimeOut < 0 )
|
|
|
|
|
goto usage;
|
|
|
|
|
break;
|
2013-07-21 08:19:28 +02:00
|
|
|
case 'c':
|
|
|
|
|
pPars->fUseWireLoads ^= 1;
|
|
|
|
|
break;
|
2013-07-21 04:11:29 +02:00
|
|
|
case 's':
|
|
|
|
|
pPars->fUseDept ^= 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'd':
|
|
|
|
|
pPars->fDumpStats ^= 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'v':
|
|
|
|
|
pPars->fVerbose ^= 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'w':
|
|
|
|
|
pPars->fVeryVerbose ^= 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Abc_FrameReadNtk(pAbc) == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no current network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_NtkHasMapping(Abc_FrameReadNtk(pAbc)) )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "The current network is not mapped.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_SclCheckNtk(Abc_FrameReadNtk(pAbc), 0) )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "The current network is not in a topo order (run \"topo\").\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( pAbc->pLibScl == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no Liberty library available.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Abc_SclDnsizePerform( (SC_Lib *)pAbc->pLibScl, pNtk, pPars );
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
2013-07-21 23:56:30 +02:00
|
|
|
fprintf( pAbc->Err, "usage: dnsize [-IJNDGT num] [-csdvwh]\n" );
|
2013-07-21 04:11:29 +02:00
|
|
|
fprintf( pAbc->Err, "\t selectively decreases gate sizes while maintaining delay\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-I <num> : the number of upsizing iterations to perform [default = %d]\n", pPars->nIters );
|
|
|
|
|
fprintf( pAbc->Err, "\t-J <num> : the number of iterations without improvement to stop [default = %d]\n", pPars->nIterNoChange );
|
2013-07-21 23:56:30 +02:00
|
|
|
fprintf( pAbc->Err, "\t-N <num> : limit on discrete upsizing steps at a node [default = %d]\n", pPars->Notches );
|
|
|
|
|
fprintf( pAbc->Err, "\t-D <num> : delay target set by the user, in picoseconds [default = %d]\n", pPars->DelayUser );
|
|
|
|
|
fprintf( pAbc->Err, "\t-G <num> : delay gap during updating, in picoseconds [default = %d]\n", pPars->DelayGap );
|
2013-07-21 04:11:29 +02:00
|
|
|
fprintf( pAbc->Err, "\t-T <num> : approximate timeout in seconds [default = %d]\n", pPars->TimeOut );
|
2013-07-21 08:19:28 +02:00
|
|
|
fprintf( pAbc->Err, "\t-c : toggle using wire-loads if specified [default = %s]\n", pPars->fUseWireLoads? "yes": "no" );
|
2013-07-21 04:11:29 +02:00
|
|
|
fprintf( pAbc->Err, "\t-s : toggle using slack based on departure times [default = %s]\n", pPars->fUseDept? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-d : toggle dumping statistics into a file [default = %s]\n", pPars->fDumpStats? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-w : toggle printing more verbose information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-h : print the command usage\n");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
int Scl_CommandPrintBuf( Abc_Frame_t * pAbc, int argc, char **argv )
|
|
|
|
|
{
|
|
|
|
|
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
|
|
|
|
int c, fVerbose = 0;
|
|
|
|
|
Extra_UtilGetoptReset();
|
|
|
|
|
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
|
|
|
|
|
{
|
|
|
|
|
switch ( c )
|
|
|
|
|
{
|
|
|
|
|
case 'v':
|
|
|
|
|
fVerbose ^= 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'h':
|
|
|
|
|
goto usage;
|
|
|
|
|
default:
|
|
|
|
|
goto usage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( Abc_FrameReadNtk(pAbc) == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no current network.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_NtkHasMapping(Abc_FrameReadNtk(pAbc)) )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "The current network is not mapped.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( !Abc_SclCheckNtk(Abc_FrameReadNtk(pAbc), 0) )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "The current network is not in a topo order (run \"topo\").\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ( pAbc->pLibScl == NULL )
|
|
|
|
|
{
|
|
|
|
|
fprintf( pAbc->Err, "There is no Liberty library available.\n" );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Abc_SclPrintBuffers( (SC_Lib *)pAbc->pLibScl, pNtk, fVerbose );
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
usage:
|
|
|
|
|
fprintf( pAbc->Err, "usage: minsize [-vh]\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t downsized all gates to their minimum size\n" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
|
|
|
|
|
fprintf( pAbc->Err, "\t-h : print the command usage\n");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-25 06:31:46 +02:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// END OF FILE ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ABC_NAMESPACE_IMPL_END
|
|
|
|
|
|