summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abc/abcUtil.c3
-rw-r--r--src/base/abci/abc.c99
-rw-r--r--src/base/abci/abcDar.c32
3 files changed, 129 insertions, 5 deletions
diff --git a/src/base/abc/abcUtil.c b/src/base/abc/abcUtil.c
index 3de48f00..bb1ae2ed 100644
--- a/src/base/abc/abcUtil.c
+++ b/src/base/abc/abcUtil.c
@@ -1490,7 +1490,8 @@ void Abc_NtkTransferCopy( Abc_Ntk_t * pNtk )
static inline int Abc_ObjCrossCutInc( Abc_Obj_t * pObj )
{
// pObj->pCopy = (void *)(((int)pObj->pCopy)++);
- ((char*)pObj->pCopy)++;
+ int Value = (int)pObj->pCopy;
+ pObj->pCopy = (void *)(Value + 1);
return (int)pObj->pCopy == Abc_ObjFanoutNum(pObj);
}
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index cd67205c..06f4299d 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -112,6 +112,7 @@ static int Abc_CommandIRewriteSeq ( Abc_Frame_t * pAbc, int argc, char ** arg
static int Abc_CommandIResyn ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandISat ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandIFraig ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDFraig ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandIProve ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandHaig ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandMini ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -267,6 +268,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "New AIG", "iresyn", Abc_CommandIResyn, 1 );
Cmd_CommandAdd( pAbc, "New AIG", "isat", Abc_CommandISat, 1 );
Cmd_CommandAdd( pAbc, "New AIG", "ifraig", Abc_CommandIFraig, 1 );
+ Cmd_CommandAdd( pAbc, "New AIG", "dfraig", Abc_CommandDFraig, 1 );
Cmd_CommandAdd( pAbc, "New AIG", "iprove", Abc_CommandIProve, 1 );
Cmd_CommandAdd( pAbc, "New AIG", "haig", Abc_CommandHaig, 1 );
Cmd_CommandAdd( pAbc, "New AIG", "mini", Abc_CommandMini, 1 );
@@ -333,7 +335,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
{
extern void Dar_LibStart();
- Dar_LibStart();
+// Dar_LibStart();
}
}
@@ -352,7 +354,7 @@ void Abc_End()
{
{
extern void Dar_LibStop();
- Dar_LibStop();
+// Dar_LibStop();
}
Abc_NtkFraigStoreClean();
@@ -6077,14 +6079,16 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
// Abc_Ntk4VarTable( pNtk );
// Dar_NtkGenerateArrays( pNtk );
// Dar_ManDeriveCnfTest2();
-
+/*
if ( !Abc_NtkIsStrash(pNtk) )
{
fprintf( pErr, "Network should be strashed. Command has failed.\n" );
return 1;
}
+*/
// pNtkRes = Abc_NtkDar( pNtk );
- pNtkRes = Abc_NtkDarToCnf( pNtk, "any.cnf" );
+// pNtkRes = Abc_NtkDarToCnf( pNtk, "any.cnf" );
+ pNtkRes = NULL;
if ( pNtkRes == NULL )
{
fprintf( pErr, "Command has failed.\n" );
@@ -6911,6 +6915,93 @@ usage:
SeeAlso []
***********************************************************************/
+int Abc_CommandDFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ FILE * pOut, * pErr;
+ Abc_Ntk_t * pNtk, * pNtkRes;
+ int c, fProve, fVerbose, fDoSparse;
+ int nConfLimit;
+
+ extern Abc_Ntk_t * Abc_NtkDarFraig( Abc_Ntk_t * pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fVerbose );
+
+ pNtk = Abc_FrameReadNtk(pAbc);
+ pOut = Abc_FrameReadOut(pAbc);
+ pErr = Abc_FrameReadErr(pAbc);
+
+ // set defaults
+ nConfLimit = 100;
+ fDoSparse = 0;
+ fProve = 0;
+ fVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "Cspvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'C':
+ if ( globalUtilOptind >= argc )
+ {
+ fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nConfLimit = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nConfLimit < 0 )
+ goto usage;
+ break;
+ case 's':
+ fDoSparse ^= 1;
+ break;
+ case 'p':
+ fProve ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pNtk == NULL )
+ {
+ fprintf( pErr, "Empty network.\n" );
+ return 1;
+ }
+
+ pNtkRes = Abc_NtkDarFraig( pNtk, nConfLimit, fDoSparse, fProve, 0, fVerbose );
+ if ( pNtkRes == NULL )
+ {
+ fprintf( pErr, "Command has failed.\n" );
+ return 0;
+ }
+ // replace the current network
+ Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+ return 0;
+
+usage:
+ fprintf( pErr, "usage: dfraig [-C num] [-spvh]\n" );
+ fprintf( pErr, "\t performs fraiging using a new method\n" );
+ fprintf( pErr, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+ fprintf( pErr, "\t-s : toggle considering sparse functions [default = %s]\n", fDoSparse? "yes": "no" );
+ fprintf( pErr, "\t-p : toggle proving the miter outputs [default = %s]\n", fProve? "yes": "no" );
+ fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ fprintf( pErr, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
int Abc_CommandIProve( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Prove_Params_t Params, * pParams = &Params;
diff --git a/src/base/abci/abcDar.c b/src/base/abci/abcDar.c
index c2988cbb..ba3ac89d 100644
--- a/src/base/abci/abcDar.c
+++ b/src/base/abci/abcDar.c
@@ -21,6 +21,7 @@
#include "abc.h"
#include "dar.h"
#include "cnf.h"
+#include "fra.h"
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -443,6 +444,37 @@ Abc_Ntk_t * Abc_NtkDarToCnf( Abc_Ntk_t * pNtk, char * pFileName )
}
+/**Function*************************************************************
+
+ Synopsis [Gives the current ABC network to AIG manager for processing.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Abc_Ntk_t * Abc_NtkDarFraig( Abc_Ntk_t * pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fVerbose )
+{
+ Fra_Par_t Params, * pParams = &Params;
+ Abc_Ntk_t * pNtkAig;
+ Dar_Man_t * pMan, * pTemp;
+ pMan = Abc_NtkToDar( pNtk );
+ if ( pMan == NULL )
+ return NULL;
+ Fra_ParamsDefault( pParams );
+ pParams->nBTLimitNode = nConfLimit;
+ pParams->fVerbose = fVerbose;
+ pParams->fProve = fProve;
+ pParams->fDoSparse = fDoSparse;
+ pMan = Fra_Perform( pTemp = pMan, pParams );
+ pNtkAig = Abc_NtkFromDar( pNtk, pMan );
+ Dar_ManStop( pTemp );
+ Dar_ManStop( pMan );
+ return pNtkAig;
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////