21#ifndef ABC__base__wlc__wlc_h
22#define ABC__base__wlc__wlc_h
231static inline void Wlc_BstParDefault(
Wlc_BstPar_t * pPar )
277static inline int Wlc_NtkObjNum(
Wlc_Ntk_t *
p ) {
return p->iObj - 1; }
278static inline int Wlc_NtkObjNumMax(
Wlc_Ntk_t *
p ) {
return p->iObj; }
279static inline int Wlc_NtkPiNum(
Wlc_Ntk_t *
p ) {
return Vec_IntSize(&
p->vPis); }
280static inline int Wlc_NtkPoNum(
Wlc_Ntk_t *
p ) {
return Vec_IntSize(&
p->vPos); }
281static inline int Wlc_NtkCiNum(
Wlc_Ntk_t *
p ) {
return Vec_IntSize(&
p->vCis); }
282static inline int Wlc_NtkCoNum(
Wlc_Ntk_t *
p ) {
return Vec_IntSize(&
p->vCos); }
283static inline int Wlc_NtkFfNum(
Wlc_Ntk_t *
p ) {
return Vec_IntSize(&
p->vCis) - Vec_IntSize(&
p->vPis); }
286static inline Wlc_Obj_t * Wlc_NtkPi(
Wlc_Ntk_t *
p,
int i ) {
return Wlc_NtkObj(
p, Vec_IntEntry(&
p->vPis, i) ); }
287static inline Wlc_Obj_t * Wlc_NtkPo(
Wlc_Ntk_t *
p,
int i ) {
return Wlc_NtkObj(
p, Vec_IntEntry(&
p->vPos, i) ); }
288static inline Wlc_Obj_t * Wlc_NtkCi(
Wlc_Ntk_t *
p,
int i ) {
return Wlc_NtkObj(
p, Vec_IntEntry(&
p->vCis, i) ); }
289static inline Wlc_Obj_t * Wlc_NtkCo(
Wlc_Ntk_t *
p,
int i ) {
return Wlc_NtkObj(
p, Vec_IntEntry(&
p->vCos, i) ); }
290static inline Wlc_Obj_t * Wlc_NtkFf(
Wlc_Ntk_t *
p,
int i ) {
return Wlc_NtkObj(
p, Vec_IntEntry(&
p->vFfs, i) ); }
291static inline Wlc_Obj_t * Wlc_NtkFf2(
Wlc_Ntk_t *
p,
int i ) {
return Wlc_NtkObj(
p, Vec_IntEntry(&
p->vFfs2, i) ); }
294static inline int Wlc_ObjIsPo(
Wlc_Obj_t *
p ) {
return p->fIsPo; }
296static inline int Wlc_ObjIsCo(
Wlc_Obj_t *
p ) {
return p->fIsPo ||
p->fIsFi; }
301static inline int Wlc_ObjIsFf(
Wlc_Ntk_t *
p,
int i ) {
return Wlc_NtkObj(
p, i)->Type ==
WLC_OBJ_FF; }
304static inline int Wlc_ObjCiId(
Wlc_Obj_t *
p ) {
assert( Wlc_ObjIsCi(
p) );
return p->Fanins[1]; }
305static inline int Wlc_ObjType(
Wlc_Obj_t * pObj ) {
return pObj->
Type; }
306static inline int Wlc_ObjFaninNum(
Wlc_Obj_t *
p ) {
return p->nFanins; }
308static inline int * Wlc_ObjFanins(
Wlc_Obj_t *
p ) {
return Wlc_ObjHasArray(
p) ?
p->pFanins[0] :
p->Fanins; }
309static inline int Wlc_ObjFaninId(
Wlc_Obj_t *
p,
int i ) {
return Wlc_ObjFanins(
p)[i]; }
310static inline int Wlc_ObjFaninId0(
Wlc_Obj_t *
p ) {
return Wlc_ObjFanins(
p)[0]; }
311static inline int Wlc_ObjFaninId1(
Wlc_Obj_t *
p ) {
return Wlc_ObjFanins(
p)[1]; }
312static inline int Wlc_ObjFaninId2(
Wlc_Obj_t *
p ) {
return Wlc_ObjFanins(
p)[2]; }
318static inline int Wlc_ObjRange(
Wlc_Obj_t *
p ) {
return 1 + (
p->End >=
p->Beg ?
p->End -
p->Beg :
p->Beg -
p->End); }
321static inline int Wlc_ObjRangeIsReversed(
Wlc_Obj_t *
p ) {
return p->End <
p->Beg; }
323static inline int Wlc_ObjIsSigned(
Wlc_Obj_t *
p ) {
return p->Signed; }
324static inline int Wlc_ObjIsSignedFanin01(
Wlc_Ntk_t *
p,
Wlc_Obj_t * pObj ){
return p->fSmtLib ? Wlc_ObjIsSigned(pObj) : (Wlc_ObjFanin0(
p, pObj)->Signed && Wlc_ObjFanin1(
p, pObj)->Signed); }
325static inline int Wlc_ObjIsSignedFanin0(
Wlc_Ntk_t *
p,
Wlc_Obj_t * pObj ) {
return p->fSmtLib ? Wlc_ObjIsSigned(pObj) : Wlc_ObjFanin0(
p, pObj)->Signed; }
326static inline int Wlc_ObjIsSignedFanin1(
Wlc_Ntk_t *
p,
Wlc_Obj_t * pObj ) {
return p->fSmtLib ? Wlc_ObjIsSigned(pObj) : Wlc_ObjFanin1(
p, pObj)->Signed; }
327static inline int Wlc_ObjSign(
Wlc_Obj_t *
p ) {
return Abc_Var2Lit( Wlc_ObjRange(
p), Wlc_ObjIsSigned(
p) ); }
330static inline word * Wlc_ObjTable(
Wlc_Ntk_t *
p,
Wlc_Obj_t * pObj ) {
return (
word *)Vec_PtrEntry(
p->vTables, Wlc_ObjTableId(pObj) ); }
331static inline int Wlc_ObjLevelId(
Wlc_Ntk_t *
p,
int iObj ) {
return Vec_IntEntry( &
p->vLevels, iObj ); }
332static inline int Wlc_ObjLevel(
Wlc_Ntk_t *
p,
Wlc_Obj_t * pObj ) {
return Wlc_ObjLevelId(
p, Wlc_ObjId(
p, pObj) ); }
334static inline void Wlc_NtkCleanCopy(
Wlc_Ntk_t *
p ) { Vec_IntFill( &
p->vCopies,
p->nObjsAlloc, 0 ); }
335static inline int Wlc_NtkHasCopy(
Wlc_Ntk_t *
p ) {
return Vec_IntSize( &
p->vCopies ) > 0; }
336static inline void Wlc_ObjSetCopy(
Wlc_Ntk_t *
p,
int iObj,
int i ) { Vec_IntWriteEntry( &
p->vCopies, iObj, i ); }
337static inline int Wlc_ObjCopy(
Wlc_Ntk_t *
p,
int iObj ) {
return Vec_IntEntry( &
p->vCopies, iObj ); }
340static inline void Wlc_NtkCleanNameId(
Wlc_Ntk_t *
p ) { Vec_IntFill( &
p->vNameIds,
p->nObjsAlloc, 0 ); }
341static inline int Wlc_NtkHasNameId(
Wlc_Ntk_t *
p ) {
return Vec_IntSize( &
p->vNameIds ) > 0; }
342static inline void Wlc_ObjSetNameId(
Wlc_Ntk_t *
p,
int iObj,
int i ) { Vec_IntWriteEntry( &
p->vNameIds, iObj, i ); }
343static inline int Wlc_ObjNameId(
Wlc_Ntk_t *
p,
int iObj ) {
return Vec_IntEntry( &
p->vNameIds, iObj ); }
346static inline Wlc_Obj_t * Wlc_ObjCo2PoFo(
Wlc_Ntk_t *
p,
int iCoId ) {
return iCoId < Wlc_NtkPoNum(
p) ? Wlc_NtkPo(
p, iCoId) : Wlc_NtkCi(
p, Wlc_NtkPiNum(
p) + iCoId - Wlc_NtkPoNum(
p)); }
356#define Wlc_NtkForEachObj( p, pObj, i ) \
357 for ( i = 1; (i < Wlc_NtkObjNumMax(p)) && (((pObj) = Wlc_NtkObj(p, i)), 1); i++ )
358#define Wlc_NtkForEachObjReverse( p, pObj, i ) \
359 for ( i = Wlc_NtkObjNumMax(p) - 1; (i > 0) && (((pObj) = Wlc_NtkObj(p, i)), 1); i-- )
360#define Wlc_NtkForEachObjVec( vVec, p, pObj, i ) \
361 for ( i = 0; (i < Vec_IntSize(vVec)) && (((pObj) = Wlc_NtkObj(p, Vec_IntEntry(vVec, i))), 1); i++ )
362#define Wlc_NtkForEachPi( p, pPi, i ) \
363 for ( i = 0; (i < Wlc_NtkPiNum(p)) && (((pPi) = Wlc_NtkPi(p, i)), 1); i++ )
364#define Wlc_NtkForEachPo( p, pPo, i ) \
365 for ( i = 0; (i < Wlc_NtkPoNum(p)) && (((pPo) = Wlc_NtkPo(p, i)), 1); i++ )
366#define Wlc_NtkForEachCi( p, pCi, i ) \
367 for ( i = 0; (i < Wlc_NtkCiNum(p)) && (((pCi) = Wlc_NtkCi(p, i)), 1); i++ )
368#define Wlc_NtkForEachCo( p, pCo, i ) \
369 for ( i = 0; (i < Wlc_NtkCoNum(p)) && (((pCo) = Wlc_NtkCo(p, i)), 1); i++ )
370#define Wlc_NtkForEachFf( p, pFf, i ) \
371 for ( i = 0; (i < Vec_IntSize(&p->vFfs)) && (((pFf) = Wlc_NtkFf(p, i)), 1); i++ )
372#define Wlc_NtkForEachFf2( p, pFf, i ) \
373 for ( i = 0; (i < Vec_IntSize(&p->vFfs2)) && (((pFf) = Wlc_NtkFf2(p, i)), 1); i++ )
375#define Wlc_ObjForEachFanin( pObj, iFanin, i ) \
376 for ( i = 0; (i < Wlc_ObjFaninNum(pObj)) && (((iFanin) = Wlc_ObjFaninId(pObj, i)), 1); i++ )
377#define Wlc_ObjForEachFaninObj( p, pObj, pFanin, i ) \
378 for ( i = 0; (i < Wlc_ObjFaninNum(pObj)) && (((pFanin) = Wlc_NtkObj(p, Wlc_ObjFaninId(pObj, i))), 1); i++ )
379#define Wlc_ObjForEachFaninReverse( pObj, iFanin, i ) \
380 for ( i = Wlc_ObjFaninNum(pObj) - 1; (i >= 0) && (((iFanin) = Wlc_ObjFaninId(pObj, i)), 1); i-- )
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
struct Gia_Man_t_ Gia_Man_t
unsigned __int64 word
DECLARATIONS ///.
struct Mem_Flex_t_ Mem_Flex_t
int nObjs[WLC_OBJ_NUMBER]
int nAnds[WLC_OBJ_NUMBER]
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Abc_Nam_t_ Abc_Nam_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Bit_t_ Vec_Bit_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Wrd_t_ Vec_Wrd_t
INCLUDES ///.
struct Wlc_Par_t_ Wlc_Par_t
Wlc_Ntk_t * Wlc_NtkDupDfsAbs(Wlc_Ntk_t *p, Vec_Int_t *vPisOld, Vec_Int_t *vPisNew, Vec_Int_t *vFlops)
Wlc_Ntk_t * Wlc_NtkUifNodePairs(Wlc_Ntk_t *pNtk, Vec_Int_t *vPairs)
void Wlc_NtkDeleteSim(Vec_Ptr_t *p)
int Wlc_NtkAbsCore2(Wlc_Ntk_t *p, Wlc_Par_t *pPars)
Vec_Ptr_t * Wlc_NtkSimulate(Wlc_Ntk_t *p, Vec_Int_t *vNodes, int nWords, int nFrames)
void Wlc_NtkTransferNames(Wlc_Ntk_t *pNew, Wlc_Ntk_t *p)
void Wlc_NtkPrintMemory(Wlc_Ntk_t *p)
void Wlc_WriteNdr(Wlc_Ntk_t *pNtk, char *pFileName)
int Wlc_NtkCountRealPis(Wlc_Ntk_t *p)
Gia_Man_t * Wlc_NtkBitBlast(Wlc_Ntk_t *p, Wlc_BstPar_t *pPars)
void Wlc_NtkPrintNode(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
char * Wlc_NtkNewName(Wlc_Ntk_t *p, int iCoId, int fSeq)
int Wlc_ObjAlloc(Wlc_Ntk_t *p, int Type, int Signed, int End, int Beg)
Vec_Int_t * Wlc_NtkFindUifableMultiplierPairs(Wlc_Ntk_t *p)
void Wlc_NtkCleanMarks(Wlc_Ntk_t *p)
int Wlc_NtkPdrAbs(Wlc_Ntk_t *p, Wlc_Par_t *pPars)
void Wlc_ObjSetCo(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, int fFlopInput)
void Wlc_ManSetDefaultParams(Wlc_Par_t *pPars)
FUNCTION DEFINITIONS ///.
Wlc_Ntk_t * Wlc_NtkMemAbstractTest(Wlc_Ntk_t *p)
void Wlc_NtkPrintNodeArray(Wlc_Ntk_t *p, Vec_Int_t *vArray)
int Wlc_NtkAbsCore(Wlc_Ntk_t *p, Wlc_Par_t *pPars)
FUNCTION DECLARATIONS ///.
Wlc_Ntk_t * Wlc_NtkDupDfs(Wlc_Ntk_t *p, int fMarked, int fSeq)
Wlc_Ntk_t * Wlc_NtkAlloc(char *pName, int nObjsAlloc)
void Wlc_NtkFree(Wlc_Ntk_t *p)
void Wlc_NtkShortNames(Wlc_Ntk_t *p)
void Wlc_NtkSetRefs(Wlc_Ntk_t *p)
void Wlc_NtkProfileCones(Wlc_Ntk_t *p)
Wlc_Ntk_t * Wlc_NtkFromNdr(void *pData)
struct Wlc_Ntk_t_ Wlc_Ntk_t
void Wlc_NtkPrintNodes(Wlc_Ntk_t *p, int Type)
char * Wlc_PrsConvertInitValues(Wlc_Ntk_t *p)
Wlc_Ntk_t * Wlc_NtkAbstractNodes(Wlc_Ntk_t *pNtk, Vec_Int_t *vNodes)
int Wlc_NtkMemAbstract(Wlc_Ntk_t *p, int nIterMax, int fDumpAbs, int fPdrVerbose, int fVerbose)
void Wlc_WinProfileArith(Wlc_Ntk_t *p)
char * Wlc_ObjTypeName(Wlc_Obj_t *p)
int Wlc_ObjDup(Wlc_Ntk_t *pNew, Wlc_Ntk_t *p, int iObj, Vec_Int_t *vFanins)
Wlc_Ntk_t * Wlc_ReadSmtBuffer(char *pFileName, char *pBuffer, char *pLimit, int fOldParser, int fPrintTree)
void Wlc_NtkPrintStats(Wlc_Ntk_t *p, int fDistrib, int fTwoSides, int fVerbose)
Vec_Int_t * Wlc_NtkCollectMemory(Wlc_Ntk_t *p, int fClean)
void Wlc_ObjAddFanins(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Vec_Int_t *vFanins)
void Wlc_ObjSetCi(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
void * Wlc_NtkToNdr(Wlc_Ntk_t *pNtk)
void Wlc_NtkPrintObjects(Wlc_Ntk_t *p)
Wlc_Ntk_t * Wlc_NtkAbstractMem(Wlc_Ntk_t *p, int nFrames, int fVerbose)
void Wlc_NtkMarkCone(Wlc_Ntk_t *p, int iCoId, int Range, int fSeq, int fAllPis)
void Wlc_WriteVer(Wlc_Ntk_t *p, char *pFileName, int fAddCos, int fNoFlops)
int Wlc_StdinProcessSmt(Abc_Frame_t *pAbc, char *pCmd)
Wlc_Ntk_t * Wlc_NtkDupSingleNodes(Wlc_Ntk_t *p)
int Wlc_NtkCreateLevels(Wlc_Ntk_t *p)
int Wlc_NtkCreateLevelsRev(Wlc_Ntk_t *p)
void Wlc_ObjUpdateType(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, int Type)
Vec_Int_t * Wlc_NtkCollectMultipliers(Wlc_Ntk_t *p)
int Wlc_ObjCreate(Wlc_Ntk_t *p, int Type, int Signed, int End, int Beg, Vec_Int_t *vFanins)
char * Wlc_ObjName(Wlc_Ntk_t *p, int iObj)
int Wlc_NtkPairIsUifable(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Wlc_Obj_t *pObj2)
int Wlc_NtkRemapLevels(Wlc_Ntk_t *p, Vec_Int_t *vObjs, int nLevels)
Wlc_ObjType_t
INCLUDES ///.
struct Wlc_BstPar_t_ Wlc_BstPar_t
void Wlc_SetNtk(Abc_Frame_t *pAbc, Wlc_Ntk_t *pNtk)
Wlc_Ntk_t * Wlc_NtkDupDfsSimple(Wlc_Ntk_t *p)
int Wlc_NtkCountObjBits(Wlc_Ntk_t *p, Vec_Int_t *vPisNew)
Vec_Int_t * Wlc_NtkCollectAddMult(Wlc_Ntk_t *p, Wlc_BstPar_t *pPar, int *pCountA, int *CountM)
Wlc_Ntk_t * Wlc_ReadNdr(char *pFileName)
struct Wlc_Obj_t_ Wlc_Obj_t
BASIC TYPES ///.
Wlc_Ntk_t * Wlc_ReadSmt(char *pFileName, int fOldParser, int fPrintTree)
int Wlc_NtkDcFlopNum(Wlc_Ntk_t *p)
struct Wla_Man_t_ Wla_Man_t
Wlc_Ntk_t * Wlc_ReadVer(char *pFileName, char *pStr, int fInter)