30static int Abc_NtkRetimeVerifyModel(
Abc_Ntk_t * pNtkCone,
Vec_Int_t * vValues,
int * pModel );
53 if ( pNtkCone == NULL )
54 return Vec_IntDup( vValues );
61 printf(
"The miter for initial state computation has %d AIG nodes. ", Abc_NtkNodeNum(pNtkMiter) );
64 RetValue =
Abc_NtkMiterSat( pNtkMiter, (ABC_INT64_T)500000, (ABC_INT64_T)50000000, 0, NULL, NULL );
66 {
ABC_PRT(
"SAT solving time", Abc_Clock() - clk ); }
69 printf(
"Abc_NtkRetimeInitialValues(): The problem is unsatisfiable. DC latch values are used.\n" );
70 else if ( RetValue == -1 )
71 printf(
"Abc_NtkRetimeInitialValues(): The SAT problem timed out. DC latch values are used.\n" );
72 else if ( !Abc_NtkRetimeVerifyModel( pNtkCone, vValues, pNtkMiter->
pModel ) )
73 printf(
"Abc_NtkRetimeInitialValues(): The computed counter-example is incorrect.\n" );
75 vSolution = RetValue? NULL : Vec_IntAllocArray( pNtkMiter->
pModel, Abc_NtkPiNum(pNtkLogic) );
95 char * pCube, * pSop = (
char *)pObj->
pData;
96 int nVars, Value, v, ResOr, ResAnd, ResVar;
107 ResVar = 1 ^ ((int)(ABC_PTRUINT_T)Abc_ObjFanin(pObj, v)->pCopy);
108 else if ( Value ==
'1' )
109 ResVar = (int)(ABC_PTRUINT_T)Abc_ObjFanin(pObj, v)->pCopy;
133int Abc_NtkRetimeVerifyModel(
Abc_Ntk_t * pNtkCone,
Vec_Int_t * vValues,
int * pModel )
138 assert( Abc_NtkIsSopLogic(pNtkCone) );
146 Vec_PtrFree( vNodes );
151 Counter += (Vec_IntEntry(vValues, i) != (int)(ABC_PTRUINT_T)pObj->
pCopy);
153 printf(
"%d outputs (out of %d) have a value mismatch.\n", Counter, Abc_NtkPoNum(pNtkCone) );
173 if ( Abc_ObjIsLatch(pObj) )
193 if ( Abc_ObjIsLatch(pObj) )
213 vValues = Vec_IntAlloc( Abc_NtkLatchNum(pNtk) );
215 if ( Abc_ObjIsLatch(pObj) )
216 Vec_IntPush( vValues, Abc_LatchIsInit1(pObj) );
236 if ( Abc_ObjIsLatch(pObj) )
239 if ( Abc_ObjIsLatch(pObj) )
263 if ( Abc_ObjIsLatch(pObj) )
264 pObj->
pCopy = Abc_NtkCreatePo(pNtkNew);
286 if ( Abc_ObjIsLatch(pObj) )
293 fprintf( stdout,
"Abc_NtkRetimeBackwardInitialFinish(): Network check has failed.\n" );
298 if ( vValuesNew ) Vec_IntFree( vValuesNew );
319 assert( Abc_NtkIsSopLogic(pNtk) );
328 for ( f = 0; f < nFrames; f++ )
341 Abc_ObjFanout0(pObj)->
pCopy = Abc_ObjFanin0(pObj)->
pCopy;
343 Vec_PtrFree( vNodes );
struct Abc_Obj_t_ Abc_Obj_t
#define Abc_NtkForEachCo(pNtk, pCo, i)
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
#define Abc_NtkForEachPo(pNtk, pPo, i)
#define Abc_NtkForEachLatch(pNtk, pObj, i)
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
ABC_DLL int Abc_SopGetPhase(char *pSop)
#define Abc_CubeForEachVar(pCube, Value, i)
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL int Abc_NtkMiterSat(Abc_Ntk_t *pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int fVerbose, ABC_INT64_T *pNumConfs, ABC_INT64_T *pNumInspects)
FUNCTION DEFINITIONS ///.
ABC_DLL void Abc_NtkAddDummyPoNames(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
#define Abc_SopForEachCube(pSop, nFanins, pCube)
#define Abc_NtkForEachPi(pNtk, pPi, i)
ABC_DLL Abc_Ntk_t * Abc_NtkCreateTarget(Abc_Ntk_t *pNtk, Vec_Ptr_t *vRoots, Vec_Int_t *vValues)
ABC_DLL int Abc_SopGetVarNum(char *pSop)
ABC_DLL int Abc_SopIsExorType(char *pSop)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_NtkAddDummyPiNames(Abc_Ntk_t *pNtk)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Abc_NtkRetimeInsertLatchValues(Abc_Ntk_t *pNtk, Vec_Int_t *vValues)
Abc_Ntk_t * Abc_NtkRetimeBackwardInitialStart(Abc_Ntk_t *pNtk)
void Abc_NtkRetimeTranferToCopy(Abc_Ntk_t *pNtk)
Vec_Int_t * Abc_NtkRetimeInitialValues(Abc_Ntk_t *pNtkCone, Vec_Int_t *vValues, int fVerbose)
FUNCTION DEFINITIONS ///.
void Abc_NtkCycleInitStateSop(Abc_Ntk_t *pNtk, int nFrames, int fVerbose)
Vec_Int_t * Abc_NtkRetimeCollectLatchValues(Abc_Ntk_t *pNtk)
void Abc_NtkRetimeBackwardInitialFinish(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew, Vec_Int_t *vValuesOld, int fVerbose)
void Abc_NtkRetimeTranferFromCopy(Abc_Ntk_t *pNtk)
int Abc_ObjSopSimulate(Abc_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.