summaryrefslogtreecommitdiffstats
path: root/src/base/abci/abcDar.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-01-16 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2008-01-16 08:01:00 -0800
commit61850d5942fcff634b16696bf3ca7ee0fc465d1c (patch)
treecf363134194ae3796b04561cd24cf7c9871dd3e4 /src/base/abci/abcDar.c
parent4a61139de0b9a50e8dda80845e379d4b937043dc (diff)
downloadabc-61850d5942fcff634b16696bf3ca7ee0fc465d1c.tar.gz
abc-61850d5942fcff634b16696bf3ca7ee0fc465d1c.tar.bz2
abc-61850d5942fcff634b16696bf3ca7ee0fc465d1c.zip
Version abc80116
Diffstat (limited to 'src/base/abci/abcDar.c')
-rw-r--r--src/base/abci/abcDar.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/base/abci/abcDar.c b/src/base/abci/abcDar.c
index 439c3383..16a772ce 100644
--- a/src/base/abci/abcDar.c
+++ b/src/base/abci/abcDar.c
@@ -1482,6 +1482,54 @@ Abc_Ntk_t * Abc_NtkDarEnlarge( Abc_Ntk_t * pNtk, int nFrames, int fVerbose )
return pNtkAig;
}
+/**Function*************************************************************
+
+ Synopsis [Interplates two networks.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Abc_Ntk_t * Abc_NtkInter( Abc_Ntk_t * pNtkOn, Abc_Ntk_t * pNtkOff, int fVerbose )
+{
+ extern Aig_Man_t * Aig_ManInter( Aig_Man_t * pManOn, Aig_Man_t * pManOff, int fVerbose );
+ Abc_Ntk_t * pNtkAig;
+ Aig_Man_t * pManOn, * pManOff, * pManAig;
+ if ( Abc_NtkCoNum(pNtkOn) != 1 || Abc_NtkCoNum(pNtkOff) != 1 )
+ {
+ printf( "Currently works only for single output networks.\n" );
+ return NULL;
+ }
+ if ( Abc_NtkCiNum(pNtkOn) != Abc_NtkCiNum(pNtkOff) )
+ {
+ printf( "The number of PIs should be the same.\n" );
+ return NULL;
+ }
+ // create internal AIGs
+ pManOn = Abc_NtkToDar( pNtkOn, 0 );
+ if ( pManOn == NULL )
+ return NULL;
+ pManOff = Abc_NtkToDar( pNtkOff, 0 );
+ if ( pManOff == NULL )
+ return NULL;
+ // derive the interpolant
+ pManAig = Aig_ManInter( pManOn, pManOff, fVerbose );
+ if ( pManAig == NULL )
+ {
+ printf( "Interpolant computation failed.\n" );
+ return NULL;
+ }
+ Aig_ManStop( pManOn );
+ Aig_ManStop( pManOff );
+ // create logic network
+ pNtkAig = Abc_NtkFromDar( pNtkOn, pManAig );
+ Aig_ManStop( pManAig );
+ return pNtkAig;
+}
+
#include "ntl.h"