abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
bbr.h File Reference
#include <stdio.h>
#include "aig/aig/aig.h"
#include "aig/saig/saig.h"
#include "bdd/cudd/cuddInt.h"

Go to the source code of this file.

Typedefs

typedef struct Bbr_ImageTree_t_ Bbr_ImageTree_t
 FUNCTION DECLARATIONS ///. More...
 
typedef struct Bbr_ImageTree2_t_ Bbr_ImageTree2_t
 

Functions

static
ABC_NAMESPACE_HEADER_START
DdNode
Aig_ObjGlobalBdd (Aig_Obj_t *pObj)
 INCLUDES ///. More...
 
Bbr_ImageTree_tBbr_bddImageStart (DdManager *dd, DdNode *bCare, int nParts, DdNode **pbParts, int nVars, DdNode **pbVars, int nBddMax, int fVerbose)
 
DdNodeBbr_bddImageCompute (Bbr_ImageTree_t *pTree, DdNode *bCare)
 
void Bbr_bddImageTreeDelete (Bbr_ImageTree_t *pTree)
 
DdNodeBbr_bddImageRead (Bbr_ImageTree_t *pTree)
 
Bbr_ImageTree2_tBbr_bddImageStart2 (DdManager *dd, DdNode *bCare, int nParts, DdNode **pbParts, int nVars, DdNode **pbVars, int fVerbose)
 
DdNodeBbr_bddImageCompute2 (Bbr_ImageTree2_t *pTree, DdNode *bCare)
 
void Bbr_bddImageTreeDelete2 (Bbr_ImageTree2_t *pTree)
 
DdNodeBbr_bddImageRead2 (Bbr_ImageTree2_t *pTree)
 
void Aig_ManFreeGlobalBdds (Aig_Man_t *p, DdManager *dd)
 
int Aig_ManSizeOfGlobalBdds (Aig_Man_t *p)
 
DdManagerAig_ManComputeGlobalBdds (Aig_Man_t *p, int nBddSizeMax, int fDropInternal, int fReorder, int fVerbose)
 
int Aig_ManVerifyUsingBdds (Aig_Man_t *p, Saig_ParBbr_t *pPars)
 
void Bbr_ManSetDefaultParams (Saig_ParBbr_t *p)
 FUNCTION DEFINITIONS ///. More...
 

Typedef Documentation

Definition at line 66 of file bbr.h.

FUNCTION DECLARATIONS ///.

Definition at line 58 of file bbr.h.

Function Documentation

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
166  // set reordering
167  if ( fReorder )
169  // prepare to construct global BDDs
170  Aig_ManCleanData( p );
171  // assign the constant node BDD
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" );
190  Aig_ManFreeGlobalBdds( p, dd );
191  Cudd_Quit( dd );
192  // reset references
193  Aig_ManResetRefs( p );
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
201  Aig_ManResetRefs( p );
202  // reorder one more time
203  if ( fReorder )
204  {
206  Cudd_AutodynDisable( dd );
207  }
208 // Cudd_PrintInfo( dd, stdout );
209  return dd;
210 }
#define CUDD_UNIQUE_SLOTS
Definition: cudd.h:97
Definition: cudd.h:278
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
#define CUDD_CACHE_SLOTS
Definition: cudd.h:98
static void Aig_ObjSetGlobalBdd(Aig_Obj_t *pObj, DdNode *bFunc)
DECLARATIONS ///.
Definition: bbrNtbdd.c:33
#define Aig_ManForEachCo(p, pObj, i)
Definition: aig.h:398
void Aig_ManFreeGlobalBdds(Aig_Man_t *p, DdManager *dd)
Definition: bbrNtbdd.c:112
DECLARATIONS ///.
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
DdManager * Cudd_Init(unsigned int numVars, unsigned int numVarsZ, unsigned int numSlots, unsigned int cacheSize, unsigned long maxMemory)
Definition: cuddInit.c:125
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
Definition: aig.h:69
static int Counter
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
Definition: aig.h:306
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
void Cudd_AutodynDisable(DdManager *unique)
Definition: cuddAPI.c:708
DdNode ** vars
Definition: cuddInt.h:390
DdNode * one
Definition: cuddInt.h:345
#define Cudd_NotCond(node, c)
Definition: cudd.h:383
void Cudd_Quit(DdManager *unique)
Definition: cuddInit.c:225
int Cudd_ReduceHeap(DdManager *table, Cudd_ReorderingType heuristic, int minsize)
Definition: cuddReorder.c:176
void Cudd_AutodynEnable(DdManager *unique, Cudd_ReorderingType method)
Definition: cuddAPI.c:669
void Cudd_Ref(DdNode *n)
Definition: cuddRef.c:129
void Aig_ManCleanData(Aig_Man_t *p)
Definition: aigUtil.c:205
void Aig_ManResetRefs(Aig_Man_t *p)
Definition: aigUtil.c:122
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 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static ABC_NAMESPACE_HEADER_START DdNode * Aig_ObjGlobalBdd(Aig_Obj_t *pObj)
INCLUDES ///.
Definition: bbr.h:51
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
static void Aig_ObjCleanGlobalBdd(DdManager *dd, Aig_Obj_t *pObj)
Definition: bbrNtbdd.c:34
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
Definition: cudd.h:278
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static ABC_NAMESPACE_HEADER_START DdNode * Aig_ObjGlobalBdd(Aig_Obj_t *pObj)
INCLUDES ///.
Definition: bbr.h:51
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
#define Aig_ManForEachCo(p, pObj, i)
Definition: aig.h:398
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
Definition: aig.h:69
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
static void ** Vec_PtrArray(Vec_Ptr_t *p)
Definition: vecPtr.h:279
int Cudd_SharingSize(DdNode **nodeArray, int n)
Definition: cuddUtil.c:544
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
int Aig_ManVerifyUsingBdds ( Aig_Man_t pInit,
Saig_ParBbr_t pPars 
)

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

Synopsis [Performs reachability to see if any PO can be asserted.]

Description []

SideEffects []

SeeAlso []

Definition at line 544 of file bbrReach.c.

545 {
546  Abc_Cex_t * pCexOld, * pCexNew;
547  Aig_Man_t * p;
548  Aig_Obj_t * pObj;
549  Vec_Int_t * vInputMap;
550  int i, k, Entry, iBitOld, iBitNew, RetValue;
551 // pPars->fVerbose = 1;
552  // check if there are PIs without fanout
553  Saig_ManForEachPi( pInit, pObj, i )
554  if ( Aig_ObjRefs(pObj) == 0 )
555  break;
556  if ( i == Saig_ManPiNum(pInit) )
557  return Aig_ManVerifyUsingBdds_int( pInit, pPars );
558  // create new AIG
559  p = Aig_ManDupTrim( pInit );
560  assert( Aig_ManCiNum(p) < Aig_ManCiNum(pInit) );
561  assert( Aig_ManRegNum(p) == Aig_ManRegNum(pInit) );
562  RetValue = Aig_ManVerifyUsingBdds_int( p, pPars );
563  if ( RetValue != 0 )
564  {
565  Aig_ManStop( p );
566  return RetValue;
567  }
568  // the problem is satisfiable - remap the pattern
569  pCexOld = p->pSeqModel;
570  assert( pCexOld != NULL );
571  // create input map
572  vInputMap = Vec_IntAlloc( Saig_ManPiNum(pInit) );
573  Saig_ManForEachPi( pInit, pObj, i )
574  if ( pObj->pData != NULL )
575  Vec_IntPush( vInputMap, Aig_ObjCioId((Aig_Obj_t *)pObj->pData) );
576  else
577  Vec_IntPush( vInputMap, -1 );
578  // create new pattern
579  pCexNew = Abc_CexAlloc( Saig_ManRegNum(pInit), Saig_ManPiNum(pInit), pCexOld->iFrame+1 );
580  pCexNew->iFrame = pCexOld->iFrame;
581  pCexNew->iPo = pCexOld->iPo;
582  // copy the bit-data
583  for ( iBitOld = 0; iBitOld < pCexOld->nRegs; iBitOld++ )
584  if ( Abc_InfoHasBit( pCexOld->pData, iBitOld ) )
585  Abc_InfoSetBit( pCexNew->pData, iBitOld );
586  // copy the primary input data
587  iBitNew = iBitOld;
588  for ( i = 0; i <= pCexNew->iFrame; i++ )
589  {
590  Vec_IntForEachEntry( vInputMap, Entry, k )
591  {
592  if ( Entry == -1 )
593  continue;
594  if ( Abc_InfoHasBit( pCexOld->pData, iBitOld + Entry ) )
595  Abc_InfoSetBit( pCexNew->pData, iBitNew + k );
596  }
597  iBitOld += Saig_ManPiNum(p);
598  iBitNew += Saig_ManPiNum(pInit);
599  }
600  assert( iBitOld < iBitNew );
601  assert( iBitOld == pCexOld->nBits );
602  assert( iBitNew == pCexNew->nBits );
603  Vec_IntFree( vInputMap );
604  pInit->pSeqModel = pCexNew;
605  Aig_ManStop( p );
606  return 0;
607 }
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
static int Abc_InfoHasBit(unsigned *p, int i)
Definition: abc_global.h:258
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
Definition: utilCex.c:51
for(p=first;p->value< newval;p=p->next)
int Aig_ManVerifyUsingBdds_int(Aig_Man_t *p, Saig_ParBbr_t *pPars)
Definition: bbrReach.c:438
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
if(last==0)
Definition: sparse_int.h:34
else
Definition: sparse_int.h:55
Definition: aig.h:69
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
static void Abc_InfoSetBit(unsigned *p, int i)
Definition: abc_global.h:259
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
Aig_Man_t * Aig_ManDupTrim(Aig_Man_t *p)
Definition: aigDup.c:413
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
Definition: saig.h:73
#define assert(ex)
Definition: util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
static int Aig_ObjRefs(Aig_Obj_t *pObj)
Definition: aig.h:300
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
static int Aig_ObjCioId(Aig_Obj_t *pObj)
Definition: aig.h:285
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91
static ABC_NAMESPACE_HEADER_START DdNode* Aig_ObjGlobalBdd ( Aig_Obj_t pObj)
inlinestatic

INCLUDES ///.

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

FileName [bbr.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD-based reachability analysis.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

Id:
bbr.h,v 1.00 2005/06/20 00:00:00 alanmi Exp

]PARAMETERS ///BASIC TYPES ///MACRO DEFINITIONS ///

Definition at line 51 of file bbr.h.

51 { return (DdNode *)pObj->pData; }
Definition: cudd.h:278
void * pData
Definition: aig.h:87
DdNode* Bbr_bddImageCompute ( Bbr_ImageTree_t pTree,
DdNode bCare 
)

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

Synopsis [Compute the image.]

Description []

SideEffects []

SeeAlso []

Definition at line 253 of file bbrImage.c.

254 {
255  DdManager * dd = pTree->pCare->dd;
256  DdNode * bSupp, * bRem;
257 
258  pTree->nIter++;
259 
260  // make sure the supports are okay
261  bSupp = Cudd_Support( dd, bCare ); Cudd_Ref( bSupp );
262  if ( bSupp != pTree->bCareSupp )
263  {
264  bRem = Cudd_bddExistAbstract( dd, bSupp, pTree->bCareSupp ); Cudd_Ref( bRem );
265  if ( bRem != b1 )
266  {
267 printf( "Original care set support: " );
268 ABC_PRB( dd, pTree->bCareSupp );
269 printf( "Current care set support: " );
270 ABC_PRB( dd, bSupp );
271  Cudd_RecursiveDeref( dd, bSupp );
272  Cudd_RecursiveDeref( dd, bRem );
273  printf( "The care set depends on some vars that were not in the care set during scheduling.\n" );
274  return NULL;
275  }
276  Cudd_RecursiveDeref( dd, bRem );
277  }
278  Cudd_RecursiveDeref( dd, bSupp );
279 
280  // remove the previous image
281  Cudd_RecursiveDeref( dd, pTree->pCare->bImage );
282  pTree->pCare->bImage = bCare; Cudd_Ref( bCare );
283 
284  // compute the image
285  pTree->nNodesMax = 0;
286  if ( !Bbr_bddImageCompute_rec( pTree, pTree->pRoot ) )
287  return NULL;
288  if ( pTree->nNodesMaxT < pTree->nNodesMax )
289  pTree->nNodesMaxT = pTree->nNodesMax;
290 
291 // if ( pTree->fVerbose )
292 // printf( "Iter %2d : Max nodes = %5d.\n", pTree->nIter, pTree->nNodesMax );
293  return pTree->pRoot->bImage;
294 }
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
Definition: cuddRef.c:154
Definition: cudd.h:278
DdNode * Cudd_Support(DdManager *dd, DdNode *f)
Definition: cuddUtil.c:740
DdNode * Cudd_bddExistAbstract(DdManager *manager, DdNode *f, DdNode *cube)
Definition: cuddBddAbs.c:130
#define b1
Definition: bbrImage.c:97
Bbr_ImageNode_t * pRoot
Definition: bbrImage.c:48
static int Bbr_bddImageCompute_rec(Bbr_ImageTree_t *pTree, Bbr_ImageNode_t *pNode)
Definition: bbrImage.c:660
#define ABC_PRB(dd, f)
Definition: bbrImage.c:100
DdNode * bCareSupp
Definition: bbrImage.c:50
Bbr_ImageNode_t * pCare
Definition: bbrImage.c:49
void Cudd_Ref(DdNode *n)
Definition: cuddRef.c:129
DdNode* Bbr_bddImageCompute2 ( Bbr_ImageTree2_t pTree,
DdNode bCare 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1273 of file bbrImage.c.

1274 {
1275  if ( pTree->bImage )
1276  Cudd_RecursiveDeref( pTree->dd, pTree->bImage );
1277  pTree->bImage = Cudd_bddAndAbstract( pTree->dd, pTree->bRel, bCare, pTree->bCube );
1278  Cudd_Ref( pTree->bImage );
1279  return pTree->bImage;
1280 }
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
Definition: cuddRef.c:154
DdNode * bCube
Definition: bbrImage.c:1216
DdNode * Cudd_bddAndAbstract(DdManager *manager, DdNode *f, DdNode *g, DdNode *cube)
Definition: cuddAndAbs.c:124
DdNode * bImage
Definition: bbrImage.c:1217
DdManager * dd
Definition: bbrImage.c:1214
void Cudd_Ref(DdNode *n)
Definition: cuddRef.c:129
DdNode* Bbr_bddImageRead ( Bbr_ImageTree_t pTree)

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

Synopsis [Reads the image from the tree.]

Description []

SideEffects []

SeeAlso []

Definition at line 326 of file bbrImage.c.

327 {
328  return pTree->pRoot->bImage;
329 }
Bbr_ImageNode_t * pRoot
Definition: bbrImage.c:48
DdNode* Bbr_bddImageRead2 ( Bbr_ImageTree2_t pTree)

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

Synopsis [Returns the previously computed image.]

Description []

SideEffects []

SeeAlso []

Definition at line 1315 of file bbrImage.c.

1316 {
1317  return pTree->bImage;
1318 }
DdNode * bImage
Definition: bbrImage.c:1217
Bbr_ImageTree_t* Bbr_bddImageStart ( DdManager dd,
DdNode bCare,
int  nParts,
DdNode **  pbParts,
int  nVars,
DdNode **  pbVars,
int  nBddMax,
int  fVerbose 
)

AutomaticEnd Function*************************************************************

Synopsis [Starts the image computation using tree-based scheduling.]

Description [This procedure starts the image computation. It uses the given care set to test-run the image computation and creates the quantification tree by scheduling variable quantifications. The tree can be used to compute images for other care sets without rescheduling. In this case, Bbr_bddImageCompute() should be called.]

SideEffects []

SeeAlso []

Definition at line 168 of file bbrImage.c.

172 {
173  Bbr_ImageTree_t * pTree;
174  Bbr_ImagePart_t ** pParts;
175  Bbr_ImageVar_t ** pVars;
176  Bbr_ImageNode_t ** pNodes, * pCare;
177  int fStop, v;
178 
179  if ( fVerbose && dd->size <= 80 )
180  Bbr_bddImagePrintLatchDependency( dd, bCare, nParts, pbParts, nVars, pbVars );
181 
182  // create variables, partitions and leaf nodes
183  pParts = Bbr_CreateParts( dd, nParts, pbParts, bCare );
184  pVars = Bbr_CreateVars( dd, nParts + 1, pParts, nVars, pbVars );
185  pNodes = Bbr_CreateNodes( dd, nParts + 1, pParts, dd->size, pVars );
186  pCare = pNodes[nParts];
187 
188  // process the nodes
189  while ( Bbr_BuildTreeNode( dd, nParts + 1, pNodes, dd->size, pVars, &fStop, nBddMax ) );
190 
191  // consider the case of BDD node blowup
192  if ( fStop )
193  {
194  for ( v = 0; v < dd->size; v++ )
195  if ( pVars[v] )
196  ABC_FREE( pVars[v] );
197  ABC_FREE( pVars );
198  for ( v = 0; v <= nParts; v++ )
199  if ( pNodes[v] )
200  {
201  Bbr_DeleteParts_rec( pNodes[v] );
202  Bbr_bddImageTreeDelete_rec( pNodes[v] );
203  }
204  ABC_FREE( pNodes );
205  ABC_FREE( pParts );
206  return NULL;
207  }
208 
209  // make sure the variables are gone
210  for ( v = 0; v < dd->size; v++ )
211  assert( pVars[v] == NULL );
212  ABC_FREE( pVars );
213 
214  // create the tree
215  pTree = ABC_ALLOC( Bbr_ImageTree_t, 1 );
216  memset( pTree, 0, sizeof(Bbr_ImageTree_t) );
217  pTree->pCare = pCare;
218  pTree->nBddMax = nBddMax;
219  pTree->fVerbose = fVerbose;
220 
221  // merge the topmost nodes
222  while ( (pTree->pRoot = Bbr_MergeTopNodes( dd, nParts + 1, pNodes )) == NULL );
223 
224  // make sure the nodes are gone
225  for ( v = 0; v < nParts + 1; v++ )
226  assert( pNodes[v] == NULL );
227  ABC_FREE( pNodes );
228 
229 // if ( fVerbose )
230 // Bbr_bddImagePrintTree( pTree );
231 
232  // set the support of the care set
233  pTree->bCareSupp = Cudd_Support( dd, bCare ); Cudd_Ref( pTree->bCareSupp );
234 
235  // clean the partitions
236  Bbr_DeleteParts_rec( pTree->pRoot );
237  ABC_FREE( pParts );
238 
239  return pTree;
240 }
char * memset()
static void Bbr_bddImagePrintLatchDependency(DdManager *dd, DdNode *bCare, int nParts, DdNode **pbParts, int nVars, DdNode **pbVars)
Definition: bbrImage.c:1050
DdNode * Cudd_Support(DdManager *dd, DdNode *f)
Definition: cuddUtil.c:740
int size
Definition: cuddInt.h:361
typedefABC_NAMESPACE_IMPL_START struct Bbr_ImageNode_t_ Bbr_ImageNode_t
Definition: bbrImage.c:42
Bbr_ImageNode_t * pRoot
Definition: bbrImage.c:48
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
static Bbr_ImagePart_t ** Bbr_CreateParts(DdManager *dd, int nParts, DdNode **pbParts, DdNode *bCare)
Definition: bbrImage.c:406
static int Bbr_BuildTreeNode(DdManager *dd, int nNodes, Bbr_ImageNode_t **pNodes, int nVars, Bbr_ImageVar_t **pVars, int *pfStop, int nBddMax)
Definition: bbrImage.c:721
static Bbr_ImageNode_t ** Bbr_CreateNodes(DdManager *dd, int nParts, Bbr_ImagePart_t **pParts, int nVars, Bbr_ImageVar_t **pVars)
Definition: bbrImage.c:507
DdNode * bCareSupp
Definition: bbrImage.c:50
Bbr_ImageNode_t * pCare
Definition: bbrImage.c:49
#define ABC_FREE(obj)
Definition: abc_global.h:232
static Bbr_ImageNode_t * Bbr_MergeTopNodes(DdManager *dd, int nNodes, Bbr_ImageNode_t **pNodes)
Definition: bbrImage.c:850
static void Bbr_DeleteParts_rec(Bbr_ImageNode_t *pNode)
Definition: bbrImage.c:611
#define assert(ex)
Definition: util_old.h:213
void Cudd_Ref(DdNode *n)
Definition: cuddRef.c:129
static void Bbr_bddImageTreeDelete_rec(Bbr_ImageNode_t *pNode)
Definition: bbrImage.c:635
static Bbr_ImageVar_t ** Bbr_CreateVars(DdManager *dd, int nParts, Bbr_ImagePart_t **pParts, int nVars, DdNode **pbVarsNs)
Definition: bbrImage.c:445
Bbr_ImageTree2_t* Bbr_bddImageStart2 ( DdManager dd,
DdNode bCare,
int  nParts,
DdNode **  pbParts,
int  nVars,
DdNode **  pbVars,
int  fVerbose 
)

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

Synopsis [Starts the monolithic image computation.]

Description []

SideEffects []

SeeAlso []

Definition at line 1231 of file bbrImage.c.

1235 {
1236  Bbr_ImageTree2_t * pTree;
1237  DdNode * bCubeAll, * bCubeNot, * bTemp;
1238  int i;
1239 
1240  pTree = ABC_ALLOC( Bbr_ImageTree2_t, 1 );
1241  pTree->dd = dd;
1242  pTree->bImage = NULL;
1243 
1244  bCubeAll = Bbr_bddComputeCube( dd, dd->vars, dd->size ); Cudd_Ref( bCubeAll );
1245  bCubeNot = Bbr_bddComputeCube( dd, pbVars, nVars ); Cudd_Ref( bCubeNot );
1246  pTree->bCube = Cudd_bddExistAbstract( dd, bCubeAll, bCubeNot ); Cudd_Ref( pTree->bCube );
1247  Cudd_RecursiveDeref( dd, bCubeAll );
1248  Cudd_RecursiveDeref( dd, bCubeNot );
1249 
1250  // derive the monolithic relation
1251  pTree->bRel = b1; Cudd_Ref( pTree->bRel );
1252  for ( i = 0; i < nParts; i++ )
1253  {
1254  pTree->bRel = Cudd_bddAnd( dd, bTemp = pTree->bRel, pbParts[i] ); Cudd_Ref( pTree->bRel );
1255  Cudd_RecursiveDeref( dd, bTemp );
1256  }
1257  Bbr_bddImageCompute2( pTree, bCare );
1258  return pTree;
1259 }
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
Definition: cuddRef.c:154
Definition: cudd.h:278
DdNode * bCube
Definition: bbrImage.c:1216
int size
Definition: cuddInt.h:361
DdNode * Bbr_bddImageCompute2(Bbr_ImageTree2_t *pTree, DdNode *bCare)
Definition: bbrImage.c:1273
DdNode * Cudd_bddExistAbstract(DdManager *manager, DdNode *f, DdNode *cube)
Definition: cuddBddAbs.c:130
#define b1
Definition: bbrImage.c:97
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
DdNode * Bbr_bddComputeCube(DdManager *dd, DdNode **bXVars, int nVars)
Definition: bbrImage.c:1191
DdNode * bImage
Definition: bbrImage.c:1217
DdNode ** vars
Definition: cuddInt.h:390
DdManager * dd
Definition: bbrImage.c:1214
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
Definition: cuddBddIte.c:314
void Cudd_Ref(DdNode *n)
Definition: cuddRef.c:129
void Bbr_bddImageTreeDelete ( Bbr_ImageTree_t pTree)

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

Synopsis [Delete the tree.]

Description []

SideEffects []

SeeAlso []

Definition at line 307 of file bbrImage.c.

308 {
309  if ( pTree->bCareSupp )
310  Cudd_RecursiveDeref( pTree->pRoot->dd, pTree->bCareSupp );
312  ABC_FREE( pTree );
313 }
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
Definition: cuddRef.c:154
Bbr_ImageNode_t * pRoot
Definition: bbrImage.c:48
DdNode * bCareSupp
Definition: bbrImage.c:50
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Bbr_bddImageTreeDelete_rec(Bbr_ImageNode_t *pNode)
Definition: bbrImage.c:635
void Bbr_bddImageTreeDelete2 ( Bbr_ImageTree2_t pTree)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1293 of file bbrImage.c.

1294 {
1295  if ( pTree->bRel )
1296  Cudd_RecursiveDeref( pTree->dd, pTree->bRel );
1297  if ( pTree->bCube )
1298  Cudd_RecursiveDeref( pTree->dd, pTree->bCube );
1299  if ( pTree->bImage )
1300  Cudd_RecursiveDeref( pTree->dd, pTree->bImage );
1301  ABC_FREE( pTree );
1302 }
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
Definition: cuddRef.c:154
DdNode * bCube
Definition: bbrImage.c:1216
DdNode * bImage
Definition: bbrImage.c:1217
#define ABC_FREE(obj)
Definition: abc_global.h:232
DdManager * dd
Definition: bbrImage.c:1214
void Bbr_ManSetDefaultParams ( Saig_ParBbr_t p)

FUNCTION DEFINITIONS ///.

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

Synopsis [This procedure sets default resynthesis parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 49 of file bbrReach.c.

50 {
51  memset( p, 0, sizeof(Saig_ParBbr_t) );
52  p->TimeLimit = 0;
53  p->nBddMax = 50000;
54  p->nIterMax = 1000;
55  p->fPartition = 1;
56  p->fReorder = 1;
57  p->fReorderImage = 1;
58  p->fVerbose = 0;
59  p->fSilent = 0;
60  p->iFrame = -1;
61 }
char * memset()
int fReorder
Definition: saig.h:60
int iFrame
Definition: saig.h:65
int fPartition
Definition: saig.h:59
int nBddMax
Definition: saig.h:57
int nIterMax
Definition: saig.h:58
int TimeLimit
Definition: saig.h:56
int fReorderImage
Definition: saig.h:61
int fSilent
Definition: saig.h:63
int fVerbose
Definition: saig.h:62