diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2022-06-25 19:44:30 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2022-06-25 19:44:30 -0700 |
commit | 8cf3f54208b5cdda6a164db4a747a2e4bffcd93b (patch) | |
tree | 9137bbe8b996c76e9fcb5cb949da357b5ddcf357 /src/base/abci | |
parent | 25455d358febbb26040916f9f90b5e2af87e1dc0 (diff) | |
download | abc-8cf3f54208b5cdda6a164db4a747a2e4bffcd93b.tar.gz abc-8cf3f54208b5cdda6a164db4a747a2e4bffcd93b.tar.bz2 abc-8cf3f54208b5cdda6a164db4a747a2e4bffcd93b.zip |
Experiments with technology mapping.
Diffstat (limited to 'src/base/abci')
-rw-r--r-- | src/base/abci/abc.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 0b60baca..f1c8cc7f 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -485,6 +485,7 @@ static int Abc_CommandAbc9If ( Abc_Frame_t * pAbc, int argc, cha static int Abc_CommandAbc9Iff ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Iiff ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9If2 ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandAbc9Sif ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Jf ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Kf ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Lf ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -1233,6 +1234,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) Cmd_CommandAdd( pAbc, "ABC9", "&iff", Abc_CommandAbc9Iff, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&iiff", Abc_CommandAbc9Iiff, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&if2", Abc_CommandAbc9If2, 0 ); + Cmd_CommandAdd( pAbc, "ABC9", "&sif", Abc_CommandAbc9Sif, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&jf", Abc_CommandAbc9Jf, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&kf", Abc_CommandAbc9Kf, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&lf", Abc_CommandAbc9Lf, 0 ); @@ -40213,6 +40215,68 @@ usage: SeeAlso [] ***********************************************************************/ +int Abc_CommandAbc9Sif( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ + extern Gia_Man_t * Gia_ManTestSif( Gia_Man_t * p, int nLutSize, int fVerbose ); + Gia_Man_t * pNew; + int c, nLutSize = 6, fVerbose = 0; + Extra_UtilGetoptReset(); + while ( ( c = Extra_UtilGetopt( argc, argv, "Kvh" ) ) != 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; + } + nLutSize = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( nLutSize < 2 || nLutSize > 16 ) + { + Abc_Print( -1, "LUT size %d is not supported.\n", nLutSize ); + goto usage; + } + break; + case 'v': + fVerbose ^= 1; + break; + case 'h': + default: + goto usage; + } + } + if ( pAbc->pGia == NULL ) + { + Abc_Print( -1, "Empty GIA network.\n" ); + return 1; + } + pNew = Gia_ManTestSif( pAbc->pGia, nLutSize, fVerbose ); + if ( pNew != NULL ) + Abc_FrameUpdateGia( pAbc, pNew ); + return 0; + +usage: + Abc_Print( -2, "usage: &sif [-K num] [-vh]\n" ); + Abc_Print( -2, "\t performs technology mapping\n" ); + Abc_Print( -2, "\t-K num : sets the LUT size for the mapping [default = %d]\n", nLutSize ); + Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" ); + Abc_Print( -2, "\t-h : prints the command usage\n"); + return 1; +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ int Abc_CommandAbc9Jf( Abc_Frame_t * pAbc, int argc, char ** argv ) { char Buffer[200]; |