From 6b554f10b8e4db1b2905160b4bc6e5f5ae7303f1 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 10 Jan 2019 16:40:53 -0800 Subject: Bug fix in deriving names for the miter output. --- src/aig/gia/giaDup.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/aig/gia') diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c index 923fbbad..a485b147 100644 --- a/src/aig/gia/giaDup.c +++ b/src/aig/gia/giaDup.c @@ -2824,16 +2824,21 @@ Gia_Man_t * Gia_ManDupAndOr( Gia_Man_t * p, int nOuts, int fUseOr, int fCompl ) SeeAlso [] ***********************************************************************/ -Vec_Ptr_t * Gia_ManMiterNames( Vec_Ptr_t * p ) +Vec_Ptr_t * Gia_ManMiterNames( Vec_Ptr_t * p, int nOuts ) { char * pName1, * pName2, pBuffer[1000]; int i; - Vec_Ptr_t * pNew = Vec_PtrAlloc( Vec_PtrSize(p)/2 ); - assert( Vec_PtrSize(p) % 2 == 0 ); + Vec_Ptr_t * pNew = Vec_PtrAlloc( Vec_PtrSize(p) - nOuts/2 ); + assert( nOuts % 2 == 0 ); + assert( nOuts <= Vec_PtrSize(p) ); Vec_PtrForEachEntryDouble( char *, char *, p, pName1, pName2, i ) { + if ( i == nOuts ) + break; sprintf( pBuffer, "%s_xor_%s", pName1, pName2 ); Vec_PtrPush( pNew, Abc_UtilStrsav(pBuffer) ); } + Vec_PtrForEachEntryStart( char *, p, pName1, i, i ) + Vec_PtrPush( pNew, Abc_UtilStrsav(pName1) ); return pNew; } @@ -2878,7 +2883,7 @@ Gia_Man_t * Gia_ManTransformMiter( Gia_Man_t * p ) if ( p->vNamesIn ) pNew->vNamesIn = Vec_PtrDupStr(p->vNamesIn); if ( p->vNamesOut ) - pNew->vNamesOut = Gia_ManMiterNames(p->vNamesOut); + pNew->vNamesOut = Gia_ManMiterNames(p->vNamesOut, Gia_ManPoNum(p)); return pNew; } Gia_Man_t * Gia_ManTransformMiter2( Gia_Man_t * p ) -- cgit v1.2.3