summaryrefslogtreecommitdiffstats
path: root/src/base/abci
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2011-07-20 13:52:54 +0700
committerAlan Mishchenko <alanmi@berkeley.edu>2011-07-20 13:52:54 +0700
commitbb86d9142ebb31d31392c3472d6b49f7989e46b6 (patch)
tree36a733a256c27ba210a97303ae02f69f43632f4b /src/base/abci
parent3ab9683d26246be83cc3f775a6b469785f12b775 (diff)
downloadabc-bb86d9142ebb31d31392c3472d6b49f7989e46b6.tar.gz
abc-bb86d9142ebb31d31392c3472d6b49f7989e46b6.tar.bz2
abc-bb86d9142ebb31d31392c3472d6b49f7989e46b6.zip
New demitering features.
Diffstat (limited to 'src/base/abci')
-rw-r--r--src/base/abci/abc.c16
-rw-r--r--src/base/abci/abcDar.c53
2 files changed, 63 insertions, 6 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 2cc8d773..209433df 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -5519,6 +5519,8 @@ int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
extern int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk );
extern int Abc_NtkDarDemiterDual( Abc_Ntk_t * pNtk, int fVerbose );
+ extern int Abc_NtkDarDemiterNew( Abc_Ntk_t * pNtk );
+
// set defaults
fDual = 0;
fSeq = 1;
@@ -5540,7 +5542,7 @@ int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
default:
goto usage;
}
- }
+ }
if ( pNtk == NULL )
{
@@ -5554,14 +5556,16 @@ int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
}
- if ( (Abc_NtkPoNum(pNtk) & 1) )
- {
- Abc_Print( -1, "The number of POs should be even.\n" );
- return 0;
- }
+// Abc_NtkDarDemiterNew( pNtk );
+// return 0;
if ( fDual )
{
+ if ( (Abc_NtkPoNum(pNtk) & 1) )
+ {
+ Abc_Print( -1, "The number of POs should be even.\n" );
+ return 0;
+ }
if ( !Abc_NtkDarDemiterDual( pNtk, fVerbose ) )
{
Abc_Print( -1, "Demitering has failed.\n" );
diff --git a/src/base/abci/abcDar.c b/src/base/abci/abcDar.c
index b1fe8bbe..97ee8c42 100644
--- a/src/base/abci/abcDar.c
+++ b/src/base/abci/abcDar.c
@@ -2063,6 +2063,59 @@ int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
+int Abc_NtkDarDemiterNew( Abc_Ntk_t * pNtk )
+{
+ char * pFileNameGeneric, pFileName0[1000], pFileName1[1000];
+ Aig_Man_t * pMan, * pPart0, * pPart1;//, * pMiter;
+ // derive the AIG manager
+ pMan = Abc_NtkToDar( pNtk, 0, 1 );
+ if ( pMan == NULL )
+ {
+ printf( "Converting network into AIG has failed.\n" );
+ return 0;
+ }
+
+ Saig_ManDemiterNew( pMan );
+ Aig_ManStop( pMan );
+ return 1;
+
+// if ( !Saig_ManDemiterSimple( pMan, &pPart0, &pPart1 ) )
+ if ( !Saig_ManDemiterSimpleDiff( pMan, &pPart0, &pPart1 ) )
+ {
+ printf( "Demitering has failed.\n" );
+ return 0;
+ }
+ // create file names
+ pFileNameGeneric = Extra_FileNameGeneric( pNtk->pSpec );
+ sprintf( pFileName0, "%s%s", pFileNameGeneric, "_part0.aig" );
+ sprintf( pFileName1, "%s%s", pFileNameGeneric, "_part1.aig" );
+ ABC_FREE( pFileNameGeneric );
+ // dump files
+ Ioa_WriteAiger( pPart0, pFileName0, 0, 0 );
+ Ioa_WriteAiger( pPart1, pFileName1, 0, 0 );
+ printf( "Demitering produced two files \"%s\" and \"%s\".\n", pFileName0, pFileName1 );
+ // create two-level miter
+// pMiter = Saig_ManCreateMiterTwo( pPart0, pPart1, 2 );
+// Aig_ManDumpBlif( pMiter, "miter01.blif", NULL, NULL );
+// Aig_ManStop( pMiter );
+// printf( "The new miter is written into file \"%s\".\n", "miter01.blif" );
+ Aig_ManStop( pPart0 );
+ Aig_ManStop( pPart1 );
+ Aig_ManStop( pMan );
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Gives the current ABC network to AIG manager for processing.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
int Abc_NtkDarDemiterDual( Abc_Ntk_t * pNtk, int fVerbose )
{
char * pFileNameGeneric, pFileName0[1000], pFileName1[1000];