93 p -> maxNumClass = Gia_ManCiNum( pSpec ) + Gia_ManAndNotBufNum(pSpec) + Gia_ManAndNum(pImpl) + 2 + Gia_ManCoNum(pSpec) * 2;
96 p -> vBmiter2Spec = Vec_PtrAlloc(
p -> maxNumClass );
97 p -> vBmiter2Impl = Vec_PtrAlloc(
p -> maxNumClass );
98 Vec_PtrFill(
p -> vBmiter2Spec,
p -> maxNumClass, 0 );
99 Vec_PtrFill(
p -> vBmiter2Impl,
p -> maxNumClass, 0 );
100 for( i = 0; i < Vec_PtrSize(
p -> vBmiter2Impl ); i ++ )
102 Vec_PtrSetEntry(
p -> vBmiter2Spec, i, Vec_IntAlloc(1) );
103 Vec_PtrSetEntry(
p -> vBmiter2Impl, i, Vec_IntAlloc(1) );
106 p -> vSpec2Impl_phase = Vec_BitAlloc( Gia_ManObjNum(pSpec) );
107 Vec_BitFill(
p -> vSpec2Impl_phase, Gia_ManObjNum(pSpec), 0 );
109 p -> vImpl2Bmiter = Vec_IntAlloc( Gia_ManObjNum(pImpl) );
110 Vec_IntFill(
p -> vImpl2Bmiter, Gia_ManObjNum(pImpl),
p -> maxNumClass - 1 );
111 p -> vSpec2Bmiter = Vec_IntAlloc( Gia_ManObjNum(pSpec) );
112 Vec_IntFill(
p -> vSpec2Bmiter, Gia_ManObjNum(pSpec),
p -> maxNumClass - 1);
114 p -> vBI = Vec_IntAlloc(16);
115 p -> vBO = Vec_IntAlloc(16);
116 p -> vEI_spec = Vec_IntAlloc(16);
117 p -> vEO_spec = Vec_IntAlloc(16);
118 p -> vEI_impl = Vec_IntAlloc(16);
119 p -> vEO_impl = Vec_IntAlloc(16);
120 p -> vEI_phase = Vec_BitAlloc(16);
121 p -> vEO_phase = Vec_BitAlloc(16);
123 p -> nNode_spec = Gia_ManAndNum(pSpec) - Gia_ManBufNum(pSpec);
124 p -> nNode_impl = Gia_ManAndNum(pImpl);
125 p -> nNode_patch = 0;
126 p -> nNode_patched = 0;
128 p -> fVerbose = fVerbose;
130 p -> combLoop_spec = 0;
131 p -> combLoop_impl = 0;
135 p -> nChoice_spec = 0;
136 p -> nChoice_impl = 0;
137 p -> feedthrough = 0;
157 Vec_PtrFree(
pBnd-> vBmiter2Spec );
158 Vec_PtrFree(
pBnd-> vBmiter2Impl );
159 Vec_BitFree(
pBnd-> vSpec2Impl_phase );
160 Vec_IntFree(
pBnd-> vImpl2Bmiter );
161 Vec_IntFree(
pBnd-> vSpec2Bmiter );
163 Vec_IntFree(
pBnd->vBI );
164 Vec_IntFree(
pBnd->vBO );
165 Vec_IntFree(
pBnd->vEI_spec );
166 Vec_IntFree(
pBnd->vEO_spec );
167 Vec_IntFree(
pBnd->vEI_impl );
168 Vec_IntFree(
pBnd->vEO_impl );
169 Vec_BitFree(
pBnd->vEI_phase );
170 Vec_BitFree(
pBnd->vEO_phase );
183 Vec_IntPush( (
Vec_Int_t *)Vec_PtrEntry(
pBnd -> vBmiter2Spec, iLit >> 1),
id );
184 Vec_BitSetEntry(
pBnd -> vSpec2Impl_phase,
id, iLit & 1 );
188 assert( (iLit & 1) == 0 );
189 Vec_IntPush( (
Vec_Int_t *)Vec_PtrEntry(
pBnd -> vBmiter2Impl, iLit >> 1),
id );
202 Vec_Int_t *vIds_spec_repr, *vIds_impl_repr, *vIds_spec_obj, *vIds_impl_obj;
204 vIds_spec_repr = (
Vec_Int_t *)Vec_PtrEntry( vBmiter2Spec, id_repr );
205 vIds_impl_repr = (
Vec_Int_t *)Vec_PtrEntry( vBmiter2Impl, id_repr );
206 vIds_spec_obj = (
Vec_Int_t *)Vec_PtrEntry( vBmiter2Spec, id_obj );
207 vIds_impl_obj = (
Vec_Int_t *)Vec_PtrEntry( vBmiter2Impl, id_obj );
211 Vec_IntPush(vIds_spec_repr,
id);
215 Vec_IntPush(vIds_impl_repr,
id);
223 Vec_BitSetEntry( vSpec2Impl_phase,
id, !Vec_BitEntry(vSpec2Impl_phase,
id) );
228 Vec_IntClear(vIds_spec_obj);
229 Vec_IntClear(vIds_impl_obj);
241 pBnd -> nMerged_impl = 0;
242 pBnd -> nMerged_spec = 0;
245 for( i = 0; i < Vec_PtrSize(vBmiter2Spec); i++ )
247 vSpec = (
Vec_Int_t *)Vec_PtrEntry( vBmiter2Spec, i );
248 vImpl = (
Vec_Int_t *)Vec_PtrEntry( vBmiter2Impl, i );
253 Vec_IntSetEntry(
pBnd->vSpec2Bmiter,
id, i );
259 Vec_IntSetEntry(
pBnd->vImpl2Bmiter,
id, i );
263 if ( Vec_IntSize(vSpec) != 0 )
265 pBnd->nMerged_spec += Vec_IntSize(vSpec) - 1;
267 if ( Vec_IntSize(vImpl) != 0 )
269 pBnd->nMerged_impl += Vec_IntSize(vImpl) - 1;
280 for(
int j=0; j < Vec_PtrSize(vBmiter2Spec); j++ )
282 printf(
"node %d: ", j);
283 vIds_spec = (
Vec_Int_t *)Vec_PtrEntry( vBmiter2Spec, j);
284 vIds_impl = (
Vec_Int_t *)Vec_PtrEntry( vBmiter2Impl, j);
300 printf(
"BI spec:\t"); Vec_IntPrint(
pBnd -> vBI);
301 printf(
"BO spec:\t"); Vec_IntPrint(
pBnd -> vBO);
302 printf(
"EI spec:\t"); Vec_IntPrint(
pBnd -> vEI_spec);
303 printf(
"EI impl:\t"); Vec_IntPrint(
pBnd -> vEI_impl);
304 printf(
"EI phase:\t"); Vec_BitPrint(
pBnd -> vEI_phase);
305 printf(
"EO spec:\t"); Vec_IntPrint(
pBnd -> vEO_spec);
306 printf(
"EO impl:\t"); Vec_IntPrint(
pBnd -> vEO_impl);
307 printf(
"EO phase:\t"); Vec_BitPrint(
pBnd -> vEO_phase);
318 if (
p->nChoice_spec > 0 )
321 printf(
"WARNING: multiple equiv nodes on the boundary of spec\n");
323 if (
p->nChoice_impl > 0 )
326 printf(
"WARNING: multiple equiv nodes on the boundary of impl\n");
329 printf(
"The outsides of spec and impl are %sEQ.\n",
p->eq_out ?
"" :
"NOT " );
330 printf(
"The patched impl is %sEQ. to spec (and impl)\n",
p->eq_res ?
"" :
"NOT " );
344 printf(
"\nRESULT\n");
345 printf(
"%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
348 p->nBI_miss,
p->nBO_miss,
349 Vec_IntSize(
p->vEI_spec), Vec_IntSize(
p->vEO_spec),
p->nExtra,
350 p->nNode_spec,
p->nNode_impl,
p->nNode_patched,
351 p->combLoop_spec,
p->combLoop_impl,
358 printf(
"#Choice Spec\t%d\n",
p->nChoice_spec);
359 printf(
"#Choice Impl\t%d\n",
p->nChoice_impl);
384 int nBI = 0, nBO = 0, nInternal = 0;
386 if ( fVerbose ) printf(
"Checking boundary... \n");
389 vPath = Vec_IntAlloc( Gia_ManObjNum(
p) );
390 Vec_IntFill( vPath, Gia_ManObjNum(
p), 0 );
395 if ( Gia_ObjIsCo( pObj ) )
397 Vec_IntSetEntry( vPath, Gia_ObjId(
p, pObj ), 1 );
400 path = Vec_IntEntry( vPath, Gia_ObjId(
p, pObj) );
406 printf(
"there're more than 2 bufs in a path\n");
411 if( Gia_ObjIsBuf( pObj ) )
413 Vec_IntSetEntry( vPath, Gia_ObjId(
p, Gia_ObjFanin0( pObj ) ), Vec_IntEntry( vPath, Gia_ObjId(
p, Gia_ObjFanin0( pObj ) ) ) | path << 1 );
420 else if ( Gia_ObjFaninNum(
p, pObj ) >= 1 )
422 Vec_IntSetEntry( vPath, Gia_ObjId(
p, Gia_ObjFanin0( pObj ) ), Vec_IntEntry( vPath, Gia_ObjId(
p, Gia_ObjFanin0( pObj ) ) ) | path );
423 if ( Gia_ObjFaninNum(
p, pObj ) >= 2 )
425 assert( Gia_ObjFaninNum(
p, pObj ) <= 2 );
426 Vec_IntSetEntry( vPath, Gia_ObjId(
p, Gia_ObjFanin1( pObj ) ), Vec_IntEntry( vPath, Gia_ObjId(
p, Gia_ObjFanin1( pObj ) ) ) | path );
436 if ( (Vec_IntEntry( vPath, Gia_ObjId(
p, pObj) ) | 5) != 5 )
439 printf(
"incorrect buf number at pi %d\n", Vec_IntEntry(vPath, Gia_ObjId(
p, pObj)) );
445 nBI = Gia_ManBufNum(
p) - nBO;
449 printf(
"invalid boundary\n");
454 printf(
"no boundary\n");
461 printf(
"valid boundary (");
462 printf(
"#BI = %d\t#BO = %d\t", nBI, Gia_ManBufNum(
p)- nBI);
463 printf(
"#Internal = %d)\n", nInternal );
469 pBnd -> nInternal = nInternal;
478 int id = Gia_ObjId(
p, pObj);
479 if ( Vec_IntEntry(vFlag,
id) == 1 )
return 1;
480 if ( Vec_IntEntry(vFlag,
id) == 2 )
return 0;
482 Vec_IntSetEntry(vFlag,
id, 1);
485 for(
int i = 0; i < Gia_ObjFaninNum(
p, pObj); i++ )
510 Vec_Int_t *vFlag = Vec_IntAlloc( Gia_ManObjNum(
p) );
511 Vec_IntFill( vFlag, Gia_ManObjNum(
p), 0 );
517 Vec_IntSetEntry( vFlag,
id, 2 );
522 if ( Vec_IntEntry(vFlag,
id) == 2 )
continue;
571 vQ = Vec_PtrAlloc(16);
572 vFlag = Vec_IntAlloc( Gia_ManObjNum(
p) );
573 Vec_IntFill( vFlag, Gia_ManObjNum(
p), 0 );
581 if ( cnt < pBnd -> nBI )
583 Vec_IntPush( vBI, Gia_ObjId(
p, Gia_ObjFanin0(pObj) ) );
587 Vec_IntPush( vBO, Gia_ObjId(
p, pObj) );
597 Vec_PtrPush( vQ, Gia_ManObj(
p,
id) );
601 Vec_IntPush(vEO_spec,
id);
604 if (
pBnd -> fVerbose ) printf(
"%d BO doesn't match. ", Vec_PtrSize(vQ) );
605 pBnd -> nBO_miss = Vec_PtrSize(vQ);
607 int cnt_extra = - Vec_PtrSize(vQ);
608 while( Vec_PtrSize(vQ) > 0 )
611 id = Gia_ObjId(
p, pObj );
613 if ( Vec_IntEntry( vFlag,
id ) == 1 )
continue;
614 Vec_IntSetEntry( vFlag,
id, 1 );
620 Vec_IntPush( vEO_spec,
id );
621 Vec_IntPush( vAO,
id );
625 for( j = 0; j < Gia_ObjFanoutNum(
p, pObj); j++ )
627 Vec_PtrPush( vQ, Gia_ObjFanout(
p, pObj, j) );
633 if (
pBnd -> fVerbose ) printf(
"%d AO found\n", Vec_IntSize(vAO) );
640 Vec_PtrPush( vQ, Gia_ManObj(
p,
id) );
644 Vec_IntSetEntry( vFlag,
id, 0 );
646 while( Vec_PtrSize(vQ) > 0 )
649 id = Gia_ObjId(
p, pObj );
651 if ( Vec_IntEntry( vFlag,
id ) == 1 )
continue;
652 Vec_IntSetEntry( vFlag,
id, 1 );
654 for( j = 0; j < Gia_ObjFanoutNum(
p, pObj); j++ )
656 Vec_PtrPush( vQ, Gia_ObjFanout(
p, pObj, j) );
669 Vec_PtrPush( vQ, Gia_ManObj(
p,
id) );
673 Vec_IntPush(vEI_spec,
id);
676 if (
pBnd -> fVerbose ) printf(
"%d BI doesn't match. ", Vec_PtrSize(vQ) );
677 pBnd -> nBI_miss = Vec_PtrSize(vQ);
678 cnt_extra -= Vec_PtrSize(vQ);
683 Vec_PtrPush( vQ, Gia_ManObj(
p,
id) );
689 Vec_IntSetEntry( vFlag,
id, 2 );
693 while( Vec_PtrSize(vQ) > 0 )
696 id = Gia_ObjId(
p, pObj );
698 if ( Vec_IntEntry( vFlag,
id ) == 2 )
continue;
705 Vec_IntPush( vEI_spec,
id );
706 Vec_IntPush( vAI,
id );
710 for( j = 0; j < Gia_ObjFaninNum(
p, pObj); j++ )
712 Vec_PtrPush( vQ, Gia_ObjFanin(pObj, j) );
717 Vec_IntSetEntry( vFlag,
id, 2 );
719 if (
pBnd -> fVerbose ) printf(
"%d AI found with %d extra nodes in total\n", Vec_IntSize(vAI) , cnt_extra );
720 pBnd -> nExtra = cnt_extra;
727 Vec_BitPush( vEI_phase, Vec_BitEntry( vSpec2Impl_phase,
id ) );
732 Vec_BitPush( vEO_phase, Vec_BitEntry( vSpec2Impl_phase,
id ) );
747 if (
pBnd -> fVerbose )
749 printf(
"#EI = %d\t#EO = %d\t#Extra Node = %d\n", Vec_IntSize(vEI_spec) , Vec_IntSize(vEO_spec), cnt_extra );
757 printf(
"Combinational loop exist\n");
758 pBnd -> combLoop_spec = 1;
790 printf(
"Combinational loop exist\n");
791 pBnd -> combLoop_impl = 1;
798 sprintf( pNew -> pName,
"%s_out",
p -> pName );
801 Gia_ManConst0(
p) -> Value = 0;
805 vValue = Vec_IntAlloc( Gia_ManObjNum(
p) );
806 Vec_IntFill( vValue, Gia_ManObjNum(
p), -1 );
811 pObj -> Value = Gia_ManAppendCi( pNew );
815 if( Gia_ManObj(
p,
id) -> Value != ~0 )
817 Vec_IntSetEntry( vValue,
id, Gia_ManObj(
p,
id) -> Value );
819 Gia_ManObj(
p,
id ) -> Value = Gia_ManAppendCi(pNew);
820 if ( vEO_phase && Vec_BitEntry( vEO_phase, i ) )
822 Gia_ManObj(
p,
id ) -> Value ^= 1;
829 if ( pObj -> Value != ~0 )
continue;
830 pObj -> Value =
Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
836 Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
840 pObj = Gia_ManObj(
p,
id);
842 if ( Gia_ObjIsAnd(pObj) )
lit =
Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
845 assert(Gia_ObjIsCi(pObj) || Gia_ObjIsConst0(pObj));
846 if ( Vec_IntEntry(vValue,
id) != -1 )
848 lit = Vec_IntEntry( vValue,
id );
854 if ( vEI_phase && Vec_BitEntry( vEI_phase, i ) )
lit ^= 1;
855 Gia_ManAppendCo( pNew,
lit );
859 Vec_IntFree( vValue );
869 if (
pBnd -> fVerbose ) printf(
"Generating spec_out with given boundary.\n");
875 if (
pBnd -> fVerbose ) printf(
"Generating impl_out with given boundary.\n");
877 if (!pNew)
pBnd -> combLoop_impl = 1;
884 if ( pObj -> Value != ~0 )
return;
886 for(
int i = 0; i < Gia_ObjFaninNum(
p, pObj); i++ )
891 if ( Gia_ObjIsAnd(pObj) )
895 if ( Gia_ObjIsBuf(pObj) ) pObj -> Value = Gia_ManAppendBuf( pNew, Gia_ObjFanin0Copy(pObj) );
896 else pObj -> Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
900 pObj -> Value =
Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
905 assert( Gia_ObjIsCo(pObj) );
907 pObj -> Value = Gia_ObjFanin0Copy(pObj);
930 pBnd -> nNode_patch = Gia_ManAndNotBufNum( pPatch );
932 pNew =
Gia_ManStart( Gia_ManObjNum(pOut) + Gia_ManObjNum( pSpec ) + Gia_ManObjNum(pPatch) );
934 sprintf( pNew -> pName,
"%s_p", pOut -> pName );
939 Gia_ManConst0(pOut)->Value = 0;
940 Gia_ManConst0(pSpec)->Value = 0;
941 Gia_ManConst0(pPatch)->Value = 0;
945 vBI_patch = Vec_IntAlloc(16);
946 vBO_patch = Vec_IntAlloc(16);
949 if ( cnt < pBnd -> nBI )
951 Vec_IntPush( vBI_patch, Gia_ObjId( pPatch, pObj ) );
956 Vec_IntPush( vBO_patch, Gia_ObjId( pPatch, pObj ) );
960 assert( Vec_IntSize( vBI_patch ) == Vec_IntSize(
pBnd->vBI) );
961 assert( Vec_IntSize( vBO_patch ) == Vec_IntSize(
pBnd->vBO) );
965 for ( i = 0; i < Gia_ManCiNum(pSpec); i++ )
967 pObj = Gia_ManCi(pOut, i);
968 pObj -> Value = Gia_ManAppendCi( pNew );
973 for ( i = 0; i < Vec_IntSize(
pBnd -> vEI_spec ); i++ )
975 pObj = Gia_ManCo(pOut, i + Gia_ManCoNum(pSpec) );
979 Gia_ManObj( pSpec, Vec_IntEntry(
pBnd -> vEI_spec, i) ) -> Value = pObj -> Value;
988 pObj = Gia_ManObj( pSpec,
id );
992 Gia_ManObj( pPatch, Vec_IntEntry( vBI_patch, i) ) -> Value = pObj -> Value;
1001 pObj = Gia_ManObj( pPatch,
id );
1005 Gia_ManObj( pSpec, Vec_IntEntry(
pBnd -> vBO, i) ) -> Value = pObj -> Value;
1014 pObj = Gia_ManObj( pSpec,
id );
1018 Gia_ManCi( pOut, i + Gia_ManCiNum(pSpec) ) -> Value = pObj -> Value;
1025 for ( i = 0; i < Gia_ManCoNum(pSpec); i++ )
1027 pObj = Gia_ManCo( pOut, i );
1029 Gia_ManAppendCo( pNew, pObj->
Value );
1036 Vec_IntFree( vBI_patch );
1037 Vec_IntFree( vBO_patch );
1043 pBnd -> nNode_patched = Gia_ManAndNum( pNew );
1066 pNew =
Gia_ManStart( Gia_ManObjNum(pOut) + Gia_ManObjNum( pSpec ) );
1068 sprintf( pNew -> pName,
"%s_p", pOut -> pName );
1072 Gia_ManConst0(pOut)->Value = 0;
1073 Gia_ManConst0(pSpec)->Value = 0;
1077 for ( i = 0; i < Gia_ManCiNum(pSpec); i++ )
1079 pObj = Gia_ManCi(pOut, i);
1080 pObj -> Value = Gia_ManAppendCi( pNew );
1085 for ( i = 0; i < Vec_IntSize(
pBnd -> vEI_spec ); i++ )
1087 pObj = Gia_ManCo(pOut, i + Gia_ManCoNum(pSpec) );
1091 Gia_ManObj( pSpec, Vec_IntEntry(
pBnd -> vEI_spec, i) ) -> Value = pObj -> Value;
1114 pObj = Gia_ManObj( pSpec,
id );
1118 Gia_ManCi( pOut, i + Gia_ManCiNum(pSpec) ) -> Value = pObj -> Value;
1125 for ( i = 0; i < Gia_ManCoNum(pSpec); i++ )
1127 pObj = Gia_ManCo( pOut, i );
1129 Gia_ManAppendCo( pNew, pObj->
Value );
1139 pBnd -> nNode_patched = Gia_ManAndNum( pNew );
1161 int i, nBI, nBI_patch, cnt;
1168 if ( 0 == nBI_patch || Gia_ManBufNum(pImpl) != Gia_ManBufNum(pPatch) || nBI != nBI_patch )
1170 Abc_Print( -1,
"Abc_CommandAbc9StrEco(): The given boundary is invalid.\n" );
1175 pNew =
Gia_ManStart( Gia_ManObjNum(pImpl) + Gia_ManObjNum( pPatch ) );
1177 sprintf( pNew -> pName,
"%s_p", pImpl -> pName );
1184 Gia_ManConst0(pImpl)->Value = 0;
1185 Gia_ManConst0(pPatch)->Value = 0;
1187 vLit = Vec_IntAlloc( Gia_ManBufNum(pImpl) );
1192 pObj -> Value = Gia_ManAppendCi( pNew );
1200 Vec_IntPush( vLit, pObj -> Value );
1202 if ( cnt >= nBI )
break;
1212 pObj -> Value = Vec_IntEntry( vLit, cnt );
1217 Vec_IntPush( vLit, pObj -> Value );
1220 if ( cnt == nBI ) Vec_IntClear( vLit );
1228 if ( cnt <= nBI)
continue;
1229 pObj -> Value = Vec_IntEntry( vLit, cnt-nBI-1 );
1236 Gia_ManAppendCo( pNew, pObj -> Value );
1244 Vec_IntFree( vLit );
1258 if ( Gia_ManBufNum(pSpec) == 0 ) {
1259 printf(
"The spec AIG should have a boundary.\n" );
1262 if ( Gia_ManBufNum(pImpl) != 0 ) {
1263 printf(
"The impl AIG should have no boundary.\n" );
1267 assert( Gia_ManBufNum(pSpec) > 0 );
1268 assert( Gia_ManBufNum(pImpl) == 0 );
1269 assert( Gia_ManRegNum(pSpec) == 0 );
1270 assert( Gia_ManRegNum(pImpl) == 0 );
1271 assert( Gia_ManCiNum(pSpec) == Gia_ManCiNum(pImpl) );
1272 assert( Gia_ManCoNum(pSpec) == Gia_ManCoNum(pImpl) );
1274 pNew =
Gia_ManStart( Gia_ManObjNum(pSpec) + Gia_ManObjNum(pImpl) );
1279 Gia_ManConst0(pSpec)->Value = 0;
1280 Gia_ManConst0(pImpl)->Value = 0;
1282 for(
int i = 0; i < Gia_ManCiNum(pSpec); i++ )
1284 int iLit = Gia_ManCi(pSpec, i)->Value = Gia_ManCi(pImpl, i) -> Value = Gia_ManAppendCi(pNew);
1286 pObj = Gia_ManCi(pSpec, i);
1287 Bnd_ManMap( iLit, Gia_ObjId( pSpec, pObj ), 1 );
1289 pObj = Gia_ManCi(pImpl, i);
1290 Bnd_ManMap( iLit, Gia_ObjId( pImpl, pObj) , 0 );
1297 if (
pBnd )
Bnd_ManMap( pObj -> Value, Gia_ObjId(pImpl, pObj), 0 );
1300 Vec_Int_t* vFlag = Vec_IntAlloc( Gia_ManObjNum( pSpec ) );
1301 Vec_IntFill( vFlag, Gia_ManObjNum(pSpec), 0 );
1305 if ( count < pBnd -> nBI )
1308 Vec_IntSetEntry( vFlag, Gia_ObjId( pSpec, pObj ), 1 );
1313 Vec_IntSetEntry( vFlag, Gia_ObjId( pSpec, Gia_ObjFanin0( pObj ) ), 1 );
1322 if ( Vec_IntEntry( vFlag, Gia_ObjId( pSpec, pObj ) ) == 0 )
1324 Bnd_ManMap( pObj -> Value, Gia_ObjId(pSpec, pObj), 1 );
1327 Vec_IntFree( vFlag );
1331 iLit = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
1335 iLit = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
1354 int nCO = Gia_ManCoNum(
p)/2;
1359 for (
int i = 0; i < nCO; i++ )
1361 pObj1 = Gia_ManCo(
p, i);
1362 pObj2 = Gia_ManCo(
p, i + nCO);
1363 if ( Gia_ObjFaninLit0p(
p, pObj1) != Gia_ObjFaninLit0p(
p, pObj2) )
return 0;
#define ABC_ALLOC(type, num)
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Bnd_ManSetEqRes(int eq)
int Bnd_CheckFlagRec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vFlag)
Gia_Man_t * Bnd_ManGenPatched1(Gia_Man_t *pOut, Gia_Man_t *pSpec)
Bnd_Man_t * Bnd_ManStart(Gia_Man_t *pSpec, Gia_Man_t *pImpl, int fVerbose)
int Bnd_ManCheckExtBound(Gia_Man_t *p, Vec_Int_t *vEI, Vec_Int_t *vEO)
void Bnd_ManMap(int iLit, int id, int spec)
Gia_Man_t * Bnd_ManGenImplOut(Gia_Man_t *p)
Vec_Int_t * Bnd_ManSpec2Impl(int id)
Bnd_Man_t * pBnd
DECLARATIONS ///.
void Bnd_ManMerge(int id_repr, int id_obj, int phaseDiff)
void Bnd_AddNodeRec(Gia_Man_t *p, Gia_Man_t *pNew, Gia_Obj_t *pObj, int fSkipStrash)
Gia_Man_t * Bnd_ManGenPatched(Gia_Man_t *pOut, Gia_Man_t *pSpec, Gia_Man_t *pPatch)
void Bnd_ManSetEqOut(int eq)
FUNCTION DEFINITIONS ///.
int Bnd_ManCheckCoMerged(Gia_Man_t *p)
Gia_Man_t * Bnd_ManGenPatched2(Gia_Man_t *pImpl, Gia_Man_t *pPatch, int fSkipStrash, int fVerbose)
int Bnd_ManCheckBound(Gia_Man_t *p, int fVerbose)
Gia_Man_t * Bnd_ManCutBoundary(Gia_Man_t *p, Vec_Int_t *vEI, Vec_Int_t *vEO, Vec_Bit_t *vEI_phase, Vec_Bit_t *vEO_phase)
int Bnd_ManImpl2SpecNum(int id)
Vec_Int_t * Bnd_ManImpl2Spec(int id)
Gia_Man_t * Bnd_ManStackGias(Gia_Man_t *pSpec, Gia_Man_t *pImpl)
void Bnd_ManFinalizeMappings()
int Bnd_ManSpec2ImplNum(int id)
void Bnd_ManPrintMappings()
Gia_Man_t * Bnd_ManGenSpecOut(Gia_Man_t *p)
void Bnd_ManFindBound(Gia_Man_t *p, Gia_Man_t *pImpl)
int Bnd_ManGetNInternal()
void Gia_ManStop(Gia_Man_t *p)
void Gia_ManStaticFanoutStart(Gia_Man_t *p)
void Gia_ManHashStart(Gia_Man_t *p)
#define Gia_ManForEachBuf(p, pObj, i)
#define Gia_ManForEachAnd(p, pObj, i)
#define Gia_ManForEachObjReverse1(p, pObj, i)
void Gia_ManHashAlloc(Gia_Man_t *p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
void Gia_ManFillValue(Gia_Man_t *p)
struct Gia_Man_t_ Gia_Man_t
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
struct Bnd_Man_t_ Bnd_Man_t
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
#define Gia_ManForEachCo(p, pObj, i)
#define Gia_ManForEachCi(p, pObj, i)
void Gia_ManHashStop(Gia_Man_t *p)
Vec_Bit_t * vSpec2Impl_phase
typedefABC_NAMESPACE_HEADER_START struct Vec_Bit_t_ Vec_Bit_t
INCLUDES ///.
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.