diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index 015a1da22..31761a735 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -1436,6 +1436,7 @@ extern void Gia_ManEquivFixOutputPairs( Gia_Man_t * p ); extern int Gia_ManCheckTopoOrder( Gia_Man_t * p ); extern int * Gia_ManDeriveNexts( Gia_Man_t * p ); extern void Gia_ManDeriveReprs( Gia_Man_t * p ); +extern void Gia_ManDeriveReprsFromSibls( Gia_Man_t *p ); extern int Gia_ManEquivCountLits( Gia_Man_t * p ); extern int Gia_ManEquivCountLitsAll( Gia_Man_t * p ); extern int Gia_ManEquivCountClasses( Gia_Man_t * p ); diff --git a/src/aig/gia/giaAig.c b/src/aig/gia/giaAig.c index c764a0993..07bab5fec 100644 --- a/src/aig/gia/giaAig.c +++ b/src/aig/gia/giaAig.c @@ -19,10 +19,12 @@ ***********************************************************************/ #include "giaAig.h" +#include "aig/gia/gia.h" #include "proof/fra/fra.h" #include "proof/dch/dch.h" #include "opt/dar/dar.h" #include "opt/dau/dau.h" +#include ABC_NAMESPACE_IMPL_START @@ -191,6 +193,8 @@ Gia_Man_t * Gia_ManFromAigChoices( Aig_Man_t * p ) Gia_ManSetRegNum( pNew, Aig_ManRegNum(p) ); //assert( Gia_ManObjNum(pNew) == Aig_ManObjNum(p) ); //Gia_ManCheckChoices( pNew ); + if ( pNew->pSibls ) + Gia_ManDeriveReprsFromSibls( pNew ); return pNew; } diff --git a/src/aig/gia/giaEquiv.c b/src/aig/gia/giaEquiv.c index e4f5a0d25..36e604153 100644 --- a/src/aig/gia/giaEquiv.c +++ b/src/aig/gia/giaEquiv.c @@ -310,6 +310,39 @@ void Gia_ManDeriveReprs( Gia_Man_t * p ) } } +/**Function************************************************************* + + Synopsis [Given pSibls, derives original representitives and nexts.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ + +void Gia_ManDeriveReprsFromSibls( Gia_Man_t *p ) +{ + + int i, iObj; + assert( !p->pReprs && p->pSibls ); + p->pReprs = ABC_CALLOC( Gia_Rpr_t, Gia_ManObjNum(p) ); + for ( i = 0; i < Gia_ManObjNum(p); i++ ) + Gia_ObjSetRepr( p, i, GIA_VOID ); + for ( i = 0; i < Gia_ManObjNum(p); i++ ) + { + if ( p->pSibls[i] == 0 ) + continue; + if ( p->pReprs[i].iRepr != GIA_VOID ) + continue; + for ( iObj = p->pSibls[i]; iObj; iObj = p->pSibls[iObj] ) + p->pReprs[iObj].iRepr = i; + } + ABC_FREE( p->pNexts ); + p->pNexts = Gia_ManDeriveNexts( p ); +} + /**Function************************************************************* Synopsis []