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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Llb_Grp_tLlb_ManGroupAlloc (Llb_Man_t *pMan)
 DECLARATIONS ///.
 
void Llb_ManGroupStop (Llb_Grp_t *p)
 
void Llb_ManGroupCollect_rec (Aig_Man_t *pAig, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
 
Vec_Ptr_tLlb_ManGroupCollect (Llb_Grp_t *pGroup)
 
void Llb_ManGroupCreate_rec (Aig_Man_t *pAig, Aig_Obj_t *pObj, Vec_Ptr_t *vSupp)
 
Llb_Grp_tLlb_ManGroupCreate (Llb_Man_t *pMan, Aig_Obj_t *pObj)
 
Llb_Grp_tLlb_ManGroupCreateFirst (Llb_Man_t *pMan)
 
Llb_Grp_tLlb_ManGroupCreateLast (Llb_Man_t *pMan)
 
Llb_Grp_tLlb_ManGroupsCombine (Llb_Grp_t *p1, Llb_Grp_t *p2)
 
void Llb_ManGroupMarkNodes_rec (Aig_Man_t *p, Aig_Obj_t *pObj)
 
Llb_Grp_tLlb_ManGroupCreateFromCuts (Llb_Man_t *pMan, Vec_Int_t *vCut1, Vec_Int_t *vCut2)
 
void Llb_ManPrepareGroups (Llb_Man_t *pMan)
 
void Llb_ManPrintSpan (Llb_Man_t *p)
 
int Llb_ManGroupHasVar (Llb_Man_t *p, int iGroup, int iVar)
 
void Llb_ManPrintHisto (Llb_Man_t *p)
 

Function Documentation

◆ Llb_ManGroupAlloc()

ABC_NAMESPACE_IMPL_START Llb_Grp_t * Llb_ManGroupAlloc ( Llb_Man_t * pMan)

DECLARATIONS ///.

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

FileName [llb1Group.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD based reachability.]

Synopsis [Initial partition computation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file llb1Group.c.

46{
47 Llb_Grp_t * p;
48 p = ABC_CALLOC( Llb_Grp_t, 1 );
49 p->pMan = pMan;
50 p->vIns = Vec_PtrAlloc( 8 );
51 p->vOuts = Vec_PtrAlloc( 8 );
52 p->Id = Vec_PtrSize( pMan->vGroups );
53 Vec_PtrPush( pMan->vGroups, p );
54 return p;
55}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
Cube * p
Definition exorList.c:222
struct Llb_Grp_t_ Llb_Grp_t
Definition llbInt.h:49
Here is the caller graph for this function:

◆ Llb_ManGroupCollect()

Vec_Ptr_t * Llb_ManGroupCollect ( Llb_Grp_t * pGroup)

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

Synopsis [Collects the support of MFFC.]

Description [Returns the number of internal nodes in the MFFC.]

SideEffects []

SeeAlso []

Definition at line 120 of file llb1Group.c.

121{
122 Vec_Ptr_t * vNodes;
123 Aig_Obj_t * pObj;
124 int i;
125 vNodes = Vec_PtrAlloc( 100 );
126 Aig_ManIncrementTravId( pGroup->pMan->pAig );
127 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vIns, pObj, i )
128 Aig_ObjSetTravIdCurrent( pGroup->pMan->pAig, pObj );
129 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vOuts, pObj, i )
130 Aig_ObjSetTravIdPrevious( pGroup->pMan->pAig, pObj );
131 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vOuts, pObj, i )
132 Llb_ManGroupCollect_rec( pGroup->pMan->pAig, pObj, vNodes );
133 return vNodes;
134}
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
Definition aigUtil.c:44
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
void Llb_ManGroupCollect_rec(Aig_Man_t *pAig, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition llb1Group.c:91
Vec_Ptr_t * vIns
Definition llbInt.h:98
Vec_Ptr_t * vOuts
Definition llbInt.h:99
Llb_Man_t * pMan
Definition llbInt.h:101
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_ManGroupCollect_rec()

void Llb_ManGroupCollect_rec ( Aig_Man_t * pAig,
Aig_Obj_t * pObj,
Vec_Ptr_t * vNodes )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 91 of file llb1Group.c.

92{
93 if ( Aig_ObjIsTravIdCurrent(pAig, pObj) )
94 return;
95 Aig_ObjSetTravIdCurrent(pAig, pObj);
96 if ( Aig_ObjIsConst1(pObj) )
97 return;
98 if ( Aig_ObjIsCo(pObj) )
99 {
100 Llb_ManGroupCollect_rec( pAig, Aig_ObjFanin0(pObj), vNodes );
101 return;
102 }
103 assert( Aig_ObjIsAnd(pObj) );
104 Llb_ManGroupCollect_rec( pAig, Aig_ObjFanin0(pObj), vNodes );
105 Llb_ManGroupCollect_rec( pAig, Aig_ObjFanin1(pObj), vNodes );
106 Vec_PtrPush( vNodes, pObj );
107}
#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_ManGroupCreate()

Llb_Grp_t * Llb_ManGroupCreate ( Llb_Man_t * pMan,
Aig_Obj_t * pObj )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 175 of file llb1Group.c.

176{
177 Llb_Grp_t * p;
178 assert( pObj->fMarkA == 1 );
179 // derive group
180 p = Llb_ManGroupAlloc( pMan );
181 Vec_PtrPush( p->vOuts, pObj );
182 Aig_ManIncrementTravId( pMan->pAig );
183 if ( Aig_ObjIsCo(pObj) )
184 Llb_ManGroupCreate_rec( pMan->pAig, Aig_ObjFanin0(pObj), p->vIns );
185 else
186 {
187 Llb_ManGroupCreate_rec( pMan->pAig, Aig_ObjFanin0(pObj), p->vIns );
188 Llb_ManGroupCreate_rec( pMan->pAig, Aig_ObjFanin1(pObj), p->vIns );
189 }
190 // derive internal objects
191 assert( p->vNodes == NULL );
192 p->vNodes = Llb_ManGroupCollect( p );
193 return p;
194}
Vec_Ptr_t * Llb_ManGroupCollect(Llb_Grp_t *pGroup)
Definition llb1Group.c:120
void Llb_ManGroupCreate_rec(Aig_Man_t *pAig, Aig_Obj_t *pObj, Vec_Ptr_t *vSupp)
Definition llb1Group.c:147
ABC_NAMESPACE_IMPL_START Llb_Grp_t * Llb_ManGroupAlloc(Llb_Man_t *pMan)
DECLARATIONS ///.
Definition llb1Group.c:45
unsigned int fMarkA
Definition aig.h:79
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManGroupCreate_rec()

void Llb_ManGroupCreate_rec ( Aig_Man_t * pAig,
Aig_Obj_t * pObj,
Vec_Ptr_t * vSupp )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 147 of file llb1Group.c.

148{
149 if ( Aig_ObjIsTravIdCurrent(pAig, pObj) )
150 return;
151 Aig_ObjSetTravIdCurrent(pAig, pObj);
152 if ( Aig_ObjIsConst1(pObj) )
153 return;
154 if ( pObj->fMarkA )
155 {
156 Vec_PtrPush( vSupp, pObj );
157 return;
158 }
159 assert( Aig_ObjIsAnd(pObj) );
160 Llb_ManGroupCreate_rec( pAig, Aig_ObjFanin0(pObj), vSupp );
161 Llb_ManGroupCreate_rec( pAig, Aig_ObjFanin1(pObj), vSupp );
162}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManGroupCreateFirst()

Llb_Grp_t * Llb_ManGroupCreateFirst ( Llb_Man_t * pMan)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 207 of file llb1Group.c.

208{
209 Llb_Grp_t * p;
210 Aig_Obj_t * pObj;
211 int i;
212 p = Llb_ManGroupAlloc( pMan );
213 Saig_ManForEachLo( pMan->pAig, pObj, i )
214 Vec_PtrPush( p->vOuts, pObj );
215 return p;
216}
#define Saig_ManForEachLo(p, pObj, i)
Definition saig.h:96
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManGroupCreateFromCuts()

Llb_Grp_t * Llb_ManGroupCreateFromCuts ( Llb_Man_t * pMan,
Vec_Int_t * vCut1,
Vec_Int_t * vCut2 )

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

Synopsis [Creates group from two cuts derived by the flow computation.]

Description []

SideEffects []

SeeAlso []

Definition at line 312 of file llb1Group.c.

313{
314 Llb_Grp_t * p;
315 Aig_Obj_t * pObj;
316 int i;
317 p = Llb_ManGroupAlloc( pMan );
318
319 // mark Cut1
320 Aig_ManIncrementTravId( pMan->pAig );
321 Aig_ManForEachObjVec( vCut1, pMan->pAig, pObj, i )
322 Aig_ObjSetTravIdCurrent( pMan->pAig, pObj );
323 // collect unmarked Cut2
324 Aig_ManForEachObjVec( vCut2, pMan->pAig, pObj, i )
325 if ( !Aig_ObjIsTravIdCurrent( pMan->pAig, pObj ) )
326 Vec_PtrPush( p->vOuts, pObj );
327
328 // mark nodes reachable from Cut2
329 Aig_ManIncrementTravId( pMan->pAig );
330 Aig_ManForEachObjVec( vCut2, pMan->pAig, pObj, i )
331 Llb_ManGroupMarkNodes_rec( pMan->pAig, pObj );
332 // collect marked Cut1
333 Aig_ManForEachObjVec( vCut1, pMan->pAig, pObj, i )
334 if ( Aig_ObjIsTravIdCurrent( pMan->pAig, pObj ) )
335 Vec_PtrPush( p->vIns, pObj );
336
337 // derive internal objects
338 assert( p->vNodes == NULL );
339 p->vNodes = Llb_ManGroupCollect( p );
340 return p;
341}
#define Aig_ManForEachObjVec(vIds, p, pObj, i)
Definition aig.h:408
void Llb_ManGroupMarkNodes_rec(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition llb1Group.c:286
Here is the call graph for this function:

◆ Llb_ManGroupCreateLast()

Llb_Grp_t * Llb_ManGroupCreateLast ( Llb_Man_t * pMan)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 229 of file llb1Group.c.

230{
231 Llb_Grp_t * p;
232 Aig_Obj_t * pObj;
233 int i;
234 p = Llb_ManGroupAlloc( pMan );
235 Saig_ManForEachLi( pMan->pAig, pObj, i )
236 Vec_PtrPush( p->vIns, pObj );
237 return p;
238}
#define Saig_ManForEachLi(p, pObj, i)
Definition saig.h:98
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManGroupHasVar()

int Llb_ManGroupHasVar ( Llb_Man_t * p,
int iGroup,
int iVar )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 426 of file llb1Group.c.

427{
428 Llb_Grp_t * pGroup = (Llb_Grp_t *)Vec_PtrEntry( p->vGroups, iGroup );
429 Aig_Obj_t * pObj;
430 int i;
431 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vIns, pObj, i )
432 if ( pObj->Id == iVar )
433 return 1;
434 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vOuts, pObj, i )
435 if ( pObj->Id == iVar )
436 return 1;
437 return 0;
438}
int Id
Definition aig.h:85
Here is the caller graph for this function:

◆ Llb_ManGroupMarkNodes_rec()

void Llb_ManGroupMarkNodes_rec ( Aig_Man_t * p,
Aig_Obj_t * pObj )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 286 of file llb1Group.c.

287{
288 if ( Aig_ObjIsTravIdCurrent(p, pObj) )
289 return;
290 if ( Aig_ObjIsTravIdPrevious(p, pObj) )
291 {
292 Aig_ObjSetTravIdCurrent(p, pObj);
293 return;
294 }
295 Aig_ObjSetTravIdCurrent(p, pObj);
296 assert( Aig_ObjIsNode(pObj) );
297 Llb_ManGroupMarkNodes_rec( p, Aig_ObjFanin0(pObj) );
298 Llb_ManGroupMarkNodes_rec( p, Aig_ObjFanin1(pObj) );
299}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManGroupsCombine()

Llb_Grp_t * Llb_ManGroupsCombine ( Llb_Grp_t * p1,
Llb_Grp_t * p2 )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 251 of file llb1Group.c.

252{
253 Llb_Grp_t * p;
254 Aig_Obj_t * pObj;
255 int i;
256 p = Llb_ManGroupAlloc( p1->pMan );
257 // create inputs
258 Vec_PtrForEachEntry( Aig_Obj_t *, p1->vIns, pObj, i )
259 Vec_PtrPush( p->vIns, pObj );
260 Vec_PtrForEachEntry( Aig_Obj_t *, p2->vIns, pObj, i )
261 Vec_PtrPushUnique( p->vIns, pObj );
262 // create outputs
263 Vec_PtrForEachEntry( Aig_Obj_t *, p1->vOuts, pObj, i )
264 Vec_PtrPush( p->vOuts, pObj );
265 Vec_PtrForEachEntry( Aig_Obj_t *, p2->vOuts, pObj, i )
266 Vec_PtrPushUnique( p->vOuts, pObj );
267
268 // derive internal objects
269 assert( p->vNodes == NULL );
270 p->vNodes = Llb_ManGroupCollect( p );
271 return p;
272}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManGroupStop()

void Llb_ManGroupStop ( Llb_Grp_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 68 of file llb1Group.c.

69{
70 if ( p == NULL )
71 return;
72 Vec_PtrWriteEntry( p->pMan->vGroups, p->Id, NULL );
73 Vec_PtrFreeP( &p->vIns );
74 Vec_PtrFreeP( &p->vOuts );
75 Vec_PtrFreeP( &p->vNodes );
76 ABC_FREE( p );
77}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function:

◆ Llb_ManPrepareGroups()

void Llb_ManPrepareGroups ( Llb_Man_t * pMan)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 356 of file llb1Group.c.

357{
358 Aig_Obj_t * pObj;
359 int i;
360 assert( pMan->vGroups == NULL );
361 pMan->vGroups = Vec_PtrAlloc( 1000 );
363 Aig_ManForEachNode( pMan->pAig, pObj, i )
364 {
365 if ( pObj->fMarkA )
366 Llb_ManGroupCreate( pMan, pObj );
367 }
368 Saig_ManForEachLi( pMan->pAig, pObj, i )
369 {
370 if ( pObj->fMarkA )
371 Llb_ManGroupCreate( pMan, pObj );
372 }
374}
#define Aig_ManForEachNode(p, pObj, i)
Definition aig.h:413
Llb_Grp_t * Llb_ManGroupCreate(Llb_Man_t *pMan, Aig_Obj_t *pObj)
Definition llb1Group.c:175
Llb_Grp_t * Llb_ManGroupCreateFirst(Llb_Man_t *pMan)
Definition llb1Group.c:207
Llb_Grp_t * Llb_ManGroupCreateLast(Llb_Man_t *pMan)
Definition llb1Group.c:229
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Llb_ManPrintHisto()

void Llb_ManPrintHisto ( Llb_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 451 of file llb1Group.c.

452{
453 Aig_Obj_t * pObj;
454 int i, k;
455 Aig_ManForEachObj( p->pAig, pObj, i )
456 {
457 if ( Vec_IntEntry(p->vObj2Var, i) < 0 )
458 continue;
459 printf( "%3d :", i );
460 for ( k = 0; k < Vec_IntEntry(p->vVarBegs, i); k++ )
461 printf( " " );
462 for ( ; k <= Vec_IntEntry(p->vVarEnds, i); k++ )
463 printf( "%c", Llb_ManGroupHasVar(p, k, i)? '*':'-' );
464 printf( "\n" );
465 }
466}
#define Aig_ManForEachObj(p, pObj, i)
Definition aig.h:403
int Llb_ManGroupHasVar(Llb_Man_t *p, int iGroup, int iVar)
Definition llb1Group.c:426
Here is the call graph for this function:

◆ Llb_ManPrintSpan()

void Llb_ManPrintSpan ( Llb_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 387 of file llb1Group.c.

388{
389 Llb_Grp_t * pGroup;
390 Aig_Obj_t * pVar;
391 int i, k, Span = 0, SpanMax = 0;
392 Vec_PtrForEachEntry( Llb_Grp_t *, p->vGroups, pGroup, i )
393 {
394 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vIns, pVar, k )
395 if ( Vec_IntEntry(p->vVarBegs, pVar->Id) == i )
396 Span++;
397 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vOuts, pVar, k )
398 if ( Vec_IntEntry(p->vVarBegs, pVar->Id) == i )
399 Span++;
400
401 SpanMax = Abc_MaxInt( SpanMax, Span );
402printf( "%d ", Span );
403
404 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vIns, pVar, k )
405 if ( Vec_IntEntry(p->vVarEnds, pVar->Id) == i )
406 Span--;
407 Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vOuts, pVar, k )
408 if ( Vec_IntEntry(p->vVarEnds, pVar->Id) == i )
409 Span--;
410 }
411printf( "\n" );
412printf( "Max = %d\n", SpanMax );
413}