From da6838463fedf0821f542dcc3a4451bfe1ca3abd Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Mon, 27 Aug 2012 14:29:32 -0700 Subject: Added features 'map -M ' to control the use of large gates. --- src/base/abci/abc.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'src/base/abci/abc.c') diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 3193583a..9c1bd720 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -13256,25 +13256,27 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Ntk_t * pNtk, * pNtkRes; char Buffer[100]; double DelayTarget; + double AreaMulti; int fAreaOnly; int fRecovery; int fSweep; int fSwitching; int fVerbose; int c; - extern Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, int fRecovery, int fSwitching, int fVerbose ); + extern Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti, int fRecovery, int fSwitching, int fVerbose ); extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose ); pNtk = Abc_FrameReadNtk(pAbc); // set defaults DelayTarget =-1; + AreaMulti = 0; fAreaOnly = 0; fRecovery = 1; fSweep = 1; fSwitching = 0; fVerbose = 0; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "Darspvh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "DMarspvh" ) ) != EOF ) { switch ( c ) { @@ -13289,6 +13291,17 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv ) if ( DelayTarget <= 0.0 ) goto usage; break; + case 'M': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-M\" should be followed by a floating point number.\n" ); + goto usage; + } + AreaMulti = (float)atof(argv[globalUtilOptind]); + globalUtilOptind++; + if ( AreaMulti < 0.0 ) + goto usage; + break; case 'a': fAreaOnly ^= 1; break; @@ -13337,7 +13350,7 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv ) } Abc_Print( 0, "The network was strashed and balanced before mapping.\n" ); // get the new network - pNtkRes = Abc_NtkMap( pNtk, DelayTarget, fRecovery, fSwitching, fVerbose ); + pNtkRes = Abc_NtkMap( pNtk, DelayTarget, AreaMulti, fRecovery, fSwitching, fVerbose ); if ( pNtkRes == NULL ) { Abc_NtkDelete( pNtk ); @@ -13349,7 +13362,7 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv ) else { // get the new network - pNtkRes = Abc_NtkMap( pNtk, DelayTarget, fRecovery, fSwitching, fVerbose ); + pNtkRes = Abc_NtkMap( pNtk, DelayTarget, AreaMulti, fRecovery, fSwitching, fVerbose ); if ( pNtkRes == NULL ) { Abc_Print( -1, "Mapping has failed.\n" ); @@ -13369,9 +13382,10 @@ usage: sprintf( Buffer, "not used" ); else sprintf( Buffer, "%.3f", DelayTarget ); - Abc_Print( -2, "usage: map [-D float] [-arspvh]\n" ); + Abc_Print( -2, "usage: map [-DM float] [-arspvh]\n" ); Abc_Print( -2, "\t performs standard cell mapping of the current network\n" ); Abc_Print( -2, "\t-D float : sets the global required times [default = %s]\n", Buffer ); + Abc_Print( -2, "\t-M float : \"area multiplier\" to discourage large gates [default = %.2f]\n", AreaMulti ); Abc_Print( -2, "\t-a : toggles area-only mapping [default = %s]\n", fAreaOnly? "yes": "no" ); Abc_Print( -2, "\t-r : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" ); Abc_Print( -2, "\t-s : toggles sweep after mapping [default = %s]\n", fSweep? "yes": "no" ); -- cgit v1.2.3