diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/base/abci/abc.c | 73 | ||||
-rw-r--r-- | src/base/abci/abcDec.c | 66 | ||||
-rw-r--r-- | src/base/abci/module.make | 1 |
3 files changed, 140 insertions, 0 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index b5b1c578..efbc888c 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -108,6 +108,7 @@ static int Abc_CommandSpeedup ( Abc_Frame_t * pAbc, int argc, cha static int Abc_CommandPowerdown ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAddBuffs ( Abc_Frame_t * pAbc, int argc, char ** argv ); //static int Abc_CommandMerge ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandTestDec ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandRewrite ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandRefactor ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -569,6 +570,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) Cmd_CommandAdd( pAbc, "Synthesis", "powerdown", Abc_CommandPowerdown, 1 ); Cmd_CommandAdd( pAbc, "Synthesis", "addbuffs", Abc_CommandAddBuffs, 1 ); // Cmd_CommandAdd( pAbc, "Synthesis", "merge", Abc_CommandMerge, 1 ); + Cmd_CommandAdd( pAbc, "Synthesis", "testdec", Abc_CommandTestDec, 0 ); Cmd_CommandAdd( pAbc, "Synthesis", "rewrite", Abc_CommandRewrite, 1 ); Cmd_CommandAdd( pAbc, "Synthesis", "refactor", Abc_CommandRefactor, 1 ); @@ -4793,6 +4795,77 @@ usage: return 1; } #endif + + + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Abc_CommandTestDec( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ + extern int Abc_DecTest( char * pFileName, int DecType ); + char * pFileName; + int c; + int fVerbose = 0; + int DecType = 0; + Extra_UtilGetoptReset(); + while ( ( c = Extra_UtilGetopt( argc, argv, "Avh" ) ) != EOF ) + { + switch ( c ) + { + case 'A': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" ); + goto usage; + } + DecType = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( DecType < 0 ) + goto usage; + break; + case 'v': + fVerbose ^= 1; + break; + case 'h': + goto usage; + default: + goto usage; + } + } + if ( argc != globalUtilOptind + 1 ) + { + printf( "Input file is not given.\n" ); + goto usage; + } + // get the output file name + pFileName = argv[globalUtilOptind]; + // call the testbench + Abc_DecTest( pFileName, DecType ); + return 0; + +usage: + Abc_Print( -2, "usage: testdec [-A <num>] [-vh] <file_name>\n" ); + Abc_Print( -2, "\t testbench for Boolean decomposition algorithms\n" ); + Abc_Print( -2, "\t-A <num> : number of decomposition algorithm [default = %d]\n", DecType ); + Abc_Print( -2, "\t 0 : none (just read the input file)\n" ); + Abc_Print( -2, "\t 1 : algebraic factoring applied to ISOP\n" ); + Abc_Print( -2, "\t 2 : bi-decomposition with cofactoring\n" ); + Abc_Print( -2, "\t 3 : disjoint-support decomposition\n" ); + Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" ); + Abc_Print( -2, "\t-h : print the command usage\n"); + return 1; +} + + /**Function************************************************************* Synopsis [] diff --git a/src/base/abci/abcDec.c b/src/base/abci/abcDec.c new file mode 100644 index 00000000..916866ad --- /dev/null +++ b/src/base/abci/abcDec.c @@ -0,0 +1,66 @@ +/**CFile**************************************************************** + + FileName [abcDec.c] + + SystemName [ABC: Logic synthesis and verification system.] + + PackageName [Network and node package.] + + Synopsis [Procedures for testing and comparing decomposition algorithms.] + + Author [Alan Mishchenko] + + Affiliation [UC Berkeley] + + Date [Ver. 1.0. Started - June 20, 2005.] + + Revision [$Id: abcDec.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $] + +***********************************************************************/ + +#include "base/abc/abc.h" + +ABC_NAMESPACE_IMPL_START + + +//////////////////////////////////////////////////////////////////////// +/// DECLARATIONS /// +//////////////////////////////////////////////////////////////////////// + +// decomposition type +// 0 - none +// 1 - factoring +// 2 - bi-decomposition +// 3 - DSD + +//////////////////////////////////////////////////////////////////////// +/// FUNCTION DEFINITIONS /// +//////////////////////////////////////////////////////////////////////// + + +/**Function************************************************************* + + Synopsis [Testbench for decomposition algorithms.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Abc_DecTest( char * pFileName, int DecType ) +{ + printf( "Trying to read file \"%s\".\n", pFileName ); + fflush( stdout ); + return 0; +} + + +//////////////////////////////////////////////////////////////////////// +/// END OF FILE /// +//////////////////////////////////////////////////////////////////////// + + +ABC_NAMESPACE_IMPL_END + diff --git a/src/base/abci/module.make b/src/base/abci/module.make index ea2dc1b7..b88c253c 100644 --- a/src/base/abci/module.make +++ b/src/base/abci/module.make @@ -11,6 +11,7 @@ SRC += src/base/abci/abc.c \ src/base/abci/abcCut.c \ src/base/abci/abcDar.c \ src/base/abci/abcDebug.c \ + src/base/abci/abcDec.c \ src/base/abci/abcDress.c \ src/base/abci/abcDress2.c \ src/base/abci/abcDsd.c \ |