From c861635cddb43f41873c1fc4246bea9aede24c14 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 20 Sep 2018 14:34:59 -0700 Subject: Preserving output names while deriving a miter. --- src/aig/gia/giaDup.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/aig/gia') diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c index 55d24cfd..923fbbad 100644 --- a/src/aig/gia/giaDup.c +++ b/src/aig/gia/giaDup.c @@ -2813,6 +2813,30 @@ Gia_Man_t * Gia_ManDupAndOr( Gia_Man_t * p, int nOuts, int fUseOr, int fCompl ) return pNew; } +/**Function************************************************************* + + Synopsis [Transforms output names.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Vec_Ptr_t * Gia_ManMiterNames( Vec_Ptr_t * p ) +{ + char * pName1, * pName2, pBuffer[1000]; int i; + Vec_Ptr_t * pNew = Vec_PtrAlloc( Vec_PtrSize(p)/2 ); + assert( Vec_PtrSize(p) % 2 == 0 ); + Vec_PtrForEachEntryDouble( char *, char *, p, pName1, pName2, i ) + { + sprintf( pBuffer, "%s_xor_%s", pName1, pName2 ); + Vec_PtrPush( pNew, Abc_UtilStrsav(pBuffer) ); + } + return pNew; +} + /**Function************************************************************* Synopsis [Transforms the circuit into a regular miter.] @@ -2853,6 +2877,8 @@ Gia_Man_t * Gia_ManTransformMiter( Gia_Man_t * p ) Gia_ManStop( pTemp ); if ( p->vNamesIn ) pNew->vNamesIn = Vec_PtrDupStr(p->vNamesIn); + if ( p->vNamesOut ) + pNew->vNamesOut = Gia_ManMiterNames(p->vNamesOut); return pNew; } Gia_Man_t * Gia_ManTransformMiter2( Gia_Man_t * p ) -- cgit v1.2.3