42 static inline int Aig_XsimAndCond(
int Value0,
int fCompl0,
int Value1,
int fCompl1 )
53 return 3 & (pInfo[i >> 4] >> ((i & 15) << 1));
59 pInfo[i >> 4] ^= (Value << ((i & 15) << 1));
136 if ( iPioNum < p->nPis )
159 if ( iPioNum < p->nPis )
180 static int s_FPrimes[128] = {
181 1009, 1049, 1093, 1151, 1201, 1249, 1297, 1361, 1427, 1459,
182 1499, 1559, 1607, 1657, 1709, 1759, 1823, 1877, 1933, 1997,
183 2039, 2089, 2141, 2213, 2269, 2311, 2371, 2411, 2467, 2543,
184 2609, 2663, 2699, 2741, 2797, 2851, 2909, 2969, 3037, 3089,
185 3169, 3221, 3299, 3331, 3389, 3461, 3517, 3557, 3613, 3671,
186 3719, 3779, 3847, 3907, 3943, 4013, 4073, 4129, 4201, 4243,
187 4289, 4363, 4441, 4493, 4549, 4621, 4663, 4729, 4793, 4871,
188 4933, 4973, 5021, 5087, 5153, 5227, 5281, 5351, 5417, 5471,
189 5519, 5573, 5651, 5693, 5749, 5821, 5861, 5923, 6011, 6073,
190 6131, 6199, 6257, 6301, 6353, 6397, 6481, 6563, 6619, 6689,
191 6737, 6803, 6863, 6917, 6977, 7027, 7109, 7187, 7237, 7309,
192 7393, 7477, 7523, 7561, 7607, 7681, 7727, 7817, 7877, 7933,
193 8011, 8039, 8059, 8081, 8093, 8111, 8123, 8147
198 for ( i = 0; i <
nWords; i++ )
199 uHash ^= pState[i] * s_FPrimes[i & 0x7F];
200 return uHash % nTableSize;
220 if ( !
memcmp( pEntry, pState,
sizeof(
unsigned) * nWords ) )
241 pBins[Hash] = pState;
259 pRes = (
unsigned *)
ABC_CALLOC(
char,
sizeof(
unsigned) * nWords +
sizeof(
unsigned *) );
260 for ( i = nPis; i < nCis; i++ )
278 int i, Value, nZeros = 0, nOnes = 0, nDcs = 0;
279 for ( i = 0; i < nRegs; i++ )
281 Value = (Aig_InfoHasBit( pState, 2 * i + 1 ) << 1) | Aig_InfoHasBit( pState, 2 * i );
283 printf(
"0" ), nZeros++;
284 else if ( Value == 2 )
285 printf(
"1" ), nOnes++;
286 else if ( Value == 3 )
287 printf(
"x" ), nDcs++;
291 printf(
" (0=%5d, 1=%5d, x=%5d)\n", nZeros, nOnes, nDcs );
309 int iCis = 0, iCos = 0;
312 pCur = p->pDataAig2 + 6;
313 pEnd = p->pDataAig2 + 3 * p->nObjs;
314 while ( pCur < pEnd )
318 else if ( pCur[2] == 0 )
324 assert( iCis == p->nCis );
325 assert( iCos == p->nCos );
343 unsigned ** pBins, * pState;
345 clock_t clk, clkTotal = clock();
352 printf(
"Obj = %8d (%8d). Cut = %6d. Front = %6d. FrtMem = %7.2f MB. ",
353 p->nObjs, p->nCis + p->nNodes, p->nCrossCutMax, p->nFront,
354 4.0*Aig_BitWordNum(2 * p->nFront)/(1<<20) );
355 ABC_PRT(
"Time", clock() - clk );
362 printf(
"Max ID = %8d. Log max ID = %2d. AigMem = %7.2f MB (%5.2f byte/obj). ",
363 p->iNumber, Aig_Base2Log(p->iNumber),
364 1.0*(p->pDataCur-p->pDataAig)/(1<<20),
365 1.0*(p->pDataCur-p->pDataAig)/p->nObjs );
366 ABC_PRT(
"Time", clock() - clk );
373 memset( pBins, 0,
sizeof(
unsigned *) * nBins );
375 assert( p->pDataSim == NULL );
376 p->pDataSim =
ABC_ALLOC(
unsigned, Aig_BitWordNum(2 * p->nFront) *
sizeof(
unsigned) );
377 p->pDataSimCis =
ABC_ALLOC(
unsigned, Aig_BitWordNum(2 * p->nCis) *
sizeof(
unsigned) );
378 p->pDataSimCos =
ABC_ALLOC(
unsigned, Aig_BitWordNum(2 * p->nCos) *
sizeof(
unsigned) );
398 printf(
"Maxcut = %8d. AigMem = %7.2f MB. SimMem = %7.2f MB. ",
400 p->pDataAig2? 12.0*p->nObjs/(1<<20) : 1.0*(p->pDataCur-p->pDataAig)/(1<<20),
401 4.0*(Aig_BitWordNum(2 * p->nFront)+Aig_BitWordNum(2 * p->nCis)+Aig_BitWordNum(2 * p->nCos))/(1<<20) );
402 ABC_PRT(
"Sim time", clock() - clkTotal );
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Abc_PrimeCudd(unsigned int p)
static unsigned * Fsim_ManTerStateNext(unsigned *pState, int nWords)
#define FSIM_ZER
DECLARATIONS ///.
static void Fsim_ManTerSimulateCi(Fsim_Man_t *p, int iNode, int iCi)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
static int Aig_XsimAndCond(int Value0, int fCompl0, int Value1, int fCompl1)
static void Fsim_ManTerSimulateRound(Fsim_Man_t *p)
static void Fsim_ManTerSimulateCo(Fsim_Man_t *p, int iCo, int iFan0)
void Fsim_ManFront(Fsim_Man_t *p, int fCompressAig)
FUNCTION DECLARATIONS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
int Fsim_ManTerStateLookup(unsigned *pState, int nWords, unsigned **pBins, int nBins)
#define ABC_ALLOC(type, num)
int Fsim_ManTerStateHash(unsigned *pState, int nWords, int nTableSize)
static int Fsim_LitIsCompl(int Lit)
static int Fsim_Lit2Var(int Lit)
unsigned * Fsim_ManTerStateCreate(unsigned *pInfo, int nPis, int nCis, int nWords)
void Fsim_ManTerStateInsert(unsigned *pState, int nWords, unsigned **pBins, int nBins)
typedefABC_NAMESPACE_HEADER_START struct Fsim_Man_t_ Fsim_Man_t
INCLUDES ///.
static void Fsim_ManTerSimInfoSet(unsigned *pInfo, int i, int Value)
#define ABC_NAMESPACE_IMPL_END
void Fsim_ManDelete(Fsim_Man_t *p)
static void Fsim_ManTerSimInfoTransfer(Fsim_Man_t *p)
static int Fsim_ManTerSimInfoGet(unsigned *pInfo, int i)
void Fsim_ManTerStatePrint(unsigned *pState, int nRegs)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static void Fsim_ManTerSimInfoInit(Fsim_Man_t *p)
static int Aig_XsimNotCond(int Value, int fCompl)
static int Aig_ManRegNum(Aig_Man_t *p)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Vec_Ptr_t * Fsim_ManTerSimulate(Aig_Man_t *pAig, int fVerbose)
static void Fsim_ManTerSimulateNode(Fsim_Man_t *p, int iNode, int iFan0, int iFan1)
#define ABC_CALLOC(type, num)
Fsim_Man_t * Fsim_ManCreate(Aig_Man_t *pAig)
static int Abc_BitWordNum(int nBits)
static int Aig_ObjRefs(Aig_Obj_t *pObj)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static void Fsim_ManTerStateSetNext(unsigned *pState, int nWords, unsigned *pNext)