From c16f5d6494982ccbbdaa5226e869ffafef0b9530 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 12 Nov 2011 13:30:28 -0800 Subject: Bug fix in GLA PBA. --- src/aig/gia/giaDup.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/aig/gia/giaDup.c') diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c index 1faa13cd..f1508375 100644 --- a/src/aig/gia/giaDup.c +++ b/src/aig/gia/giaDup.c @@ -1619,7 +1619,7 @@ Gia_Man_t * Gia_ManDupAbsGates( Gia_Man_t * p, Vec_Int_t * vGateClasses ) { Vec_Int_t * vAssigned, * vPis, * vPPis, * vFlops, * vNodes; Gia_Man_t * pNew, * pTemp; - Gia_Obj_t * pObj; + Gia_Obj_t * pObj, * pCopy; int i, nFlops = 0; assert( Gia_ManPoNum(p) == 1 ); assert( Vec_IntSize(vGateClasses) == Gia_ManObjNum(p) ); @@ -1672,11 +1672,23 @@ Gia_Man_t * Gia_ManDupAbsGates( Gia_Man_t * p, Vec_Int_t * vGateClasses ) Gia_ObjRoToRi(p, pObj)->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(Gia_ObjRoToRi(p, pObj)) ); Gia_ManSetRegNum( pNew, Vec_IntSize(vFlops) ); // clean up -// pNew = Gia_ManSeqCleanup( pTemp = pNew ); - pNew = Gia_ManCleanup( pTemp = pNew ); + pNew = Gia_ManSeqCleanup( pTemp = pNew ); + // transfer copy values: (p -> pTemp -> pNew) => (p -> pNew) if ( Gia_ManObjNum(pTemp) != Gia_ManObjNum(pNew) ) - printf( "Gia_ManDupAbsGates() Internal error: object mismatch.\n" ); - assert( Gia_ManObjNum(pTemp) == Gia_ManObjNum(pNew) ); + { +// printf( "Gia_ManDupAbsGates() Internal error: object mismatch.\n" ); + Gia_ManForEachObj( p, pObj, i ) + { + if ( !~pObj->Value ) + continue; + assert( !Gia_LitIsCompl(pObj->Value) ); + pCopy = Gia_ObjCopy( pTemp, pObj ); + if ( !~pCopy->Value ) + continue; + assert( !Gia_LitIsCompl(pCopy->Value) ); + pObj->Value = pCopy->Value; + } + } Gia_ManStop( pTemp ); Vec_IntFree( vPis ); -- cgit v1.2.3