Go to the source code of this file.
◆ Aig_ManFanoutStart()
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Create fanout for all objects in the manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 56 of file aigFanout.c.
57{
59 int i;
60 assert( Aig_ManBufNum(
p) == 0 );
61
63 p->nFansAlloc = 2 * Aig_ManObjNumMax(
p);
64 if (
p->nFansAlloc < (1<<12) )
65 p->nFansAlloc = (1<<12);
67 memset(
p->pFanData, 0,
sizeof(
int) * 5 *
p->nFansAlloc );
68
70 {
71 if ( Aig_ObjChild0(pObj) )
73 if ( Aig_ObjChild1(pObj) )
75 }
76}
#define ABC_ALLOC(type, num)
void Aig_ObjAddFanout(Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pFanout)
#define Aig_ManForEachObj(p, pObj, i)
struct Aig_Obj_t_ Aig_Obj_t
◆ Aig_ManFanoutStop()
Function*************************************************************
Synopsis [Deletes fanout for all objects in the manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 89 of file aigFanout.c.
◆ Aig_ObjAddFanout()
Function*************************************************************
Synopsis [Adds fanout (pFanout) of node (pObj).]
Description []
SideEffects []
SeeAlso []
Definition at line 107 of file aigFanout.c.
108{
109 int iFan, * pFirst, * pPrevC, * pNextC, * pPrev, * pNext;
111 assert( !Aig_IsComplement(pObj) && !Aig_IsComplement(pFanout) );
113 if ( pObj->
Id >=
p->nFansAlloc || pFanout->
Id >=
p->nFansAlloc )
114 {
115 int nFansAlloc = 2 * Abc_MaxInt( pObj->
Id, pFanout->
Id );
116 p->pFanData =
ABC_REALLOC(
int,
p->pFanData, 5 * nFansAlloc );
117 memset(
p->pFanData + 5 *
p->nFansAlloc, 0,
sizeof(
int) * 5 * (nFansAlloc -
p->nFansAlloc) );
118 p->nFansAlloc = nFansAlloc;
119 }
120 assert( pObj->
Id <
p->nFansAlloc && pFanout->
Id <
p->nFansAlloc );
121 iFan = Aig_FanoutCreate( pFanout->
Id, Aig_ObjWhatFanin(pFanout, pObj) );
122 pPrevC = Aig_FanoutPrev(
p->pFanData, iFan );
123 pNextC = Aig_FanoutNext(
p->pFanData, iFan );
124 pFirst = Aig_FanoutObj(
p->pFanData, pObj->
Id );
125 if ( *pFirst == 0 )
126 {
127 *pFirst = iFan;
128 *pPrevC = iFan;
129 *pNextC = iFan;
130 }
131 else
132 {
133 pPrev = Aig_FanoutPrev(
p->pFanData, *pFirst );
134 pNext = Aig_FanoutNext(
p->pFanData, *pPrev );
135 assert( *pNext == *pFirst );
136 *pPrevC = *pPrev;
137 *pNextC = *pFirst;
138 *pPrev = iFan;
139 *pNext = iFan;
140 }
141}
#define ABC_REALLOC(type, obj, num)
◆ Aig_ObjRemoveFanout()
Function*************************************************************
Synopsis [Removes fanout (pFanout) of node (pObj).]
Description []
SideEffects []
SeeAlso []
Definition at line 154 of file aigFanout.c.
155{
156 int iFan, * pFirst, * pPrevC, * pNextC, * pPrev, * pNext;
157 assert(
p->pFanData && pObj->
Id <
p->nFansAlloc && pFanout->
Id <
p->nFansAlloc );
158 assert( !Aig_IsComplement(pObj) && !Aig_IsComplement(pFanout) );
160 iFan = Aig_FanoutCreate( pFanout->
Id, Aig_ObjWhatFanin(pFanout, pObj) );
161 pPrevC = Aig_FanoutPrev(
p->pFanData, iFan );
162 pNextC = Aig_FanoutNext(
p->pFanData, iFan );
163 pPrev = Aig_FanoutPrev(
p->pFanData, *pNextC );
164 pNext = Aig_FanoutNext(
p->pFanData, *pPrevC );
167 pFirst = Aig_FanoutObj(
p->pFanData, pObj->
Id );
169 if ( *pFirst == iFan )
170 {
171 if ( *pNextC == iFan )
172 {
173 *pFirst = 0;
174 *pPrev = 0;
175 *pNext = 0;
176 *pPrevC = 0;
177 *pNextC = 0;
178 return;
179 }
180 *pFirst = *pNextC;
181 }
182 *pPrev = *pPrevC;
183 *pNext = *pNextC;
184 *pPrevC = 0;
185 *pNextC = 0;
186}