46static DdManager * s_pDd = NULL;
50static int nDsdCounter = 0;
67Abc_Ntk_t *
Abc_NtkRenode(
Abc_Ntk_t * pNtk,
int nFaninMax,
int nCubeMax,
int nFlowIters,
int nAreaIters,
int fArea,
int fUseBdds,
int fUseSops,
int fUseCnfs,
int fUseMv,
int fVerbose )
74 printf(
"Performing renoding with choices.\n" );
123 s_pDd = Cudd_Init( nFaninMax, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
129 assert( s_vMemory == NULL );
130 s_vMemory = Vec_IntAlloc( 1 << 16 );
131 s_vMemory2 = Vec_IntAlloc( 1 << 16 );
147 Vec_IntFree( s_vMemory );
148 Vec_IntFree( s_vMemory2 );
171 char * pPerm = If_CutPerm( pCut );
174 pGraph =
Kit_TruthToGraph( If_CutTruth(
p, pCut), If_CutLeaveNum(pCut), s_vMemory );
175 if ( pGraph == NULL )
177 for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
181 nNodes = Kit_GraphNodeNum( pGraph );
182 for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
201 char * pPerm = If_CutPerm( pCut );
203 DdNode * bFunc, * bFuncNew;
205 for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
206 pPerm[i] = pOrder[i] = -100;
207 bFunc = Kit_TruthToBdd( s_pDd, If_CutTruth(
p, pCut), If_CutLeaveNum(pCut), 0 ); Cudd_Ref( bFunc );
208 bFuncNew =
Extra_Reorder( s_pReo, s_pDd, bFunc, pOrder ); Cudd_Ref( bFuncNew );
209 for ( i = k = 0; i < If_CutLeaveNum(pCut); i++ )
210 if ( pOrder[i] >= 0 )
211 pPerm[pOrder[i]] = ++k;
212 nNodes = -1 + Cudd_DagSize( bFuncNew );
213 Cudd_RecursiveDeref( s_pDd, bFuncNew );
214 Cudd_RecursiveDeref( s_pDd, bFunc );
231 char * pPerm = If_CutPerm( pCut );
233 for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
235 RetValue =
Kit_TruthIsop( If_CutTruth(
p, pCut), If_CutLeaveNum(pCut), s_vMemory, 1 );
236 if ( RetValue == -1 )
238 assert( RetValue == 0 || RetValue == 1 );
239 return Vec_IntSize( s_vMemory );
255 char * pPerm = If_CutPerm( pCut );
256 int i, RetValue, nClauses;
258 for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
261 RetValue =
Kit_TruthIsop( If_CutTruth(
p, pCut), If_CutLeaveNum(pCut), s_vMemory, 0 );
262 if ( RetValue == -1 )
264 assert( RetValue == 0 || RetValue == 1 );
265 nClauses = Vec_IntSize( s_vMemory );
267 Kit_TruthNot( If_CutTruth(
p, pCut), If_CutTruth(
p, pCut), If_CutLeaveNum(pCut) );
268 RetValue =
Kit_TruthIsop( If_CutTruth(
p, pCut), If_CutLeaveNum(pCut), s_vMemory, 0 );
269 Kit_TruthNot( If_CutTruth(
p, pCut), If_CutTruth(
p, pCut), If_CutLeaveNum(pCut) );
270 if ( RetValue == -1 )
272 assert( RetValue == 0 || RetValue == 1 );
273 nClauses += Vec_IntSize( s_vMemory );
290 char * pPerm = If_CutPerm( pCut );
293 for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
296 RetValue =
Kit_TruthIsop( If_CutTruth(
p, pCut), If_CutLeaveNum(pCut), s_vMemory, 0 );
297 if ( RetValue == -1 )
299 assert( RetValue == 0 || RetValue == 1 );
301 Kit_TruthNot( If_CutTruth(
p, pCut), If_CutTruth(
p, pCut), If_CutLeaveNum(pCut) );
302 RetValue =
Kit_TruthIsop( If_CutTruth(
p, pCut), If_CutLeaveNum(pCut), s_vMemory2, 0 );
303 Kit_TruthNot( If_CutTruth(
p, pCut), If_CutTruth(
p, pCut), If_CutLeaveNum(pCut) );
304 if ( RetValue == -1 )
306 assert( RetValue == 0 || RetValue == 1 );
316Abc_Ntk_t *
Abc_NtkRenode(
Abc_Ntk_t * pNtk,
int nFaninMax,
int nCubeMax,
int nFlowIters,
int nAreaIters,
int fArea,
int fUseBdds,
int fUseSops,
int fUseCnfs,
int fUseMv,
int fVerbose ) {
return NULL; }
ABC_NAMESPACE_IMPL_START Abc_Ntk_t * Abc_NtkRenode(Abc_Ntk_t *pNtk, int nFaninMax, int nCubeMax, int nFlowIters, int nAreaIters, int fArea, int fUseBdds, int fUseSops, int fUseCnfs, int fUseMv, int fVerbose)
DECLARATIONS ///.
ABC_DLL int Abc_NodeEvalMvCost(int nVars, Vec_Int_t *vSop0, Vec_Int_t *vSop1)
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
struct Abc_Ntk_t_ Abc_Ntk_t
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Abc_Ntk_t * Abc_NtkIf(Abc_Ntk_t *pNtk, If_Par_t *pPars)
struct If_Par_t_ If_Par_t
struct If_Cut_t_ If_Cut_t
#define IF_MAX_LUTSIZE
INCLUDES ///.
struct If_Man_t_ If_Man_t
BASIC TYPES ///.
struct Kit_Graph_t_ Kit_Graph_t
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
int Kit_GraphLeafDepth_rec(Kit_Graph_t *pGraph, Kit_Node_t *pNode, Kit_Node_t *pLeaf)
void Kit_GraphFree(Kit_Graph_t *pGraph)
Kit_Graph_t * Kit_TruthToGraph(unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
void Extra_ReorderQuit(reo_man *p)
DdNode * Extra_Reorder(reo_man *p, DdManager *dd, DdNode *Func, int *pOrder)
reo_man * Extra_ReorderInit(int nDdVarsMax, int nNodesMax)
FUNCTION DECLARATIONS ///.
int(* pFuncCost)(If_Man_t *, If_Cut_t *)