30 #define SAIG_DIFF_VALUES 8
31 #define SAIG_UNDEF_VALUE 0x1ffffffe //536870910
103 static inline int Saig_MvNot(
int iNode ) {
return (iNode ^ 01); }
112 #define Saig_MvManForEachObj( pAig, pEntry ) \
113 for ( pEntry = pAig; pEntry->Type != AIG_OBJ_VOID; pEntry++ )
183 pNode->
iFan0 = iFan0;
184 pNode->
iFan1 = iFan1;
186 if ( iFan0 || iFan1 )
227 for ( i = 1; i < p->
nFlops; i++ )
282 static inline int Saig_MvHash(
int iFan0,
int iFan1,
int TableSize )
290 return (
int)(Key % TableSize);
308 for ( pEntry = (*pPlace)? p->
pAigNew + *pPlace : NULL; pEntry;
309 pPlace = &pEntry->
iNext, pEntry = (*pPlace)? p->
pAigNew + *pPlace : NULL )
310 if ( pEntry->
iFan0 == iFan0 && pEntry->
iFan1 == iFan1 )
328 if ( iFan0 == iFan1 )
358 int iPlace = pPlace - (
int*)p->
pAigNew;
360 ((
int*)p->
pAigNew)[iPlace] = iNode;
411 printf(
"%3d : ", Iter );
417 printf(
"%5d", pEntry->
Value );
449 if ( pEntry->
iFan1 == 0 )
485 static int s_SPrimes[16] = {
505 for ( i = 0; i < nFlops; i++ )
506 uHash ^= pState[i] * s_SPrimes[i & 0xF];
507 return (
int)(uHash % TableSize);
526 pPlace = pEntry, pEntry = (*pPlace)? (
unsigned *)
Vec_PtrEntry(p->
vStates, *pPlace) : NULL )
527 if (
memcmp( pEntry+1, pState+1,
sizeof(
int)*p->
nFlops ) == 0 )
546 unsigned * pState, * pPlace;
551 pState[i+1] = pEntry->
Value;
575 int i, k, j,
nTotal = 0, iFlop;
582 printf(
"The number of registers that never became undef = %d. (Total = %d.)\n", nTotal, p->
nFlops );
590 if ( pState[iFlop+1] != pState[i+1] )
606 printf(
"FLOP %5d : (%3d) ", iFlop,
Vec_IntEntry(vCounter,i) );
622 printf(
"%d", pState[iFlop+1] );
652 for ( k = 0; k < p->
nFlops; k++ )
685 for ( Per = 0; Per <
Vec_IntSize(vValues)/2; Per++ )
733 for ( k = 0; k < p->
nFlops; k++ )
795 Vec_Int_t * vConst0, * vOscils, * vXFlops;
827 int i, k, j, FlopK, FlopJ;
828 int Counter1 = 0, Counter2 = 0;
851 if ( pState[FlopK+1] != pState[FlopJ+1] )
861 printf(
"Detected %d const0 flops and %d pairs of equiv binary flops.\n", Counter1, Counter2 );
863 if ( Counter1 == 0 && Counter2 == 0 )
886 assert( nFramesSymb >= 1 && nFramesSymb <= nFramesSatur );
903 if ( f == nFramesSatur )
906 printf(
"Begining to saturate simulation after %d frames\n", f );
910 if ( f == 2 * nFramesSatur )
913 printf(
"Agressively saturating simulation after %d frames\n", f );
933 printf(
"Converged after %d frames with lasso in state %d. Cycle = %d.\n", f+1, iState-1, f+2-iState );
static int Saig_MvLev(Saig_MvMan_t *p, int iNode)
Vec_Int_t * Saig_MvManFindOscilators(Saig_MvMan_t *p, Vec_Int_t **pvConst0)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Abc_PrimeCudd(unsigned int p)
static int Aig_ObjFaninId0(Aig_Obj_t *pObj)
static int Saig_MvUndef()
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
static int Saig_ObjIsLo(Aig_Man_t *p, Aig_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
int Saig_MvSimHash(unsigned *pState, int nFlops, int TableSize)
static Aig_Obj_t * Saig_ObjLoToLi(Aig_Man_t *p, Aig_Obj_t *pObj)
#define ABC_REALLOC(type, obj, num)
static Aig_Obj_t * Saig_ManLo(Aig_Man_t *p, int i)
void Aig_MmFixedStop(Aig_MmFixed_t *p, int fVerbose)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Saig_MvObj_t * Saig_ManCreateReducedAig(Aig_Man_t *p, Vec_Ptr_t **pvFlops)
FUNCTION DEFINITIONS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static Aig_Obj_t * Aig_ManConst0(Aig_Man_t *p)
int nRValues[SAIG_DIFF_VALUES+1]
static int Saig_MvConst0()
Vec_Int_t * Saig_MvManFindXFlops(Saig_MvMan_t *p)
static int Saig_MvCreateObj(Saig_MvMan_t *p, int iFan0, int iFan1)
#define ABC_ALLOC(type, num)
int Saig_MvManCheckOscilator(Saig_MvMan_t *p, int iFlop)
static abctime Abc_Clock()
static int Aig_ObjFaninId1(Aig_Obj_t *pObj)
static int Abc_MaxInt(int a, int b)
static int Vec_PtrSize(Vec_Ptr_t *p)
Aig_MmFixed_t * Aig_MmFixedStart(int nEntrySize, int nEntriesMax)
FUNCTION DEFINITIONS ///.
void Saig_MvPrintState(int Iter, Saig_MvMan_t *p)
static int Saig_MvVar2Lit(int iVar)
static int * Saig_MvTableFind(Saig_MvMan_t *p, int iFan0, int iFan1)
Vec_Int_t * Saig_MvManCreateNextSkip(Saig_MvMan_t *p)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static int Saig_MvObjFanin0(Saig_MvObj_t *pObj)
void Saig_MvSimulateFrame(Saig_MvMan_t *p, int fFirst, int fVerbose)
Vec_Int_t * Saig_MvManFindConstBinaryFlops(Saig_MvMan_t *p, Vec_Int_t **pvBinary)
static Vec_Int_t * Vec_IntStart(int nSize)
static int Saig_MvObjFanin1(Saig_MvObj_t *pObj)
static int Saig_MvObjFaninC1(Saig_MvObj_t *pObj)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Saig_MvIsConst1(int iNode)
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
static int Saig_MvObjFaninC0(Saig_MvObj_t *pObj)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Aig_ManCiNum(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
static int Saig_MvSimulateValue0(Saig_MvObj_t *pAig, Saig_MvObj_t *pObj)
char * Aig_MmFixedEntryFetch(Aig_MmFixed_t *p)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Saig_MvLit2Var(int iNode)
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
static void Vec_IntFreeP(Vec_Int_t **p)
Saig_MvMan_t * Saig_MvManStart(Aig_Man_t *pAig, int nFramesSatur)
static int Saig_MvConst1()
Vec_Ptr_t * Saig_MvManSimulate(Aig_Man_t *pAig, int nFramesSymb, int nFramesSatur, int fVerbose, int fVeryVerbose)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
static int Aig_ManObjNumMax(Aig_Man_t *p)
static int Saig_MvNotCond(int iNode, int c)
#define ABC_NAMESPACE_IMPL_START
static int Saig_MvIsConst(int iNode)
void Saig_MvManStop(Saig_MvMan_t *p)
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static int Saig_MvAnd(Saig_MvMan_t *p, int iFan0, int iFan1, int fFirst)
static int Saig_MvHash(int iFan0, int iFan1, int TableSize)
static int Aig_ManRegNum(Aig_Man_t *p)
static int Saig_MvIsUndef(int iNode)
static int Vec_IntSize(Vec_Int_t *p)
#define Aig_ManForEachObj(p, pObj, i)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static unsigned * Saig_MvSimTableFind(Saig_MvMan_t *p, unsigned *pState)
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
#define ABC_CALLOC(type, num)
static int Saig_MvRegular(int iNode)
Aig_MmFixed_t * pMemStates
static void Vec_PtrFreeP(Vec_Ptr_t **p)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
#define SAIG_DIFF_VALUES
DECLARATIONS ///.
void Saig_MvManPostProcess(Saig_MvMan_t *p, int iState)
static int Saig_MvConst(int c)
#define Saig_MvManForEachObj(pAig, pEntry)
static int Saig_MvIsConst0(int iNode)
int Saig_MvSaveState(Saig_MvMan_t *p)
static int Saig_MvSimulateValue1(Saig_MvObj_t *pAig, Saig_MvObj_t *pObj)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static int Aig_ObjIsCo(Aig_Obj_t *pObj)
Vec_Ptr_t * Saig_MvManDeriveMap(Saig_MvMan_t *p, int fVerbose)
static int Saig_MvNot(int iNode)
int nTotal
DECLARATIONS ///.
static int Saig_MvIsComplement(int iNode)
static void Vec_PtrFree(Vec_Ptr_t *p)