80 p->nNodesAhead = 1000;
81 p->nCallsRecycle = 100;
107 pParsRwr->fUpdateLevel = fUpdateLevel;
110 pParsRwr->fPower = fPower;
112 pParsRwr->fVerbose = 0;
138 pParsRwr->fUseZeros = 1;
172 pParsRwr->fUpdateLevel = fUpdateLevel;
174 pParsRwr->fFanout = fFanout;
175 pParsRwr->fPower = fPower;
177 pParsRwr->fVerbose = 0;
209 pParsRwr->fUseZeros = 1;
266 vGias = Vec_PtrAlloc( 3 );
268 Vec_PtrPush( vGias, pGia );
270 pAig =
Hcd_Compress( pAig, fBalance, fUpdateLevel, fPower, fVerbose );
272 Vec_PtrPush( vGias, pGia );
275 pAig =
Hcd_Compress2( pAig, fBalance, fUpdateLevel, 1, fPower, fVerbose );
277 Vec_PtrPush( vGias, pGia );
301 if ( Gia_ObjIsCo(pObj) )
302 return pObj->
Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
304 return pObj->
Value =
Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
321 int i, k, iNode, nNodes;
323 assert( Vec_PtrSize(vGias) > 0 );
324 pGia0 = (
Gia_Man_t *)Vec_PtrEntry( vGias, 0 );
327 assert( Gia_ManCiNum(pGia) == Gia_ManCiNum(pGia0) );
328 assert( Gia_ManCoNum(pGia) == Gia_ManCoNum(pGia0) );
329 assert( Gia_ManRegNum(pGia) == Gia_ManRegNum(pGia0) );
331 Gia_ManConst0(pGia)->Value = 0;
334 pNew =
Gia_ManStart( Vec_PtrSize(vGias) * Gia_ManObjNum(pGia0) );
338 for ( k = 0; k < Gia_ManCiNum(pGia0); k++ )
340 iNode = Gia_ManAppendCi(pNew);
342 Gia_ManCi( pGia, k )->Value = iNode;
346 for ( k = 0; k < Gia_ManCoNum(pGia0); k++ )
374 if ( Gia_ObjIsCi(pNode) )
384 Vec_PtrPush( vVisited, pNode );
410 assert( !Gia_IsComplement(pOld) );
411 assert( !Gia_IsComplement(pNode) );
412 vVisited = Vec_PtrAlloc( 100 );
416 Vec_PtrFree( vVisited );
433 if ( Gia_ObjNext(
p, Gia_ObjId(
p, pOld)) == 0 )
435 Gia_ObjSetNext(
p, Gia_ObjId(
p, pOld), Gia_ObjId(
p, pNode) );
454 Gia_Obj_t * pRepr, * pReprNew, * pObjNew;
457 if ( (pRepr = Gia_ObjReprObj(
p, Gia_ObjId(
p, pObj))) )
459 if ( Gia_ObjIsConst0(pRepr) )
461 pObj->
Value = Abc_LitNotCond( pRepr->
Value, Gia_ObjPhaseReal(pRepr) ^ Gia_ObjPhaseReal(pObj) );
465 assert( Gia_ObjIsAnd(pObj) );
469 if ( Abc_LitRegular(pObj->
Value) == Abc_LitRegular(pRepr->
Value) )
471 assert( (
int)pObj->
Value == Abc_LitNotCond( pRepr->
Value, Gia_ObjPhaseReal(pRepr) ^ Gia_ObjPhaseReal(pObj) ) );
477 pReprNew = Gia_ManObj( pNew, Abc_Lit2Var(pRepr->
Value) );
478 pObjNew = Gia_ManObj( pNew, Abc_Lit2Var(pObj->
Value) );
479 if ( Gia_ObjReprObj( pNew, Gia_ObjId(pNew, pObjNew) ) )
481 assert( Gia_ObjReprObj( pNew, Gia_ObjId(pNew, pObjNew) ) == pReprNew );
482 pObj->
Value = Abc_LitNotCond( pRepr->
Value, Gia_ObjPhaseReal(pRepr) ^ Gia_ObjPhaseReal(pObj) );
487 assert( Gia_ObjNext(pNew, Gia_ObjId(pNew, pObjNew)) == 0 );
488 Gia_ObjSetRepr( pNew, Gia_ObjId(pNew, pObjNew), Gia_ObjId(pNew, pReprNew) );
491 pObj->
Value = Abc_LitNotCond( pRepr->
Value, Gia_ObjPhaseReal(pRepr) ^ Gia_ObjPhaseReal(pObj) );
494 assert( Gia_ObjIsAnd(pObj) );
514 int i, iObj, iPrev, Counter = 0;
519 if ( Gia_ObjIsAnd(pObj) )
521 Gia_ObjFanin0(pObj)->fMark0 = 1;
522 Gia_ObjFanin1(pObj)->fMark0 = 1;
524 else if ( Gia_ObjIsCo(pObj) )
525 Gia_ObjFanin0(pObj)->fMark0 = 1;
530 for ( iPrev = i, iObj = Gia_ObjNext(
p, i); iObj; iObj = Gia_ObjNext(
p, iPrev) )
532 if ( !Gia_ManObj(
p, iObj)->fMark0 )
538 Gia_ObjSetNext(
p, iPrev, Gia_ObjNext(
p, iObj) );
539 Gia_ObjSetNext(
p, iObj, 0 );
564 assert( (Gia_ManCoNum(
p) % nSnapshots) == 0 );
567 pNew->
pName = Abc_UtilStrsav(
p->pName );
568 pNew->
pSpec = Abc_UtilStrsav(
p->pSpec );
571 for ( i = 0; i < Gia_ManObjNum(
p); i++ )
572 Gia_ObjSetRepr( pNew, i,
GIA_VOID );
574 Gia_ManConst0(
p)->Value = 0;
576 pObj->
Value = Gia_ManAppendCi(pNew);
578 if ( (pRepr = Gia_ObjReprObj(
p, Gia_ObjId(
p, pObj))) )
580 assert( Gia_ObjIsConst0(pRepr) || Gia_ObjIsRo(
p, pRepr) );
587 if ( i % nSnapshots == 0 )
588 Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
616 clock_t clk = clock();
622 ABC_PRT(
"Synthesis time", clock() - clk );
633 vGias = Vec_PtrStart( 3 );
642 Vec_PtrFree( vGias );
644 ABC_PRT(
"Choicing time", clock() - clk );
654 printf(
"Choices : Reprs = %5d. Equivs = %5d. Choices = %5d.\n",
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
int Aig_ManChoiceNum(Aig_Man_t *p)
Aig_Man_t * Aig_ManDupDfs(Aig_Man_t *p)
void Aig_ManStop(Aig_Man_t *p)
void Aig_ManPrintStats(Aig_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
int Dar_ManRefactor(Aig_Man_t *pAig, Dar_RefPar_t *pPars)
typedefABC_NAMESPACE_HEADER_START struct Dar_RwrPar_t_ Dar_RwrPar_t
INCLUDES ///.
void Dar_ManDefaultRwrParams(Dar_RwrPar_t *pPars)
FUNCTION DEFINITIONS ///.
Aig_Man_t * Dar_ManBalance(Aig_Man_t *p, int fUpdateLevel)
struct Dar_RefPar_t_ Dar_RefPar_t
int Dar_ManRewrite(Aig_Man_t *pAig, Dar_RwrPar_t *pPars)
void Dar_ManDefaultRefParams(Dar_RefPar_t *pPars)
FUNCTION DEFINITIONS ///.
int Dch_DeriveChoiceCountEquivs(Aig_Man_t *pAig)
int Dch_DeriveChoiceCountReprs(Aig_Man_t *pAig)
FUNCTION DECLARATIONS ///.
Gia_Man_t * Gia_ManFromAig(Aig_Man_t *p)
INCLUDES ///.
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
Gia_Man_t * Hcd_ManChoiceMiter(Vec_Ptr_t *vGias)
void Hcd_ManAddNextEntry_rec(Gia_Man_t *p, Gia_Obj_t *pOld, Gia_Obj_t *pNode)
Vec_Ptr_t * Hcd_ChoiceSynthesis(Aig_Man_t *pAig, int fBalance, int fUpdateLevel, int fPower, int fVerbose)
int Hcd_ObjCheckTfi_rec(Gia_Man_t *p, Gia_Obj_t *pOld, Gia_Obj_t *pNode, Vec_Ptr_t *vVisited)
void Hcd_ManSetDefaultParams(Hcd_Pars_t *p)
FUNCTION DEFINITIONS ///.
Aig_Man_t * Hcd_Compress2(Aig_Man_t *pAig, int fBalance, int fUpdateLevel, int fFanout, int fPower, int fVerbose)
int Hcd_ObjCheckTfi(Gia_Man_t *p, Gia_Obj_t *pOld, Gia_Obj_t *pNode)
int Hcd_ManChoiceMiter_rec(Gia_Man_t *pNew, Gia_Man_t *p, Gia_Obj_t *pObj)
void Gia_ComputeEquivalences(Gia_Man_t *pMiter, int nBTLimit, int fUseMiniSat, int fVerbose)
void Hcd_ManEquivToChoices_rec(Gia_Man_t *pNew, Gia_Man_t *p, Gia_Obj_t *pObj)
Aig_Man_t * Hcd_Compress(Aig_Man_t *pAig, int fBalance, int fUpdateLevel, int fPower, int fVerbose)
Gia_Man_t * Hcd_ManEquivToChoices(Gia_Man_t *p, int nSnapshots)
typedefABC_NAMESPACE_IMPL_START struct Hcd_Pars_t_ Hcd_Pars_t
DECLARATIONS ///.
Aig_Man_t * Hcd_ComputeChoices(Aig_Man_t *pAig, int nBTLimit, int fSynthesis, int fUseMiniSat, int fVerbose)
void Hcd_ComputeChoicesTest(Gia_Man_t *pGia, int nBTLimit, int fSynthesis, int fUseMiniSat, int fVerbose)
void Hcd_ManRemoveBadChoices(Gia_Man_t *p)
struct Gia_Rpr_t_ Gia_Rpr_t
void Gia_ManStop(Gia_Man_t *p)
#define Gia_ManForEachRo(p, pObj, i)
int Gia_ManHasDangling(Gia_Man_t *p)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
void Gia_ManHashAlloc(Gia_Man_t *p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
void Gia_ManFillValue(Gia_Man_t *p)
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachClass(p, i)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
void Gia_ManCleanMark0(Gia_Man_t *p)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
#define Gia_ManForEachCo(p, pObj, i)
#define Gia_ManForEachCi(p, pObj, i)
void Gia_ManSetPhase(Gia_Man_t *p)
void Gia_ManHashStop(Gia_Man_t *p)
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact, int fWriteNewLine)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.