diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-09-15 23:18:43 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-09-15 23:18:43 -0700 |
commit | 5d2dc04144e322daa7dc901d2acc1923521a61d6 (patch) | |
tree | 978abd229aef525e55182b9c9ec8c349cf86d71f /src/opt | |
parent | 549fd2ed1507f4600f4838b0bf8ec01516a179ba (diff) | |
download | abc-5d2dc04144e322daa7dc901d2acc1923521a61d6.tar.gz abc-5d2dc04144e322daa7dc901d2acc1923521a61d6.tar.bz2 abc-5d2dc04144e322daa7dc901d2acc1923521a61d6.zip |
Bug fix in XOR balancing.
Diffstat (limited to 'src/opt')
-rw-r--r-- | src/opt/dar/darBalance.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/opt/dar/darBalance.c b/src/opt/dar/darBalance.c index 01cd7953..5f6fb93c 100644 --- a/src/opt/dar/darBalance.c +++ b/src/opt/dar/darBalance.c @@ -513,10 +513,6 @@ Aig_Obj_t * Dar_Balance_rec( Aig_Man_t * pNew, Aig_Obj_t * pObjOld, Vec_Vec_t * // check if supergate contains two nodes in the opposite polarity if ( vSuper->nSize == 0 ) return (Aig_Obj_t *)(pObjOld->pData = Aig_ManConst0(pNew)); - if ( vSuper->nSize == 1 ) - return (Aig_Obj_t *)((Aig_Obj_t *)Vec_PtrEntry(vSuper, 0))->pData; - if ( Vec_PtrSize(vSuper) < 2 ) - 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++ ) { @@ -525,6 +521,9 @@ Aig_Obj_t * Dar_Balance_rec( Aig_Man_t * pNew, Aig_Obj_t * pObjOld, Vec_Vec_t * return NULL; vSuper->pArray[i] = Aig_NotCond( pObjNew, Aig_IsComplement((Aig_Obj_t *)vSuper->pArray[i]) ); } + // check for exactly one node + if ( vSuper->nSize == 1 ) + return (Aig_Obj_t *)Vec_PtrEntry(vSuper, 0); // build the supergate #ifdef USE_LUTSIZE_BALANCE pObjNew = Dar_BalanceBuildSuperTop( pNew, vSuper, Aig_ObjType(pObjOld), fUpdateLevel, 6 ); |