summaryrefslogtreecommitdiffstats
path: root/src/base/abci/abcClpBdd.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2006-03-03 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2006-03-03 08:01:00 -0800
commit0e57e953062cd2d97573d8428f6f77853ba8535e (patch)
tree44eb008801aae04cd834aa0c02efd6cdd67a64b5 /src/base/abci/abcClpBdd.c
parent9e6f8406e80c55455c464b01033040a88fd12c40 (diff)
downloadabc-0e57e953062cd2d97573d8428f6f77853ba8535e.tar.gz
abc-0e57e953062cd2d97573d8428f6f77853ba8535e.tar.bz2
abc-0e57e953062cd2d97573d8428f6f77853ba8535e.zip
Version abc60303
Diffstat (limited to 'src/base/abci/abcClpBdd.c')
-rw-r--r--src/base/abci/abcClpBdd.c46
1 files changed, 43 insertions, 3 deletions
diff --git a/src/base/abci/abcClpBdd.c b/src/base/abci/abcClpBdd.c
index 59c76e09..84016436 100644
--- a/src/base/abci/abcClpBdd.c
+++ b/src/base/abci/abcClpBdd.c
@@ -25,6 +25,7 @@
////////////////////////////////////////////////////////////////////////
static Abc_Ntk_t * Abc_NtkFromGlobalBdds( Abc_Ntk_t * pNtk );
+static Abc_Ntk_t * Abc_NtkFromGlobalBddsDual( Abc_Ntk_t * pNtk );
static Abc_Obj_t * Abc_NodeFromGlobalBdds( Abc_Ntk_t * pNtkNew, DdManager * dd, DdNode * bFunc );
////////////////////////////////////////////////////////////////////////
@@ -42,20 +43,23 @@ static Abc_Obj_t * Abc_NodeFromGlobalBdds( Abc_Ntk_t * pNtkNew, DdManager * dd,
SeeAlso []
***********************************************************************/
-Abc_Ntk_t * Abc_NtkCollapse( Abc_Ntk_t * pNtk, int fVerbose )
+Abc_Ntk_t * Abc_NtkCollapse( Abc_Ntk_t * pNtk, int fBddSizeMax, int fDualRail, int fVerbose )
{
Abc_Ntk_t * pNtkNew;
assert( Abc_NtkIsStrash(pNtk) );
// compute the global BDDs
- if ( Abc_NtkGlobalBdds(pNtk, 0) == NULL )
+ if ( Abc_NtkGlobalBdds(pNtk, fBddSizeMax, 0) == NULL )
return NULL;
if ( fVerbose )
printf( "The shared BDD size is %d nodes.\n", Cudd_ReadKeys(pNtk->pManGlob) - Cudd_ReadDead(pNtk->pManGlob) );
// create the new network
- pNtkNew = Abc_NtkFromGlobalBdds( pNtk );
+ if ( fDualRail )
+ pNtkNew = Abc_NtkFromGlobalBddsDual( pNtk );
+ else
+ pNtkNew = Abc_NtkFromGlobalBdds( pNtk );
Abc_NtkFreeGlobalBdds( pNtk );
if ( pNtkNew == NULL )
{
@@ -127,6 +131,42 @@ Abc_Ntk_t * Abc_NtkFromGlobalBdds( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
+Abc_Ntk_t * Abc_NtkFromGlobalBddsDual( Abc_Ntk_t * pNtk )
+{
+ ProgressBar * pProgress;
+ Abc_Ntk_t * pNtkNew;
+ Abc_Obj_t * pNode, * pNodeNew;
+ DdManager * dd = pNtk->pManGlob;
+ int i;
+ // start the new network
+ pNtkNew = Abc_NtkStartFromDual( pNtk, ABC_NTK_LOGIC, ABC_FUNC_BDD );
+ // make sure the new manager has the same number of inputs
+ Cudd_bddIthVar( pNtkNew->pManFunc, dd->size-1 );
+ // process the POs
+ pProgress = Extra_ProgressBarStart( stdout, Abc_NtkCoNum(pNtk) );
+ Abc_NtkForEachCo( pNtk, pNode, i )
+ {
+ Extra_ProgressBarUpdate( pProgress, i, NULL );
+ pNodeNew = Abc_NodeFromGlobalBdds( pNtkNew, dd, Cudd_Not( Vec_PtrEntry(pNtk->vFuncsGlob, i) ) );
+ Abc_ObjAddFanin( pNode->pCopy->pCopy, pNodeNew );
+ pNodeNew = Abc_NodeFromGlobalBdds( pNtkNew, dd, Vec_PtrEntry(pNtk->vFuncsGlob, i) );
+ Abc_ObjAddFanin( pNode->pCopy, pNodeNew );
+ }
+ Extra_ProgressBarStop( pProgress );
+ return pNtkNew;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Derives the network with the given global BDD.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
Abc_Obj_t * Abc_NodeFromGlobalBdds( Abc_Ntk_t * pNtkNew, DdManager * dd, DdNode * bFunc )
{
Abc_Obj_t * pNodeNew, * pTemp;