diff options
Diffstat (limited to 'src/aig/gia/giaDup.c')
-rw-r--r-- | src/aig/gia/giaDup.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c index 269c2215..d8ddff38 100644 --- a/src/aig/gia/giaDup.c +++ b/src/aig/gia/giaDup.c @@ -525,7 +525,7 @@ Gia_Man_t * Gia_ManDup( Gia_Man_t * p ) pNew = Gia_ManStart( Gia_ManObjNum(p) ); pNew->pName = Abc_UtilStrsav( p->pName ); pNew->pSpec = Abc_UtilStrsav( p->pSpec ); - if ( p->pSibls ) + if ( Gia_ManHasChoices(p) ) pNew->pSibls = ABC_CALLOC( int, Gia_ManObjNum(p) ); Gia_ManConst0(p)->Value = 0; Gia_ManForEachObj1( p, pObj, i ) @@ -975,7 +975,7 @@ Gia_Man_t * Gia_ManDupMarked( Gia_Man_t * p ) if ( p->pReprs && p->pNexts ) { Gia_Obj_t * pRepr; - pNew->pReprs = ABC_CALLOC( Gia_Rpr_t, Gia_ManObjNum(p) ); + pNew->pReprs = ABC_CALLOC( Gia_Rpr_t, Gia_ManObjNum(pNew) ); for ( i = 0; i < Gia_ManObjNum(p); i++ ) Gia_ObjSetRepr( pNew, i, GIA_VOID ); Gia_ManForEachObj1( p, pObj, i ) @@ -985,7 +985,6 @@ Gia_Man_t * Gia_ManDupMarked( Gia_Man_t * p ) pRepr = Gia_ObjReprObj( p, i ); if ( pRepr == NULL ) continue; -// assert( ~pRepr->Value ); if ( !~pRepr->Value ) continue; if ( Abc_Lit2Var(pObj->Value) != Abc_Lit2Var(pRepr->Value) ) @@ -993,6 +992,23 @@ Gia_Man_t * Gia_ManDupMarked( Gia_Man_t * p ) } pNew->pNexts = Gia_ManDeriveNexts( pNew ); } + if ( Gia_ManHasChoices(p) ) + { + Gia_Obj_t * pSibl; + pNew->pSibls = ABC_CALLOC( int, Gia_ManObjNum(pNew) ); + Gia_ManForEachObj1( p, pObj, i ) + { + if ( !~pObj->Value ) + continue; + pSibl = Gia_ObjSiblObj( p, i ); + if ( pSibl == NULL ) + continue; + if ( !~pSibl->Value ) + continue; + assert( Abc_Lit2Var(pObj->Value) > Abc_Lit2Var(pSibl->Value) ); + pNew->pSibls[Abc_Lit2Var(pObj->Value)] = Abc_Lit2Var(pSibl->Value); + } + } return pNew; } |