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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Llb_ManCountEntries (Vec_Int_t *vCands)
 DECLARATIONS ///.
 
void Llb_ManPrintEntries (Aig_Man_t *p, Vec_Int_t *vCands)
 
void Llb_ManDerefenceBdds (Aig_Man_t *p, DdManager *dd)
 
DdNode * Llb_ManComputeIndCase_rec (Aig_Man_t *p, Aig_Obj_t *pObj, DdManager *dd, Vec_Ptr_t *vBdds)
 
void Llb_ManComputeIndCase (Aig_Man_t *p, DdManager *dd, Vec_Int_t *vNodes)
 
Vec_Int_tLlb_ManComputeBaseCase (Aig_Man_t *p, DdManager *dd)
 
DdManager * Llb_ManConstructGlobalBdds (Aig_Man_t *p)
 
Vec_Int_tLlb_ManDeriveConstraints (Aig_Man_t *p)
 FUNCTION DECLARATIONS ///.
 
void Llb_ManConstrTest (Aig_Man_t *p)
 

Function Documentation

◆ Llb_ManComputeBaseCase()

Vec_Int_t * Llb_ManComputeBaseCase ( Aig_Man_t * p,
DdManager * dd )

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

Synopsis [Returns the array of constraint candidates.]

Description []

SideEffects []

SeeAlso []

Definition at line 199 of file llb1Constr.c.

200{
201 Vec_Int_t * vNodes;
202 Aig_Obj_t * pObj, * pRoot;
203 int i;
204 pRoot = Aig_ManCo( p, 0 );
205 vNodes = Vec_IntStartFull( Aig_ManObjNumMax(p) );
206 Aig_ManForEachObj( p, pObj, i )
207 {
208 if ( !Aig_ObjIsNode(pObj) && !Aig_ObjIsCi(pObj) )
209 continue;
210 if ( Cudd_bddLeq( dd, (DdNode *)pObj->pData, Cudd_Not(pRoot->pData) ) )
211 Vec_IntWriteEntry( vNodes, i, 1 );
212 else if ( Cudd_bddLeq( dd, Cudd_Not((DdNode *)pObj->pData), Cudd_Not(pRoot->pData) ) )
213 Vec_IntWriteEntry( vNodes, i, 0 );
214 }
215 return vNodes;
216}
#define Aig_ManForEachObj(p, pObj, i)
Definition aig.h:403
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
void * pData
Definition aig.h:87
Here is the caller graph for this function:

◆ Llb_ManComputeIndCase()

void Llb_ManComputeIndCase ( Aig_Man_t * p,
DdManager * dd,
Vec_Int_t * vNodes )

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

Synopsis [Returns the array of constraint candidates.]

Description []

SideEffects []

SeeAlso []

Definition at line 142 of file llb1Constr.c.

143{
144 Vec_Ptr_t * vBdds;
145 Aig_Obj_t * pObj;
146 DdNode * bFunc;
147 int i, Entry;
148 vBdds = Vec_PtrStart( Aig_ManObjNumMax(p) );
149 bFunc = Cudd_ReadOne(dd); Cudd_Ref( bFunc );
150 Vec_PtrWriteEntry( vBdds, Aig_ObjId(Aig_ManConst1(p)), bFunc );
151 Saig_ManForEachPi( p, pObj, i )
152 {
153 bFunc = Cudd_bddIthVar( dd, Aig_ManCiNum(p) + i ); Cudd_Ref( bFunc );
154 Vec_PtrWriteEntry( vBdds, Aig_ObjId(pObj), bFunc );
155 }
156 Saig_ManForEachLi( p, pObj, i )
157 {
158 bFunc = (DdNode *)pObj->pData; Cudd_Ref( bFunc );
159 Vec_PtrWriteEntry( vBdds, Aig_ObjId(Saig_ObjLiToLo(p, pObj)), bFunc );
160 }
161 Vec_IntForEachEntry( vNodes, Entry, i )
162 {
163 if ( Entry != 0 && Entry != 1 )
164 continue;
165 pObj = Aig_ManObj( p, i );
166 bFunc = Llb_ManComputeIndCase_rec( p, pObj, dd, vBdds );
167 if ( Entry == 0 )
168 {
169// Extra_bddPrint( dd, Cudd_Not(pObj->pData) ); printf( "\n" );
170// Extra_bddPrint( dd, Cudd_Not(bFunc) ); printf( "\n" );
171 if ( !Cudd_bddLeq( dd, Cudd_Not(pObj->pData), Cudd_Not(bFunc) ) )
172 Vec_IntWriteEntry( vNodes, i, -1 );
173 }
174 else if ( Entry == 1 )
175 {
176// Extra_bddPrint( dd, pObj->pData ); printf( "\n" );
177// Extra_bddPrint( dd, bFunc ); printf( "\n" );
178 if ( !Cudd_bddLeq( dd, (DdNode *)pObj->pData, bFunc ) )
179 Vec_IntWriteEntry( vNodes, i, -1 );
180 }
181 }
182 Vec_PtrForEachEntry( DdNode *, vBdds, bFunc, i )
183 if ( bFunc )
184 Cudd_RecursiveDeref( dd, bFunc );
185 Vec_PtrFree( vBdds );
186}
DdNode * Llb_ManComputeIndCase_rec(Aig_Man_t *p, Aig_Obj_t *pObj, DdManager *dd, Vec_Ptr_t *vBdds)
Definition llb1Constr.c:115
#define Saig_ManForEachLi(p, pObj, i)
Definition saig.h:98
#define Saig_ManForEachPi(p, pObj, i)
Definition saig.h:91
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManComputeIndCase_rec()

DdNode * Llb_ManComputeIndCase_rec ( Aig_Man_t * p,
Aig_Obj_t * pObj,
DdManager * dd,
Vec_Ptr_t * vBdds )

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

Synopsis [Returns the array of constraint candidates.]

Description []

SideEffects []

SeeAlso []

Definition at line 115 of file llb1Constr.c.

116{
117 DdNode * bBdd0, * bBdd1;
118 DdNode * bFunc = (DdNode *)Vec_PtrEntry( vBdds, Aig_ObjId(pObj) );
119 if ( bFunc != NULL )
120 return bFunc;
121 assert( Aig_ObjIsNode(pObj) );
122 bBdd0 = Llb_ManComputeIndCase_rec( p, Aig_ObjFanin0(pObj), dd, vBdds );
123 bBdd1 = Llb_ManComputeIndCase_rec( p, Aig_ObjFanin1(pObj), dd, vBdds );
124 bBdd0 = Cudd_NotCond( bBdd0, Aig_ObjFaninC0(pObj) );
125 bBdd1 = Cudd_NotCond( bBdd1, Aig_ObjFaninC1(pObj) );
126 bFunc = Cudd_bddAnd( dd, bBdd0, bBdd1 ); Cudd_Ref( bFunc );
127 Vec_PtrWriteEntry( vBdds, Aig_ObjId(pObj), bFunc );
128 return bFunc;
129}
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManConstrTest()

void Llb_ManConstrTest ( Aig_Man_t * p)

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

Synopsis [Tests derived constraints.]

Description []

SideEffects []

SeeAlso []

Definition at line 299 of file llb1Constr.c.

300{
301 Vec_Int_t * vNodes;
302 vNodes = Llb_ManDeriveConstraints( p );
303 Llb_ManPrintEntries( p, vNodes );
304 Vec_IntFreeP( &vNodes );
305}
Vec_Int_t * Llb_ManDeriveConstraints(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
Definition llb1Constr.c:267
void Llb_ManPrintEntries(Aig_Man_t *p, Vec_Int_t *vCands)
Definition llb1Constr.c:64
Here is the call graph for this function:

◆ Llb_ManConstructGlobalBdds()

DdManager * Llb_ManConstructGlobalBdds ( Aig_Man_t * p)

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

Synopsis [Constructs global BDDs for each object in the AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 229 of file llb1Constr.c.

230{
231 DdManager * dd;
232 DdNode * bBdd0, * bBdd1;
233 Aig_Obj_t * pObj;
234 int i;
235 dd = Cudd_Init( Aig_ManCiNum(p), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
236 Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT );
237 pObj = Aig_ManConst1(p);
238 pObj->pData = Cudd_ReadOne(dd); Cudd_Ref( (DdNode *)pObj->pData );
239 Aig_ManForEachCi( p, pObj, i )
240 {
241 pObj->pData = Cudd_bddIthVar(dd, i); Cudd_Ref( (DdNode *)pObj->pData );
242 }
243 Aig_ManForEachNode( p, pObj, i )
244 {
245 bBdd0 = Cudd_NotCond( (DdNode *)Aig_ObjFanin0(pObj)->pData, Aig_ObjFaninC0(pObj) );
246 bBdd1 = Cudd_NotCond( (DdNode *)Aig_ObjFanin1(pObj)->pData, Aig_ObjFaninC1(pObj) );
247 pObj->pData = Cudd_bddAnd( dd, bBdd0, bBdd1 ); Cudd_Ref( (DdNode *)pObj->pData );
248 }
249 Aig_ManForEachCo( p, pObj, i )
250 {
251 pObj->pData = Cudd_NotCond( (DdNode *)Aig_ObjFanin0(pObj)->pData, Aig_ObjFaninC0(pObj) ); Cudd_Ref( (DdNode *)pObj->pData );
252 }
253 return dd;
254}
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition aig.h:393
#define Aig_ManForEachNode(p, pObj, i)
Definition aig.h:413
#define Aig_ManForEachCo(p, pObj, i)
Definition aig.h:398
Here is the caller graph for this function:

◆ Llb_ManCountEntries()

ABC_NAMESPACE_IMPL_START int Llb_ManCountEntries ( Vec_Int_t * vCands)

DECLARATIONS ///.

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

FileName [llb1Constr.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD based reachability.]

Synopsis [Computing inductive constraints.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Returns the array of constraint candidates.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file llb1Constr.c.

46{
47 int i, Entry, Counter = 0;
48 Vec_IntForEachEntry( vCands, Entry, i )
49 Counter += ((Entry == 0) || (Entry == 1));
50 return Counter;
51}
Here is the caller graph for this function:

◆ Llb_ManDerefenceBdds()

void Llb_ManDerefenceBdds ( Aig_Man_t * p,
DdManager * dd )

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

Synopsis [Dereference BDD nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 96 of file llb1Constr.c.

97{
98 Aig_Obj_t * pObj;
99 int i;
100 Aig_ManForEachObj( p, pObj, i )
101 Cudd_RecursiveDeref( dd, (DdNode *)pObj->pData );
102}
Here is the caller graph for this function:

◆ Llb_ManDeriveConstraints()

Vec_Int_t * Llb_ManDeriveConstraints ( Aig_Man_t * p)

FUNCTION DECLARATIONS ///.

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

Synopsis [Derives inductive constraints.]

Description []

SideEffects []

SeeAlso []

Definition at line 267 of file llb1Constr.c.

268{
269 DdManager * dd;
270 Vec_Int_t * vNodes;
271 if ( Saig_ManPoNum(p) != 1 )
272 {
273 printf( "The AIG has %d property outputs.\n", Saig_ManPoNum(p) );
274 return NULL;
275 }
276 assert( Saig_ManPoNum(p) == 1 );
278 vNodes = Llb_ManComputeBaseCase( p, dd );
279 if ( Llb_ManCountEntries(vNodes) > 0 )
280 Llb_ManComputeIndCase( p, dd, vNodes );
281 if ( Llb_ManCountEntries(vNodes) == 0 )
282 Vec_IntFreeP( &vNodes );
283 Llb_ManDerefenceBdds( p, dd );
284 Extra_StopManager( dd );
285 return vNodes;
286}
void Extra_StopManager(DdManager *dd)
void Llb_ManDerefenceBdds(Aig_Man_t *p, DdManager *dd)
Definition llb1Constr.c:96
Vec_Int_t * Llb_ManComputeBaseCase(Aig_Man_t *p, DdManager *dd)
Definition llb1Constr.c:199
ABC_NAMESPACE_IMPL_START int Llb_ManCountEntries(Vec_Int_t *vCands)
DECLARATIONS ///.
Definition llb1Constr.c:45
DdManager * Llb_ManConstructGlobalBdds(Aig_Man_t *p)
Definition llb1Constr.c:229
void Llb_ManComputeIndCase(Aig_Man_t *p, DdManager *dd, Vec_Int_t *vNodes)
Definition llb1Constr.c:142
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManPrintEntries()

void Llb_ManPrintEntries ( Aig_Man_t * p,
Vec_Int_t * vCands )

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

Synopsis [Returns the array of constraint candidates.]

Description []

SideEffects []

SeeAlso []

Definition at line 64 of file llb1Constr.c.

65{
66 int i, Entry;
67 if ( vCands == NULL )
68 {
69 printf( "There is no hints.\n" );
70 return;
71 }
72 Entry = Llb_ManCountEntries(vCands);
73 printf( "\n*** Using %d hint%s:\n", Entry, (Entry != 1 ? "s":"") );
74 Vec_IntForEachEntry( vCands, Entry, i )
75 {
76 if ( Entry != 0 && Entry != 1 )
77 continue;
78 printf( "%c", Entry ? '+' : '-' );
79 printf( "%-6d : ", i );
80 Aig_ObjPrint( p, Aig_ManObj(p, i) );
81 printf( "\n" );
82 }
83}
void Aig_ObjPrint(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition aigObj.c:316
Here is the call graph for this function:
Here is the caller graph for this function: