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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Saig_ManSupport_rec (Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vSupp)
 DECLARATIONS ///. More...
 
Vec_Ptr_tSaig_ManSupport (Aig_Man_t *p, Vec_Ptr_t *vNodes)
 
void Saig_ManPrintConeOne (Aig_Man_t *p, Aig_Obj_t *pObj)
 
void Saig_ManPrintCones (Aig_Man_t *p)
 FUNCTION DECLARATIONS ///. More...
 

Function Documentation

void Saig_ManPrintConeOne ( Aig_Man_t p,
Aig_Obj_t pObj 
)

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

Synopsis [Prints information about cones of influence of the POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 103 of file saigCone.c.

104 {
105  Vec_Ptr_t * vPrev, * vCur, * vTotal;
106  int s, i, nCurNew, nCurPrev, nCurOld;
107  assert( Saig_ObjIsPo(p, pObj) );
108  // start the array
109  vPrev = Vec_PtrAlloc( 100 );
110  Vec_PtrPush( vPrev, pObj );
111  // get the current support
112  vCur = Saig_ManSupport( p, vPrev );
113  Vec_PtrClear( vPrev );
114  printf( " PO %3d ", Aig_ObjCioId(pObj) );
115  // continue computing supports as long as there are now nodes
116  vTotal = Vec_PtrAlloc( 100 );
117  for ( s = 0; ; s++ )
118  {
119  // classify current into those new, prev, and older
120  nCurNew = nCurPrev = nCurOld = 0;
121  Vec_PtrForEachEntry( Aig_Obj_t *, vCur, pObj, i )
122  {
123  if ( Vec_PtrFind(vTotal, pObj) == -1 )
124  {
125  Vec_PtrPush( vTotal, pObj );
126  nCurNew++;
127  }
128  else if ( Vec_PtrFind(vPrev, pObj) >= 0 )
129  nCurPrev++;
130  else
131  nCurOld++;
132  }
133  assert( nCurNew + nCurPrev + nCurOld == Vec_PtrSize(vCur) );
134  // print the result
135  printf( "%d:%d %d=%d+%d+%d ", s, Vec_PtrSize(vTotal), Vec_PtrSize(vCur), nCurNew, nCurPrev, nCurOld );
136  if ( nCurNew == 0 )
137  break;
138  // compute one more step
139  Vec_PtrFree( vPrev );
140  vCur = Saig_ManSupport( p, vPrev = vCur );
141  }
142  printf( "\n" );
143  Vec_PtrFree( vPrev );
144  Vec_PtrFree( vCur );
145  Vec_PtrFree( vTotal );
146 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static int Vec_PtrFind(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:694
static int Saig_ObjIsPo(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: saig.h:83
Definition: aig.h:69
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define assert(ex)
Definition: util_old.h:213
static void Vec_PtrClear(Vec_Ptr_t *p)
Definition: vecPtr.h:545
Vec_Ptr_t * Saig_ManSupport(Aig_Man_t *p, Vec_Ptr_t *vNodes)
Definition: saigCone.c:77
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static int Aig_ObjCioId(Aig_Obj_t *pObj)
Definition: aig.h:285
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
void Saig_ManPrintCones ( Aig_Man_t p)

FUNCTION DECLARATIONS ///.

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

Synopsis [Prints information about cones of influence of the POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 159 of file saigCone.c.

160 {
161  Aig_Obj_t * pObj;
162  int i;
163  printf( "The format of this print-out: For each PO, x:a b=c+d+e, where \n" );
164  printf( "- x is the time-frame counting back from the PO\n" );
165  printf( "- a is the total number of registers in the COI of the PO so far\n" );
166  printf( "- b is the number of registers in the COI of the PO in this time-frame\n" );
167  printf( "- c is the number of registers in b that are new (appear for the first time)\n" );
168  printf( "- d is the number of registers in b in common with the previous time-frame\n" );
169  printf( "- e is the number of registers in b in common with other time-frames\n" );
170  Aig_ManSetCioIds( p );
171  Saig_ManForEachPo( p, pObj, i )
172  Saig_ManPrintConeOne( p, pObj );
173 }
void Saig_ManPrintConeOne(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: saigCone.c:103
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Definition: aig.h:69
void Aig_ManSetCioIds(Aig_Man_t *p)
Definition: aigUtil.c:965
#define Saig_ManForEachPo(p, pObj, i)
Definition: saig.h:93
Vec_Ptr_t* Saig_ManSupport ( Aig_Man_t p,
Vec_Ptr_t vNodes 
)

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

Synopsis [Counts the support size of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 77 of file saigCone.c.

78 {
79  Vec_Ptr_t * vSupp;
80  Aig_Obj_t * pObj;
81  int i;
82  vSupp = Vec_PtrAlloc( 100 );
84  Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
85  {
86  assert( Aig_ObjIsCo(pObj) );
87  Saig_ManSupport_rec( p, Aig_ObjFanin0(pObj), vSupp );
88  }
89  return vSupp;
90 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
ABC_NAMESPACE_IMPL_START void Saig_ManSupport_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vSupp)
DECLARATIONS ///.
Definition: saigCone.c:45
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigUtil.c:44
Definition: aig.h:69
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static int Aig_ObjIsCo(Aig_Obj_t *pObj)
Definition: aig.h:276
ABC_NAMESPACE_IMPL_START void Saig_ManSupport_rec ( Aig_Man_t p,
Aig_Obj_t pObj,
Vec_Ptr_t vSupp 
)

DECLARATIONS ///.

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

FileName [saigCone.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Sequential AIG package.]

Synopsis [Cone of influence computation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Counts the support size of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file saigCone.c.

46 {
47  if ( Aig_ObjIsTravIdCurrent(p, pObj) )
48  return;
50  if ( Aig_ObjIsConst1(pObj) )
51  return;
52  if ( Aig_ObjIsCi(pObj) )
53  {
54  if ( Saig_ObjIsLo(p,pObj) )
55  {
56  pObj = Saig_ManLi( p, Aig_ObjCioId(pObj)-Saig_ManPiNum(p) );
57  Vec_PtrPush( vSupp, pObj );
58  }
59  return;
60  }
61  assert( Aig_ObjIsNode(pObj) );
62  Saig_ManSupport_rec( p, Aig_ObjFanin0(pObj), vSupp );
63  Saig_ManSupport_rec( p, Aig_ObjFanin1(pObj), vSupp );
64 }
static int Saig_ObjIsLo(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: saig.h:84
ABC_NAMESPACE_IMPL_START void Saig_ManSupport_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vSupp)
DECLARATIONS ///.
Definition: saigCone.c:45
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Aig_ObjIsTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aig.h:295
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
Definition: aig.h:309
static void Aig_ObjSetTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aig.h:293
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
Definition: aig.h:280
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
Definition: aig.h:274
static Aig_Obj_t * Saig_ManLi(Aig_Man_t *p, int i)
Definition: saig.h:80
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
Definition: saig.h:73
#define assert(ex)
Definition: util_old.h:213
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
Definition: aig.h:275
static int Aig_ObjCioId(Aig_Obj_t *pObj)
Definition: aig.h:285