21 #ifndef ABC__aig__hop__hop_h
22 #define ABC__aig__hop__hop_h
118 static inline int Hop_BitWordNum(
int nBits ) {
return (nBits>>5) + ((nBits&31) > 0); }
119 static inline int Hop_TruthWordNum(
int nVars ) {
return nVars <= 5 ? 1 : (1 << (nVars - 5)); }
120 static inline int Hop_InfoHasBit(
unsigned *
p,
int i ) {
return (p[(i)>>5] & (1<<((i) & 31))) > 0; }
121 static inline void Hop_InfoSetBit(
unsigned *
p,
int i ) { p[(i)>>5] |= (1<<((i) & 31)); }
122 static inline void Hop_InfoXorBit(
unsigned *
p,
int i ) { p[(i)>>5] ^= (1<<((i) & 31)); }
123 static inline int Hop_Base2Log(
unsigned n ) {
int r;
if ( n < 2 )
return n;
for ( r = 0, n--; n; n >>= 1, r++ ) {};
return r; }
124 static inline int Hop_Base10Log(
unsigned n ) {
int r;
if ( n < 2 )
return n;
for ( r = 0, n--; n; n /= 10, r++ ) {};
return r; }
233 if ( p->pListFree == NULL )
235 pTemp = p->pListFree;
243 pTemp->
Id = p->nCreated++;
250 p->pListFree = pEntry;
259 #define Hop_ManForEachPi( p, pObj, i ) \
260 Vec_PtrForEachEntry( Hop_Obj_t *, p->vPis, pObj, i )
262 #define Hop_ManForEachPo( p, pObj, i ) \
263 Vec_PtrForEachEntry( Hop_Obj_t *, p->vPos, pObj, i )
265 #define Hop_ManForEachNode( p, pObj, i ) \
266 for ( i = 0; i < p->nTableSize; i++ ) \
267 if ( ((pObj) = p->pTable[i]) == NULL ) {} else
int Hop_ObjFanoutCount(Hop_Obj_t *pObj, Hop_Obj_t *pPivot)
Hop_Obj_t * Hop_ObjRepr(Hop_Obj_t *pObj)
int Hop_ManCheck(Hop_Man_t *p)
DECLARATIONS ///.
static Hop_Obj_t * Hop_ObjChild0(Hop_Obj_t *pObj)
static Hop_Obj_t * Hop_ObjFanin1(Hop_Obj_t *pObj)
static int Hop_ObjIsMarkA(Hop_Obj_t *pObj)
static Hop_Edge_t Hop_EdgeNot(Hop_Edge_t Edge)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
int Hop_ManCleanup(Hop_Man_t *p)
void Hop_ManCreateRefs(Hop_Man_t *p)
static void Hop_ObjSetMarkA(Hop_Obj_t *pObj)
Hop_Man_t * Hop_ManDup(Hop_Man_t *p)
Vec_Ptr_t * Hop_ManDfs(Hop_Man_t *p)
Hop_Obj_t * Hop_Or(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
static int Hop_ObjRefs(Hop_Obj_t *pObj)
static void Hop_InfoXorBit(unsigned *p, int i)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
static Hop_Obj_t * Hop_ManConst1(Hop_Man_t *p)
Hop_Obj_t * Hop_And(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
int Hop_DagSize(Hop_Obj_t *pObj)
void Hop_TableInsert(Hop_Man_t *p, Hop_Obj_t *pObj)
static Hop_Edge_t Hop_EdgeNotCond(Hop_Edge_t Edge, int fCond)
void Hop_ManDumpBlif(Hop_Man_t *p, char *pFileName)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Hop_ObjPhase(Hop_Obj_t *pObj)
void Hop_ManIncrementTravId(Hop_Man_t *p)
DECLARATIONS ///.
static int Hop_ObjIsPi(Hop_Obj_t *pObj)
Hop_Obj_t * Hop_Maj(Hop_Man_t *p, Hop_Obj_t *pA, Hop_Obj_t *pB, Hop_Obj_t *pC)
Hop_Obj_t * Hop_ObjCreate(Hop_Man_t *p, Hop_Obj_t *pGhost)
Hop_Obj_t * Hop_NodeBalanceBuildSuper(Hop_Man_t *p, Vec_Ptr_t *vSuper, Hop_Type_t Type, int fUpdateLevel)
static int Hop_ObjIsNode(Hop_Obj_t *pObj)
static Hop_Type_t Hop_ObjType(Hop_Obj_t *pObj)
void Hop_ManPrintVerbose(Hop_Man_t *p, int fHaig)
Hop_Obj_t * Hop_Transfer(Hop_Man_t *pSour, Hop_Man_t *pDest, Hop_Obj_t *pObj, int nVars)
void Hop_ObjDelete_rec(Hop_Man_t *p, Hop_Obj_t *pObj)
Hop_Obj_t * Hop_Compose(Hop_Man_t *p, Hop_Obj_t *pRoot, Hop_Obj_t *pFunc, int iVar)
int Hop_ManCountLevels(Hop_Man_t *p)
static Hop_Obj_t * Hop_ManGhost(Hop_Man_t *p)
static int Hop_ObjChild0CopyI(Hop_Obj_t *pObj)
void Hop_ObjConnect(Hop_Man_t *p, Hop_Obj_t *pObj, Hop_Obj_t *pFan0, Hop_Obj_t *pFan1)
Hop_Obj_t * Hop_CreateExor(Hop_Man_t *p, int nVars)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
void Hop_ManStartMemory(Hop_Man_t *p)
FUNCTION DEFINITIONS ///.
word Hop_ManComputeTruth6(Hop_Man_t *p, Hop_Obj_t *pObj, int nVars)
static int Hop_ManGetCost(Hop_Man_t *p)
static int Abc_MaxInt(int a, int b)
static int Hop_ManPoNum(Hop_Man_t *p)
static int Hop_ObjFaninC1(Hop_Obj_t *pObj)
static Hop_Obj_t * Hop_ManObj(Hop_Man_t *p, int i)
static int Vec_PtrSize(Vec_Ptr_t *p)
static Hop_Edge_t Hop_EdgeRegular(Hop_Edge_t Edge)
static Hop_Obj_t * Hop_Not(Hop_Obj_t *p)
static int Hop_ManObjNum(Hop_Man_t *p)
static int Hop_ObjIsAnd(Hop_Obj_t *pObj)
static int Abc_LitNotCond(int Lit, int c)
static void Hop_ObjSetTravIdCurrent(Hop_Man_t *p, Hop_Obj_t *pObj)
Hop_Obj_t * Hop_Oper(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1, Hop_Type_t Type)
Hop_Obj_t * Hop_Mux(Hop_Man_t *p, Hop_Obj_t *pC, Hop_Obj_t *p1, Hop_Obj_t *p0)
void Hop_ConeUnmark_rec(Hop_Obj_t *pObj)
static void Hop_ManRecycleMemory(Hop_Man_t *p, Hop_Obj_t *pEntry)
void Hop_ObjPrintVerbose(Hop_Obj_t *pObj, int fHaig)
Hop_Obj_t * Hop_Exor(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
static int Hop_BitWordNum(int nBits)
void Hop_ManStop(Hop_Man_t *p)
Hop_Obj_t * Hop_Remap(Hop_Man_t *p, Hop_Obj_t *pRoot, unsigned uSupp, int nVars)
void Hop_ObjCleanData_rec(Hop_Obj_t *pObj)
void Hop_ObjCreateChoice(Hop_Obj_t *pOld, Hop_Obj_t *pNew)
static Hop_Obj_t * Hop_ManPi(Hop_Man_t *p, int i)
void Hop_ObjCollectMulti(Hop_Obj_t *pFunc, Vec_Ptr_t *vSuper)
Hop_Obj_t * Hop_Permute(Hop_Man_t *p, Hop_Obj_t *pRoot, int nRootVars, int *pPermute)
Hop_Obj_t * Hop_CreateAnd(Hop_Man_t *p, int nVars)
static int Hop_ObjPhaseCompl(Hop_Obj_t *pObj)
static Hop_Obj_t * Hop_ObjChild1Copy(Hop_Obj_t *pObj)
static int Hop_ObjTravId(Hop_Obj_t *pObj)
static int Hop_Base10Log(unsigned n)
unsigned __int64 word
DECLARATIONS ///.
static int Hop_ManAndNum(Hop_Man_t *p)
static Hop_Obj_t * Hop_ManPo(Hop_Man_t *p, int i)
static int Hop_ObjIsNone(Hop_Obj_t *pObj)
static Hop_Obj_t * Hop_ObjChild1(Hop_Obj_t *pObj)
static Hop_Obj_t * Hop_ManFetchMemory(Hop_Man_t *p)
Hop_Man_t * Hop_ManStart()
DECLARATIONS ///.
static int Hop_IsComplement(Hop_Obj_t *p)
static Hop_Obj_t * Hop_ObjChild0Copy(Hop_Obj_t *pObj)
void Hop_ObjDelete(Hop_Man_t *p, Hop_Obj_t *pObj)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
static int Hop_ObjIsPo(Hop_Obj_t *pObj)
static void Hop_ObjSetTravId(Hop_Obj_t *pObj, int TravId)
static int Hop_ObjIsHash(Hop_Obj_t *pObj)
static void Hop_ObjClearMarkA(Hop_Obj_t *pObj)
static int Hop_ObjIsExor(Hop_Obj_t *pObj)
static Hop_Obj_t * Hop_ObjFanin0(Hop_Obj_t *pObj)
void Hop_TableProfile(Hop_Man_t *p)
#define ABC_NAMESPACE_HEADER_END
static int Hop_ObjIsConst1(Hop_Obj_t *pObj)
static void Hop_ObjClearRef(Hop_Obj_t *pObj)
static int Hop_ObjIsTravIdPrevious(Hop_Man_t *p, Hop_Obj_t *pObj)
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static int Hop_ObjLevel(Hop_Obj_t *pObj)
static int Hop_ObjIsTravIdCurrent(Hop_Man_t *p, Hop_Obj_t *pObj)
static int Hop_TruthWordNum(int nVars)
static int Hop_ManExorNum(Hop_Man_t *p)
Hop_Obj_t * Hop_CreateOr(Hop_Man_t *p, int nVars)
static int Hop_ObjChild1CopyI(Hop_Obj_t *pObj)
static int Hop_ObjFaninC0(Hop_Obj_t *pObj)
static int Hop_ObjWhatFanin(Hop_Obj_t *pObj, Hop_Obj_t *pFanin)
static int Hop_ObjIsTerm(Hop_Obj_t *pObj)
static Hop_Obj_t * Hop_NotCond(Hop_Obj_t *p, int c)
Hop_Obj_t * Hop_ObjRecognizeMux(Hop_Obj_t *pObj, Hop_Obj_t **ppObjT, Hop_Obj_t **ppObjE)
void Hop_ObjDisconnect(Hop_Man_t *p, Hop_Obj_t *pObj)
static void Hop_ObjRef(Hop_Obj_t *pObj)
static void Hop_ObjDeref(Hop_Obj_t *pObj)
void Hop_ManCleanData(Hop_Man_t *p)
static int Hop_InfoHasBit(unsigned *p, int i)
unsigned * Hop_ManConvertAigToTruth(Hop_Man_t *p, Hop_Obj_t *pRoot, int nVars, Vec_Int_t *vTruth, int fMsbFirst)
void Hop_TableDelete(Hop_Man_t *p, Hop_Obj_t *pObj)
int Hop_ObjIsMuxType(Hop_Obj_t *pObj)
static void Hop_InfoSetBit(unsigned *p, int i)
void Hop_ManAddMemory(Hop_Man_t *p)
MACRO DEFINITIONS ///.
static Hop_Obj_t * Hop_ManConst0(Hop_Man_t *p)
static int Hop_EdgeId(Hop_Edge_t Edge)
Hop_Obj_t * Hop_ObjCreatePo(Hop_Man_t *p, Hop_Obj_t *pDriver)
Hop_Obj_t * Hop_Miter(Hop_Man_t *p, Vec_Ptr_t *vPairs)
static int Hop_ObjFanoutC(Hop_Obj_t *pObj, Hop_Obj_t *pFanout)
static Hop_Obj_t * Hop_Regular(Hop_Obj_t *p)
Vec_Ptr_t * Hop_ManDfsNode(Hop_Man_t *p, Hop_Obj_t *pNode)
Hop_Man_t * Hop_ManBalance(Hop_Man_t *p, int fUpdateLevel)
FUNCTION DECLARATIONS ///.
int Hop_ObjRecognizeExor(Hop_Obj_t *pObj, Hop_Obj_t **ppFan0, Hop_Obj_t **ppFan1)
static Hop_Obj_t * Hop_ObjCreateGhost(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1, Hop_Type_t Type)
static int Hop_ObjLevelNew(Hop_Obj_t *pObj)
Hop_Obj_t * Hop_ObjCreatePi(Hop_Man_t *p)
DECLARATIONS ///.
static int Hop_EdgeIsComplement(Hop_Edge_t Edge)
static int Hop_ManNodeNum(Hop_Man_t *p)
int Hop_TableCountEntries(Hop_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
static Hop_Edge_t Hop_EdgeCreate(int Id, int fCompl)
Hop_Obj_t * Hop_TableLookup(Hop_Man_t *p, Hop_Obj_t *pGhost)
FUNCTION DEFINITIONS ///.
static void Hop_ObjClean(Hop_Obj_t *pObj)
static int Hop_Base2Log(unsigned n)
void Hop_ManPrintStats(Hop_Man_t *p)
Hop_Obj_t * Hop_Complement(Hop_Man_t *p, Hop_Obj_t *pRoot, int iVar)
void Hop_ObjPrintEqn(FILE *pFile, Hop_Obj_t *pObj, Vec_Vec_t *vLevels, int Level)
void Hop_ObjPrintVerilog(FILE *pFile, Hop_Obj_t *pObj, Vec_Vec_t *vLevels, int Level)
static int Hop_ManPiNum(Hop_Man_t *p)
void Hop_ManStopMemory(Hop_Man_t *p)
static void Hop_ObjSetTravIdPrevious(Hop_Man_t *p, Hop_Obj_t *pObj)