74 pObjPo =
Aig_ManCo(pTemp, pTemp->nAsserts + k++);
96 Aig_Obj_t * pObjNew, * pObjNew2, * pObjRepr, * pObjReprNew, * pMiter;
113 pMiter =
Aig_Exor( pManFraig, pObjNew, pObjReprNew );
133 Aig_Obj_t * pObj, * pObjLi, * pObjLo, * pObjNew;
143 pManFraig->nRegs = p->
pManAig->nRegs;
182 assert( pManFraig->pData == NULL );
200 int i, k, f, nNodesOld;
207 for ( f = 0; f < nFrames; f++ )
221 pLatches[k++] = NULL;
226 pObj->
pData = pLatches[k++];
261 int i, nCountPis, nCountRegs;
262 int nClasses, nPartSize, fVerbose;
269 if ( pAig->vClockDoms )
288 printf(
"Simple partitioning. %d partitions are saved:\n",
Vec_PtrSize(vResult) );
291 sprintf( Buffer,
"part%03d.aig", i );
294 printf(
"part%03d.aig : Reg = %4d. PI = %4d. (True = %4d. Regs = %4d.) And = %5d.\n",
306 if ( pAig->vOnehots )
312 printf(
"%3d : Reg = %4d. PI = %4d. (True = %4d. Regs = %4d.) And = %5d. It = %3d. Cl = %5d.\n",
346 int fUseSimpleCnf = 0;
347 int fUseOldSimulation = 0;
359 int nNodesBeg, nRegsBeg;
379 printf(
"Partitioning was disabled to allow implication writing.\n" );
383 || (pManAig->vClockDoms &&
Vec_VecSize(pManAig->vClockDoms) > 0) )
394 pPars->nFramesP = pParams->
nFramesP;
395 pPars->nFramesK = pParams->
nFramesK;
396 pPars->nMaxImps = pParams->
nMaxImps;
397 pPars->nMaxLevs = pParams->
nMaxLevs;
398 pPars->fVerbose = pParams->
fVerbose;
399 pPars->fRewrite = pParams->
fRewrite;
401 pPars->fUseImps = pParams->
fUseImps;
403 pPars->fUse1Hot = pParams->
fUse1Hot;
405 assert( !(pPars->nFramesP > 0 && pPars->fUse1Hot) );
406 assert( !(pPars->nFramesK > 1 && pPars->fUse1Hot) );
410 p->
pPars->nBTLimitNode = 0;
412 if ( fUseOldSimulation )
414 if ( pPars->nFramesP > 0 )
417 printf(
"Fra_FraigInduction(): Prefix cannot be used.\n" );
419 p->
pSml =
Fra_SmlStart( pManAig, 0, pPars->nFramesK + 1, pPars->nSimWords );
427 if ( pPars->fVerbose )
428 printf(
"Simulating %d AIG nodes for %d cycles ... ",
Aig_ManNodeNum(pManAig), pPars->nFramesP + 32 );
430 if ( pPars->fVerbose )
437 if ( p->
pPars->fUse1Hot )
441 p->
pSml =
Fra_SmlStart( pManAig, 0, pPars->nFramesK + 1, pPars->nSimWords );
445 if ( pPars->fUseImps )
448 if ( pParams->
TimeLimit != 0.0 && Abc_Clock() > TimeToStop )
451 printf(
"Fra_FraigInduction(): Runtime limit exceeded.\n" );
480 if ( pParams->
TimeLimit != 0.0 && Abc_Clock() > TimeToStop )
483 printf(
"Fra_FraigInduction(): Runtime limit exceeded.\n" );
496 if ( p->
pPars->fRewrite )
500 if ( fUseSimpleCnf || pPars->fUseImps )
510 if ( p->
pSat == NULL )
511 printf(
"Fra_FraigInduction(): Computed CNF is not valid.\n" );
512 if ( pPars->fUseImps )
515 if ( p->
pSat == NULL )
516 printf(
"Fra_FraigInduction(): Adding implicationsn to CNF led to a conflict.\n" );
537 if ( p->
pPars->fUse1Hot )
543 if ( pPars->fVerbose )
545 printf(
"%3d : C = %6d. Cl = %6d. L = %6d. LR = %6d. ",
550 if ( p->
pPars->fUse1Hot )
560 if ( p->
pPars->fUse1Hot )
563 if ( pPars->fVerbose )
577 printf(
"Fra_FraigInduction(): SAT solver timed out!\n" );
585 printf(
"Fra_FraigInduction(): Internal error. The result may not verify.\n" );
610 printf(
"Care one-hotness clauses will be written into file \"%s\".\n", pFileName );
681 printf(
"Original AIG: " );
683 printf(
"Reduced AIG: " );
687 pNum2Id = (
int *)pMan->pData;
690 pFile = fopen( pFilePairs,
"w" );
692 if ( (pRepr = pMan->pReprs[pObj->
Id]) )
700 printf(
"Result: %d pairs of seq equiv nodes are written into file \"%s\".\n", Counter, pFilePairs );
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Aig_Man_t * Aig_ManRegCreatePart(Aig_Man_t *pAig, Vec_Int_t *vPart, int *pnCountPis, int *pnCountRegs, int **ppMapBack)
static int Aig_ObjPhase(Aig_Obj_t *pObj)
Aig_Man_t * Fra_FraigInduction(Aig_Man_t *pManAig, Fra_Ssw_t *pParams)
char * Aig_FileNameGenericAppend(char *pBase, char *pSuffix)
static Vec_Int_t * Vec_IntDup(Vec_Int_t *pVec)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Aig_Man_t * Saig_ManReadBlif(char *pFileName)
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
static Aig_Obj_t * Aig_ObjChild0(Aig_Obj_t *pObj)
Fra_Man_t * Fra_ManStart(Aig_Man_t *pManAig, Fra_Par_t *pParams)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Aig_ManPartDivide(Vec_Ptr_t *vResult, Vec_Int_t *vDomain, int nPartSize, int nOverSize)
void Aig_ManStop(Aig_Man_t *p)
void Fra_FramesAddMore(Aig_Man_t *p, int nFrames)
Fra_Sml_t * Fra_SmlSimulateSeq(Aig_Man_t *pAig, int nPref, int nFrames, int nWords, int fCheckMiter)
int Aig_ManSeqCleanup(Aig_Man_t *p)
int Fra_ClassesCountLits(Fra_Cla_t *p)
Aig_Obj_t * Aig_Exor(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Aig_Man_t * Aig_ManDupOrdered(Aig_Man_t *p)
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 Aig_ManPrintStats(Aig_Man_t *p)
Vec_Ptr_t * Aig_ManRegProjectOnehots(Aig_Man_t *pAig, Aig_Man_t *pPart, Vec_Ptr_t *vOnehots, int fVerbose)
static void Fra_ObjSetFaninVec(Aig_Obj_t *pObj, Vec_Ptr_t *vFanins)
static Aig_Obj_t * Fra_ObjChild0Fra(Aig_Obj_t *pObj, int i)
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
Vec_Int_t * Fra_ImpDerive(Fra_Man_t *p, int nImpMaxLimit, int nImpUseLimit, int fLatchCorr)
static abctime Abc_Clock()
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_VecFree(Vec_Vec_t *p)
void Fra_ManClean(Fra_Man_t *p, int nNodesMax)
static int Aig_ManNodeNum(Aig_Man_t *p)
static void Fra_ObjSetFraig(Aig_Obj_t *pObj, int i, Aig_Obj_t *pNode)
void Fra_ParamsDefaultSeq(Fra_Par_t *pParams)
static void Fra_FramesConstrainNode(Aig_Man_t *pManFraig, Aig_Obj_t *pObj, int iFrame)
Vec_Int_t * Fra_OneHotCompute(Fra_Man_t *p, Fra_Sml_t *pSim)
Fra_Sml_t * Fra_SmlStart(Aig_Man_t *pAig, int nPref, int nFrames, int nWordsFrame)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
char * Ioa_FileNameGenericAppend(char *pBase, char *pSuffix)
void Fra_ClassesPrepare(Fra_Cla_t *p, int fLatchCorr, int nMaxLevs)
static int Aig_ManCoNum(Aig_Man_t *p)
void Fra_FraigSweep(Fra_Man_t *pManAig)
#define Aig_ManForEachNode(p, pObj, i)
void Aig_ManReprStart(Aig_Man_t *p, int nIdMax)
DECLARATIONS ///.
static Aig_Obj_t * Fra_ObjFraig(Aig_Obj_t *pObj, int i)
int Fra_FraigInductionTest(char *pFileName, Fra_Ssw_t *pParams)
static Aig_Obj_t * Aig_ManCi(Aig_Man_t *p, int i)
#define Aig_ManForEachLiLoSeq(p, pObjLi, pObjLo, k)
static void Fra_ObjSetSatNum(Aig_Obj_t *pObj, int Num)
int Aig_TransferMappedClasses(Aig_Man_t *pAig, Aig_Man_t *pPart, int *pMapBack)
static int Aig_ManCiNum(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
Aig_Man_t * Dar_ManRewriteDefault(Aig_Man_t *pAig)
DECLARATIONS ///.
void Fra_BmcPerform(Fra_Man_t *p, int nPref, int nDepth)
void Fra_ImpAddToSolver(Fra_Man_t *p, Vec_Int_t *vImps, int *pSatVarNums)
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
static int Aig_ObjPhaseReal(Aig_Obj_t *pObj)
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
void Ioa_WriteAiger(Aig_Man_t *pMan, char *pFileName, int fWriteSymbols, int fCompact)
Aig_Man_t * Aig_ManDupRepr(Aig_Man_t *p, int fOrdered)
static int Aig_ManObjNumMax(Aig_Man_t *p)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
Aig_Man_t * Fra_FraigInductionPart(Aig_Man_t *pAig, Fra_Ssw_t *pPars)
ABC_NAMESPACE_IMPL_START void Fra_FraigInductionRewrite(Fra_Man_t *p)
DECLARATIONS ///.
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
static int Aig_ManRegNum(Aig_Man_t *p)
void Fra_SmlSimulate(Fra_Man_t *p, int fInit)
void Fra_ClassesSelectRepr(Fra_Cla_t *p)
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)
Cnf_Dat_t * Cnf_DeriveSimple(Aig_Man_t *p, int nOutputs)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Fra_Par_t_ Fra_Par_t
INCLUDES ///.
static Aig_Obj_t * Fra_ClassObjRepr(Aig_Obj_t *pObj)
void Fra_ManStop(Fra_Man_t *p)
int Fra_OneHotCount(Fra_Man_t *p, Vec_Int_t *vOneHots)
void Fra_ClassesCopyReprs(Fra_Cla_t *p, Vec_Ptr_t *vFailed)
#define Aig_ManForEachLoSeq(p, pObj, i)
static int Vec_VecSize(Vec_Vec_t *p)
void Cnf_DataFree(Cnf_Dat_t *p)
void Fra_OneHotCheck(Fra_Man_t *p, Vec_Int_t *vOneHots)
#define Aig_ManForEachLiSeq(p, pObj, i)
static Aig_Obj_t * Fra_ObjChild1Fra(Aig_Obj_t *pObj, int i)
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
Aig_Man_t * Fra_OneHotCreateExdc(Fra_Man_t *p, Vec_Int_t *vOneHots)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
char * Abc_UtilStrsav(char *s)
int Aig_ManCleanup(Aig_Man_t *p)
Aig_Man_t * Fra_FramesWithClasses(Fra_Man_t *p)
Vec_Ptr_t * Aig_ManRegPartitionSimple(Aig_Man_t *pAig, int nPartSize, int nOverSize)
#define Aig_ManForEachPiSeq(p, pObj, i)
SEQUENTIAL ITERATORS ///.
void Fra_SmlStop(Fra_Sml_t *p)
void Fra_OneHotAssume(Fra_Man_t *p, Vec_Int_t *vOneHots)