ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abcReorder.c
Go to the documentation of this file.
1
20
21#include "base/abc/abc.h"
22
23#ifdef ABC_USE_CUDD
24#include "bdd/reo/reo.h"
25#endif
26
28
32
36
37#ifdef ABC_USE_CUDD
38
50void Abc_NodeBddReorder( reo_man * p, Abc_Obj_t * pNode )
51{
52 Abc_Obj_t * pFanin;
53 DdNode * bFunc;
54 int * pOrder, i;
55 // create the temporary array for the variable order
56 pOrder = ABC_ALLOC( int, Abc_ObjFaninNum(pNode) );
57 for ( i = 0; i < Abc_ObjFaninNum(pNode); i++ )
58 pOrder[i] = -1;
59 // reorder the BDD
60 bFunc = Extra_Reorder( p, (DdManager *)pNode->pNtk->pManFunc, (DdNode *)pNode->pData, pOrder ); Cudd_Ref( bFunc );
61 Cudd_RecursiveDeref( (DdManager *)pNode->pNtk->pManFunc, (DdNode *)pNode->pData );
62 pNode->pData = bFunc;
63 // update the fanin order
64 Abc_ObjForEachFanin( pNode, pFanin, i )
65 pOrder[i] = pNode->vFanins.pArray[ pOrder[i] ];
66 Abc_ObjForEachFanin( pNode, pFanin, i )
67 pNode->vFanins.pArray[i] = pOrder[i];
68 ABC_FREE( pOrder );
69}
70
82void Abc_NtkBddReorder( Abc_Ntk_t * pNtk, int fVerbose )
83{
84 reo_man * p;
85 Abc_Obj_t * pNode;
86 int i;
87 //Abc_NtkRemoveDupFanins( pNtk );
88 Abc_NtkMinimumBase( pNtk );
90 Abc_NtkForEachNode( pNtk, pNode, i )
91 {
92 if ( Abc_ObjFaninNum(pNode) < 3 )
93 continue;
94 if ( fVerbose )
95 fprintf( stdout, "%10s: ", Abc_ObjName(pNode) );
96 if ( fVerbose )
97 fprintf( stdout, "Before = %5d BDD nodes. ", Cudd_DagSize((DdNode *)pNode->pData) );
98 Abc_NodeBddReorder( p, pNode );
99 if ( fVerbose )
100 fprintf( stdout, "After = %5d BDD nodes.\n", Cudd_DagSize((DdNode *)pNode->pData) );
101 }
103}
104
105#else
106
107void Abc_NtkBddReorder( Abc_Ntk_t * pNtk, int fVerbose ) {}
108
109#endif
110
114
115
117
ABC_NAMESPACE_IMPL_START void Abc_NtkBddReorder(Abc_Ntk_t *pNtk, int fVerbose)
DECLARATIONS ///.
Definition abcReorder.c:107
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
Definition abcUtil.c:486
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition abcNames.c:49
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
ABC_DLL int Abc_NtkMinimumBase(Abc_Ntk_t *pNtk)
DECLARATIONS ///.
Definition abcMinBase.c:892
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition abc.h:464
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_FREE(obj)
Definition abc_global.h:267
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Cube * p
Definition exorList.c:222
struct _reo_man reo_man
Definition reo.h:63
void Extra_ReorderQuit(reo_man *p)
Definition reoApi.c:79
DdNode * Extra_Reorder(reo_man *p, DdManager *dd, DdNode *Func, int *pOrder)
Definition reoApi.c:262
reo_man * Extra_ReorderInit(int nDdVarsMax, int nNodesMax)
FUNCTION DECLARATIONS ///.
Definition reoApi.c:50
void * pManFunc
Definition abc.h:191
void * pData
Definition abc.h:145
Vec_Int_t vFanins
Definition abc.h:143
Abc_Ntk_t * pNtk
Definition abc.h:130