abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
llb2Driver.c File Reference
#include "llbInt.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Vec_Int_t
Llb_DriverCountRefs (Aig_Man_t *p)
 DECLARATIONS ///. More...
 
Vec_Int_tLlb_DriverCollectNs (Aig_Man_t *pAig, Vec_Int_t *vDriRefs)
 
Vec_Int_tLlb_DriverCollectCs (Aig_Man_t *pAig)
 
DdNodeLlb_DriverPhaseCube (Aig_Man_t *pAig, Vec_Int_t *vDriRefs, DdManager *dd)
 
DdManagerLlb_DriverLastPartition (Aig_Man_t *p, Vec_Int_t *vVarsNs, abctime TimeTarget)
 

Function Documentation

Vec_Int_t* Llb_DriverCollectCs ( Aig_Man_t pAig)

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

Synopsis [Returns array of CS variables.]

Description []

SideEffects []

SeeAlso []

Definition at line 106 of file llb2Driver.c.

107 {
108  Vec_Int_t * vVars;
109  Aig_Obj_t * pObj;
110  int i;
111  vVars = Vec_IntAlloc( Aig_ManRegNum(pAig) );
112  Saig_ManForEachLo( pAig, pObj, i )
113  Vec_IntPush( vVars, Aig_ObjId(pObj) );
114  return vVars;
115 }
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
Definition: aig.h:69
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
#define Saig_ManForEachLo(p, pObj, i)
Definition: saig.h:96
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
static int Aig_ObjId(Aig_Obj_t *pObj)
Definition: aig.h:286
Vec_Int_t* Llb_DriverCollectNs ( Aig_Man_t pAig,
Vec_Int_t vDriRefs 
)

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

Synopsis [Returns array of NS variables.]

Description []

SideEffects []

SeeAlso []

Definition at line 78 of file llb2Driver.c.

79 {
80  Vec_Int_t * vVars;
81  Aig_Obj_t * pObj, * pDri;
82  int i;
83  vVars = Vec_IntAlloc( Aig_ManRegNum(pAig) );
84  Saig_ManForEachLi( pAig, pObj, i )
85  {
86  pDri = Aig_ObjFanin0(pObj);
87  if ( Vec_IntEntry( vDriRefs, Aig_ObjId(pDri) ) != 1 || Saig_ObjIsPi(pAig, pDri) || Aig_ObjIsConst1(pDri) )
88  Vec_IntPush( vVars, Aig_ObjId(pObj) );
89  else
90  Vec_IntPush( vVars, Aig_ObjId(pDri) );
91  }
92  return vVars;
93 }
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
#define Saig_ManForEachLi(p, pObj, i)
Definition: saig.h:98
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
Definition: aig.h:274
Definition: aig.h:69
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
static int Aig_ObjId(Aig_Obj_t *pObj)
Definition: aig.h:286
static int Saig_ObjIsPi(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: saig.h:82
ABC_NAMESPACE_IMPL_START Vec_Int_t* Llb_DriverCountRefs ( Aig_Man_t p)

DECLARATIONS ///.

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

FileName [llb2Driver.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD based reachability.]

Synopsis [Procedures working with flop drivers.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Returns the array of times each flop driver is referenced.]

Description []

SideEffects []

SeeAlso []

Definition at line 56 of file llb2Driver.c.

57 {
58  Vec_Int_t * vCounts;
59  Aig_Obj_t * pObj;
60  int i;
61  vCounts = Vec_IntStart( Aig_ManObjNumMax(p) );
62  Saig_ManForEachLi( p, pObj, i )
63  Vec_IntAddToEntry( vCounts, Aig_ObjFaninId0(pObj), 1 );
64  return vCounts;
65 }
static int Aig_ObjFaninId0(Aig_Obj_t *pObj)
Definition: aig.h:304
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
static Vec_Int_t * Vec_IntStart(int nSize)
Definition: bblif.c:172
#define Saig_ManForEachLi(p, pObj, i)
Definition: saig.h:98
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
Definition: bblif.c:302
Definition: aig.h:69
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
DdManager* Llb_DriverLastPartition ( Aig_Man_t p,
Vec_Int_t vVarsNs,
abctime  TimeTarget 
)

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

Synopsis [Compute the last partition.]

Description []

SideEffects []

SeeAlso []

Definition at line 163 of file llb2Driver.c.

164 {
165 // int fVerbose = 1;
166  DdManager * dd;
167  DdNode * bVar1, * bVar2, * bProd, * bRes, * bTemp;
168  Aig_Obj_t * pObj;
169  int i;
172  dd->TimeStop = TimeTarget;
173  bRes = Cudd_ReadOne(dd); Cudd_Ref( bRes );
174 
175  // mark the duplicated flop inputs
176  Aig_ManForEachObjVec( vVarsNs, p, pObj, i )
177  {
178  if ( !Saig_ObjIsLi(p, pObj) )
179  continue;
180  bVar1 = Cudd_bddIthVar( dd, Aig_ObjId(pObj) );
181  bVar2 = Cudd_bddIthVar( dd, Aig_ObjFaninId0(pObj) );
182  if ( Aig_ObjIsConst1(Aig_ObjFanin0(pObj)) )
183  bVar2 = Cudd_ReadOne(dd);
184  bVar2 = Cudd_NotCond( bVar2, Aig_ObjFaninC0(pObj) );
185  bProd = Cudd_bddXnor( dd, bVar1, bVar2 ); Cudd_Ref( bProd );
186 // bRes = Cudd_bddAnd( dd, bTemp = bRes, bProd ); Cudd_Ref( bRes );
187 // bRes = Extra_bddAndTime( dd, bTemp = bRes, bProd, TimeTarget );
188  bRes = Cudd_bddAnd( dd, bTemp = bRes, bProd );
189  if ( bRes == NULL )
190  {
191  Cudd_RecursiveDeref( dd, bTemp );
192  Cudd_RecursiveDeref( dd, bProd );
193  return NULL;
194  }
195  Cudd_Ref( bRes );
196  Cudd_RecursiveDeref( dd, bTemp );
197  Cudd_RecursiveDeref( dd, bProd );
198  }
199 
200 /*
201  Saig_ManForEachLi( p, pObj, i )
202  printf( "%d ", Aig_ObjId(pObj) );
203  printf( "\n" );
204  Saig_ManForEachLi( p, pObj, i )
205  printf( "%c%d ", Aig_ObjFaninC0(pObj)? '-':'+', Aig_ObjFaninId0(pObj) );
206  printf( "\n" );
207 */
208  Cudd_AutodynDisable( dd );
209 // Cudd_RecursiveDeref( dd, bRes );
210 // Extra_StopManager( dd );
211  dd->bFunc = bRes;
212  dd->TimeStop = 0;
213  return dd;
214 }
#define CUDD_UNIQUE_SLOTS
Definition: cudd.h:97
static int Aig_ObjFaninId0(Aig_Obj_t *pObj)
Definition: aig.h:304
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
Definition: cuddRef.c:154
abctime TimeStop
Definition: cuddInt.h:489
Definition: cudd.h:278
#define Aig_ManForEachObjVec(vIds, p, pObj, i)
Definition: aig.h:408
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
#define CUDD_CACHE_SLOTS
Definition: cudd.h:98
DdNode * bFunc
Definition: cuddInt.h:487
static int Saig_ObjIsLi(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: saig.h:85
DdManager * Cudd_Init(unsigned int numVars, unsigned int numVarsZ, unsigned int numSlots, unsigned int cacheSize, unsigned long maxMemory)
Definition: cuddInit.c:125
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
Definition: aig.h:274
Definition: aig.h:69
DdNode * Cudd_bddXnor(DdManager *dd, DdNode *f, DdNode *g)
Definition: cuddBddIte.c:507
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
Definition: aig.h:306
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
void Cudd_AutodynDisable(DdManager *unique)
Definition: cuddAPI.c:708
DdNode * Cudd_ReadOne(DdManager *dd)
Definition: cuddAPI.c:987
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
Definition: cuddAPI.c:416
#define Cudd_NotCond(node, c)
Definition: cudd.h:383
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
Definition: cuddBddIte.c:314
static int Aig_ObjId(Aig_Obj_t *pObj)
Definition: aig.h:286
void Cudd_AutodynEnable(DdManager *unique, Cudd_ReorderingType method)
Definition: cuddAPI.c:669
void Cudd_Ref(DdNode *n)
Definition: cuddRef.c:129
DdNode* Llb_DriverPhaseCube ( Aig_Man_t pAig,
Vec_Int_t vDriRefs,
DdManager dd 
)

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

Synopsis [Create cube for phase swapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 128 of file llb2Driver.c.

129 {
130  DdNode * bCube, * bVar, * bTemp;
131  Aig_Obj_t * pObj;
132  int i;
133  abctime TimeStop;
134  TimeStop = dd->TimeStop; dd->TimeStop = 0;
135  bCube = Cudd_ReadOne( dd ); Cudd_Ref( bCube );
136  Saig_ManForEachLi( pAig, pObj, i )
137  {
138  assert( Vec_IntEntry( vDriRefs, Aig_ObjFaninId0(pObj) ) >= 1 );
139  if ( Vec_IntEntry( vDriRefs, Aig_ObjFaninId0(pObj) ) != 1 )
140  continue;
141  if ( !Aig_ObjFaninC0(pObj) )
142  continue;
143  bVar = Cudd_bddIthVar( dd, Aig_ObjFaninId0(pObj) );
144  bCube = Cudd_bddAnd( dd, bTemp = bCube, bVar ); Cudd_Ref( bCube );
145  Cudd_RecursiveDeref( dd, bTemp );
146  }
147  Cudd_Deref( bCube );
148  dd->TimeStop = TimeStop;
149  return bCube;
150 }
static int Aig_ObjFaninId0(Aig_Obj_t *pObj)
Definition: aig.h:304
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
Definition: cuddRef.c:154
abctime TimeStop
Definition: cuddInt.h:489
Definition: cudd.h:278
void Cudd_Deref(DdNode *node)
Definition: cuddRef.c:438
#define Saig_ManForEachLi(p, pObj, i)
Definition: saig.h:98
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Definition: aig.h:69
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
Definition: aig.h:306
DdNode * Cudd_ReadOne(DdManager *dd)
Definition: cuddAPI.c:987
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
Definition: cuddAPI.c:416
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
Definition: cuddBddIte.c:314
#define assert(ex)
Definition: util_old.h:213
void Cudd_Ref(DdNode *n)
Definition: cuddRef.c:129
ABC_INT64_T abctime
Definition: abc_global.h:278