diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-07-29 18:55:13 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-07-29 18:55:13 -0700 |
commit | 1dca7458f3739ec6e2af7670cc340794c28b747d (patch) | |
tree | 3b09cf0da63eb3a5bc6271644d948765b7ab2953 /src/map/scl/scl.c | |
parent | 4c6804c3aea08f6aec693c686ec409191e983ca4 (diff) | |
download | abc-1dca7458f3739ec6e2af7670cc340794c28b747d.tar.gz abc-1dca7458f3739ec6e2af7670cc340794c28b747d.tar.bz2 abc-1dca7458f3739ec6e2af7670cc340794c28b747d.zip |
Improved buffering.
Diffstat (limited to 'src/map/scl/scl.c')
-rw-r--r-- | src/map/scl/scl.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/src/map/scl/scl.c b/src/map/scl/scl.c index ea8731c4..23457f7c 100644 --- a/src/map/scl/scl.c +++ b/src/map/scl/scl.c @@ -554,14 +554,15 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv ) { Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Abc_Ntk_t * pNtkRes; - int Degree, fUseInvs; + int FanMin, FanMax, fUseInvs; int c, fVerbose; int fOldAlgo = 0; - Degree = 4; - fUseInvs = 0; - fVerbose = 0; + FanMin = 6; + FanMax = 14; + fUseInvs = 0; + fVerbose = 0; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "Naivh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "NMaivh" ) ) != EOF ) { switch ( c ) { @@ -571,9 +572,20 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" ); goto usage; } - Degree = atoi(argv[globalUtilOptind]); + FanMin = atoi(argv[globalUtilOptind]); globalUtilOptind++; - if ( Degree < 0 ) + 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 ) goto usage; break; case 'a': @@ -605,9 +617,9 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv ) // modify the current network if ( fOldAlgo ) - pNtkRes = Abc_SclPerformBuffering( pNtk, Degree, fUseInvs, fVerbose ); + pNtkRes = Abc_SclPerformBuffering( pNtk, FanMax, fUseInvs, fVerbose ); else - pNtkRes = Abc_SclBufPerform( pNtk, fVerbose ); + pNtkRes = Abc_SclBufPerform( pNtk, FanMin, FanMax, fVerbose ); if ( pNtkRes == NULL ) { Abc_Print( -1, "The command has failed.\n" ); @@ -618,9 +630,10 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv ) return 0; usage: - fprintf( pAbc->Err, "usage: buffer [-N num] [-aivh]\n" ); + fprintf( pAbc->Err, "usage: buffer [-NM num] [-aivh]\n" ); fprintf( pAbc->Err, "\t performs buffering of the mapped network\n" ); - fprintf( pAbc->Err, "\t-N <num> : the max allowed fanout count of node/buffer [default = %d]\n", Degree ); + 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 ); fprintf( pAbc->Err, "\t-a : toggle using old algorithm [default = %s]\n", fOldAlgo? "yes": "no" ); fprintf( pAbc->Err, "\t-i : toggle using interters instead of buffers [default = %s]\n", fUseInvs? "yes": "no" ); fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" ); |