@@ -1103,23 +1103,31 @@ Vec_Int_t * Gia_ManCreatePerm( int n )
11031103 }
11041104 return vPerm ;
11051105}
1106- Gia_Man_t * Gia_ManDupRandPerm ( Gia_Man_t * p )
1106+ Gia_Man_t * Gia_ManDupRandPerm ( Gia_Man_t * p , int fVerbose )
11071107{
11081108 Vec_Int_t * vPiPerm = Gia_ManCreatePerm ( Gia_ManCiNum (p ) );
11091109 Vec_Int_t * vPoPerm = Gia_ManCreatePerm ( Gia_ManCoNum (p ) );
11101110 Gia_Man_t * pNew ;
11111111 Gia_Obj_t * pObj ;
1112- int i ;
1112+ int i , fCompl = 0 ;
11131113 pNew = Gia_ManStart ( Gia_ManObjNum (p ) );
11141114 pNew -> pName = Abc_UtilStrsav ( p -> pName );
11151115 pNew -> pSpec = Abc_UtilStrsav ( p -> pSpec );
11161116 Gia_ManConst0 (p )-> Value = 0 ;
1117- Gia_ManForEachPi ( p , pObj , i )
1118- Gia_ManPi (p , Vec_IntEntry (vPiPerm ,i ))-> Value = Gia_ManAppendCi (pNew ) ^ (Abc_Random (0 ) & 1 );
1117+ if ( fVerbose ) printf ( "Input NP transform: " );
1118+ Gia_ManForEachPi ( p , pObj , i ) {
1119+ Gia_ManPi (p , Vec_IntEntry (vPiPerm ,i ))-> Value = Gia_ManAppendCi (pNew ) ^ (fCompl = (Abc_Random (0 ) & 1 ));
1120+ if ( fVerbose ) printf ( "%s%d " , fCompl ? "~" :"" , Vec_IntEntry (vPiPerm ,i ) );
1121+ }
1122+ if ( fVerbose ) printf ( "\n" );
11191123 Gia_ManForEachAnd ( p , pObj , i )
11201124 pObj -> Value = Gia_ManAppendAnd ( pNew , Gia_ObjFanin0Copy (pObj ), Gia_ObjFanin1Copy (pObj ) );
1121- Gia_ManForEachPo ( p , pObj , i )
1122- Gia_ManAppendCo ( pNew , Gia_ObjFanin0Copy (Gia_ManPo (p , Vec_IntEntry (vPoPerm ,i ))) ^ (Abc_Random (0 ) & 1 ) );
1125+ if ( fVerbose ) printf ( "Output NP transform: " );
1126+ Gia_ManForEachPo ( p , pObj , i ) {
1127+ Gia_ManAppendCo ( pNew , Gia_ObjFanin0Copy (Gia_ManPo (p , Vec_IntEntry (vPoPerm ,i ))) ^ (fCompl = (Abc_Random (0 ) & 1 )) );
1128+ if ( fVerbose ) printf ( "%s%d " , fCompl ? "~" :"" , Vec_IntEntry (vPoPerm ,i ) );
1129+ }
1130+ if ( fVerbose ) printf ( "\n" );
11231131 Vec_IntFree ( vPiPerm );
11241132 Vec_IntFree ( vPoPerm );
11251133 return pNew ;
0 commit comments