30static inline int Extra_TruthWordNum(
int nVars ) {
return nVars <= 5 ? 1 : (1 << (nVars - 5)); }
31static inline void Extra_TruthNot(
unsigned * pOut,
unsigned * pIn,
int nVars )
34 for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- )
37static inline void Extra_TruthOr(
unsigned * pOut,
unsigned * pIn0,
unsigned * pIn1,
int nVars )
40 for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- )
41 pOut[w] = pIn0[w] | pIn1[w];
43static inline void Extra_TruthSharp(
unsigned * pOut,
unsigned * pIn0,
unsigned * pIn1,
int nVars )
46 for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- )
47 pOut[w] = pIn0[w] & ~pIn1[w];
75 if ( Hop_IsComplement(pRoot) )
76 for ( i = Abc_TruthWordNum(nVars)-1; i >= 0; i-- )
77 pTruth[i] = ~pTruth[i];
81 float Prob = (float)2.0 * dProb * (1.0 - dProb);
82 assert( Prob >= 0.0 && Prob <= 0.5 );
85 Extra_TruthNot( puCare, puCare, nVars );
87 Extra_TruthOr( pTruth, pTruth, puCare, nVars );
89 Extra_TruthSharp( pTruth, pTruth, puCare, nVars );
90 Extra_TruthNot( puCare, puCare, nVars );
107 for ( i = 0; i < nVars; i++ )
110 for ( i = nVars + 1; i < nNodes; i++ )
135 int i, nGainTotal = 0, nNodes1, nNodes2;
138 pPars->fVerbose = fVerbose;
139 if ( pPars->nVarsMax < 2 )
141 printf(
"Resynthesis is not performed for networks whose nodes are less than 2 inputs.\n" );
144 if ( pPars->nVarsMax > 15 )
147 printf(
"Resynthesis is not performed for nodes with more than 15 inputs.\n" );
148 pPars->nVarsMax = 15;
150 vTruth = Vec_IntAlloc( 0 );
154 if ( Nwk_ObjFaninNum(pObj) > 15 )
159 nGainTotal += nNodes1 - nNodes2;
162 Vec_IntFree( vTruth );
165 printf(
"Total gain in AIG nodes = %d. ", nGainTotal );
166 ABC_PRT(
"Total runtime", Abc_Clock() - clk );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
int Bdc_ManNodeNum(Bdc_Man_t *p)
Bdc_Fun_t * Bdc_FuncFanin0(Bdc_Fun_t *p)
Bdc_Fun_t * Bdc_ManRoot(Bdc_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Bdc_Fun_t_ Bdc_Fun_t
INCLUDES ///.
struct Bdc_Par_t_ Bdc_Par_t
void Bdc_FuncSetCopy(Bdc_Fun_t *p, void *pCopy)
struct Bdc_Man_t_ Bdc_Man_t
Bdc_Fun_t * Bdc_FuncFanin1(Bdc_Fun_t *p)
void * Bdc_FuncCopy(Bdc_Fun_t *p)
void Bdc_ManFree(Bdc_Man_t *p)
int Bdc_ManDecompose(Bdc_Man_t *p, unsigned *puFunc, unsigned *puCare, int nVars, Vec_Ptr_t *vDivs, int nNodesMax)
Bdc_Fun_t * Bdc_ManFunc(Bdc_Man_t *p, int i)
DECLARATIONS ///.
Bdc_Man_t * Bdc_ManAlloc(Bdc_Par_t *pPars)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
int Hop_DagSize(Hop_Obj_t *pObj)
Hop_Obj_t * Hop_And(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
unsigned * Hop_ManConvertAigToTruth(Hop_Man_t *p, Hop_Obj_t *pRoot, int nVars, Vec_Int_t *vTruth, int fMsbFirst)
struct Hop_Obj_t_ Hop_Obj_t
struct Nwk_Man_t_ Nwk_Man_t
Hop_Obj_t * Nwk_NodeIfNodeResyn(Bdc_Man_t *p, Hop_Man_t *pHop, Hop_Obj_t *pRoot, int nVars, Vec_Int_t *vTruth, unsigned *puCare, float dProb)
FUNCTION DEFINITIONS ///.
void Nwk_ManBidecResyn(Nwk_Man_t *pNtk, int fVerbose)
#define Nwk_ManForEachNode(p, pObj, i)
typedefABC_NAMESPACE_HEADER_START struct Nwk_Obj_t_ Nwk_Obj_t
INCLUDES ///.
ABC_DLL int Nwk_ManGetFaninMax(Nwk_Man_t *pNtk)