diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-08-29 16:20:39 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-08-29 16:20:39 -0700 |
commit | 83bfe0b1fec515d9350ebd63f07f0ed742bb4745 (patch) | |
tree | 8fcfd00de92c20fc7e07011c70c8d6ffa8d9d537 /src/map/scl/scl.c | |
parent | 6814c48bb4e748add7e4ebd37f0d4d00312e0c5a (diff) | |
download | abc-83bfe0b1fec515d9350ebd63f07f0ed742bb4745.tar.gz abc-83bfe0b1fec515d9350ebd63f07f0ed742bb4745.tar.bz2 abc-83bfe0b1fec515d9350ebd63f07f0ed742bb4745.zip |
New package to read/write a subset of Liberty for STA.
Diffstat (limited to 'src/map/scl/scl.c')
-rw-r--r-- | src/map/scl/scl.c | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/src/map/scl/scl.c b/src/map/scl/scl.c index 91aaac5e..56fdd7ea 100644 --- a/src/map/scl/scl.c +++ b/src/map/scl/scl.c @@ -4,7 +4,9 @@ SystemName [ABC: Logic synthesis and verification system.] - Synopsis [Standard-cell library representation.] + PackageName [Standard-cell library representation.] + + Synopsis [Relevant command handlers.] Author [Alan Mishchenko, Niklas Een] @@ -17,7 +19,6 @@ ***********************************************************************/ #include "sclInt.h" -#include "scl.h" #include "base/main/mainInt.h" ABC_NAMESPACE_IMPL_START @@ -27,15 +28,12 @@ ABC_NAMESPACE_IMPL_START /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// -static int Scl_CommandRead ( Abc_Frame_t * pAbc, int argc, char **argv ); -static int Scl_CommandWrite ( Abc_Frame_t * pAbc, int argc, char **argv ); -static int Scl_CommandPrint ( Abc_Frame_t * pAbc, int argc, char **argv ); -static int Scl_CommandStime ( Abc_Frame_t * pAbc, int argc, char **argv ); -static int Scl_CommandGsize ( Abc_Frame_t * pAbc, int argc, char **argv ); -static int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char **argv ); - -extern int Abc_SclCheckNtk( Abc_Ntk_t * p, int fVerbose ); -extern Abc_Ntk_t * Abc_SclPerformBuffering( Abc_Ntk_t * p, int Degree, int fVerbose ); +static int Scl_CommandRead ( Abc_Frame_t * pAbc, int argc, char **argv ); +static int Scl_CommandWrite ( Abc_Frame_t * pAbc, int argc, char **argv ); +static int Scl_CommandPrint ( Abc_Frame_t * pAbc, int argc, char **argv ); +static int Scl_CommandStime ( Abc_Frame_t * pAbc, int argc, char **argv ); +static int Scl_CommandGsize ( Abc_Frame_t * pAbc, int argc, char **argv ); +static int Scl_CommandBuffer ( Abc_Frame_t * pAbc, int argc, char **argv ); //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// @@ -54,12 +52,12 @@ extern Abc_Ntk_t * Abc_SclPerformBuffering( Abc_Ntk_t * p, int Degree, int fVerb ***********************************************************************/ void Scl_Init( Abc_Frame_t * pAbc ) { - Cmd_CommandAdd( pAbc, "SC mapping", "read_scl", Scl_CommandRead, 0 ); - Cmd_CommandAdd( pAbc, "SC mapping", "write_scl", Scl_CommandWrite, 0 ); - Cmd_CommandAdd( pAbc, "SC mapping", "print_scl", Scl_CommandPrint, 0 ); - Cmd_CommandAdd( pAbc, "SC mapping", "stime", Scl_CommandStime, 0 ); - Cmd_CommandAdd( pAbc, "SC mapping", "gsize", Scl_CommandGsize, 1 ); - Cmd_CommandAdd( pAbc, "SC mapping", "buffer", Scl_CommandBuffer, 1 ); + Cmd_CommandAdd( pAbc, "SCL mapping", "read_scl", Scl_CommandRead, 0 ); + Cmd_CommandAdd( pAbc, "SCL mapping", "write_scl", Scl_CommandWrite, 0 ); + Cmd_CommandAdd( pAbc, "SCL mapping", "print_scl", Scl_CommandPrint, 0 ); + Cmd_CommandAdd( pAbc, "SCL mapping", "stime", Scl_CommandStime, 0 ); + Cmd_CommandAdd( pAbc, "SCL mapping", "gsize", Scl_CommandGsize, 1 ); + Cmd_CommandAdd( pAbc, "SCL mapping", "buffer", Scl_CommandBuffer, 1 ); } void Scl_End( Abc_Frame_t * pAbc ) { @@ -234,12 +232,16 @@ usage: int Scl_CommandStime( Abc_Frame_t * pAbc, int argc, char **argv ) { int c; + int fShowAll = 0; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "ah" ) ) != EOF ) { switch ( c ) { + case 'a': + fShowAll ^= 1; + break; case 'h': goto usage; default: @@ -268,12 +270,13 @@ int Scl_CommandStime( Abc_Frame_t * pAbc, int argc, char **argv ) return 1; } - Abc_SclTimePerform( pAbc->pLibScl, Abc_FrameReadNtk(pAbc) ); + Abc_SclTimePerform( pAbc->pLibScl, Abc_FrameReadNtk(pAbc), fShowAll ); return 0; usage: - fprintf( pAbc->Err, "usage: stime [-h]\n" ); + fprintf( pAbc->Err, "usage: stime [-ah]\n" ); fprintf( pAbc->Err, "\t performs STA using Liberty library\n" ); + fprintf( pAbc->Err, "\t-a : display timing information for all nodes [default = %s]\n", fShowAll? "yes": "no" ); fprintf( pAbc->Err, "\t-h : print the help massage\n" ); return 1; } @@ -291,11 +294,11 @@ usage: ***********************************************************************/ int Scl_CommandGsize( Abc_Frame_t * pAbc, int argc, char **argv ) { - int c; - int nSteps = 100; + int c, fVerbose = 0; + int nSteps = 100000; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF ) { switch ( c ) { @@ -310,6 +313,9 @@ int Scl_CommandGsize( Abc_Frame_t * pAbc, int argc, char **argv ) if ( nSteps <= 0 ) goto usage; break; + case 'v': + fVerbose ^= 1; + break; case 'h': goto usage; default: @@ -338,13 +344,14 @@ int Scl_CommandGsize( Abc_Frame_t * pAbc, int argc, char **argv ) return 1; } -// Abc_SclSizingPerform( pAbc->pLibScl, Abc_FrameReadNtk(pAbc), nSteps ); + Abc_SclSizingPerform( pAbc->pLibScl, Abc_FrameReadNtk(pAbc), nSteps, fVerbose ); return 0; usage: - fprintf( pAbc->Err, "usage: gsize [-N num] [-h]\n" ); + fprintf( pAbc->Err, "usage: gsize [-N num] [-vh]\n" ); fprintf( pAbc->Err, "\t performs gate sizing using Liberty library\n" ); - fprintf( pAbc->Err, "\t-N <num> : the number of refinement iterations [default = %d]\n", nSteps ); + fprintf( pAbc->Err, "\t-N <num> : the number of gate-sizing steps performed [default = %d]\n", nSteps ); + fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" ); fprintf( pAbc->Err, "\t-h : print the help massage\n" ); return 1; } @@ -366,7 +373,7 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Ntk_t * pNtkRes; int Degree; int c, fVerbose; - Degree = 3; + Degree = 4; fVerbose = 0; Extra_UtilGetoptReset(); while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF ) @@ -419,8 +426,8 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv ) usage: fprintf( pAbc->Err, "usage: buffer [-N num] [-vh]\n" ); fprintf( pAbc->Err, "\t performs buffering of the mapped network\n" ); - fprintf( pAbc->Err, "\t-N <num> : the number of refinement iterations [default = %d]\n", Degree ); - fprintf( pAbc->Err, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" ); + fprintf( pAbc->Err, "\t-N <num> : the max allowed fanout count of node/buffer [default = %d]\n", Degree ); + 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; } |