summaryrefslogtreecommitdiffstats
path: root/src/temp/ivy/ivyBalance.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2006-08-12 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2006-08-12 08:01:00 -0700
commiteb2a5b43a46b90f3c46b388f50ea0ca8918983aa (patch)
tree55a47e46ceefc8837d8a05807d8b7169d763e3f0 /src/temp/ivy/ivyBalance.c
parent6b44b18e69f4e26249140e10c459615a77b32fc5 (diff)
downloadabc-eb2a5b43a46b90f3c46b388f50ea0ca8918983aa.tar.gz
abc-eb2a5b43a46b90f3c46b388f50ea0ca8918983aa.tar.bz2
abc-eb2a5b43a46b90f3c46b388f50ea0ca8918983aa.zip
Version abc60812
Diffstat (limited to 'src/temp/ivy/ivyBalance.c')
-rw-r--r--src/temp/ivy/ivyBalance.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/temp/ivy/ivyBalance.c b/src/temp/ivy/ivyBalance.c
index 0303485a..3e8bd6d2 100644
--- a/src/temp/ivy/ivyBalance.c
+++ b/src/temp/ivy/ivyBalance.c
@@ -59,6 +59,9 @@ Ivy_Man_t * Ivy_ManBalance( Ivy_Man_t * p, int fUpdateLevel )
Ivy_ManConst1(p)->TravId = Ivy_EdgeFromNode( Ivy_ManConst1(pNew) );
Ivy_ManForEachPi( p, pObj, i )
pObj->TravId = Ivy_EdgeFromNode( Ivy_ObjCreatePi(pNew) );
+ // if HAIG is defined, trasfer the pointers to the PIs/latches
+// if ( p->pHaig )
+// Ivy_ManHaigTrasfer( p, pNew );
// balance the AIG
vStore = Vec_VecAlloc( 50 );
Ivy_ManForEachPo( p, pObj, i )
@@ -327,10 +330,18 @@ void Ivy_NodeBalancePermute( Ivy_Man_t * p, Vec_Ptr_t * vSuper, int LeftBound, i
// get the two last nodes
pObj1 = Vec_PtrEntry( vSuper, RightBound + 1 );
pObj2 = Vec_PtrEntry( vSuper, RightBound );
+ if ( Ivy_Regular(pObj1) == p->pConst1 || Ivy_Regular(pObj2) == p->pConst1 )
+ return;
// find the first node that can be shared
for ( i = RightBound; i >= LeftBound; i-- )
{
pObj3 = Vec_PtrEntry( vSuper, i );
+ if ( Ivy_Regular(pObj3) == p->pConst1 )
+ {
+ Vec_PtrWriteEntry( vSuper, i, pObj2 );
+ Vec_PtrWriteEntry( vSuper, RightBound, pObj3 );
+ return;
+ }
pGhost = Ivy_ObjCreateGhost( p, pObj1, pObj3, fExor? IVY_EXOR : IVY_AND, IVY_INIT_NONE );
if ( Ivy_TableLookup( p, pGhost ) )
{