214{
218 Vec_Int_t * vMapping, * vMapping2, * vPacking = NULL;
219 Vec_Int_t * vLeaves, * vLeaves2, * vCover;
220 word uTruth, * pTruth = &uTruth;
221 int i, k, Entry, iLitNew = 0;
222
223
224 vMapping = Vec_IntStart( Mig_ManObjNum(pMan->
pMig) );
225 vMapping2 = Vec_IntStart( 1 );
226 if ( 0 )
227 {
228 vPacking = Vec_IntAlloc( 1000 );
229 Vec_IntPush( vPacking, 0 );
230 }
231
233
234 vCover = Vec_IntAlloc( 1 << 16 );
235 vLeaves = Vec_IntAlloc( 16 );
236 vLeaves2 = Vec_IntAlloc( 16 );
237 Mig_ManCleanCopy( pMan->
pMig );
239 {
240 if ( !Mpm_ObjMapRef(pMan, pObj) && !Mig_ObjIsTerm(pObj) )
241 continue;
242 if ( Mig_ObjIsNode(pObj) )
243 {
244
245 Vec_IntClear( vLeaves );
246 pCutBest = Mpm_ObjCutBestP( pMan, pObj );
248 Vec_IntPush( vLeaves, Mig_ObjCopy(pFanin) );
250 {
254 pTruth = Mpm_CutTruth(pMan, Abc_Lit2Var(pCutBest->
iFunc));
255 else
257
258
259 iLitNew =
Gia_ManFromIfLogicNode( NULL, pNew, Mig_ObjId(pObj), vLeaves, vLeaves2, pTruth, NULL, vCover, vMapping, vMapping2, vPacking, 0, 0 );
260 iLitNew = Abc_LitNotCond( iLitNew, pCutBest->
fCompl ^ Abc_LitIsCompl(pCutBest->
iFunc) );
261 }
262 else
263 {
264
266
267 Vec_IntSetEntry( vMapping, Abc_Lit2Var(iLitNew), Vec_IntSize(vMapping2) );
268 Vec_IntPush( vMapping2, Vec_IntSize(vLeaves) );
270 assert( Abc_Lit2Var(Entry) < Abc_Lit2Var(iLitNew) );
272 Vec_IntPush( vMapping2, Abc_Lit2Var(Entry) );
273 Vec_IntPush( vMapping2, Abc_Lit2Var(iLitNew) );
274 }
275 }
276 else if ( Mig_ObjIsCi(pObj) )
277 iLitNew = Gia_ManAppendCi(pNew);
278 else if ( Mig_ObjIsCo(pObj) )
279 iLitNew = Gia_ManAppendCo( pNew, Abc_LitNotCond(Mig_ObjCopy(Mig_ObjFanin0(pObj)), Mig_ObjFaninC0(pObj)) );
280 else if ( Mig_ObjIsConst0(pObj) )
281 {
282 iLitNew = 0;
283
284 Vec_IntWriteEntry( vMapping, 0, Vec_IntSize(vMapping2) );
285 Vec_IntPush( vMapping2, 0 );
286 Vec_IntPush( vMapping2, 0 );
287 }
289 Mig_ObjSetCopy( pObj, iLitNew );
290 }
291 Vec_IntFree( vCover );
292 Vec_IntFree( vLeaves );
293 Vec_IntFree( vLeaves2 );
294
295
296
297 if ( Vec_IntSize(vMapping) > Gia_ManObjNum(pNew) )
298 Vec_IntShrink( vMapping, Gia_ManObjNum(pNew) );
299 else
300 Vec_IntFillExtra( vMapping, Gia_ManObjNum(pNew), 0 );
301 assert( Vec_IntSize(vMapping) == Gia_ManObjNum(pNew) );
303 if ( Entry > 0 )
304 Vec_IntAddToEntry( vMapping, i, Gia_ManObjNum(pNew) );
305 Vec_IntAppend( vMapping, vMapping2 );
306 Vec_IntFree( vMapping2 );
307
312
313 {
316 assert( !Gia_ObjIsAnd(Gia_ObjFanin0(pObj)) || Gia_ObjIsLut(pNew, Gia_ObjFaninId0p(pNew, pObj)) );
317 }
318 return pNew;
319}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
int Gia_ManFromIfLogicNode(void *pIfMan, Gia_Man_t *pNew, int iObj, Vec_Int_t *vLeaves, Vec_Int_t *vLeavesTemp, word *pRes, char *pStr, Vec_Int_t *vCover, Vec_Int_t *vMapping, Vec_Int_t *vMapping2, Vec_Int_t *vPacking, int fCheck75, int fCheck44e)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
#define Gia_ManForEachCo(p, pObj, i)
unsigned __int64 word
DECLARATIONS ///.
int Mpm_ManNodeIfToGia(Gia_Man_t *pNew, Mpm_Man_t *pMan, Mig_Obj_t *pObj, Vec_Int_t *vLeaves, int fHash)
word Mpm_CutTruthFromDsd(Mpm_Man_t *pMan, Mpm_Cut_t *pCut, int iClass)
#define Mpm_CutForEachLeaf(p, pCut, pLeaf, i)
struct Mpm_Cut_t_ Mpm_Cut_t
BASIC TYPES ///.
struct Mig_Obj_t_ Mig_Obj_t
#define Mig_ManForEachObj(p, pObj)
MACRO DEFINITIONS ///.
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.