diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-07-26 16:46:45 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-07-26 16:46:45 -0700 |
commit | 704b4bad6b43ed1df4c16eb73555dc3580750f7f (patch) | |
tree | 927058d2ced65d07bc9e246c7aaba91845e76d63 /src/base | |
parent | 7d81490fe66c0deda91ef04be6d1f79be7025c6a (diff) | |
download | abc-704b4bad6b43ed1df4c16eb73555dc3580750f7f.tar.gz abc-704b4bad6b43ed1df4c16eb73555dc3580750f7f.tar.bz2 abc-704b4bad6b43ed1df4c16eb73555dc3580750f7f.zip |
Generating abstraction of standard cell library.
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/abci/abc.c | 189 |
1 files changed, 189 insertions, 0 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 6bec3157..df3fc630 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -385,6 +385,7 @@ static int Abc_CommandAbc9Jf ( Abc_Frame_t * pAbc, int argc, cha static int Abc_CommandAbc9Kf ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Lf ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Mf ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandAbc9Nf ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Struct ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Trace ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Speedup ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -966,6 +967,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) Cmd_CommandAdd( pAbc, "ABC9", "&kf", Abc_CommandAbc9Kf, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&lf", Abc_CommandAbc9Lf, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&mf", Abc_CommandAbc9Mf, 0 ); + Cmd_CommandAdd( pAbc, "ABC9", "&nf", Abc_CommandAbc9Nf, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&struct", Abc_CommandAbc9Struct, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&trace", Abc_CommandAbc9Trace, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&speedup", Abc_CommandAbc9Speedup, 0 ); @@ -31598,6 +31600,193 @@ usage: return 1; } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Abc_CommandAbc9Nf( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ + extern void Nf_ManSetDefaultPars( Jf_Par_t * pPars ); + extern Gia_Man_t * Nf_ManPerformMapping( Gia_Man_t * pGia, Jf_Par_t * pPars ); + char Buffer[200]; + Jf_Par_t Pars, * pPars = &Pars; + Gia_Man_t * pNew; int c; + Nf_ManSetDefaultPars( pPars ); + Extra_UtilGetoptReset(); + while ( ( c = Extra_UtilGetopt( argc, argv, "KCFARLEDWakvwh" ) ) != EOF ) + { + switch ( c ) + { + case 'K': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" ); + goto usage; + } + pPars->nLutSize = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax ) + { + Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize ); + goto usage; + } + break; + case 'C': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" ); + goto usage; + } + pPars->nCutNum = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax ) + { + Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum ); + goto usage; + } + break; + case 'F': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" ); + goto usage; + } + pPars->nRounds = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( pPars->nRounds < 0 ) + goto usage; + break; + case 'A': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" ); + goto usage; + } + pPars->nRoundsEla = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( pPars->nRoundsEla < 0 ) + goto usage; + break; + case 'R': + if ( globalUtilOptind >= argc ) + { + Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" ); + return 0; + } + pPars->nRelaxRatio = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( pPars->nRelaxRatio < 0 ) + goto usage; + break; + case 'L': + if ( globalUtilOptind >= argc ) + { + Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" ); + return 0; + } + pPars->nCoarseLimit = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( pPars->nCoarseLimit < 0 ) + goto usage; + break; + case 'E': + if ( globalUtilOptind >= argc ) + { + Abc_Print( 1, "Command line switch \"-E\" should be followed by a floating point number.\n" ); + return 0; + } + pPars->nAreaTuner = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( pPars->nAreaTuner < 0 ) + goto usage; + break; + case 'D': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" ); + goto usage; + } + pPars->DelayTarget = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( pPars->DelayTarget <= 0.0 ) + goto usage; + break; + case 'W': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" ); + goto usage; + } + pPars->nVerbLimit = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( pPars->nVerbLimit < 0 ) + goto usage; + break; + case 'a': + pPars->fAreaOnly ^= 1; + break; + case 'k': + pPars->fCoarsen ^= 1; + break; + case 'v': + pPars->fVerbose ^= 1; + break; + case 'w': + pPars->fVeryVerbose ^= 1; + break; + case 'h': + default: + goto usage; + } + } + if ( pAbc->pGia == NULL ) + { + Abc_Print( -1, "Empty GIA network.\n" ); + return 1; + } + if ( Abc_FrameReadLibGen() == NULL ) + { + Abc_Print( -1, "Current library is not available.\n" ); + return 1; + } + pNew = Nf_ManPerformMapping( pAbc->pGia, pPars ); + if ( pNew == NULL ) + { + Abc_Print( -1, "Abc_CommandAbc9Nf(): Mapping into LUTs has failed.\n" ); + return 1; + } + Abc_FrameUpdateGia( pAbc, pNew ); + return 0; + +usage: + if ( pPars->DelayTarget == -1 ) + sprintf(Buffer, "best possible" ); + else + sprintf(Buffer, "%d", pPars->DelayTarget ); + Abc_Print( -2, "usage: &nf [-KCFARLED num] [-akvwh]\n" ); + Abc_Print( -2, "\t performs technology mapping of the network\n" ); + Abc_Print( -2, "\t-K num : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize ); + Abc_Print( -2, "\t-C num : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum ); + Abc_Print( -2, "\t-F num : the number of area flow rounds [default = %d]\n", pPars->nRounds ); + Abc_Print( -2, "\t-A num : the number of exact area rounds [default = %d]\n", pPars->nRoundsEla ); + Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio ); + Abc_Print( -2, "\t-L num : the fanout limit for coarsening XOR/MUX (num >= 2) [default = %d]\n", pPars->nCoarseLimit ); + Abc_Print( -2, "\t-E num : the area/edge tradeoff parameter (0 <= num <= 100) [default = %d]\n", pPars->nAreaTuner ); + Abc_Print( -2, "\t-D num : sets the delay constraint for the mapping [default = %s]\n", Buffer ); + Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" ); + Abc_Print( -2, "\t-k : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" ); + Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" ); + Abc_Print( -2, "\t-w : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" ); + Abc_Print( -2, "\t-h : prints the command usage\n"); + return 1; +} /**Function************************************************************* |