diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-11-09 22:49:17 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-11-09 22:49:17 -0800 |
commit | 372a348c90eb3f13c2a366815d1406476a638c24 (patch) | |
tree | 1953198dcba51e0df0d5c65b2e6f00b35c09dcc0 /src/base/abci | |
parent | 153e8887942387aa005dc5be9fd4b93a7cf3b86a (diff) | |
download | abc-372a348c90eb3f13c2a366815d1406476a638c24.tar.gz abc-372a348c90eb3f13c2a366815d1406476a638c24.tar.bz2 abc-372a348c90eb3f13c2a366815d1406476a638c24.zip |
Detecting full-adder chains and putting them into white boxes.
Diffstat (limited to 'src/base/abci')
-rw-r--r-- | src/base/abci/abc.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 7bd2b617..c0591571 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -439,6 +439,7 @@ static int Abc_CommandAbc9Maxi ( Abc_Frame_t * pAbc, int argc, cha static int Abc_CommandAbc9Bmci ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9PoXsim ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Demiter ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandAbc9Fadds ( Abc_Frame_t * pAbc, int argc, char ** argv ); //static int Abc_CommandAbc9PoPart2 ( Abc_Frame_t * pAbc, int argc, char ** argv ); //static int Abc_CommandAbc9CexCut ( Abc_Frame_t * pAbc, int argc, char ** argv ); //static int Abc_CommandAbc9CexMerge ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -1040,6 +1041,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) Cmd_CommandAdd( pAbc, "ABC9", "&bmci", Abc_CommandAbc9Bmci, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&poxsim", Abc_CommandAbc9PoXsim, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&demiter", Abc_CommandAbc9Demiter, 0 ); + Cmd_CommandAdd( pAbc, "ABC9", "&fadds", Abc_CommandAbc9Fadds, 0 ); // Cmd_CommandAdd( pAbc, "ABC9", "&popart2", Abc_CommandAbc9PoPart2, 0 ); // Cmd_CommandAdd( pAbc, "ABC9", "&cexcut", Abc_CommandAbc9CexCut, 0 ); // Cmd_CommandAdd( pAbc, "ABC9", "&cexmerge", Abc_CommandAbc9CexMerge, 0 ); @@ -36557,6 +36559,64 @@ usage: SeeAlso [] ***********************************************************************/ +int Abc_CommandAbc9Fadds( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ + extern Gia_Man_t * Gia_ManDupWithFaddBoxes( Gia_Man_t * p, int nFaddMin, int fVerbose ); + Gia_Man_t * pTemp; + int c, nFaddMin = 3, fVerbose = 0; + Extra_UtilGetoptReset(); + while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF ) + { + switch ( c ) + { + case 'N': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" ); + goto usage; + } + nFaddMin = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( nFaddMin < 0 ) + goto usage; + break; + case 'v': + fVerbose ^= 1; + break; + case 'h': + goto usage; + default: + goto usage; + } + } + if ( pAbc->pGia == NULL ) + { + Abc_Print( -1, "Abc_CommandAbc9Fadds(): There is no AIG.\n" ); + return 0; + } + pTemp = Gia_ManDupWithFaddBoxes( pAbc->pGia, nFaddMin, fVerbose ); + Abc_FrameUpdateGia( pAbc, pTemp ); + return 0; +usage: + Abc_Print( -2, "usage: &fadds [-N num] [-vh]\n" ); + Abc_Print( -2, "\t detects full-adder chains and puts them into white boxes\n" ); + Abc_Print( -2, "\t-N num : the minimum length of full-adder chain to box [default = %d]\n", nFaddMin ); + Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose? "yes": "no" ); + Abc_Print( -2, "\t-h : print the command usage\n"); + return 1; +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ int Abc_CommandAbc9CexCut( Abc_Frame_t * pAbc, int argc, char ** argv ) { return -1; |