abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
giaIff.c File Reference
#include "gia.h"
#include "map/if/if.h"

Go to the source code of this file.

Data Structures

struct  Iff_Man_t_
 

Typedefs

typedef
typedefABC_NAMESPACE_IMPL_START
struct Iff_Man_t_ 
Iff_Man_t
 DECLARATIONS ///. More...
 

Functions

static float Iff_ObjTimeId (Iff_Man_t *p, int iObj)
 
static float Iff_ObjTime (Iff_Man_t *p, Gia_Obj_t *pObj)
 
static void Iff_ObjSetTimeId (Iff_Man_t *p, int iObj, float Time)
 
static void Iff_ObjSetTime (Iff_Man_t *p, Gia_Obj_t *pObj, float Time)
 
static int Iff_ObjMatchId (Iff_Man_t *p, int iObj, int Type)
 
static int Iff_ObjMatch (Iff_Man_t *p, Gia_Obj_t *pObj, int Type)
 
static void Iff_ObjSetMatchId (Iff_Man_t *p, int iObj, int Type, int Match)
 
static void Iff_ObjSetMatch (Iff_Man_t *p, Gia_Obj_t *pObj, int Type, int Match)
 
Iff_Man_tGia_ManIffStart (Gia_Man_t *pGia)
 FUNCTION DEFINITIONS ///. More...
 
void Gia_ManIffStop (Iff_Man_t *p)
 
int Gia_IffObjCount (Gia_Man_t *pGia, int iObj, int iFaninSkip2, int iFaninSkip3)
 
float Gia_IffObjTimeOne (Iff_Man_t *p, int iObj, int iFaninSkip2, int iFaninSkip3)
 
float Gia_IffObjTimeTwo (Iff_Man_t *p, int iObj, int *piFanin, float DelayMin)
 
float Gia_IffObjTimeThree (Iff_Man_t *p, int iObj, int *piFanin, int *piFanin2, float DelayMin)
 
Iff_Man_tGia_ManIffPerform (Gia_Man_t *pGia, If_LibLut_t *pLib, Tim_Man_t *pTime, int nLutSize, int nDegree)
 
void Gia_ManIffSelect_rec (Iff_Man_t *p, int iObj, Vec_Int_t *vPacking)
 
Vec_Int_tGia_ManIffSelect (Iff_Man_t *p)
 
void Gia_ManIffTest (Gia_Man_t *pGia, If_LibLut_t *pLib, int fVerbose)
 

Typedef Documentation

typedef typedefABC_NAMESPACE_IMPL_START struct Iff_Man_t_ Iff_Man_t

DECLARATIONS ///.

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

FileName [giaIff.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Scalable AIG package.]

Synopsis [Hierarchical mapping of AIG with white boxes.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 30 of file giaIff.c.

Function Documentation

int Gia_IffObjCount ( Gia_Man_t pGia,
int  iObj,
int  iFaninSkip2,
int  iFaninSkip3 
)

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

Synopsis [Count the number of unique fanins.]

Description []

SideEffects []

SeeAlso []

Definition at line 93 of file giaIff.c.

94 {
95  int i, iFanin, Count = 0;
96  Gia_ManIncrementTravId( pGia );
97  Gia_LutForEachFanin( pGia, iObj, iFanin, i )
98  {
99  if ( iFanin == iFaninSkip2 || iFanin == iFaninSkip3 )
100  continue;
101  if ( Gia_ObjIsTravIdCurrentId( pGia, iFanin ) )
102  continue;
103  Gia_ObjSetTravIdCurrentId( pGia, iFanin );
104  Count++;
105  }
106  if ( iFaninSkip2 >= 0 )
107  {
108  Gia_LutForEachFanin( pGia, iFaninSkip2, iFanin, i )
109  {
110  if ( iFanin == iFaninSkip3 )
111  continue;
112  if ( Gia_ObjIsTravIdCurrentId( pGia, iFanin ) )
113  continue;
114  Gia_ObjSetTravIdCurrentId( pGia, iFanin );
115  Count++;
116  }
117  }
118  if ( iFaninSkip3 >= 0 )
119  {
120  Gia_LutForEachFanin( pGia, iFaninSkip3, iFanin, i )
121  {
122  if ( iFanin == iFaninSkip2 )
123  continue;
124  if ( Gia_ObjIsTravIdCurrentId( pGia, iFanin ) )
125  continue;
126  Gia_ObjSetTravIdCurrentId( pGia, iFanin );
127  Count++;
128  }
129  }
130  return Count;
131 }
static int Gia_ObjIsTravIdCurrentId(Gia_Man_t *p, int Id)
Definition: gia.h:536
void Gia_ManIncrementTravId(Gia_Man_t *p)
Definition: giaUtil.c:149
static void Gia_ObjSetTravIdCurrentId(Gia_Man_t *p, int Id)
Definition: gia.h:535
#define Gia_LutForEachFanin(p, i, iFan, k)
Definition: gia.h:970
float Gia_IffObjTimeOne ( Iff_Man_t p,
int  iObj,
int  iFaninSkip2,
int  iFaninSkip3 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 144 of file giaIff.c.

145 {
146  int i, iFanin;
147  float DelayMax = -ABC_INFINITY;
148  Gia_LutForEachFanin( p->pGia, iObj, iFanin, i )
149  if ( iFanin != iFaninSkip2 && iFanin != iFaninSkip3 && DelayMax < Iff_ObjTimeId(p, iFanin) )
150  DelayMax = Iff_ObjTimeId(p, iFanin);
151  assert( i == Gia_ObjLutSize(p->pGia, iObj) );
152  if ( iFaninSkip2 == -1 )
153  return DelayMax;
154  Gia_LutForEachFanin( p->pGia, iFaninSkip2, iFanin, i )
155  if ( iFanin != iFaninSkip3 && DelayMax < Iff_ObjTimeId(p, iFanin) )
156  DelayMax = Iff_ObjTimeId(p, iFanin);
157  if ( iFaninSkip3 == -1 )
158  return DelayMax;
159  Gia_LutForEachFanin( p->pGia, iFaninSkip3, iFanin, i )
160  if ( iFanin != iFaninSkip2 && DelayMax < Iff_ObjTimeId(p, iFanin) )
161  DelayMax = Iff_ObjTimeId(p, iFanin);
162  assert( DelayMax >= 0 );
163  return DelayMax;
164 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static float Iff_ObjTimeId(Iff_Man_t *p, int iObj)
Definition: giaIff.c:41
static int Gia_ObjLutSize(Gia_Man_t *p, int Id)
Definition: gia.h:953
if(last==0)
Definition: sparse_int.h:34
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
#define assert(ex)
Definition: util_old.h:213
#define Gia_LutForEachFanin(p, i, iFan, k)
Definition: gia.h:970
float Gia_IffObjTimeThree ( Iff_Man_t p,
int  iObj,
int *  piFanin,
int *  piFanin2,
float  DelayMin 
)

Definition at line 186 of file giaIff.c.

187 {
188  int i, k, iFanin, iFanin2, nSize;
189  float This;
190  *piFanin = -1;
191  *piFanin2 = -1;
192  Gia_LutForEachFanin( p->pGia, iObj, iFanin, i )
193  Gia_LutForEachFanin( p->pGia, iObj, iFanin2, k )
194  {
195  if ( iFanin == iFanin2 )
196  continue;
197  if ( Gia_ObjIsCi(Gia_ManObj(p->pGia, iFanin)) )
198  continue;
199  if ( Gia_ObjIsCi(Gia_ManObj(p->pGia, iFanin2)) )
200  continue;
201  This = Gia_IffObjTimeOne( p, iObj, iFanin, iFanin2 );
202  nSize = Gia_IffObjCount( p->pGia, iObj, iFanin, iFanin2 );
203  assert( nSize <= p->pLib->LutMax );
204  This += p->pLib->pLutDelays[nSize][0];
205  if ( DelayMin > This )
206  {
207  DelayMin = This;
208  *piFanin = iFanin;
209  *piFanin2 = iFanin2;
210  }
211  }
212  return DelayMin;
213 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Gia_IffObjCount(Gia_Man_t *pGia, int iObj, int iFaninSkip2, int iFaninSkip3)
Definition: giaIff.c:93
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
#define assert(ex)
Definition: util_old.h:213
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Definition: gia.h:420
#define Gia_LutForEachFanin(p, i, iFan, k)
Definition: gia.h:970
float Gia_IffObjTimeOne(Iff_Man_t *p, int iObj, int iFaninSkip2, int iFaninSkip3)
Definition: giaIff.c:144
float Gia_IffObjTimeTwo ( Iff_Man_t p,
int  iObj,
int *  piFanin,
float  DelayMin 
)

Definition at line 165 of file giaIff.c.

166 {
167  int i, iFanin, nSize;
168  float This;
169  *piFanin = -1;
170  Gia_LutForEachFanin( p->pGia, iObj, iFanin, i )
171  {
172  if ( Gia_ObjIsCi(Gia_ManObj(p->pGia, iFanin)) )
173  continue;
174  This = Gia_IffObjTimeOne( p, iObj, iFanin, -1 );
175  nSize = Gia_IffObjCount( p->pGia, iObj, iFanin, -1 );
176  assert( nSize <= p->pLib->LutMax );
177  This += p->pLib->pLutDelays[nSize][0];
178  if ( DelayMin > This )
179  {
180  DelayMin = This;
181  *piFanin = iFanin;
182  }
183  }
184  return DelayMin;
185 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Gia_IffObjCount(Gia_Man_t *pGia, int iObj, int iFaninSkip2, int iFaninSkip3)
Definition: giaIff.c:93
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
#define assert(ex)
Definition: util_old.h:213
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Definition: gia.h:420
#define Gia_LutForEachFanin(p, i, iFan, k)
Definition: gia.h:970
float Gia_IffObjTimeOne(Iff_Man_t *p, int iObj, int iFaninSkip2, int iFaninSkip3)
Definition: giaIff.c:144
Iff_Man_t* Gia_ManIffPerform ( Gia_Man_t pGia,
If_LibLut_t pLib,
Tim_Man_t pTime,
int  nLutSize,
int  nDegree 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 226 of file giaIff.c.

227 {
228  Iff_Man_t * p;
229  Gia_Obj_t * pObj;
230  int iObj, iFanin, iFanin1, iFanin2;
231  int CountAll = 0, Count2 = 0, Count3 = 0;
232  float arrTime1, arrTime2, arrTime3, arrMax = -ABC_INFINITY;
233  assert( nDegree == 2 || nDegree == 3 );
234  // start the mapping manager and set its parameters
235  p = Gia_ManIffStart( pGia );
236  p->pGia = pGia;
237  p->pLib = pLib;
238  p->nLutSize = nLutSize;
239  p->nDegree = nDegree;
240  // compute arrival times of each node
241  Iff_ObjSetTimeId( p, 0, 0 );
242  Tim_ManIncrementTravId( pTime );
243  Gia_ManForEachObj1( pGia, pObj, iObj )
244  {
245  if ( Gia_ObjIsAnd(pObj) )
246  {
247  if ( !Gia_ObjIsLut(pGia, iObj) )
248  continue;
249  CountAll++;
250  // compute arrival times of LUT inputs
251  arrTime1 = Gia_IffObjTimeOne( p, iObj, -1, -1 );
252  arrTime1 += p->pLib->pLutDelays[Gia_ObjLutSize(pGia, iObj)][0];
253  // compute arrival times of LUT pairs
254  arrTime2 = Gia_IffObjTimeTwo( p, iObj, &iFanin, arrTime1 );
255  if ( nDegree == 2 )
256  {
257  // set arrival times
258  Iff_ObjSetTimeId( p, iObj, arrTime2 );
259  if ( arrTime2 < arrTime1 )
260  Iff_ObjSetMatchId( p, iObj, 2, iFanin ), Count2++;
261  }
262  else if ( nDegree == 3 )
263  {
264  // compute arrival times of LUT triples
265  arrTime3 = Gia_IffObjTimeThree( p, iObj, &iFanin1, &iFanin2, arrTime2 );
266  // set arrival times
267  Iff_ObjSetTimeId( p, iObj, arrTime3 );
268  if ( arrTime3 == arrTime1 )
269  continue;
270  if ( arrTime3 == arrTime2 )
271  Iff_ObjSetMatchId( p, iObj, 2, iFanin ), Count2++;
272  else
273  {
274  assert( arrTime3 < arrTime2 );
275  Iff_ObjSetMatchId( p, iObj, 2, iFanin1 );
276  Iff_ObjSetMatchId( p, iObj, 3, iFanin2 ), Count3++;
277  }
278  }
279  else assert( 0 );
280  }
281  else if ( Gia_ObjIsCi(pObj) )
282  {
283  arrTime1 = Tim_ManGetCiArrival( pTime, Gia_ObjCioId(pObj) );
284  Iff_ObjSetTime( p, pObj, arrTime1 );
285  }
286  else if ( Gia_ObjIsCo(pObj) )
287  {
288  arrTime1 = Iff_ObjTimeId( p, Gia_ObjFaninId0p(pGia, pObj) );
289  Tim_ManSetCoArrival( pTime, Gia_ObjCioId(pObj), arrTime1 );
290  Iff_ObjSetTime( p, pObj, arrTime1 );
291  arrMax = Abc_MaxFloat( arrMax, arrTime1 );
292  }
293  else assert( 0 );
294  }
295  printf( "Max delay = %.2f. Count1 = %d. Count2 = %d. Count3 = %d.\n",
296  arrMax, CountAll - Count2 - Count3, Count2, Count3 );
297  return p;
298 }
float Gia_IffObjTimeTwo(Iff_Man_t *p, int iObj, int *piFanin, float DelayMin)
Definition: giaIff.c:165
static void Iff_ObjSetTimeId(Iff_Man_t *p, int iObj, float Time)
Definition: giaIff.c:43
void Tim_ManIncrementTravId(Tim_Man_t *p)
DECLARATIONS ///.
Definition: timTrav.c:44
float Gia_IffObjTimeThree(Iff_Man_t *p, int iObj, int *piFanin, int *piFanin2, float DelayMin)
Definition: giaIff.c:186
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Tim_ManSetCoArrival(Tim_Man_t *p, int iCo, float Delay)
Definition: timTime.c:116
static void Iff_ObjSetTime(Iff_Man_t *p, Gia_Obj_t *pObj, float Time)
Definition: giaIff.c:44
static float Iff_ObjTimeId(Iff_Man_t *p, int iObj)
Definition: giaIff.c:41
static float Abc_MaxFloat(float a, float b)
Definition: abc_global.h:243
Definition: gia.h:75
static int Gia_ObjLutSize(Gia_Man_t *p, int Id)
Definition: gia.h:953
Iff_Man_t * Gia_ManIffStart(Gia_Man_t *pGia)
FUNCTION DEFINITIONS ///.
Definition: giaIff.c:66
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
Definition: gia.h:421
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:463
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
#define assert(ex)
Definition: util_old.h:213
static int Gia_ObjIsLut(Gia_Man_t *p, int Id)
Definition: gia.h:952
#define Gia_ManForEachObj1(p, pObj, i)
Definition: gia.h:986
typedefABC_NAMESPACE_IMPL_START struct Iff_Man_t_ Iff_Man_t
DECLARATIONS ///.
Definition: giaIff.c:30
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Definition: gia.h:420
float Tim_ManGetCiArrival(Tim_Man_t *p, int iCi)
Definition: timTime.c:174
static int Gia_ObjCioId(Gia_Obj_t *pObj)
Definition: gia.h:411
float Gia_IffObjTimeOne(Iff_Man_t *p, int iObj, int iFaninSkip2, int iFaninSkip3)
Definition: giaIff.c:144
static void Iff_ObjSetMatchId(Iff_Man_t *p, int iObj, int Type, int Match)
Definition: giaIff.c:48
Vec_Int_t* Gia_ManIffSelect ( Iff_Man_t p)

Definition at line 359 of file giaIff.c.

360 {
361  Vec_Int_t * vPacking;
362  Gia_Obj_t * pObj; int i;
363  vPacking = Vec_IntAlloc( Gia_ManObjNum(p->pGia) );
364  Vec_IntPush( vPacking, 0 );
365  // mark const0 and PIs
366  Gia_ManIncrementTravId( p->pGia );
367  Gia_ObjSetTravIdCurrentId( p->pGia, 0 );
368  Gia_ManForEachCi( p->pGia, pObj, i )
369  Gia_ObjSetTravIdCurrent( p->pGia, pObj );
370  // recursively collect internal nodes
371  Gia_ManForEachCo( p->pGia, pObj, i )
372  Gia_ManIffSelect_rec( p, Gia_ObjFaninId0p(p->pGia, pObj), vPacking );
373  return vPacking;
374 }
#define Gia_ManForEachCo(p, pObj, i)
Definition: gia.h:1022
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
Definition: gia.h:75
#define Gia_ManForEachCi(p, pObj, i)
Definition: gia.h:1016
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static void Gia_ObjSetTravIdCurrent(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:531
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
void Gia_ManIffSelect_rec(Iff_Man_t *p, int iObj, Vec_Int_t *vPacking)
Definition: giaIff.c:311
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:463
void Gia_ManIncrementTravId(Gia_Man_t *p)
Definition: giaUtil.c:149
static void Gia_ObjSetTravIdCurrentId(Gia_Man_t *p, int Id)
Definition: gia.h:535
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
void Gia_ManIffSelect_rec ( Iff_Man_t p,
int  iObj,
Vec_Int_t vPacking 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 311 of file giaIff.c.

312 {
313  int i, iFanin, iFaninSkip2, iFaninSkip3;
314  if ( Gia_ObjIsTravIdCurrentId( p->pGia, iObj ) )
315  return;
316  Gia_ObjSetTravIdCurrentId( p->pGia, iObj );
317  assert( Gia_ObjIsLut(p->pGia, iObj) );
318  iFaninSkip2 = Iff_ObjMatchId(p, iObj, 2);
319  iFaninSkip3 = Iff_ObjMatchId(p, iObj, 3);
320  if ( iFaninSkip2 == -1 )
321  {
322  assert( iFaninSkip3 == -1 );
323  Gia_LutForEachFanin( p->pGia, iObj, iFanin, i )
324  Gia_ManIffSelect_rec( p, iFanin, vPacking );
325  Vec_IntPush( vPacking, 1 );
326  Vec_IntPush( vPacking, iObj );
327  }
328  else if ( iFaninSkip3 == -1 )
329  {
330  assert( iFaninSkip2 > 0 );
331  Gia_LutForEachFanin( p->pGia, iObj, iFanin, i )
332  if ( iFanin != iFaninSkip2 )
333  Gia_ManIffSelect_rec( p, iFanin, vPacking );
334  Gia_LutForEachFanin( p->pGia, iFaninSkip2, iFanin, i )
335  Gia_ManIffSelect_rec( p, iFanin, vPacking );
336  Vec_IntPush( vPacking, 2 );
337  Vec_IntPush( vPacking, iFaninSkip2 );
338  Vec_IntPush( vPacking, iObj );
339  }
340  else
341  {
342  assert( iFaninSkip2 > 0 && iFaninSkip3 > 0 );
343  Gia_LutForEachFanin( p->pGia, iObj, iFanin, i )
344  if ( iFanin != iFaninSkip2 && iFanin != iFaninSkip3 )
345  Gia_ManIffSelect_rec( p, iFanin, vPacking );
346  Gia_LutForEachFanin( p->pGia, iFaninSkip2, iFanin, i )
347  if ( iFanin != iFaninSkip3 )
348  Gia_ManIffSelect_rec( p, iFanin, vPacking );
349  Gia_LutForEachFanin( p->pGia, iFaninSkip3, iFanin, i )
350  if ( iFanin != iFaninSkip2 )
351  Gia_ManIffSelect_rec( p, iFanin, vPacking );
352  Vec_IntPush( vPacking, 3 );
353  Vec_IntPush( vPacking, iFaninSkip2 );
354  Vec_IntPush( vPacking, iFaninSkip3 );
355  Vec_IntPush( vPacking, iObj );
356  }
357  Vec_IntAddToEntry( vPacking, 0, 1 );
358 }
static int Iff_ObjMatchId(Iff_Man_t *p, int iObj, int Type)
Definition: giaIff.c:46
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
Definition: bblif.c:302
if(last==0)
Definition: sparse_int.h:34
else
Definition: sparse_int.h:55
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static int Gia_ObjIsTravIdCurrentId(Gia_Man_t *p, int Id)
Definition: gia.h:536
void Gia_ManIffSelect_rec(Iff_Man_t *p, int iObj, Vec_Int_t *vPacking)
Definition: giaIff.c:311
#define assert(ex)
Definition: util_old.h:213
static int Gia_ObjIsLut(Gia_Man_t *p, int Id)
Definition: gia.h:952
static void Gia_ObjSetTravIdCurrentId(Gia_Man_t *p, int Id)
Definition: gia.h:535
#define Gia_LutForEachFanin(p, i, iFan, k)
Definition: gia.h:970
Iff_Man_t* Gia_ManIffStart ( Gia_Man_t pGia)

FUNCTION DEFINITIONS ///.

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 66 of file giaIff.c.

67 {
68  Iff_Man_t * p = ABC_CALLOC( Iff_Man_t, 1 );
69  p->vTimes = Vec_FltStartFull( Gia_ManObjNum(pGia) );
70  p->vMatch[2] = Vec_IntStartFull( Gia_ManObjNum(pGia) );
71  p->vMatch[3] = Vec_IntStartFull( Gia_ManObjNum(pGia) );
72  return p;
73 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Vec_Int_t * Vec_IntStartFull(int nSize)
Definition: vecInt.h:119
static Vec_Flt_t * Vec_FltStartFull(int nSize)
Definition: vecFlt.h:109
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
typedefABC_NAMESPACE_IMPL_START struct Iff_Man_t_ Iff_Man_t
DECLARATIONS ///.
Definition: giaIff.c:30
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
void Gia_ManIffStop ( Iff_Man_t p)

Definition at line 74 of file giaIff.c.

75 {
76  Vec_FltFree( p->vTimes );
77  Vec_IntFree( p->vMatch[2] );
78  Vec_IntFree( p->vMatch[3] );
79  ABC_FREE( p );
80 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_FltFree(Vec_Flt_t *p)
Definition: vecFlt.h:218
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
void Gia_ManIffTest ( Gia_Man_t pGia,
If_LibLut_t pLib,
int  fVerbose 
)

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

Synopsis [This command performs hierarhical mapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 387 of file giaIff.c.

388 {
389  Iff_Man_t * p;
390  Tim_Man_t * pTemp = NULL;
391  int nDegree = -1;
392  int nLutSize = Gia_ManLutSizeMax( pGia );
393  if ( nLutSize <= 4 )
394  {
395  nLutSize = 4;
396  if ( pLib->LutMax == 7 )
397  nDegree = 2;
398  else if ( pLib->LutMax == 10 )
399  nDegree = 3;
400  else
401  { printf( "LUT library for packing 4-LUTs should have 7 or 10 inputs.\n" ); return; }
402  }
403  else if ( nLutSize <= 6 )
404  {
405  nLutSize = 6;
406  if ( pLib->LutMax == 11 )
407  nDegree = 2;
408  else if ( pLib->LutMax == 16 )
409  nDegree = 3;
410  else
411  { printf( "LUT library for packing 6-LUTs should have 11 or 16 inputs.\n" ); return; }
412  }
413  else
414  {
415  printf( "The LUT size is more than 6.\n" );
416  return;
417  }
418  if ( fVerbose )
419  printf( "Performing %d-clustering with %d-LUTs:\n", nDegree, nLutSize );
420  // create timing manager
421  if ( pGia->pManTime == NULL )
422  pGia->pManTime = pTemp = Tim_ManStart( Gia_ManCiNum(pGia), Gia_ManCoNum(pGia) );
423  // perform timing computation
424  p = Gia_ManIffPerform( pGia, pLib, (Tim_Man_t *)pGia->pManTime, nLutSize, nDegree );
425  // remove timing manager
426  if ( pGia->pManTime == pTemp )
427  pGia->pManTime = NULL;
428  Tim_ManStopP( (Tim_Man_t **)&pTemp );
429  // derive clustering
430  Vec_IntFreeP( &pGia->vPacking );
431  pGia->vPacking = Gia_ManIffSelect( p );
432  Gia_ManIffStop( p );
433  // print statistics
434  if ( fVerbose )
435  Gia_ManPrintPackingStats( pGia );
436 }
void Gia_ManIffStop(Iff_Man_t *p)
Definition: giaIff.c:74
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int LutMax
Definition: if.h:173
Vec_Int_t * vPacking
Definition: gia.h:133
void Gia_ManPrintPackingStats(Gia_Man_t *p)
Definition: giaIf.c:553
Tim_Man_t * Tim_ManStart(int nCis, int nCos)
DECLARATIONS ///.
Definition: timMan.c:45
void * pManTime
Definition: gia.h:165
int Gia_ManLutSizeMax(Gia_Man_t *p)
Definition: giaIf.c:125
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
void Tim_ManStopP(Tim_Man_t **p)
Definition: timMan.c:384
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition: tim.h:92
Iff_Man_t * Gia_ManIffPerform(Gia_Man_t *pGia, If_LibLut_t *pLib, Tim_Man_t *pTime, int nLutSize, int nDegree)
Definition: giaIff.c:226
typedefABC_NAMESPACE_IMPL_START struct Iff_Man_t_ Iff_Man_t
DECLARATIONS ///.
Definition: giaIff.c:30
Vec_Int_t * Gia_ManIffSelect(Iff_Man_t *p)
Definition: giaIff.c:359
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
static int Iff_ObjMatch ( Iff_Man_t p,
Gia_Obj_t pObj,
int  Type 
)
inlinestatic

Definition at line 47 of file giaIff.c.

47 { return Iff_ObjMatchId( p, Gia_ObjId(p->pGia, pObj), Type ); }
static int Iff_ObjMatchId(Iff_Man_t *p, int iObj, int Type)
Definition: giaIff.c:46
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
static int Iff_ObjMatchId ( Iff_Man_t p,
int  iObj,
int  Type 
)
inlinestatic

Definition at line 46 of file giaIff.c.

46 { return Vec_IntEntry( p->vMatch[Type], iObj ); }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static void Iff_ObjSetMatch ( Iff_Man_t p,
Gia_Obj_t pObj,
int  Type,
int  Match 
)
inlinestatic

Definition at line 49 of file giaIff.c.

49 { Iff_ObjSetMatchId( p, Gia_ObjId(p->pGia, pObj), Type, Match );}
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
static void Iff_ObjSetMatchId(Iff_Man_t *p, int iObj, int Type, int Match)
Definition: giaIff.c:48
static void Iff_ObjSetMatchId ( Iff_Man_t p,
int  iObj,
int  Type,
int  Match 
)
inlinestatic

Definition at line 48 of file giaIff.c.

48 { Vec_IntWriteEntry( p->vMatch[Type], iObj, Match ); }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
static void Iff_ObjSetTime ( Iff_Man_t p,
Gia_Obj_t pObj,
float  Time 
)
inlinestatic

Definition at line 44 of file giaIff.c.

44 { Iff_ObjSetTimeId( p, Gia_ObjId(p->pGia, pObj), Time ); }
static void Iff_ObjSetTimeId(Iff_Man_t *p, int iObj, float Time)
Definition: giaIff.c:43
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
static void Iff_ObjSetTimeId ( Iff_Man_t p,
int  iObj,
float  Time 
)
inlinestatic

Definition at line 43 of file giaIff.c.

43 { Vec_FltWriteEntry( p->vTimes, iObj, Time ); }
static void Vec_FltWriteEntry(Vec_Flt_t *p, int i, float Entry)
Definition: vecFlt.h:364
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static float Iff_ObjTime ( Iff_Man_t p,
Gia_Obj_t pObj 
)
inlinestatic

Definition at line 42 of file giaIff.c.

42 { return Iff_ObjTimeId( p, Gia_ObjId(p->pGia, pObj) ); }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static float Iff_ObjTimeId(Iff_Man_t *p, int iObj)
Definition: giaIff.c:41
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
static float Iff_ObjTimeId ( Iff_Man_t p,
int  iObj 
)
inlinestatic

Definition at line 41 of file giaIff.c.

41 { return Vec_FltEntry( p->vTimes, iObj ); }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static float Vec_FltEntry(Vec_Flt_t *p, int i)
Definition: vecFlt.h:342