summaryrefslogtreecommitdiffstats
path: root/src/aig/dar/darBalance.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/aig/dar/darBalance.c')
-rw-r--r--src/aig/dar/darBalance.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/aig/dar/darBalance.c b/src/aig/dar/darBalance.c
index 63f6f232..6e78041a 100644
--- a/src/aig/dar/darBalance.c
+++ b/src/aig/dar/darBalance.c
@@ -333,7 +333,7 @@ Aig_Obj_t * Dar_Balance_rec( Aig_Man_t * pNew, Aig_Obj_t * pObjOld, Vec_Vec_t *
if ( vSuper->nSize == 0 )
return pObjOld->pData = Aig_ManConst0(pNew);
if ( Vec_PtrSize(vSuper) < 2 )
- printf( "BUG!\n" );
+ printf( "Dar_Balance_rec: Internal error!\n" );
// for each old node, derive the new well-balanced node
for ( i = 0; i < Vec_PtrSize(vSuper); i++ )
{
@@ -366,9 +366,11 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
Aig_Obj_t * pObj, * pDriver, * pObjNew;
Vec_Vec_t * vStore;
int i;
+ assert( Aig_ManVerifyTopoOrder(p) );
// create the new manager
pNew = Aig_ManStart( Aig_ManObjNumMax(p) );
pNew->pName = Aig_UtilStrsav( p->pName );
+ pNew->pSpec = Aig_UtilStrsav( p->pSpec );
pNew->nRegs = p->nRegs;
pNew->nAsserts = p->nAsserts;
if ( p->vFlopNums )
@@ -439,6 +441,35 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
/**Function*************************************************************
+ Synopsis [Reproduces script "compress2".]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Aig_Man_t * Dar_ManBalanceXor( Aig_Man_t * pAig, int fExor, int fUpdateLevel, int fVerbose )
+{
+ Aig_Man_t * pAigXor, * pRes;
+ if ( fExor )
+ {
+ pAigXor = Aig_ManDupExor( pAig );
+ if ( fVerbose )
+ Dar_BalancePrintStats( pAigXor );
+ pRes = Dar_ManBalance( pAigXor, fUpdateLevel );
+ Aig_ManStop( pAigXor );
+ }
+ else
+ {
+ pRes = Dar_ManBalance( pAig, fUpdateLevel );
+ }
+ return pRes;
+}
+
+/**Function*************************************************************
+
Synopsis [Inserts a new node in the order by levels.]
Description []