47 unsigned x = (unsigned)Num;
51 *p->pDataCur++ = (x & 0x7f) | 0x80;
55 assert( p->pDataCur - p->pDataAig < p->nDataAig );
72 for ( i = 0; (ch = *p->pDataCur++) & 0x80; i++ )
73 x |= (ch & 0x7f) << (7 * i);
74 assert( p->pDataCur - p->pDataAig < p->nDataAig );
75 return x | (ch << (7 * i));
93 *p->pDataCur2++ = pObj->iNode;
94 *p->pDataCur2++ = pObj->iFan0;
95 *p->pDataCur2++ = pObj->iFan1;
98 if ( pObj->iFan0 && pObj->iFan1 )
101 assert( pObj->iNode >= p->iNodePrev );
102 assert( (pObj->iNode << 1) > pObj->iFan0 );
103 assert( pObj->iFan0 > pObj->iFan1 );
107 p->iNodePrev = pObj->iNode;
109 else if ( !pObj->iFan0 && !pObj->iFan1 )
112 assert( pObj->iNode >= p->iNodePrev );
114 p->iNodePrev = pObj->iNode;
118 assert( pObj->iNode == 0 );
119 assert( pObj->iFan0 != 0 );
120 assert( pObj->iFan1 == 0 );
121 assert( ((p->iNodePrev << 1) | 1) >= pObj->iFan0 );
140 if ( (iValue & 3) == 3 )
142 pObj->iNode = (iValue >> 2) + p->iNodePrev;
145 p->iNodePrev = pObj->iNode;
147 else if ( (iValue & 3) == 1 )
149 pObj->iNode = (iValue >> 2) + p->iNodePrev;
152 p->iNodePrev = pObj->iNode;
157 pObj->iFan0 = ((p->iNodePrev << 1) | 1) - (iValue >> 1);
176 assert( p->iNumber < (1 << 30) - p->nFront );
179 if ( p->iNumber % p->nFront == 0 )
181 if ( pFront[p->iNumber % p->nFront] == 0 )
183 pFront[p->iNumber % p->nFront] = 1;
205 int * pFans0, * pFans1;
210 pFans0[0] = pFans1[0] = 0;
211 pFans0[1] = pFans1[1] = 0;
218 pFrontToId[pObj->iNode % p->nFront] = i;
224 for ( i = 0; i < p->nObjs; i++ )
226 assert( pFans0[i] == p->pFans0[i] );
227 assert( pFans1[i] == p->pFans1[i] );
250 int i, iVar0, iVar1, nCrossCut = 0, nCrossCutMax = 0;
266 p->nDataAig = p->nObjs * 6;
267 p->pDataAig =
ABC_ALLOC(
unsigned char, p->nDataAig );
268 p->pDataCur = p->pDataAig;
273 p->pDataAig2 =
ABC_ALLOC(
int, 3 * p->nObjs );
274 p->pDataCur2 = p->pDataAig2 + 6;
277 for ( i = 2; i < p->nObjs; i++ )
279 if ( p->pFans0[i] == 0 )
283 pObj->iNode = pIdToFront[i];
288 if ( p->pRefs[i] == 0 )
290 pFront[pIdToFront[i] % p->nFront] = 0;
294 else if ( p->pFans1[i] == 0 )
296 assert( p->pRefs[i] == 0 );
299 assert( pIdToFront[iVar0] > 0 );
306 if ( --p->pRefs[iVar0] == 0 )
308 pFront[pIdToFront[iVar0] % p->nFront] = 0;
309 pIdToFront[iVar0] = -1;
317 assert( pIdToFront[iVar0] > 0 );
319 assert( pIdToFront[iVar1] > 0 );
322 pObj->iNode = pIdToFront[i];
327 if ( --p->pRefs[iVar0] == 0 )
329 pFront[pIdToFront[iVar0] % p->nFront] = 0;
330 pIdToFront[iVar0] = -1;
333 if ( --p->pRefs[iVar1] == 0 )
335 pFront[pIdToFront[iVar1] % p->nFront] = 0;
336 pIdToFront[iVar1] = -1;
340 if ( p->pRefs[i] == 0 )
342 pFront[pIdToFront[i] % p->nFront] = 0;
347 if ( nCrossCutMax < ++nCrossCut )
348 nCrossCutMax = nCrossCut;
350 assert( p->pDataAig2 == NULL || p->pDataCur2 - p->pDataAig2 == (3 * p->nObjs) );
352 assert( nCrossCutMax == p->nCrossCutMax );
353 for ( i = 0; i < p->nFront; i++ )
void Fsim_ManVerifyFront(Fsim_Man_t *p)
static int Fsim_ManRestoreObj(Fsim_Man_t *p, Fsim_Obj_t *pObj)
void Fsim_ManFront(Fsim_Man_t *p, int fCompressAig)
FUNCTION DECLARATIONS ///.
#define ABC_ALLOC(type, num)
static void Fsim_ManStoreObj(Fsim_Man_t *p, Fsim_Obj_t *pObj)
static int Fsim_ManFrontFindNext(Fsim_Man_t *p, char *pFront)
static int Fsim_LitIsCompl(int Lit)
static int Fsim_Lit2Var(int Lit)
static int Fsim_Var2Lit(int Var, int fCompl)
MACRO DEFINITIONS ///.
static ABC_NAMESPACE_IMPL_START void Fsim_ManStoreNum(Fsim_Man_t *p, int Num)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Fsim_Man_t_ Fsim_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Fsim_Obj_t_ Fsim_Obj_t
INCLUDES ///.
#define ABC_NAMESPACE_IMPL_END
static int Fsim_ManRestoreNum(Fsim_Man_t *p)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
#define Fsim_ManForEachObj(p, pObj, i)
#define ABC_CALLOC(type, num)
static int Aig_ObjRefs(Aig_Obj_t *pObj)