summaryrefslogtreecommitdiffstats
path: root/src/aig/dar
diff options
context:
space:
mode:
Diffstat (limited to 'src/aig/dar')
-rw-r--r--src/aig/dar/darBalance.c2
-rw-r--r--src/aig/dar/darRefact.c4
-rw-r--r--src/aig/dar/darScript.c26
3 files changed, 20 insertions, 12 deletions
diff --git a/src/aig/dar/darBalance.c b/src/aig/dar/darBalance.c
index 6e78041a..574c72d9 100644
--- a/src/aig/dar/darBalance.c
+++ b/src/aig/dar/darBalance.c
@@ -187,7 +187,7 @@ void Dar_BalancePermute( Aig_Man_t * p, Vec_Ptr_t * vSuper, int LeftBound, int f
// get the two last nodes
pObj1 = Vec_PtrEntry( vSuper, RightBound + 1 );
pObj2 = Vec_PtrEntry( vSuper, RightBound );
- if ( Aig_Regular(pObj1) == p->pConst1 || Aig_Regular(pObj2) == p->pConst1 )
+ if ( Aig_Regular(pObj1) == p->pConst1 || Aig_Regular(pObj2) == p->pConst1 || Aig_Regular(pObj1) == Aig_Regular(pObj2) )
return;
// find the first node that can be shared
for ( i = RightBound; i >= LeftBound; i-- )
diff --git a/src/aig/dar/darRefact.c b/src/aig/dar/darRefact.c
index e814840f..0637fee0 100644
--- a/src/aig/dar/darRefact.c
+++ b/src/aig/dar/darRefact.c
@@ -376,14 +376,14 @@ int Dar_ManRefactorTryCuts( Ref_Man_t * p, Aig_Obj_t * pObj, int nNodesSaved, in
pTruth = Aig_ManCutTruth( pObj, vCut, p->vCutNodes, p->vTruthElem, p->vTruthStore );
if ( Kit_TruthIsConst0(pTruth, Vec_PtrSize(vCut)) )
{
- p->GainBest = Vec_PtrSize(p->vCutNodes);
+ p->GainBest = Aig_NodeMffsSupp( p->pAig, pObj, 0, NULL );
p->pGraphBest = Kit_GraphCreateConst0();
Vec_PtrCopy( p->vLeavesBest, vCut );
return p->GainBest;
}
if ( Kit_TruthIsConst1(pTruth, Vec_PtrSize(vCut)) )
{
- p->GainBest = Vec_PtrSize(p->vCutNodes);
+ p->GainBest = Aig_NodeMffsSupp( p->pAig, pObj, 0, NULL );
p->pGraphBest = Kit_GraphCreateConst1();
Vec_PtrCopy( p->vLeavesBest, vCut );
return p->GainBest;
diff --git a/src/aig/dar/darScript.c b/src/aig/dar/darScript.c
index 69810125..6d6b761c 100644
--- a/src/aig/dar/darScript.c
+++ b/src/aig/dar/darScript.c
@@ -82,19 +82,27 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
pAig = Aig_ManDupDfs( pAig );
if ( fVerbose ) Aig_ManPrintStats( pAig );
+
+ // balance
+ if ( fBalance )
+ {
+ pAig = Dar_ManBalance( pTemp = pAig, 0 );
+ Aig_ManStop( pTemp );
+ if ( fVerbose ) Aig_ManPrintStats( pAig );
+ }
// rewrite
Dar_ManRewrite( pAig, pParsRwr );
pAig = Aig_ManDupDfs( pTemp = pAig );
Aig_ManStop( pTemp );
if ( fVerbose ) Aig_ManPrintStats( pAig );
-/*
+
// refactor
Dar_ManRefactor( pAig, pParsRef );
pAig = Aig_ManDupDfs( pTemp = pAig );
Aig_ManStop( pTemp );
if ( fVerbose ) Aig_ManPrintStats( pAig );
-*/
+
// balance
if ( fBalance )
{
@@ -167,9 +175,9 @@ Aig_Man_t * Dar_ManCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
// balance
if ( fBalance )
{
-// pAig = Dar_ManBalance( pTemp = pAig, fUpdateLevel );
-// Aig_ManStop( pTemp );
-// if ( fVerbose ) Aig_ManPrintStats( pAig );
+ pAig = Dar_ManBalance( pTemp = pAig, fUpdateLevel );
+ Aig_ManStop( pTemp );
+ if ( fVerbose ) Aig_ManPrintStats( pAig );
}
// rewrite
@@ -239,9 +247,9 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
// balance
if ( fBalance )
{
-// pAig = Dar_ManBalance( pTemp = pAig, fUpdateLevel );
-// Aig_ManStop( pTemp );
-// if ( fVerbose ) Aig_ManPrintStats( pAig );
+ pAig = Dar_ManBalance( pTemp = pAig, fUpdateLevel );
+ Aig_ManStop( pTemp );
+ if ( fVerbose ) Aig_ManPrintStats( pAig );
}
@@ -336,7 +344,7 @@ Vec_Ptr_t * Dar_ManChoiceSynthesis( Aig_Man_t * pAig, int fBalance, int fUpdateL
Aig_ManForEachObj( pAig, pObj, i )
pObj->pHaig = pObj;
- pAig = Dar_ManCompress (pAig, 0, fUpdateLevel, fVerbose);
+ pAig = Dar_ManCompress (pAig, fBalance, fUpdateLevel, fVerbose);
Vec_PtrPush( vAigs, pAig );
//Aig_ManPrintStats( pAig );