31static int Abc_NtkCountFaninsTotal(
Abc_Ntk_t * pNtk );
53 char * pFileName =
"bug_found.blif";
54 int i, nSteps, nIter, ModNum, RandNum = 1;
55 abctime clk, clkTotal = Abc_Clock();
56 assert( Abc_NtkIsLogic(pNtk) );
60 if ( !(*pFuncError)( pNtk ) )
62 printf(
"The original network does not cause the bug. Quitting.\n" );
67 for ( nIter = 0; ; nIter++ )
71 nSteps = 2 * Abc_NtkCountFaninsTotal(pNtk);
74 for ( i = 0; i < nSteps; i++ )
77 ModNum = (i + RandNum) % nSteps;
79 pNtkMod = Abc_NtkAutoDebugModify( pNtk, ModNum/2, ModNum%2 );
83 if ( (*pFuncError)( pNtkMod ) )
92 printf(
"Iter %6d : Latches = %6d. Nodes = %6d. Steps = %6d. Error step = %3d. ",
93 nIter, Abc_NtkLatchNum(pNtk), Abc_NtkNodeNum(pNtk), nSteps, i );
94 ABC_PRT(
"Time", Abc_Clock() - clk );
100 printf(
"Final network written into file \"%s\". ", pFileName );
101 ABC_PRT(
"Total time", Abc_Clock() - clkTotal );
116int Abc_NtkCountFaninsTotal(
Abc_Ntk_t * pNtk )
119 int i, k, Counter = 0;
123 if ( !Abc_ObjIsNode(pObj) && !Abc_ObjIsPo(pObj) )
125 if ( Abc_ObjIsPo(pObj) && Abc_NtkPoNum(pNtk) == 1 )
148 int i, k, Counter = 0;
152 if ( !Abc_ObjIsNode(pObj) && !Abc_ObjIsPo(pObj) )
154 if ( Abc_ObjIsPo(pObj) && Abc_NtkPoNum(pNtk) == 1 )
158 if ( Counter++ == Step )
186 assert( Abc_NtkNodeNum(pNtk) == Abc_NtkNodeNum(pNtkInit) );
int Abc_NtkFindGivenFanin(Abc_Ntk_t *pNtk, int Step, Abc_Obj_t **ppObj, Abc_Obj_t **ppFanin)
void Abc_NtkAutoDebug(Abc_Ntk_t *pNtk, int(*pFuncError)(Abc_Ntk_t *))
FUNCTION DEFINITIONS ///.
ABC_DLL int Abc_NtkSweep(Abc_Ntk_t *pNtk, int fVerbose)
struct Abc_Obj_t_ Abc_Obj_t
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst1(Abc_Ntk_t *pNtk)
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst0(Abc_Ntk_t *pNtk)
#define Abc_ObjForEachFanin(pObj, pFanin, i)
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL void Abc_ObjTransferFanout(Abc_Obj_t *pObjOld, Abc_Obj_t *pObjNew)
ABC_DLL int Abc_NodeIsConst(Abc_Obj_t *pNode)
ABC_DLL int Abc_NtkToSop(Abc_Ntk_t *pNtk, int fMode, int nCubeLimit)
ABC_DLL int Abc_NtkCleanupSeq(Abc_Ntk_t *pNtk, int fLatchSweep, int fAutoSweep, int fVerbose)
ABC_DLL void Abc_NtkDeleteAll_rec(Abc_Obj_t *pObj)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
void Io_WriteBlifLogic(Abc_Ntk_t *pNtk, char *pFileName, int fWriteLatches)
FUNCTION DEFINITIONS ///.
void Abc_NtkCycleInitStateSop(Abc_Ntk_t *pNtk, int nFrames, int fVerbose)