ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
hopDfs.c File Reference
#include "hop.h"
Include dependency graph for hopDfs.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Hop_ManDfs_rec (Hop_Obj_t *pObj, Vec_Ptr_t *vNodes)
 DECLARATIONS ///.
 
Vec_Ptr_tHop_ManDfs (Hop_Man_t *p)
 
Vec_Ptr_tHop_ManDfsNode (Hop_Man_t *p, Hop_Obj_t *pNode)
 
int Hop_ManCountLevels (Hop_Man_t *p)
 
void Hop_ManCreateRefs (Hop_Man_t *p)
 
void Hop_ConeMark_rec (Hop_Obj_t *pObj)
 
void Hop_ConeCleanAndMark_rec (Hop_Obj_t *pObj)
 
int Hop_ConeCountAndMark_rec (Hop_Obj_t *pObj)
 
void Hop_ConeUnmark_rec (Hop_Obj_t *pObj)
 
int Hop_DagSize (Hop_Obj_t *pObj)
 
int Hop_ObjFanoutCount_rec (Hop_Obj_t *pObj, Hop_Obj_t *pPivot)
 
int Hop_ObjFanoutCount (Hop_Obj_t *pObj, Hop_Obj_t *pPivot)
 
void Hop_Transfer_rec (Hop_Man_t *pDest, Hop_Obj_t *pObj)
 
Hop_Obj_tHop_Transfer (Hop_Man_t *pSour, Hop_Man_t *pDest, Hop_Obj_t *pRoot, int nVars)
 
void Hop_Compose_rec (Hop_Man_t *p, Hop_Obj_t *pObj, Hop_Obj_t *pFunc, Hop_Obj_t *pVar)
 
Hop_Obj_tHop_Compose (Hop_Man_t *p, Hop_Obj_t *pRoot, Hop_Obj_t *pFunc, int iVar)
 
void Hop_Complement_rec (Hop_Man_t *p, Hop_Obj_t *pObj, Hop_Obj_t *pVar)
 
Hop_Obj_tHop_Complement (Hop_Man_t *p, Hop_Obj_t *pRoot, int iVar)
 
void Hop_Remap_rec (Hop_Man_t *p, Hop_Obj_t *pObj)
 
Hop_Obj_tHop_Remap (Hop_Man_t *p, Hop_Obj_t *pRoot, unsigned uSupp, int nVars)
 
Hop_Obj_tHop_Permute (Hop_Man_t *p, Hop_Obj_t *pRoot, int nRootVars, int *pPermute)
 

Function Documentation

◆ Hop_Complement()

Hop_Obj_t * Hop_Complement ( Hop_Man_t * p,
Hop_Obj_t * pRoot,
int iVar )

Function*************************************************************

Synopsis [Complements the AIG (pRoot) with the function (pFunc) using PI var (iVar).]

Description []

SideEffects []

SeeAlso []

Definition at line 469 of file hopDfs.c.

470{
471 // quit if the PI variable is not defined
472 if ( iVar >= Hop_ManPiNum(p) )
473 {
474 printf( "Hop_Complement(): The PI variable %d is not defined.\n", iVar );
475 return NULL;
476 }
477 // recursively perform composition
478 Hop_Complement_rec( p, Hop_Regular(pRoot), Hop_ManPi(p, iVar) );
479 // clear the markings
480 Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
481 return Hop_NotCond( (Hop_Obj_t *)Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
482}
Cube * p
Definition exorList.c:222
void Hop_ConeUnmark_rec(Hop_Obj_t *pObj)
Definition hopDfs.c:257
void Hop_Complement_rec(Hop_Man_t *p, Hop_Obj_t *pObj, Hop_Obj_t *pVar)
Definition hopDfs.c:441
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_Complement_rec()

void Hop_Complement_rec ( Hop_Man_t * p,
Hop_Obj_t * pObj,
Hop_Obj_t * pVar )

Function*************************************************************

Synopsis [Complements the AIG (pRoot) with the function (pFunc) using PI var (iVar).]

Description []

SideEffects []

SeeAlso []

Definition at line 441 of file hopDfs.c.

442{
443 assert( !Hop_IsComplement(pObj) );
444 if ( Hop_ObjIsMarkA(pObj) )
445 return;
446 if ( Hop_ObjIsConst1(pObj) || Hop_ObjIsPi(pObj) )
447 {
448 pObj->pData = pObj == pVar ? Hop_Not(pObj) : pObj;
449 return;
450 }
451 Hop_Complement_rec( p, Hop_ObjFanin0(pObj), pVar );
452 Hop_Complement_rec( p, Hop_ObjFanin1(pObj), pVar );
453 pObj->pData = Hop_And( p, Hop_ObjChild0Copy(pObj), Hop_ObjChild1Copy(pObj) );
454 assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
455 Hop_ObjSetMarkA( pObj );
456}
Hop_Obj_t * Hop_And(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
Definition hopOper.c:104
void * pData
Definition hop.h:68
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_Compose()

Hop_Obj_t * Hop_Compose ( Hop_Man_t * p,
Hop_Obj_t * pRoot,
Hop_Obj_t * pFunc,
int iVar )

Function*************************************************************

Synopsis [Composes the AIG (pRoot) with the function (pFunc) using PI var (iVar).]

Description []

SideEffects []

SeeAlso []

Definition at line 415 of file hopDfs.c.

416{
417 // quit if the PI variable is not defined
418 if ( iVar >= Hop_ManPiNum(p) )
419 {
420 printf( "Hop_Compose(): The PI variable %d is not defined.\n", iVar );
421 return NULL;
422 }
423 // recursively perform composition
424 Hop_Compose_rec( p, Hop_Regular(pRoot), pFunc, Hop_ManPi(p, iVar) );
425 // clear the markings
426 Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
427 return Hop_NotCond( (Hop_Obj_t *)Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
428}
void Hop_Compose_rec(Hop_Man_t *p, Hop_Obj_t *pObj, Hop_Obj_t *pFunc, Hop_Obj_t *pVar)
Definition hopDfs.c:387
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_Compose_rec()

void Hop_Compose_rec ( Hop_Man_t * p,
Hop_Obj_t * pObj,
Hop_Obj_t * pFunc,
Hop_Obj_t * pVar )

Function*************************************************************

Synopsis [Composes the AIG (pRoot) with the function (pFunc) using PI var (iVar).]

Description []

SideEffects []

SeeAlso []

Definition at line 387 of file hopDfs.c.

388{
389 assert( !Hop_IsComplement(pObj) );
390 if ( Hop_ObjIsMarkA(pObj) )
391 return;
392 if ( Hop_ObjIsConst1(pObj) || Hop_ObjIsPi(pObj) )
393 {
394 pObj->pData = pObj == pVar ? pFunc : pObj;
395 return;
396 }
397 Hop_Compose_rec( p, Hop_ObjFanin0(pObj), pFunc, pVar );
398 Hop_Compose_rec( p, Hop_ObjFanin1(pObj), pFunc, pVar );
399 pObj->pData = Hop_And( p, Hop_ObjChild0Copy(pObj), Hop_ObjChild1Copy(pObj) );
400 assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
401 Hop_ObjSetMarkA( pObj );
402}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ConeCleanAndMark_rec()

void Hop_ConeCleanAndMark_rec ( Hop_Obj_t * pObj)

Function*************************************************************

Synopsis [Counts the number of AIG nodes rooted at this cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 210 of file hopDfs.c.

211{
212 assert( !Hop_IsComplement(pObj) );
213 if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
214 return;
215 Hop_ConeCleanAndMark_rec( Hop_ObjFanin0(pObj) );
216 Hop_ConeCleanAndMark_rec( Hop_ObjFanin1(pObj) );
217 assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
218 Hop_ObjSetMarkA( pObj );
219 pObj->pData = NULL;
220}
void Hop_ConeCleanAndMark_rec(Hop_Obj_t *pObj)
Definition hopDfs.c:210
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ConeCountAndMark_rec()

int Hop_ConeCountAndMark_rec ( Hop_Obj_t * pObj)

Function*************************************************************

Synopsis [Counts the number of AIG nodes rooted at this cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 233 of file hopDfs.c.

234{
235 int Counter;
236 assert( !Hop_IsComplement(pObj) );
237 if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
238 return 0;
239 Counter = 1 + Hop_ConeCountAndMark_rec( Hop_ObjFanin0(pObj) ) +
240 Hop_ConeCountAndMark_rec( Hop_ObjFanin1(pObj) );
241 assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
242 Hop_ObjSetMarkA( pObj );
243 return Counter;
244}
int Hop_ConeCountAndMark_rec(Hop_Obj_t *pObj)
Definition hopDfs.c:233
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ConeMark_rec()

void Hop_ConeMark_rec ( Hop_Obj_t * pObj)

Function*************************************************************

Synopsis [Counts the number of AIG nodes rooted at this cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 188 of file hopDfs.c.

189{
190 assert( !Hop_IsComplement(pObj) );
191 if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
192 return;
193 Hop_ConeMark_rec( Hop_ObjFanin0(pObj) );
194 Hop_ConeMark_rec( Hop_ObjFanin1(pObj) );
195 assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
196 Hop_ObjSetMarkA( pObj );
197}
void Hop_ConeMark_rec(Hop_Obj_t *pObj)
Definition hopDfs.c:188
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ConeUnmark_rec()

void Hop_ConeUnmark_rec ( Hop_Obj_t * pObj)

Function*************************************************************

Synopsis [Counts the number of AIG nodes rooted at this cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 257 of file hopDfs.c.

258{
259 assert( !Hop_IsComplement(pObj) );
260 if ( !Hop_ObjIsNode(pObj) || !Hop_ObjIsMarkA(pObj) )
261 return;
262 Hop_ConeUnmark_rec( Hop_ObjFanin0(pObj) );
263 Hop_ConeUnmark_rec( Hop_ObjFanin1(pObj) );
264 assert( Hop_ObjIsMarkA(pObj) ); // loop detection
265 Hop_ObjClearMarkA( pObj );
266}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_DagSize()

int Hop_DagSize ( Hop_Obj_t * pObj)

Function*************************************************************

Synopsis [Counts the number of AIG nodes rooted at this cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 279 of file hopDfs.c.

280{
281 int Counter;
282 Counter = Hop_ConeCountAndMark_rec( Hop_Regular(pObj) );
283 Hop_ConeUnmark_rec( Hop_Regular(pObj) );
284 return Counter;
285}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ManCountLevels()

int Hop_ManCountLevels ( Hop_Man_t * p)

Function*************************************************************

Synopsis [Computes the max number of levels in the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 116 of file hopDfs.c.

117{
118 Vec_Ptr_t * vNodes;
119 Hop_Obj_t * pObj;
120 int i, LevelsMax, Level0, Level1;
121 // initialize the levels
122 Hop_ManConst1(p)->pData = NULL;
123 Hop_ManForEachPi( p, pObj, i )
124 pObj->pData = NULL;
125 // compute levels in a DFS order
126 vNodes = Hop_ManDfs( p );
127 Vec_PtrForEachEntry( Hop_Obj_t *, vNodes, pObj, i )
128 {
129 Level0 = (int)(ABC_PTRUINT_T)Hop_ObjFanin0(pObj)->pData;
130 Level1 = (int)(ABC_PTRUINT_T)Hop_ObjFanin1(pObj)->pData;
131 pObj->pData = (void *)(ABC_PTRUINT_T)(1 + Hop_ObjIsExor(pObj) + Abc_MaxInt(Level0, Level1));
132 }
133 Vec_PtrFree( vNodes );
134 // get levels of the POs
135 LevelsMax = 0;
136 Hop_ManForEachPo( p, pObj, i )
137 LevelsMax = Abc_MaxInt( LevelsMax, (int)(ABC_PTRUINT_T)Hop_ObjFanin0(pObj)->pData );
138 return LevelsMax;
139}
Vec_Ptr_t * Hop_ManDfs(Hop_Man_t *p)
Definition hopDfs.c:68
#define Hop_ManForEachPi(p, pObj, i)
ITERATORS ///.
Definition hop.h:259
#define Hop_ManForEachPo(p, pObj, i)
Definition hop.h:262
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ManCreateRefs()

void Hop_ManCreateRefs ( Hop_Man_t * p)

Function*************************************************************

Synopsis [Creates correct reference counters at each node.]

Description []

SideEffects []

SeeAlso []

Definition at line 152 of file hopDfs.c.

153{
154 Hop_Obj_t * pObj;
155 int i;
156 if ( p->fRefCount )
157 return;
158 p->fRefCount = 1;
159 // clear refs
160 Hop_ObjClearRef( Hop_ManConst1(p) );
161 Hop_ManForEachPi( p, pObj, i )
162 Hop_ObjClearRef( pObj );
163 Hop_ManForEachNode( p, pObj, i )
164 Hop_ObjClearRef( pObj );
165 Hop_ManForEachPo( p, pObj, i )
166 Hop_ObjClearRef( pObj );
167 // set refs
168 Hop_ManForEachNode( p, pObj, i )
169 {
170 Hop_ObjRef( Hop_ObjFanin0(pObj) );
171 Hop_ObjRef( Hop_ObjFanin1(pObj) );
172 }
173 Hop_ManForEachPo( p, pObj, i )
174 Hop_ObjRef( Hop_ObjFanin0(pObj) );
175}
#define Hop_ManForEachNode(p, pObj, i)
Definition hop.h:265

◆ Hop_ManDfs()

Vec_Ptr_t * Hop_ManDfs ( Hop_Man_t * p)

Function*************************************************************

Synopsis [Collects internal nodes in the DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 68 of file hopDfs.c.

69{
70 Vec_Ptr_t * vNodes;
71 Hop_Obj_t * pObj;
72 int i;
73 vNodes = Vec_PtrAlloc( Hop_ManNodeNum(p) );
74 Hop_ManForEachNode( p, pObj, i )
75 Hop_ManDfs_rec( pObj, vNodes );
76 Hop_ManForEachNode( p, pObj, i )
77 Hop_ObjClearMarkA(pObj);
78 return vNodes;
79}
ABC_NAMESPACE_IMPL_START void Hop_ManDfs_rec(Hop_Obj_t *pObj, Vec_Ptr_t *vNodes)
DECLARATIONS ///.
Definition hopDfs.c:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ManDfs_rec()

ABC_NAMESPACE_IMPL_START void Hop_ManDfs_rec ( Hop_Obj_t * pObj,
Vec_Ptr_t * vNodes )

DECLARATIONS ///.

CFile****************************************************************

FileName [hopDfs.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Minimalistic And-Inverter Graph package.]

Synopsis [DFS traversal procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - May 11, 2006.]

Revision [

Id
hopDfs.c,v 1.00 2006/05/11 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Collects internal nodes in the DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file hopDfs.c.

46{
47 assert( !Hop_IsComplement(pObj) );
48 if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
49 return;
50 Hop_ManDfs_rec( Hop_ObjFanin0(pObj), vNodes );
51 Hop_ManDfs_rec( Hop_ObjFanin1(pObj), vNodes );
52 assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
53 Hop_ObjSetMarkA(pObj);
54 Vec_PtrPush( vNodes, pObj );
55}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ManDfsNode()

Vec_Ptr_t * Hop_ManDfsNode ( Hop_Man_t * p,
Hop_Obj_t * pNode )

Function*************************************************************

Synopsis [Collects internal nodes in the DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 92 of file hopDfs.c.

93{
94 Vec_Ptr_t * vNodes;
95 Hop_Obj_t * pObj;
96 int i;
97 assert( !Hop_IsComplement(pNode) );
98 vNodes = Vec_PtrAlloc( 16 );
99 Hop_ManDfs_rec( pNode, vNodes );
100 Vec_PtrForEachEntry( Hop_Obj_t *, vNodes, pObj, i )
101 Hop_ObjClearMarkA(pObj);
102 return vNodes;
103}
Here is the call graph for this function:

◆ Hop_ObjFanoutCount()

int Hop_ObjFanoutCount ( Hop_Obj_t * pObj,
Hop_Obj_t * pPivot )

Definition at line 310 of file hopDfs.c.

311{
312 int Counter;
313 assert( !Hop_IsComplement(pPivot) );
314 Counter = Hop_ObjFanoutCount_rec( Hop_Regular(pObj), pPivot );
315 Hop_ConeUnmark_rec( Hop_Regular(pObj) );
316 return Counter;
317}
int Hop_ObjFanoutCount_rec(Hop_Obj_t *pObj, Hop_Obj_t *pPivot)
Definition hopDfs.c:298
Here is the call graph for this function:

◆ Hop_ObjFanoutCount_rec()

int Hop_ObjFanoutCount_rec ( Hop_Obj_t * pObj,
Hop_Obj_t * pPivot )

Function*************************************************************

Synopsis [Counts how many fanout the given node has.]

Description []

SideEffects []

SeeAlso []

Definition at line 298 of file hopDfs.c.

299{
300 int Counter;
301 assert( !Hop_IsComplement(pObj) );
302 if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
303 return (int)(pObj == pPivot);
304 Counter = Hop_ObjFanoutCount_rec( Hop_ObjFanin0(pObj), pPivot ) +
305 Hop_ObjFanoutCount_rec( Hop_ObjFanin1(pObj), pPivot );
306 assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
307 Hop_ObjSetMarkA( pObj );
308 return Counter;
309}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_Permute()

Hop_Obj_t * Hop_Permute ( Hop_Man_t * p,
Hop_Obj_t * pRoot,
int nRootVars,
int * pPermute )

Function*************************************************************

Synopsis [Permute the AIG according to the given permutation.]

Description []

SideEffects []

SeeAlso []

Definition at line 563 of file hopDfs.c.

564{
565 Hop_Obj_t * pObj;
566 int i;
567 // return if constant
568 if ( Hop_ObjIsConst1( Hop_Regular(pRoot) ) )
569 return pRoot;
570 // create mapping
571 Hop_ManForEachPi( p, pObj, i )
572 {
573 if ( i == nRootVars )
574 break;
575 assert( pPermute[i] >= 0 && pPermute[i] < Hop_ManPiNum(p) );
576 pObj->pData = Hop_IthVar( p, pPermute[i] );
577 }
578 // recursively perform composition
579 Hop_Remap_rec( p, Hop_Regular(pRoot) );
580 // clear the markings
581 Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
582 return Hop_NotCond( (Hop_Obj_t *)Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
583}
void Hop_Remap_rec(Hop_Man_t *p, Hop_Obj_t *pObj)
Definition hopDfs.c:495
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition hopOper.c:63
Here is the call graph for this function:

◆ Hop_Remap()

Hop_Obj_t * Hop_Remap ( Hop_Man_t * p,
Hop_Obj_t * pRoot,
unsigned uSupp,
int nVars )

Function*************************************************************

Synopsis [Remaps the AIG (pRoot) to have the given support (uSupp).]

Description []

SideEffects []

SeeAlso []

Definition at line 518 of file hopDfs.c.

519{
520 Hop_Obj_t * pObj;
521 int i, k;
522 // quit if the PI variable is not defined
523 if ( nVars > Hop_ManPiNum(p) )
524 {
525 printf( "Hop_Remap(): The number of variables (%d) is more than the manager size (%d).\n", nVars, Hop_ManPiNum(p) );
526 return NULL;
527 }
528 // return if constant
529 if ( Hop_ObjIsConst1( Hop_Regular(pRoot) ) )
530 return pRoot;
531 if ( uSupp == 0 )
532 return Hop_NotCond( Hop_ManConst0(p), Hop_ObjPhaseCompl(pRoot) );
533 // set the PI mapping
534 k = 0;
535 Hop_ManForEachPi( p, pObj, i )
536 {
537 if ( i == nVars )
538 break;
539 if ( uSupp & (1 << i) )
540 pObj->pData = Hop_IthVar(p, k++);
541 else
542 pObj->pData = Hop_ManConst0(p);
543 }
544 assert( k > 0 && k < nVars );
545 // recursively perform composition
546 Hop_Remap_rec( p, Hop_Regular(pRoot) );
547 // clear the markings
548 Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
549 return Hop_NotCond( (Hop_Obj_t *)Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
550}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_Remap_rec()

void Hop_Remap_rec ( Hop_Man_t * p,
Hop_Obj_t * pObj )

Function*************************************************************

Synopsis [Remaps the AIG (pRoot) to have the given support (uSupp).]

Description []

SideEffects []

SeeAlso []

Definition at line 495 of file hopDfs.c.

496{
497 assert( !Hop_IsComplement(pObj) );
498 if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
499 return;
500 Hop_Remap_rec( p, Hop_ObjFanin0(pObj) );
501 Hop_Remap_rec( p, Hop_ObjFanin1(pObj) );
502 pObj->pData = Hop_And( p, Hop_ObjChild0Copy(pObj), Hop_ObjChild1Copy(pObj) );
503 assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
504 Hop_ObjSetMarkA( pObj );
505}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_Transfer()

Hop_Obj_t * Hop_Transfer ( Hop_Man_t * pSour,
Hop_Man_t * pDest,
Hop_Obj_t * pRoot,
int nVars )

Function*************************************************************

Synopsis [Transfers the AIG from one manager into another.]

Description []

SideEffects []

SeeAlso []

Definition at line 353 of file hopDfs.c.

354{
355 Hop_Obj_t * pObj;
356 int i;
357 // solve simple cases
358 if ( pSour == pDest )
359 return pRoot;
360 if ( Hop_ObjIsConst1( Hop_Regular(pRoot) ) )
361 return Hop_NotCond( Hop_ManConst1(pDest), Hop_IsComplement(pRoot) );
362 // set the PI mapping
363 Hop_ManForEachPi( pSour, pObj, i )
364 {
365 if ( i == nVars )
366 break;
367 pObj->pData = Hop_IthVar(pDest, i);
368 }
369 // transfer and set markings
370 Hop_Transfer_rec( pDest, Hop_Regular(pRoot) );
371 // clear the markings
372 Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
373 return Hop_NotCond( (Hop_Obj_t *)Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
374}
void Hop_Transfer_rec(Hop_Man_t *pDest, Hop_Obj_t *pObj)
Definition hopDfs.c:330
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_Transfer_rec()

void Hop_Transfer_rec ( Hop_Man_t * pDest,
Hop_Obj_t * pObj )

Function*************************************************************

Synopsis [Transfers the AIG from one manager into another.]

Description []

SideEffects []

SeeAlso []

Definition at line 330 of file hopDfs.c.

331{
332 assert( !Hop_IsComplement(pObj) );
333 if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
334 return;
335 Hop_Transfer_rec( pDest, Hop_ObjFanin0(pObj) );
336 Hop_Transfer_rec( pDest, Hop_ObjFanin1(pObj) );
337 pObj->pData = Hop_And( pDest, Hop_ObjChild0Copy(pObj), Hop_ObjChild1Copy(pObj) );
338 assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
339 Hop_ObjSetMarkA( pObj );
340}
Here is the call graph for this function:
Here is the caller graph for this function: