83 unsigned * pTruth, * pSimInfo;
167 static int s_FPrimes[128] = {
168 1009, 1049, 1093, 1151, 1201, 1249, 1297, 1361, 1427, 1459,
169 1499, 1559, 1607, 1657, 1709, 1759, 1823, 1877, 1933, 1997,
170 2039, 2089, 2141, 2213, 2269, 2311, 2371, 2411, 2467, 2543,
171 2609, 2663, 2699, 2741, 2797, 2851, 2909, 2969, 3037, 3089,
172 3169, 3221, 3299, 3331, 3389, 3461, 3517, 3557, 3613, 3671,
173 3719, 3779, 3847, 3907, 3943, 4013, 4073, 4129, 4201, 4243,
174 4289, 4363, 4441, 4493, 4549, 4621, 4663, 4729, 4793, 4871,
175 4933, 4973, 5021, 5087, 5153, 5227, 5281, 5351, 5417, 5471,
176 5519, 5573, 5651, 5693, 5749, 5821, 5861, 5923, 6011, 6073,
177 6131, 6199, 6257, 6301, 6353, 6397, 6481, 6563, 6619, 6689,
178 6737, 6803, 6863, 6917, 6977, 7027, 7109, 7187, 7237, 7309,
179 7393, 7477, 7523, 7561, 7607, 7681, 7727, 7817, 7877, 7933,
180 8011, 8039, 8059, 8081, 8093, 8111, 8123, 8147
185 for ( i = 0; i < nWordsSim; i++ )
186 uHash ^= pState[i] * s_FPrimes[i & 0x7F];
187 return uHash % nTableSize;
206 pPlace = (
unsigned *)&pThis->iNext, pThis = (*pPlace)?
Gia_ManEraState(p, *pPlace) : NULL )
207 if ( !
memcmp( pState->pData, pThis->pData,
sizeof(
unsigned) * p->
nWordsDat ) )
210 *pStateNum = pThis->Num;
232 unsigned * pBinsOld, * piPlace;
233 int nBinsOld, iNext,
Counter, i;
242 for ( i = 0; i < nBinsOld; i++ )
244 iNext = (pThis? pThis->iNext : 0);
246 iNext = (pThis? pThis->iNext : 0) )
252 *piPlace = pThis->Num;
325 pInfo[w] = ~pInfo0[w];
328 pInfo[w] = pInfo0[w];
353 pInfo[w] = ~(pInfo0[w] | pInfo1[w]);
356 pInfo[w] = ~pInfo0[w] & pInfo1[w];
362 pInfo[w] = pInfo0[w] & ~pInfo1[w];
365 pInfo[w] = pInfo0[w] & pInfo1[w];
409 for ( ; pState; pState = pState->iPrev ?
Gia_ManEraState(p, pState->iPrev) : NULL )
433 for ( ; pState; pState = pState->iPrev ?
Gia_ManEraState(p, pState->iPrev) : NULL )
452 unsigned * pSimInfo, * piPlace, uOutput = 0;
453 int i, k, iCond, nMints, iNextState;
469 for ( k = 0; k < nMints; k++ )
493 if ( piPlace == NULL )
544 p->
pBins[ Hash ] = pState->Num;
550 printf(
"Reached the limit on states traversed (%d). ", nStatesMax );
555 if ( p->
iCurState > 1 && pState->iPrev == 0 )
564 printf(
"Miter failed in state %d after %d transitions. ",
568 if ( fVerbose && p->
iCurState % 5000 == 0 )
570 printf(
"States =%10d. Reached =%10d. R = %5.3f. Depth =%6d. Mem =%9.2f MB. ",
573 1.0*p->
nBins*
sizeof(
unsigned) + 1.0*p->
vStates->nCap *
sizeof(
void*)) );
581 char * pFileName =
"test.stg";
582 FILE * pFile = fopen( pFileName,
"wb" );
584 printf(
"Cannot open file \"%s\" for writing.\n", pFileName );
589 printf(
"Extracted STG was written into file \"%s\".\n", pFileName );
static void Gia_ManSimulateCo(Gia_ManEra_t *p, Gia_Obj_t *pObj)
int Gia_ManCountDepth(Gia_ManEra_t *p)
static unsigned * Gia_ManEraHashFind(Gia_ManEra_t *p, Gia_ObjEra_t *pState, int *pStateNum)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Abc_PrimeCudd(unsigned int p)
static int Gia_ManPoNum(Gia_Man_t *p)
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
void Gia_ManEraFree(Gia_ManEra_t *p)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Gia_ManStgPrint(FILE *pFile, Vec_Int_t *vLines, int nIns, int nOuts, int nStates)
static int Abc_InfoHasBit(unsigned *p, int i)
static void Abc_InfoXorBit(unsigned *p, int i)
Gia_ManEra_t * Gia_ManEraCreate(Gia_Man_t *pAig)
FUNCTION DEFINITIONS ///.
Vec_Int_t * Gia_ManCollectBugTrace(Gia_ManEra_t *p, Gia_ObjEra_t *pState, int iCond)
static int Gia_ManOutputAsserted(Gia_ManEra_t *p, Gia_Obj_t *pObj)
int Gia_ManAnalyzeResult(Gia_ManEra_t *p, Gia_ObjEra_t *pState, int fMiter, int fStgDump)
static int Gia_WordFindFirstBit(unsigned uWord)
static void Gia_ManSimulateNode(Gia_ManEra_t *p, Gia_Obj_t *pObj)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
void Mem_FixedStop(Mem_Fixed_t *p, int fVerbose)
static int Abc_TruthWordNum(int nVars)
static abctime Abc_Clock()
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_IntReverseOrder(Vec_Int_t *p)
int Gia_ManCollectReachable(Gia_Man_t *pAig, int nStatesMax, int fMiter, int fDumpFile, int fVerbose)
static Vec_Ptr_t * Vec_PtrAllocTruthTables(int nVars)
Mem_Fixed_t * Mem_FixedStart(int nEntrySize)
FUNCTION DEFINITIONS ///.
static unsigned * Gia_ManEraData(Gia_ManEra_t *p, int i)
static Gia_Obj_t * Gia_ManPi(Gia_Man_t *p, int v)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void * Vec_PtrEntryLast(Vec_Ptr_t *p)
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Gia_ObjEra_t_ Gia_ObjEra_t
DECLARATIONS ///.
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Mem_Fixed_t_ Mem_Fixed_t
DECLARATIONS ///.
int Gia_ManEraStateHash(unsigned *pState, int nWordsSim, int nTableSize)
void Gia_ManInsertState(Gia_ManEra_t *p, Gia_ObjEra_t *pState)
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static int Vec_IntSize(Vec_Int_t *p)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Gia_ManPerformOneIter(Gia_ManEra_t *p)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
#define ABC_CALLOC(type, num)
#define Gia_ManForEachRo(p, pObj, i)
static int Abc_BitWordNum(int nBits)
void Gia_ManEraHashResize(Gia_ManEra_t *p)
#define Gia_ManForEachRi(p, pObj, i)
#define Gia_ManForEachObj1(p, pObj, i)
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Gia_ManPiNum(Gia_Man_t *p)
static Gia_ObjEra_t * Gia_ManEraState(Gia_ManEra_t *p, int i)
#define Gia_ManForEachPo(p, pObj, i)
static int Gia_ObjFaninId1(Gia_Obj_t *pObj, int ObjId)
char * Mem_FixedEntryFetch(Mem_Fixed_t *p)
Gia_ObjEra_t * Gia_ManEraCreateState(Gia_ManEra_t *p)
static int Gia_ManObjNum(Gia_Man_t *p)
static void Vec_PtrFree(Vec_Ptr_t *p)
static int Gia_ObjFaninId0(Gia_Obj_t *pObj, int ObjId)
static int Gia_ManRegNum(Gia_Man_t *p)