49 if ( pLatch == pLatchRoot )
148 Abc_Obj_t * pObj, * pLatch, * pFanin, * pFanout;
149 int i, k,
nTotal, nDigits;
160 for ( pFanin = pObj, k = 0; k < nLatches; k++, pFanin = pLatch )
262 Abc_Obj_t * pLatchOut, * pLatch, * pLatchIn;
272 pLatch->
pData = (
void *)Init;
316 Abc_Obj_t * pCtrl, * pLatch, * pMux, * pPi;
337 pLatch->
pData = (
void *)Init;
354 printf(
"The number of converted latches with DC values = %d.\n",
Counter );
398 printf(
"Converted %d one-hot registers.\n",
Vec_IntSize(vNumbers) );
425 Abc_Obj_t * pObj, * pFanin, * pObjNew, * pObjLiNew, * pObjLoNew;
426 int i, k, nFlops, nStates, iState, pfCompl[32];
433 printf(
"Cannot reencode %d flops because it will lead to 2^%d states.\n", nFlops, nFlops );
442 printf(
"Cannot process logic network with don't-care init values. Run \"zero\".\n" );
452 nStates = (1 << nFlops);
453 for ( i = 0; i < nStates; i++ )
474 for ( i = 0; i < nFlops; i++ )
477 for ( k = 0; k < nStates; k++ )
484 pObj->
pCopy = pObjNew;
502 for ( k = 0; k < nStates; k++ )
505 for ( i = 0; i < nFlops; i++ )
516 fprintf( stdout,
"Abc_NtkConvertOnehot(): Network check has failed.\n" );
569 Abc_Ntk_t * pNtkAig, * pNtkAigRet, * pNtkRes;
596 Abc_Obj_t * pObj, * pNodeNew, * pCtrl, * pDriver;
645 Vec_Int_t * vFlopClasses, * vFlopClassesNew;
646 Abc_Obj_t * pObj, * pDriver, * pFlopOut, * pObjPo;
647 int i, iFlop, CountN = 0, Count2 = 0, Count1 = 0, Count0 = 0;
687 printf(
"Opposite phase enable is present in %d flops (out of %d).\n", Count1,
Abc_NtkLatchNum(pNtk) );
689 printf(
"CountN = %4d. Count2 = %4d. Count1 = %4d. Count0 = %4d. Ctrls = %d.\n",
690 CountN, Count2, Count1, Count0,
Vec_PtrSize(vControls) );
729 int RetValue, i, k, iBit = 0;
739 for ( i = 0; i <= p->iFrame; i++ )
751 assert( iBit == p->nBits );
int Abc_NtkCountSelfFeedLatches(Abc_Ntk_t *pNtk)
Abc_Obj_t * Abc_NtkAddLatch(Abc_Ntk_t *pNtk, Abc_Obj_t *pDriver, Abc_InitType_t Init)
int Nm_ManFindIdByName(Nm_Man_t *p, char *pName, int Type)
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
ABC_NAMESPACE_IMPL_END ABC_NAMESPACE_IMPL_START Aig_Man_t * Abc_NtkRetimeWithClassesAig(Aig_Man_t *pMan, Vec_Int_t *vClasses, Vec_Int_t **pvClasses, int fVerbose)
void Nm_ManDeleteIdName(Nm_Man_t *p, int ObjId)
static int Abc_NtkHasBdd(Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
static int Abc_NtkHasSop(Abc_Ntk_t *pNtk)
void Gia_ManStop(Gia_Man_t *p)
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
static int Abc_ObjIsBo(Abc_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
static int Abc_ObjFaninC1(Abc_Obj_t *pObj)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Aig_ManStop(Aig_Man_t *p)
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
static int Abc_InfoHasBit(unsigned *p, int i)
static int Abc_ObjIsLatch(Abc_Obj_t *pObj)
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
ABC_DLL char * Abc_SopCreateAnd(Mem_Flex_t *pMan, int nVars, int *pfCompl)
ABC_DLL void Abc_NtkCleanMarkC(Abc_Ntk_t *pNtk)
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
ABC_DLL Abc_Obj_t * Abc_NtkDupObj(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj, int fCopyName)
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst1(Abc_Ntk_t *pNtk)
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
static int Abc_LatchIsInit0(Abc_Obj_t *pLatch)
#define ABC_ALLOC(type, num)
#define Abc_NtkForEachCo(pNtk, pCo, i)
static Abc_Obj_t * Abc_NtkCi(Abc_Ntk_t *pNtk, int i)
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
DdNode * Cudd_bddIte(DdManager *dd, DdNode *f, DdNode *g, DdNode *h)
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
ABC_DLL int Abc_NtkCleanup(Abc_Ntk_t *pNtk, int fVerbose)
static Abc_Obj_t * Abc_NtkObj(Abc_Ntk_t *pNtk, int i)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Abc_LatchSetInitDc(Abc_Obj_t *pLatch)
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
static int Vec_PtrFind(Vec_Ptr_t *p, void *Entry)
Hop_Obj_t * Hop_Mux(Hop_Man_t *p, Hop_Obj_t *pC, Hop_Obj_t *p1, Hop_Obj_t *p0)
void Abc_NtkInsertLatchValues(Abc_Ntk_t *pNtk, Vec_Int_t *vValues)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
static void Abc_ObjSetData(Abc_Obj_t *pObj, void *pData)
static Abc_Obj_t * Abc_NtkCo(Abc_Ntk_t *pNtk, int i)
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Vec_Int_t * Abc_NtkCollectLatchValues(Abc_Ntk_t *pNtk)
void Abc_NtkLatchPipe(Abc_Ntk_t *pNtk, int nLatches)
ABC_DLL Abc_Ntk_t * Abc_NtkToLogic(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
int Abc_NtkRemoveSelfFeedLatches(Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_NtkCreateBo(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_ObjPatchFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew)
void Abc_NtkNodeConvertToMux(Abc_Ntk_t *pNtk, Abc_Obj_t *pNodeC, Abc_Obj_t *pNode1, Abc_Obj_t *pNode0, Abc_Obj_t *pMux)
ABC_DLL char * Abc_SopRegister(Mem_Flex_t *pMan, char *pName)
DECLARATIONS ///.
ABC_DLL void Abc_NtkDeleteObj(Abc_Obj_t *pObj)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
ABC_DLL int Abc_NtkToSop(Abc_Ntk_t *pNtk, int fDirect)
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Gia_Man_t * Gia_ManRetimeForward(Gia_Man_t *p, int nMaxIters, int fVerbose)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Abc_Base10Log(unsigned n)
#define ABC_NAMESPACE_IMPL_END
static int Abc_LatchIsInitDc(Abc_Obj_t *pLatch)
ABC_DLL char * Abc_ObjNameDummy(char *pPrefix, int Num, int nDigits)
Abc_Ntk_t * Abc_NtkCRetime(Abc_Ntk_t *pNtk, int fVerbose)
ABC_DLL void Abc_NtkAddDummyBoxNames(Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_NtkCreateLatch(Abc_Ntk_t *pNtk)
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define Abc_NtkForEachLatch(pNtk, pObj, i)
static int Abc_LatchIsInit1(Abc_Obj_t *pLatch)
static Abc_Obj_t * Abc_NtkCreatePi(Abc_Ntk_t *pNtk)
void Abc_NtkConvertDcLatches(Abc_Ntk_t *pNtk)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
Abc_Ntk_t * Abc_NtkRetimeWithClassesNtk(Abc_Ntk_t *pNtk, Vec_Int_t *vClasses, Vec_Int_t **pvClasses, int fVerbose)
#define Abc_NtkForEachNode(pNtk, pNode, i)
ABC_DLL void Abc_ObjTransferFanout(Abc_Obj_t *pObjOld, Abc_Obj_t *pObjNew)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static void Abc_LatchSetInit1(Abc_Obj_t *pLatch)
int Abc_NtkVerifyCex(Abc_Ntk_t *pNtk, Abc_Cex_t *p)
ABC_DLL int Abc_NtkLogicMakeSimpleCos(Abc_Ntk_t *pNtk, int fDuplicate)
static Abc_Obj_t * Abc_ObjRegular(Abc_Obj_t *p)
Abc_Ntk_t * Abc_NtkFromDarSeqSweep(Abc_Ntk_t *pNtkOld, Aig_Man_t *pMan)
static int Vec_IntSize(Vec_Int_t *p)
ABC_DLL Abc_Obj_t * Abc_NodeFindCoFanout(Abc_Obj_t *pNode)
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Vec_Ptr_t * Abc_NtkConverLatchNamesIntoNumbers(Abc_Ntk_t *pNtk)
#define Abc_ObjForEachFanin(pObj, pFanin, i)
ABC_DLL Abc_Ntk_t * Abc_NtkStartFromNoLatches(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
char * Abc_NtkCollectLatchValuesStr(Abc_Ntk_t *pNtk)
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
static Abc_Obj_t * Abc_NtkCreateNode(Abc_Ntk_t *pNtk)
static int Abc_ObjIsPo(Abc_Obj_t *pObj)
static Abc_Obj_t * Abc_ObjNotCond(Abc_Obj_t *p, int c)
static int Abc_NtkHasAig(Abc_Ntk_t *pNtk)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Abc_Ntk_t * Abc_NtkConvertOnehot(Abc_Ntk_t *pNtk)
#define Abc_NtkForEachPo(pNtk, pPo, i)
static Abc_Obj_t * Abc_NtkCreateBi(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_NodeCollectFanouts(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
static Abc_Obj_t * Abc_ObjFanin(Abc_Obj_t *pObj, int i)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
ABC_NAMESPACE_IMPL_START int Abc_NtkLatchIsSelfFeed_rec(Abc_Obj_t *pLatch, Abc_Obj_t *pLatchRoot)
DECLARATIONS ///.
static int Abc_ObjIsComplement(Abc_Obj_t *p)
ABC_DLL void Abc_NtkOrderCisCos(Abc_Ntk_t *pNtk)
static void Abc_LatchSetInit0(Abc_Obj_t *pLatch)
static Abc_Obj_t * Abc_NtkCreatePo(Abc_Ntk_t *pNtk)
ABC_DLL char * Abc_SopCreateOr(Mem_Flex_t *pMan, int nVars, int *pfCompl)
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 ///.
int Abc_NtkLatchIsSelfFeed(Abc_Obj_t *pLatch)
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
int nTotal
DECLARATIONS ///.
#define Abc_NtkForEachPi(pNtk, pPi, i)
static void Vec_PtrFree(Vec_Ptr_t *p)
void Abc_NtkTransformBack(Abc_Ntk_t *pNtkOld, Abc_Ntk_t *pNtkNew, Vec_Ptr_t *vControls, Vec_Int_t *vClasses)
static int Gia_ManRegNum(Gia_Man_t *p)