52 int nConfLimit = 1000000;
57 int i, RetValue, * pModel;
66 RetValue =
sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
99 int nConfLimit = 1000000;
100 void * pSatCnf = NULL;
106 int * pClause1, * pClause2, * pLit, * pVars;
107 int i, RetValue, iBadPo, iClause, nVars, nPos;
113 for ( i = 0; i < pCnf->
nClauses; i++ )
124 RetValue =
sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
142 pClause2 = pCnf->
pClauses[iClause+1];
143 for ( pLit = pClause1; pLit < pClause2; pLit++ )
145 if ( pVars[ (*pLit) >> 1 ] == 0 )
147 pVars[ (*pLit) >> 1 ] = 1;
149 printf(
"%s%d ", ((*pLit) & 1)?
"-" :
"+", (*pLit) >> 1 );
155 if ( fVeryVerbose ) {
174 printf(
"UNSAT core: %d clauses, %d variables, %d POs. ",
Vec_IntSize(vCore), nVars, nPos );
293 pNew->nTruePis = p->nTruePis;
294 pNew->nTruePos = p->nTruePos;
352 pNew->nTruePis = p->nTruePis;
353 pNew->nTruePos = p->nTruePos;
495 int nTruePi, nTruePo, nBadRegs, i;
500 pObjLi->
pData = pObjLo;
506 assert( nTruePi == p->nTruePis );
507 assert( nTruePo == p->nTruePos );
532 p->nRegs -= nBadRegs;
533 p->nTruePis += nBadRegs;
534 p->nTruePos += nBadRegs;
551 p->nRegs += nBadRegs;
552 p->nTruePis -= nBadRegs;
553 p->nTruePos -= nBadRegs;
576 printf(
"Excluding %d registers that cannot be backward retimed.\n",
Vec_PtrSize(vBadRegs) );
604 printf(
"Excluding register %d.\n", iBadReg );
631 if ( !fBackwardOnly )
632 for ( i = 0; i < nMaxIters; i++ )
639 if ( fVerbose && !fChanges )
640 printf(
"Forward retiming cannot reduce registers.\n" );
653 if ( !fForwardOnly && !fInitial )
654 for ( i = 0; i < nMaxIters; i++ )
661 if ( fVerbose && !fChanges )
662 printf(
"Backward retiming cannot reduce registers.\n" );
673 else if ( !fForwardOnly && fInitial )
674 for ( i = 0; i < nMaxIters; i++ )
683 if ( fVerbose && !fChanges )
684 printf(
"Backward retiming cannot reduce registers.\n" );
694 if ( !fForwardOnly && !fInitial && fChanges )
695 printf(
"Assuming const-0 init-state after backward retiming. Result will not verify.\n" );
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
void Saig_ManRetimeDup_rec(Aig_Man_t *pNew, Aig_Obj_t *pObj)
void * Intp_ManUnsatCore(Intp_Man_t *p, Sto_Man_t *pCnf, int fLearned, int fVerbose)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Saig_ManPoNum(Aig_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
int sat_solver_addclause(sat_solver *s, lit *begin, lit *end)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Aig_ManStop(Aig_Man_t *p)
Vec_Ptr_t * Saig_ManGetRegistersToExclude(Aig_Man_t *p)
static int Aig_ObjIsTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
static Vec_Int_t * Vec_IntAllocArray(int *pArray, int nSize)
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
Aig_Man_t * Saig_ManRetimeDupInitState(Aig_Man_t *p, Vec_Ptr_t *vCut)
Aig_Man_t * Saig_ManRetimeDupForward(Aig_Man_t *p, Vec_Ptr_t *vCut)
void sat_solver_delete(sat_solver *s)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
void * sat_solver_store_release(sat_solver *s)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define Aig_ManForEachCo(p, pObj, i)
#define ABC_ALLOC(type, num)
static Vec_Ptr_t * Vec_PtrDup(Vec_Ptr_t *pVec)
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
Cnf_Dat_t * Cnf_DeriveSimpleForRetiming(Aig_Man_t *p)
static int Vec_PtrSize(Vec_Ptr_t *p)
int Saig_ManRetimeUnsatCore(Aig_Man_t *p, int fVerbose)
static void Aig_ObjSetTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Intp_Man_t * Intp_ManAlloc()
FUNCTION DEFINITIONS ///.
void Aig_ObjPrint(Aig_Man_t *p, Aig_Obj_t *pObj)
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
void Intp_ManFree(Intp_Man_t *p)
int Saig_ManRetimeCountCut(Aig_Man_t *p, Vec_Ptr_t *vCut)
static int Aig_ManCoNum(Aig_Man_t *p)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define Saig_ManForEachLi(p, pObj, i)
Aig_Man_t * Saig_ManRetimeMinArea(Aig_Man_t *p, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose)
void Aig_ManReportImprovement(Aig_Man_t *p, Aig_Man_t *pNew)
static Aig_Obj_t * Aig_ManCi(Aig_Man_t *p, int i)
void sat_solver_store_alloc(sat_solver *s)
void sat_solver_setnvars(sat_solver *s, int n)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Aig_ManCiNum(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
Aig_Man_t * Saig_ManRetimeDupBackward(Aig_Man_t *p, Vec_Ptr_t *vCut, Vec_Int_t *vInit)
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
ABC_DLL Vec_Ptr_t * Nwk_ManDeriveRetimingCut(Aig_Man_t *p, int fForward, int fVerbose)
FUNCTION DECLARATIONS ///.
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
void Saig_ManMarkCone_rec(Aig_Man_t *p, Aig_Obj_t *pObj)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static int Saig_ManRegNum(Aig_Man_t *p)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
static int Aig_ManObjNumMax(Aig_Man_t *p)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
void sat_solver_store_mark_roots(sat_solver *s)
static int Aig_ManRegNum(Aig_Man_t *p)
sat_solver * sat_solver_new(void)
static int Vec_IntSize(Vec_Int_t *p)
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
#define Aig_ManForEachObj(p, pObj, i)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Sto_ManFree(Sto_Man_t *p)
int Saig_ManHideBadRegs(Aig_Man_t *p, Vec_Ptr_t *vBadRegs)
void Saig_ManExposeBadRegs(Aig_Man_t *p, int nBadRegs)
void Cnf_DataFree(Cnf_Dat_t *p)
Aig_Man_t * Saig_ManRetimeMinAreaBackward(Aig_Man_t *pNew, int fVerbose)
ABC_NAMESPACE_IMPL_START Vec_Int_t * Saig_ManRetimeInitState(Aig_Man_t *p)
DECLARATIONS ///.
#define Saig_ManForEachPo(p, pObj, i)
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
char * Abc_UtilStrsav(char *s)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
void Aig_ManCleanData(Aig_Man_t *p)
int Aig_ManCleanup(Aig_Man_t *p)
Aig_Man_t * Aig_ManDupSimple(Aig_Man_t *p)
DECLARATIONS ///.
int * Sat_SolverGetModel(sat_solver *p, int *pVars, int nVars)
static void Vec_PtrFree(Vec_Ptr_t *p)
#define Saig_ManForEachPi(p, pObj, i)