summaryrefslogtreecommitdiffstats
path: root/src/base/abci/abc.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-07-16 07:51:58 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2016-07-16 07:51:58 -0700
commit32d1516c64eca2805f951b1dc6f3d6ce93c29f4e (patch)
tree6c3aa971d91a091cce0f6ca02075b3c9e6931576 /src/base/abci/abc.c
parentabdf39711f8c175840da90fd8531183c61691f68 (diff)
downloadabc-32d1516c64eca2805f951b1dc6f3d6ce93c29f4e.tar.gz
abc-32d1516c64eca2805f951b1dc6f3d6ce93c29f4e.tar.bz2
abc-32d1516c64eca2805f951b1dc6f3d6ce93c29f4e.zip
Adding command 'exact' developed by Mathias Soeken to implement Knuth's exact synthesis algorithm.
Diffstat (limited to 'src/base/abci/abc.c')
-rw-r--r--src/base/abci/abc.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index e883c8fc..bc411998 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -135,6 +135,7 @@ static int Abc_CommandCascade ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandExtract ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandVarMin ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDetect ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandExact ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandLogic ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandComb ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -773,6 +774,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Synthesis", "extract", Abc_CommandExtract, 1 );
Cmd_CommandAdd( pAbc, "Synthesis", "varmin", Abc_CommandVarMin, 0 );
Cmd_CommandAdd( pAbc, "Synthesis", "detect", Abc_CommandDetect, 0 );
+ Cmd_CommandAdd( pAbc, "Synthesis", "exact", Abc_CommandExact, 1 );
Cmd_CommandAdd( pAbc, "Various", "logic", Abc_CommandLogic, 1 );
Cmd_CommandAdd( pAbc, "Various", "comb", Abc_CommandComb, 1 );
@@ -7274,6 +7276,61 @@ usage:
SeeAlso []
***********************************************************************/
+int Abc_CommandExact( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ int c, fVerbose = 0, nVars;
+ word pTruth[1];
+ Abc_Ntk_t * pNtkRes;
+
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+
+ if ( argc != globalUtilOptind + 1 )
+ {
+ goto usage;
+ }
+
+ nVars = Abc_TtReadHex( pTruth, argv[globalUtilOptind] );
+ pNtkRes = Abc_NtkFindExact( pTruth, nVars, 1, fVerbose );
+ assert( pNtkRes != NULL );
+ Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+ Abc_FrameClearVerifStatus( pAbc );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: exact [-vh] <truth>\n" );
+ Abc_Print( -2, "\t finds optimum networks using SAT-based exact synthesis\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");
+ Abc_Print( -2, "\t\n" );
+ Abc_Print( -2, "\t This command was contributed by Mathias Soeken from EPFL in July 2016.\n" );
+ Abc_Print( -2, "\t The author can be contacted as mathias.soeken at epfl.ch\n" );
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
int Abc_CommandLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Abc_Ntk_t * pNtk, * pNtkRes;