Commit 6b554f10 by Alan Mishchenko

Bug fix in deriving names for the miter output.

parent 0a1fb03e
...@@ -2824,16 +2824,21 @@ Gia_Man_t * Gia_ManDupAndOr( Gia_Man_t * p, int nOuts, int fUseOr, int fCompl ) ...@@ -2824,16 +2824,21 @@ Gia_Man_t * Gia_ManDupAndOr( Gia_Man_t * p, int nOuts, int fUseOr, int fCompl )
SeeAlso [] 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; char * pName1, * pName2, pBuffer[1000]; int i;
Vec_Ptr_t * pNew = Vec_PtrAlloc( Vec_PtrSize(p)/2 ); Vec_Ptr_t * pNew = Vec_PtrAlloc( Vec_PtrSize(p) - nOuts/2 );
assert( Vec_PtrSize(p) % 2 == 0 ); assert( nOuts % 2 == 0 );
assert( nOuts <= Vec_PtrSize(p) );
Vec_PtrForEachEntryDouble( char *, char *, p, pName1, pName2, i ) Vec_PtrForEachEntryDouble( char *, char *, p, pName1, pName2, i )
{ {
if ( i == nOuts )
break;
sprintf( pBuffer, "%s_xor_%s", pName1, pName2 ); sprintf( pBuffer, "%s_xor_%s", pName1, pName2 );
Vec_PtrPush( pNew, Abc_UtilStrsav(pBuffer) ); Vec_PtrPush( pNew, Abc_UtilStrsav(pBuffer) );
} }
Vec_PtrForEachEntryStart( char *, p, pName1, i, i )
Vec_PtrPush( pNew, Abc_UtilStrsav(pName1) );
return pNew; return pNew;
} }
...@@ -2878,7 +2883,7 @@ Gia_Man_t * Gia_ManTransformMiter( Gia_Man_t * p ) ...@@ -2878,7 +2883,7 @@ Gia_Man_t * Gia_ManTransformMiter( Gia_Man_t * p )
if ( p->vNamesIn ) if ( p->vNamesIn )
pNew->vNamesIn = Vec_PtrDupStr(p->vNamesIn); pNew->vNamesIn = Vec_PtrDupStr(p->vNamesIn);
if ( p->vNamesOut ) if ( p->vNamesOut )
pNew->vNamesOut = Gia_ManMiterNames(p->vNamesOut); pNew->vNamesOut = Gia_ManMiterNames(p->vNamesOut, Gia_ManPoNum(p));
return pNew; return pNew;
} }
Gia_Man_t * Gia_ManTransformMiter2( Gia_Man_t * p ) Gia_Man_t * Gia_ManTransformMiter2( Gia_Man_t * p )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment