abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcReorder.c File Reference
#include "base/abc/abc.h"
#include "bdd/reo/reo.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Abc_NodeBddReorder (reo_man *p, Abc_Obj_t *pNode)
 DECLARATIONS ///. More...
 
void Abc_NtkBddReorder (Abc_Ntk_t *pNtk, int fVerbose)
 

Function Documentation

ABC_NAMESPACE_IMPL_START void Abc_NodeBddReorder ( reo_man p,
Abc_Obj_t pNode 
)

DECLARATIONS ///.

CFile****************************************************************

FileName [abcReorder.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Reordering local BDDs of the nodes.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
abcReorder.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Reorders BDD of the local function of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file abcReorder.c.

46 {
47  Abc_Obj_t * pFanin;
48  DdNode * bFunc;
49  int * pOrder, i;
50  // create the temporary array for the variable order
51  pOrder = ABC_ALLOC( int, Abc_ObjFaninNum(pNode) );
52  for ( i = 0; i < Abc_ObjFaninNum(pNode); i++ )
53  pOrder[i] = -1;
54  // reorder the BDD
55  bFunc = Extra_Reorder( p, (DdManager *)pNode->pNtk->pManFunc, (DdNode *)pNode->pData, pOrder ); Cudd_Ref( bFunc );
56  Cudd_RecursiveDeref( (DdManager *)pNode->pNtk->pManFunc, (DdNode *)pNode->pData );
57  pNode->pData = bFunc;
58  // update the fanin order
59  Abc_ObjForEachFanin( pNode, pFanin, i )
60  pOrder[i] = pNode->vFanins.pArray[ pOrder[i] ];
61  Abc_ObjForEachFanin( pNode, pFanin, i )
62  pNode->vFanins.pArray[i] = pOrder[i];
63  ABC_FREE( pOrder );
64 }
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
Definition: cuddRef.c:154
Definition: cudd.h:278
DdNode * Extra_Reorder(reo_man *p, DdManager *dd, DdNode *Func, int *pOrder)
Definition: reoApi.c:262
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
void * pManFunc
Definition: abc.h:191
Abc_Ntk_t * pNtk
Definition: abc.h:130
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
#define ABC_FREE(obj)
Definition: abc_global.h:232
void * pData
Definition: abc.h:145
void Cudd_Ref(DdNode *n)
Definition: cuddRef.c:129
void Abc_NtkBddReorder ( Abc_Ntk_t pNtk,
int  fVerbose 
)

Function*************************************************************

Synopsis [Reorders BDDs of the local functions.]

Description []

SideEffects []

SeeAlso []

Definition at line 77 of file abcReorder.c.

78 {
79  reo_man * p;
80  Abc_Obj_t * pNode;
81  int i;
82  Abc_NtkRemoveDupFanins( pNtk );
83  Abc_NtkMinimumBase( pNtk );
84  p = Extra_ReorderInit( Abc_NtkGetFaninMax(pNtk), 100 );
85  Abc_NtkForEachNode( pNtk, pNode, i )
86  {
87  if ( Abc_ObjFaninNum(pNode) < 3 )
88  continue;
89  if ( fVerbose )
90  fprintf( stdout, "%10s: ", Abc_ObjName(pNode) );
91  if ( fVerbose )
92  fprintf( stdout, "Before = %5d BDD nodes. ", Cudd_DagSize((DdNode *)pNode->pData) );
93  Abc_NodeBddReorder( p, pNode );
94  if ( fVerbose )
95  fprintf( stdout, "After = %5d BDD nodes.\n", Cudd_DagSize((DdNode *)pNode->pData) );
96  }
97  Extra_ReorderQuit( p );
98 }
ABC_NAMESPACE_IMPL_START void Abc_NodeBddReorder(reo_man *p, Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcReorder.c:45
Definition: cudd.h:278
ABC_DLL int Abc_NtkMinimumBase(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcMinBase.c:48
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:453
ABC_DLL int Abc_NtkRemoveDupFanins(Abc_Ntk_t *pNtk)
Definition: abcMinBase.c:116
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
reo_man * Extra_ReorderInit(int nDdVarsMax, int nNodesMax)
FUNCTION DECLARATIONS ///.
Definition: reoApi.c:50
void Extra_ReorderQuit(reo_man *p)
Definition: reoApi.c:79
void * pData
Definition: abc.h:145
Definition: reo.h:101
int Cudd_DagSize(DdNode *node)
Definition: cuddUtil.c:442