48 int nNew, Gain, nGain = 0, nVars = 0;
55 if ( !Aig_ObjIsNode(pObj) )
57 if ( pObj->
nRefs == 0 )
64 if ( !Aig_ObjIsNode(pFan) )
67 if ( pFan->
nRefs != 1 )
103 printf(
"Total gain = %d. Vars = %d.\n", nGain, nVars );
124 if ( Aig_ObjIsNode(pObj) && pObj->
nRefs > 0 )
169 int Order[16], Costs[16];
173 if ( pObj->
nRefs == 0 )
175 pCut = Cnf_ObjBestCut(pObj);
181 Costs[k] = Aig_ObjIsNode(pFan)? Cnf_ObjBestCut(pFan)->Cost : 0;
187 for ( k = 0; k < pCut->
nFanins - 1; k++ )
189 if ( Costs[Order[k]] <= Costs[Order[k+1]] )
192 Order[k] = Order[k+1];
196 }
while ( fChanges );
200 for ( k = 0; (k < (int)(pCut)->nFanins) && ((pFan) = Aig_ManObj(
p->pManAig, (pCut)->pFanins[Order[k]])); k++ )
202 if ( !Aig_ObjIsNode(pFan) )
205 if ( pFan->
nRefs != 1 )
207 pCutFan = Cnf_ObjBestCut(pFan);
214 if ( pCutRes == NULL || pCutRes->
Cost == 127 || pCutRes->
Cost > pCut->
Cost + pCutFan->
Cost )
221 Cnf_ObjSetBestCut( pObj, pCutRes );
222 Cnf_ObjSetBestCut( pFan, NULL );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
void Aig_MmFlexRestart(Aig_MmFlex_t *p)
#define Aig_ManForEachObj(p, pObj, i)
struct Aig_Obj_t_ Aig_Obj_t
#define Aig_ManForEachNode(p, pObj, i)
void Cnf_ManTransferCuts(Cnf_Man_t *p)
ABC_NAMESPACE_IMPL_START void Cnf_ManPostprocess_old(Cnf_Man_t *p)
DECLARATIONS ///.
void Cnf_ManFreeCuts(Cnf_Man_t *p)
void Cnf_ManPostprocess(Cnf_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Cnf_Man_t_ Cnf_Man_t
INCLUDES ///.
void Cnf_CutUpdateRefs(Cnf_Man_t *p, Cnf_Cut_t *pCut, Cnf_Cut_t *pCutFan, Cnf_Cut_t *pCutRes)
Cnf_Cut_t * Cnf_CutCompose(Cnf_Man_t *p, Cnf_Cut_t *pCut, Cnf_Cut_t *pCutFan, int iFan)
Cnf_Cut_t * Cnf_CutCreate(Cnf_Man_t *p, Aig_Obj_t *pObj)
void Cnf_CutFree(Cnf_Cut_t *pCut)
struct Cnf_Cut_t_ Cnf_Cut_t
#define Cnf_CutForEachLeaf(p, pCut, pLeaf, i)
struct Dar_Cut_t_ Dar_Cut_t
#define Dar_CutForEachLeaf(p, pCut, pLeaf, i)