21 #ifndef ABC__opt__sim__sim_h
22 #define ABC__opt__sim__sim_h
148 #define SIM_NUM_WORDS(n) (((n)>>5) + (((n)&31) > 0))
149 #define SIM_LAST_BITS(n) ((((n)&31) > 0)? (n)&31 : 32)
151 #define SIM_MASK_FULL (0xFFFFFFFF)
152 #define SIM_MASK_BEG(n) (SIM_MASK_FULL >> (32-n))
153 #define SIM_MASK_END(n) (SIM_MASK_FULL << (n))
154 #define SIM_SET_0_FROM(m,n) ((m) & ~SIM_MASK_BEG(n))
155 #define SIM_SET_1_FROM(m,n) ((m) | SIM_MASK_END(n))
158 #define SIM_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand()))
161 #define Sim_SetBit(p,i) ((p)[(i)>>5] |= (1<<((i) & 31)))
162 #define Sim_XorBit(p,i) ((p)[(i)>>5] ^= (1<<((i) & 31)))
163 #define Sim_HasBit(p,i) (((p)[(i)>>5] & (1<<((i) & 31))) > 0)
166 #define Sim_SuppStrSetVar(vSupps,pNode,v) Sim_SetBit((unsigned*)(vSupps)->pArray[(pNode)->Id],(v))
167 #define Sim_SuppStrHasVar(vSupps,pNode,v) Sim_HasBit((unsigned*)(vSupps)->pArray[(pNode)->Id],(v))
168 #define Sim_SuppFunSetVar(vSupps,Output,v) Sim_SetBit((unsigned*)(vSupps)->pArray[Output],(v))
169 #define Sim_SuppFunHasVar(vSupps,Output,v) Sim_HasBit((unsigned*)(vSupps)->pArray[Output],(v))
170 #define Sim_SimInfoSetVar(vSupps,pNode,v) Sim_SetBit((unsigned*)(vSupps)->pArray[(pNode)->Id],(v))
171 #define Sim_SimInfoHasVar(vSupps,pNode,v) Sim_HasBit((unsigned*)(vSupps)->pArray[(pNode)->Id],(v))
172 #define Sim_SimInfoGet(vInfo,pNode) ((unsigned *)((vInfo)->pArray[(pNode)->Id]))
218 extern void Sim_UtilSetConst(
unsigned * pPatRand,
int nSimWords,
int fConst1 );
220 extern int Sim_UtilInfoIsImp(
unsigned * pPats1,
unsigned * pPats2,
int nSimWords );
int Sim_UtilInfoIsEqual(unsigned *pPats1, unsigned *pPats2, int nSimWords)
int Sim_UtilCountAllPairs(Vec_Ptr_t *vSuppFun, int nSimWords, Vec_Int_t *vCounters)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
void Sim_ManPrintStats(Sim_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Vec_Int_t * Sim_UtilCountOnesArray(Vec_Ptr_t *vInfo, int nSimWords)
int Sim_UtilCountSuppSizes(Sim_Man_t *p, int fStruct)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Sym_ManStop(Sym_Man_t *p)
void Sim_UtilSetRandom(unsigned *pPatRand, int nSimWords)
void Sim_UtilSetCompl(unsigned *pPatRand, int nSimWords)
Vec_Ptr_t * Sim_SimulateSeqRandom(Abc_Ntk_t *pNtk, int nFrames, int nWords)
FUNCTION DEFINITIONS ///.
int Sim_ComputeTwoVarSymms(Abc_Ntk_t *pNtk, int fVerbose)
DECLARATIONS ///.
int Sim_UtilCountOnes(unsigned *pSimInfo, int nSimWords)
typedefABC_NAMESPACE_HEADER_START struct Sym_Man_t_ Sym_Man_t
INCLUDES ///.
void Sym_ManPrintStats(Sym_Man_t *p)
void Sim_SymmsStructCompute(Abc_Ntk_t *pNtk, Vec_Ptr_t *vMatrs, Vec_Ptr_t *vSuppFun)
FUNCTION DEFINITIONS ///.
Vec_Ptr_t * Sim_ComputeStrSupp(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
void Sim_UtilInfoFree(Vec_Ptr_t *p)
void Sim_ManPatFree(Sim_Man_t *p, Sim_Pat_t *pPat)
void Sim_UtilSimulateNode(Sim_Man_t *p, Abc_Obj_t *pNode, int fType, int fType1, int fType2)
void Sim_UtilInfoAdd(unsigned *pInfo1, unsigned *pInfo2, int nWords)
Vec_Ptr_t * Sim_UtilInfoAlloc(int nSize, int nWords, int fClean)
FUNCTION DEFINITIONS ///.
void Sim_UtilInfoFlip(Sim_Man_t *p, Abc_Obj_t *pNode)
void Sim_UtilSimulateNodeOne(Abc_Obj_t *pNode, Vec_Ptr_t *vSimInfo, int nSimWords, int nOffset)
void Sim_UtilSimulate(Sim_Man_t *p, int fFirst)
int Sim_UtilInfoIsImp(unsigned *pPats1, unsigned *pPats2, int nSimWords)
void Sim_ManStop(Sim_Man_t *p)
void Sim_UtilInfoDetectDiffs(unsigned *pInfo1, unsigned *pInfo2, int nWords, Vec_Int_t *vDiffs)
int Sim_SymmsGetPatternUsingSat(Sym_Man_t *p, unsigned *pPattern)
FUNCTION DEFINITIONS ///.
void Sim_UtilCountPairsAll(Sym_Man_t *p)
Vec_Ptr_t * Sim_SimulateSeqModel(Abc_Ntk_t *pNtk, int nFrames, int *pModel)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
#define ABC_NAMESPACE_HEADER_END
void Sim_SymmsSimulate(Sym_Man_t *p, unsigned *pPatRand, Vec_Ptr_t *vMatrsNonSym)
FUNCTION DEFINITIONS ///.
void Sim_UtilTransferNodeOne(Abc_Obj_t *pNode, Vec_Ptr_t *vSimInfo, int nSimWords, int nOffset, int fShift)
int Sim_UtilInfoIsClause(unsigned *pPats1, unsigned *pPats2, int nSimWords)
int Sim_UtilMatrsAreDisjoint(Sym_Man_t *p)
void Sim_UtilSetConst(unsigned *pPatRand, int nSimWords, int fConst1)
Vec_Ptr_t * Sim_ComputeFunSupp(Abc_Ntk_t *pNtk, int fVerbose)
int Sim_UtilInfoCompare(Sim_Man_t *p, Abc_Obj_t *pNode)
Vec_Ptr_t * vMatrNonSymms
Sim_Man_t * Sim_ManStart(Abc_Ntk_t *pNtk, int fLightweight)
void Sim_UtilInfoDetectNews(unsigned *pInfo1, unsigned *pInfo2, int nWords, Vec_Int_t *vDiffs)
Sym_Man_t * Sym_ManStart(Abc_Ntk_t *pNtk, int fVerbose)
FUNCTION DECLARATIONS ///.
Sim_Pat_t * Sim_ManPatAlloc(Sim_Man_t *p)