148{
150 Gia_Obj_t * pObj, * pFanin0New, * pFanin1New, * pObjNew;
151 char * pFront;
152 int i, iLit, nCrossCut = 0, nCrossCutMax = 0;
154 int iFront = 0;
155
157
159 pNew->
pName = Abc_UtilStrsav(
p->pName );
160 pNew->
pSpec = Abc_UtilStrsav(
p->pSpec );
161 pNew->
nFront = 1 + (int)((
float)1.1 * nCrossCutMaxInit);
162
164
165 Gia_ManConst0(pNew)->Value = iFront = Gia_ManFrontFindNext( pFront, pNew->
nFront, iFront );
166 if ( Gia_ObjValue(Gia_ManConst0(
p)) == 0 )
167 pFront[iFront] = 0;
168 else
169 nCrossCut = 1;
170
172 {
173 if ( Gia_ObjIsCi(pObj) )
174 {
175 if ( Gia_ObjValue(pObj) && nCrossCutMax < ++nCrossCut )
176 nCrossCutMax = nCrossCut;
177
178 iLit = Gia_ManAppendCi( pNew );
179 pObjNew = Gia_ManObj( pNew, Abc_Lit2Var(iLit) );
180 assert( Gia_ObjId(pNew, pObjNew) == Gia_ObjId(
p, pObj) );
181 pObjNew->
Value = iFront = Gia_ManFrontFindNext( pFront, pNew->
nFront, iFront );
182
183 if ( Gia_ObjValue(pObj) == 0 )
184 pFront[iFront] = 0;
185 continue;
186 }
187 if ( Gia_ObjIsCo(pObj) )
188 {
189 assert( Gia_ObjValue(pObj) == 0 );
190
191 iLit = Gia_ManAppendCo( pNew, 0 );
192 pObjNew = Gia_ManObj( pNew, Abc_Lit2Var(iLit) );
193 assert( Gia_ObjId(pNew, pObjNew) == Gia_ObjId(
p, pObj) );
194
195 pFanin0New = Gia_ManObj( pNew, Gia_ObjFaninId0(pObj, i) );
199 pObjNew->
fCompl0 = Gia_ObjFaninC0(pObj);
200
201 if ( --Gia_ObjFanin0(pObj)->Value == 0 )
202 {
203 pFront[pFanin0New->
Value] = 0;
204 nCrossCut--;
205 }
206 continue;
207 }
208 if ( Gia_ObjValue(pObj) && nCrossCutMax < ++nCrossCut )
209 nCrossCutMax = nCrossCut;
210
211 pObjNew = Gia_ManAppendObj( pNew );
212 assert( Gia_ObjId(pNew, pObjNew) == Gia_ObjId(
p, pObj) );
213
214 pFanin0New = Gia_ManObj( pNew, Gia_ObjFaninId0(pObj, i) );
217 pObjNew->
fCompl0 = Gia_ObjFaninC0(pObj);
218
219 pFanin1New = Gia_ManObj( pNew, Gia_ObjFaninId1(pObj, i) );
222 pObjNew->
fCompl1 = Gia_ObjFaninC1(pObj);
223
224 pObjNew->
Value = iFront = Gia_ManFrontFindNext( pFront, pNew->
nFront, iFront );
225
226 if ( --Gia_ObjFanin0(pObj)->Value == 0 )
227 {
228 pFront[pFanin0New->
Value] = 0;
229 nCrossCut--;
230 }
231 if ( --Gia_ObjFanin1(pObj)->Value == 0 )
232 {
233 pFront[pFanin1New->
Value] = 0;
234 nCrossCut--;
235 }
236
237 if ( Gia_ObjValue(pObj) == 0 )
238 pFront[iFront] = 0;
239 }
241 assert( nCrossCut == 0 || nCrossCutMax == nCrossCutMaxInit );
242 for ( i = 0; i < pNew->
nFront; i++ )
245
246
248 return pNew;
249}
#define ABC_CALLOC(type, num)
int Gia_ManCrossCutSimple(Gia_Man_t *p)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachObj1(p, pObj, i)
#define GIA_NONE
INCLUDES ///.