ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
bbrNtbdd.c File Reference
#include "bbr.h"
Include dependency graph for bbrNtbdd.c:

Go to the source code of this file.

Functions

DdNode * Bbr_NodeGlobalBdds_rec (DdManager *dd, Aig_Obj_t *pNode, int nBddSizeMax, int fDropInternal, ProgressBar *pProgress, int *pCounter, int fVerbose)
 FUNCTION DEFINITIONS ///.
 
void Aig_ManFreeGlobalBdds (Aig_Man_t *p, DdManager *dd)
 
int Aig_ManSizeOfGlobalBdds (Aig_Man_t *p)
 
DdManager * Aig_ManComputeGlobalBdds (Aig_Man_t *p, int nBddSizeMax, int fDropInternal, int fReorder, int fVerbose)
 

Variables

ABC_NAMESPACE_IMPL_START typedef char ProgressBar
 

Function Documentation

◆ Aig_ManComputeGlobalBdds()

DdManager * Aig_ManComputeGlobalBdds ( Aig_Man_t * p,
int nBddSizeMax,
int fDropInternal,
int fReorder,
int fVerbose )

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

Synopsis [Recursively computes global BDDs for the AIG in the manager.]

Description [On exit, BDDs are stored in the pNode->pData fields.]

SideEffects []

SeeAlso []

Definition at line 157 of file bbrNtbdd.c.

158{
159 ProgressBar * pProgress = NULL;
160 Aig_Obj_t * pObj;
161 DdManager * dd;
162 DdNode * bFunc;
163 int i, Counter;
164 // start the manager
165 dd = Cudd_Init( Aig_ManCiNum(p), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
166 // set reordering
167 if ( fReorder )
168 Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT );
169 // prepare to construct global BDDs
171 // assign the constant node BDD
172 Aig_ObjSetGlobalBdd( Aig_ManConst1(p), dd->one ); Cudd_Ref( dd->one );
173 // set the elementary variables
174 Aig_ManForEachCi( p, pObj, i )
175 {
176 Aig_ObjSetGlobalBdd( pObj, dd->vars[i] ); Cudd_Ref( dd->vars[i] );
177 }
178
179 // collect the global functions of the COs
180 Counter = 0;
181 // construct the BDDs
182// pProgress = Extra_ProgressBarStart( stdout, Aig_ManNodeNum(p) );
183 Aig_ManForEachCo( p, pObj, i )
184 {
185 bFunc = Bbr_NodeGlobalBdds_rec( dd, Aig_ObjFanin0(pObj), nBddSizeMax, fDropInternal, pProgress, &Counter, fVerbose );
186 if ( bFunc == NULL )
187 {
188 if ( fVerbose )
189 printf( "Constructing global BDDs is aborted.\n" );
191 Cudd_Quit( dd );
192 // reset references
194 return NULL;
195 }
196 bFunc = Cudd_NotCond( bFunc, Aig_ObjFaninC0(pObj) ); Cudd_Ref( bFunc );
197 Aig_ObjSetGlobalBdd( pObj, bFunc );
198 }
199// Extra_ProgressBarStop( pProgress );
200 // reset references
202 // reorder one more time
203 if ( fReorder )
204 {
205 Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 1 );
206 Cudd_AutodynDisable( dd );
207 }
208// Cudd_PrintInfo( dd, stdout );
209 return dd;
210}
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition aig.h:393
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
void Aig_ManResetRefs(Aig_Man_t *p)
Definition aigUtil.c:122
#define Aig_ManForEachCo(p, pObj, i)
Definition aig.h:398
void Aig_ManCleanData(Aig_Man_t *p)
Definition aigUtil.c:205
DdNode * Bbr_NodeGlobalBdds_rec(DdManager *dd, Aig_Obj_t *pNode, int nBddSizeMax, int fDropInternal, ProgressBar *pProgress, int *pCounter, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition bbrNtbdd.c:51
ABC_NAMESPACE_IMPL_START typedef char ProgressBar
Definition bbrNtbdd.c:27
void Aig_ManFreeGlobalBdds(Aig_Man_t *p, DdManager *dd)
Definition bbrNtbdd.c:112
Cube * p
Definition exorList.c:222
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManFreeGlobalBdds()

void Aig_ManFreeGlobalBdds ( Aig_Man_t * p,
DdManager * dd )

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

Synopsis [Frees the global BDDs of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 112 of file bbrNtbdd.c.

113{
114 Aig_Obj_t * pObj;
115 int i;
116 Aig_ManForEachObj( p, pObj, i )
117 if ( Aig_ObjGlobalBdd(pObj) )
118 Aig_ObjCleanGlobalBdd( dd, pObj );
119}
#define Aig_ManForEachObj(p, pObj, i)
Definition aig.h:403
Here is the caller graph for this function:

◆ Aig_ManSizeOfGlobalBdds()

int Aig_ManSizeOfGlobalBdds ( Aig_Man_t * p)

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

Synopsis [Returns the shared size of global BDDs of the COs.]

Description []

SideEffects []

SeeAlso []

Definition at line 132 of file bbrNtbdd.c.

133{
134 Vec_Ptr_t * vFuncsGlob;
135 Aig_Obj_t * pObj;
136 int RetValue, i;
137 // complement the global functions
138 vFuncsGlob = Vec_PtrAlloc( Aig_ManCoNum(p) );
139 Aig_ManForEachCo( p, pObj, i )
140 Vec_PtrPush( vFuncsGlob, Aig_ObjGlobalBdd(pObj) );
141 RetValue = Cudd_SharingSize( (DdNode **)Vec_PtrArray(vFuncsGlob), Vec_PtrSize(vFuncsGlob) );
142 Vec_PtrFree( vFuncsGlob );
143 return RetValue;
144}
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42

◆ Bbr_NodeGlobalBdds_rec()

DdNode * Bbr_NodeGlobalBdds_rec ( DdManager * dd,
Aig_Obj_t * pNode,
int nBddSizeMax,
int fDropInternal,
ProgressBar * pProgress,
int * pCounter,
int fVerbose )

FUNCTION DEFINITIONS ///.

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

Synopsis [Derives the global BDD for one AIG node.]

Description []

SideEffects []

SeeAlso []

Definition at line 51 of file bbrNtbdd.c.

52{
53 DdNode * bFunc, * bFunc0, * bFunc1;
54 assert( !Aig_IsComplement(pNode) );
55 if ( Cudd_ReadKeys(dd)-Cudd_ReadDead(dd) > (unsigned)nBddSizeMax )
56 {
57// Extra_ProgressBarStop( pProgress );
58 if ( fVerbose )
59 printf( "The number of live nodes reached %d.\n", nBddSizeMax );
60 fflush( stdout );
61 return NULL;
62 }
63 // if the result is available return
64 if ( Aig_ObjGlobalBdd(pNode) == NULL )
65 {
66 // compute the result for both branches
67 bFunc0 = Bbr_NodeGlobalBdds_rec( dd, Aig_ObjFanin0(pNode), nBddSizeMax, fDropInternal, pProgress, pCounter, fVerbose );
68 if ( bFunc0 == NULL )
69 return NULL;
70 Cudd_Ref( bFunc0 );
71 bFunc1 = Bbr_NodeGlobalBdds_rec( dd, Aig_ObjFanin1(pNode), nBddSizeMax, fDropInternal, pProgress, pCounter, fVerbose );
72 if ( bFunc1 == NULL )
73 return NULL;
74 Cudd_Ref( bFunc1 );
75 bFunc0 = Cudd_NotCond( bFunc0, Aig_ObjFaninC0(pNode) );
76 bFunc1 = Cudd_NotCond( bFunc1, Aig_ObjFaninC1(pNode) );
77 // get the final result
78 bFunc = Cudd_bddAnd( dd, bFunc0, bFunc1 ); Cudd_Ref( bFunc );
79 Cudd_RecursiveDeref( dd, bFunc0 );
80 Cudd_RecursiveDeref( dd, bFunc1 );
81 // add the number of used nodes
82 (*pCounter)++;
83 // set the result
84 assert( Aig_ObjGlobalBdd(pNode) == NULL );
85 Aig_ObjSetGlobalBdd( pNode, bFunc );
86 // increment the progress bar
87// if ( pProgress )
88// Extra_ProgressBarUpdate( pProgress, *pCounter, NULL );
89 }
90 // prepare the return value
91 bFunc = Aig_ObjGlobalBdd(pNode);
92 // dereference BDD at the node
93 if ( --pNode->nRefs == 0 && fDropInternal )
94 {
95 Cudd_Deref( bFunc );
96 Aig_ObjSetGlobalBdd( pNode, NULL );
97 }
98 return bFunc;
99}
unsigned int nRefs
Definition aig.h:81
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ProgressBar

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

FileName [bbrNtbdd.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD-based reachability analysis.]

Synopsis [Procedures to construct global BDDs for the network.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 27 of file bbrNtbdd.c.