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

Go to the source code of this file.

Data Structures

struct  Frc_Obj_t_
 
struct  Frc_Man_t_
 

Macros

#define Frc_ManForEachObj(p, pObj, i)   for ( i = 0; (i < p->nObjData) && (pObj = Frc_ManObj(p,i)); i += Frc_ObjSize(pObj) )
 
#define Frc_ManForEachObjVec(vVec, p, pObj, i)   for ( i = 0; (i < Vec_IntSize(vVec)) && ((pObj) = Frc_ManObj(p, Vec_IntEntry(vVec,i))); i++ )
 
#define Frc_ManForEachNode(p, pObj, i)   for ( i = 0; (i < p->nObjData) && (pObj = Frc_ManObj(p,i)); i += Frc_ObjSize(pObj) ) if ( Frc_ObjIsTerm(pObj) ) {} else
 
#define Frc_ManForEachCi(p, pObj, i)   for ( i = 0; (i < Vec_IntSize(p->vCis)) && (pObj = Frc_ManObj(p,Vec_IntEntry(p->vCis,i))); i++ )
 
#define Frc_ManForEachCo(p, pObj, i)   for ( i = 0; (i < Vec_IntSize(p->vCos)) && (pObj = Frc_ManObj(p,Vec_IntEntry(p->vCos,i))); i++ )
 
#define Frc_ObjForEachFanin(pObj, pNext, i)   for ( i = 0; (i < (int)pObj->nFanins) && (pNext = Frc_ObjFanin(pObj,i)); i++ )
 
#define Frc_ObjForEachFaninReverse(pObj, pNext, i)   for ( i = (int)pObj->nFanins - 1; (i >= 0) && (pNext = Frc_ObjFanin(pObj,i)); i-- )
 
#define Frc_ObjForEachFanout(pObj, pNext, i)   for ( i = 0; (i < (int)pObj->nFanouts) && (pNext = Frc_ObjFanout(pObj,i)); i++ )
 

Typedefs

typedef
typedefABC_NAMESPACE_IMPL_START
struct Frc_Obj_t_ 
Frc_Obj_t
 DECLARATIONS ///. More...
 
typedef struct Frc_Man_t_ Frc_Man_t
 

Functions

static int Frc_ManRegNum (Frc_Man_t *p)
 
static int Frc_ManCiNum (Frc_Man_t *p)
 
static int Frc_ManCoNum (Frc_Man_t *p)
 
static int Frc_ManPiNum (Frc_Man_t *p)
 
static int Frc_ManPoNum (Frc_Man_t *p)
 
static int Frc_ManObjNum (Frc_Man_t *p)
 
static int Frc_ManNodeNum (Frc_Man_t *p)
 
static Frc_Obj_tFrc_ManObj (Frc_Man_t *p, int hHandle)
 
static Frc_Obj_tFrc_ManCi (Frc_Man_t *p, int i)
 
static Frc_Obj_tFrc_ManCo (Frc_Man_t *p, int i)
 
static int Frc_ObjIsTerm (Frc_Obj_t *pObj)
 
static int Frc_ObjIsCi (Frc_Obj_t *pObj)
 
static int Frc_ObjIsCo (Frc_Obj_t *pObj)
 
static int Frc_ObjIsPi (Frc_Obj_t *pObj)
 
static int Frc_ObjIsPo (Frc_Obj_t *pObj)
 
static int Frc_ObjIsNode (Frc_Obj_t *pObj)
 
static int Frc_ObjIsConst0 (Frc_Obj_t *pObj)
 
static int Frc_ObjSize (Frc_Obj_t *pObj)
 
static int Frc_ObjFaninNum (Frc_Obj_t *pObj)
 
static int Frc_ObjFanoutNum (Frc_Obj_t *pObj)
 
static Frc_Obj_tFrc_ObjFanin (Frc_Obj_t *pObj, int i)
 
static Frc_Obj_tFrc_ObjFanout (Frc_Obj_t *pObj, int i)
 
void Frc_ObjAddFanin (Frc_Obj_t *pObj, Frc_Obj_t *pFanin)
 FUNCTION DEFINITIONS ///. More...
 
Frc_Man_tFrc_ManStartSimple (Gia_Man_t *pGia)
 
void Frc_ManCollectSuper_rec (Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSuper, Vec_Int_t *vVisit)
 
void Frc_ManCollectSuper (Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSuper, Vec_Int_t *vVisit)
 
void Frc_ManCreateRefsSpecial (Gia_Man_t *p)
 
void Frc_ManTransformRefs (Gia_Man_t *p, int *pnObjs, int *pnFanios)
 
Frc_Man_tFrc_ManStart (Gia_Man_t *pGia)
 
void Frc_ManPrintStats (Frc_Man_t *p)
 
void Frc_ManStop (Frc_Man_t *p)
 
int Frc_ManCrossCut_rec (Frc_Man_t *p, Frc_Obj_t *pObj)
 
int Frc_ManCrossCut2_rec (Frc_Man_t *p, Frc_Obj_t *pObj)
 
int Frc_ManCrossCut (Frc_Man_t *p, Vec_Int_t *vOrder, int fReverse)
 
Vec_Int_tFrc_ManCollectCos (Frc_Man_t *p)
 
void Frc_ManCrossCutTest (Frc_Man_t *p, Vec_Int_t *vOrderInit)
 
void Frc_ManPlaceRandom (Frc_Man_t *p)
 
void Frc_ManArrayShuffle (Vec_Int_t *vArray)
 
void Frc_ManPlaceDfs_rec (Frc_Man_t *p, Frc_Obj_t *pObj, int *piPlace)
 
void Frc_ManPlaceDfs (Frc_Man_t *p, Vec_Int_t *vCoOrder)
 
int Frc_ManPlaceDfsBoth (Frc_Man_t *p, Vec_Int_t *vCoOrder, int *piCutSize2)
 
void Frc_ManPlacementRefine (Frc_Man_t *p, int nIters, int fVerbose)
 
int Frc_ObjFanoutsAreCos (Frc_Obj_t *pThis)
 
void Frc_DumpGraphIntoFile (Frc_Man_t *p)
 
void For_ManExperiment (Gia_Man_t *pGia, int nIters, int fClustered, int fVerbose)
 
void For_ManFileExperiment ()
 

Macro Definition Documentation

#define Frc_ManForEachCi (   p,
  pObj,
 
)    for ( i = 0; (i < Vec_IntSize(p->vCis)) && (pObj = Frc_ManObj(p,Vec_IntEntry(p->vCis,i))); i++ )

Definition at line 103 of file giaForce.c.

#define Frc_ManForEachCo (   p,
  pObj,
 
)    for ( i = 0; (i < Vec_IntSize(p->vCos)) && (pObj = Frc_ManObj(p,Vec_IntEntry(p->vCos,i))); i++ )

Definition at line 105 of file giaForce.c.

#define Frc_ManForEachNode (   p,
  pObj,
 
)    for ( i = 0; (i < p->nObjData) && (pObj = Frc_ManObj(p,i)); i += Frc_ObjSize(pObj) ) if ( Frc_ObjIsTerm(pObj) ) {} else

Definition at line 101 of file giaForce.c.

#define Frc_ManForEachObj (   p,
  pObj,
 
)    for ( i = 0; (i < p->nObjData) && (pObj = Frc_ManObj(p,i)); i += Frc_ObjSize(pObj) )

Definition at line 96 of file giaForce.c.

#define Frc_ManForEachObjVec (   vVec,
  p,
  pObj,
 
)    for ( i = 0; (i < Vec_IntSize(vVec)) && ((pObj) = Frc_ManObj(p, Vec_IntEntry(vVec,i))); i++ )

Definition at line 98 of file giaForce.c.

#define Frc_ObjForEachFanin (   pObj,
  pNext,
 
)    for ( i = 0; (i < (int)pObj->nFanins) && (pNext = Frc_ObjFanin(pObj,i)); i++ )

Definition at line 108 of file giaForce.c.

#define Frc_ObjForEachFaninReverse (   pObj,
  pNext,
 
)    for ( i = (int)pObj->nFanins - 1; (i >= 0) && (pNext = Frc_ObjFanin(pObj,i)); i-- )

Definition at line 110 of file giaForce.c.

#define Frc_ObjForEachFanout (   pObj,
  pNext,
 
)    for ( i = 0; (i < (int)pObj->nFanouts) && (pNext = Frc_ObjFanout(pObj,i)); i++ )

Definition at line 112 of file giaForce.c.

Typedef Documentation

typedef struct Frc_Man_t_ Frc_Man_t

Definition at line 55 of file giaForce.c.

typedef typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t

DECLARATIONS ///.

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

FileName [gia.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Scalable AIG package.]

Synopsis []

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 36 of file giaForce.c.

Function Documentation

void For_ManExperiment ( Gia_Man_t pGia,
int  nIters,
int  fClustered,
int  fVerbose 
)

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

Synopsis [Experiment with the FORCE algorithm.]

Description []

SideEffects []

SeeAlso []

Definition at line 1039 of file giaForce.c.

1040 {
1041  Frc_Man_t * p;
1042  Gia_ManRandom( 1 );
1043  if ( fClustered )
1044  p = Frc_ManStart( pGia );
1045  else
1046  p = Frc_ManStartSimple( pGia );
1047 // Frc_DumpGraphIntoFile( p );
1048  if ( fVerbose )
1049  Frc_ManPrintStats( p );
1050 // Frc_ManCrossCutTest( p, NULL );
1051  Frc_ManPlacementRefine( p, nIters, fVerbose );
1052  Frc_ManStop( p );
1053 }
Frc_Man_t * Frc_ManStartSimple(Gia_Man_t *pGia)
Definition: giaForce.c:150
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Frc_Man_t * Frc_ManStart(Gia_Man_t *pGia)
Definition: giaForce.c:428
void Frc_ManPrintStats(Frc_Man_t *p)
Definition: giaForce.c:557
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition: giaUtil.c:49
void Frc_ManPlacementRefine(Frc_Man_t *p, int nIters, int fVerbose)
Definition: giaForce.c:886
void Frc_ManStop(Frc_Man_t *p)
Definition: giaForce.c:584
void For_ManFileExperiment ( )

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

Synopsis [Experiment with the FORCE algorithm.]

Description []

SideEffects []

SeeAlso []

Definition at line 1066 of file giaForce.c.

1067 {
1068  FILE * pFile;
1069  int * pBuffer;
1070  int i, Size, Exp = 25;
1071  abctime clk = Abc_Clock();
1072  int RetValue;
1073 
1074  Size = (1 << Exp);
1075  printf( "2^%d machine words (%d bytes).\n", Exp, (int)sizeof(int) * Size );
1076 
1077  pBuffer = ABC_ALLOC( int, Size );
1078  for ( i = 0; i < Size; i++ )
1079  pBuffer[i] = i;
1080 ABC_PRT( "Fillup", Abc_Clock() - clk );
1081 
1082 clk = Abc_Clock();
1083  pFile = fopen( "test.txt", "rb" );
1084  RetValue = fread( pBuffer, 1, sizeof(int) * Size, pFile );
1085  fclose( pFile );
1086 ABC_PRT( "Read ", Abc_Clock() - clk );
1087 
1088 clk = Abc_Clock();
1089  pFile = fopen( "test.txt", "wb" );
1090  fwrite( pBuffer, 1, sizeof(int) * Size, pFile );
1091  fclose( pFile );
1092 ABC_PRT( "Write ", Abc_Clock() - clk );
1093 /*
1094 2^25 machine words (134217728 bytes).
1095 Fillup = 0.06 sec
1096 Read = 0.08 sec
1097 Write = 1.81 sec
1098 */
1099 }
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
static abctime Abc_Clock()
Definition: abc_global.h:279
#define ABC_PRT(a, t)
Definition: abc_global.h:220
ABC_INT64_T abctime
Definition: abc_global.h:278
void Frc_DumpGraphIntoFile ( Frc_Man_t p)

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

Synopsis [Computes the distances from the given set of objects.]

Description [Returns one of the most distant objects.]

SideEffects []

SeeAlso []

Definition at line 1002 of file giaForce.c.

1003 {
1004  FILE * pFile;
1005  Frc_Obj_t * pThis, * pNext;
1006  int i, k, Counter = 0;
1007  // assign numbers to CIs and internal nodes
1008  Frc_ManForEachObj( p, pThis, i )
1009  {
1010  if ( i && ((Frc_ObjIsCi(pThis) && !Frc_ObjFanoutsAreCos(pThis)) || Frc_ObjIsNode(pThis)) )
1011  pThis->iFanin = Counter++;
1012  else
1013  pThis->iFanin = ~0;
1014  }
1015  // assign numbers to all other nodes
1016  pFile = fopen( "x\\large\\aig\\dg1.g", "w" );
1017  Frc_ManForEachObj( p, pThis, i )
1018  {
1019  Frc_ObjForEachFanout( pThis, pNext, k )
1020  {
1021  if ( ~pThis->iFanin && ~pNext->iFanin )
1022  fprintf( pFile, "%d %d\n", pThis->iFanin, pNext->iFanin );
1023  }
1024  }
1025  fclose( pFile );
1026 }
#define Frc_ObjForEachFanout(pObj, pNext, i)
Definition: giaForce.c:112
static int Frc_ObjIsNode(Frc_Obj_t *pObj)
Definition: giaForce.c:87
static int Counter
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
int Frc_ObjFanoutsAreCos(Frc_Obj_t *pThis)
Definition: giaForce.c:981
#define Frc_ManForEachObj(p, pObj, i)
Definition: giaForce.c:96
static int Frc_ObjIsCi(Frc_Obj_t *pObj)
Definition: giaForce.c:83
void Frc_ManArrayShuffle ( Vec_Int_t vArray)

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

Synopsis [Shuffles array of random integers.]

Description []

SideEffects []

SeeAlso []

Definition at line 775 of file giaForce.c.

776 {
777  int i, iNext, Temp;
778  for ( i = 0; i < vArray->nSize; i++ )
779  {
780  iNext = Gia_ManRandom( 0 ) % vArray->nSize;
781  Temp = vArray->pArray[i];
782  vArray->pArray[i] = vArray->pArray[iNext];
783  vArray->pArray[iNext] = Temp;
784  }
785 }
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition: giaUtil.c:49
static Frc_Obj_t* Frc_ManCi ( Frc_Man_t p,
int  i 
)
inlinestatic

Definition at line 79 of file giaForce.c.

79 { return Frc_ManObj( p, Vec_IntEntry(p->vCis,i) ); }
static Frc_Obj_t * Frc_ManObj(Frc_Man_t *p, int hHandle)
Definition: giaForce.c:78
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t * vCis
Definition: giaForce.c:59
static int Frc_ManCiNum ( Frc_Man_t p)
inlinestatic

Definition at line 71 of file giaForce.c.

71 { return Vec_IntSize(p->vCis); }
Vec_Int_t * vCis
Definition: giaForce.c:59
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static Frc_Obj_t* Frc_ManCo ( Frc_Man_t p,
int  i 
)
inlinestatic

Definition at line 80 of file giaForce.c.

80 { return Frc_ManObj( p, Vec_IntEntry(p->vCos,i) ); }
static Frc_Obj_t * Frc_ManObj(Frc_Man_t *p, int hHandle)
Definition: giaForce.c:78
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t * vCos
Definition: giaForce.c:60
Vec_Int_t* Frc_ManCollectCos ( Frc_Man_t p)

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

Synopsis [Collects CO handles.]

Description []

SideEffects []

SeeAlso []

Definition at line 692 of file giaForce.c.

693 {
694  Vec_Int_t * vCoOrder;
695  Frc_Obj_t * pObj;
696  int i;
697  vCoOrder = Vec_IntAlloc( Frc_ManCoNum(p) );
698  Frc_ManForEachCo( p, pObj, i )
699  Vec_IntPush( vCoOrder, pObj->hHandle );
700  return vCoOrder;
701 }
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
#define Frc_ManForEachCo(p, pObj, i)
Definition: giaForce.c:105
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
static int Frc_ManCoNum(Frc_Man_t *p)
Definition: giaForce.c:72
void Frc_ManCollectSuper ( Gia_Man_t p,
Gia_Obj_t pObj,
Vec_Int_t vSuper,
Vec_Int_t vVisit 
)

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

Synopsis [Collect the fanin IDs.]

Description []

SideEffects []

SeeAlso []

Definition at line 289 of file giaForce.c.

290 {
291  int Entry, i;
292  Vec_IntClear( vSuper );
293  Vec_IntClear( vVisit );
294  assert( pObj->fMark0 == 1 );
295  pObj->fMark0 = 0;
296  Frc_ManCollectSuper_rec( p, pObj, vSuper, vVisit );
297  pObj->fMark0 = 1;
298  Vec_IntForEachEntry( vVisit, Entry, i )
299  Gia_ManObj(p, Entry)->fMark1 = 0;
300 }
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
void Frc_ManCollectSuper_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSuper, Vec_Int_t *vVisit)
Definition: giaForce.c:261
unsigned fMark0
Definition: gia.h:79
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
void Frc_ManCollectSuper_rec ( Gia_Man_t p,
Gia_Obj_t pObj,
Vec_Int_t vSuper,
Vec_Int_t vVisit 
)

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

Synopsis [Collect the fanin IDs.]

Description []

SideEffects []

SeeAlso []

Definition at line 261 of file giaForce.c.

262 {
263  if ( pObj->fMark1 )
264  return;
265  pObj->fMark1 = 1;
266  Vec_IntPush( vVisit, Gia_ObjId(p, pObj) );
267  if ( pObj->fMark0 )
268  {
269  Vec_IntPush( vSuper, Gia_ObjId(p, pObj) );
270  return;
271  }
272  assert( Gia_ObjIsAnd(pObj) );
273  Frc_ManCollectSuper_rec( p, Gia_ObjFanin0(pObj), vSuper, vVisit );
274  Frc_ManCollectSuper_rec( p, Gia_ObjFanin1(pObj), vSuper, vVisit );
275 
276 }
unsigned fMark1
Definition: gia.h:84
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
void Frc_ManCollectSuper_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSuper, Vec_Int_t *vVisit)
Definition: giaForce.c:261
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
unsigned fMark0
Definition: gia.h:79
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
#define assert(ex)
Definition: util_old.h:213
static int Frc_ManCoNum ( Frc_Man_t p)
inlinestatic

Definition at line 72 of file giaForce.c.

72 { return Vec_IntSize(p->vCos); }
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
Vec_Int_t * vCos
Definition: giaForce.c:60
void Frc_ManCreateRefsSpecial ( Gia_Man_t p)

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

Synopsis [Assigns references while removing the MUX/XOR ones.]

Description []

SideEffects []

SeeAlso []

Definition at line 313 of file giaForce.c.

314 {
315  Gia_Obj_t * pObj, * pFan0, * pFan1;
316  Gia_Obj_t * pObjC, * pObjD0, * pObjD1;
317  int i;
318  assert( p->pRefs == NULL );
319  Gia_ManCleanMark0( p );
320  Gia_ManCreateRefs( p );
321  Gia_ManForEachAnd( p, pObj, i )
322  {
323  assert( pObj->fMark0 == 0 );
324  pFan0 = Gia_ObjFanin0(pObj);
325  pFan1 = Gia_ObjFanin1(pObj);
326  // skip nodes whose fanins are PIs or are already marked
327  if ( Gia_ObjIsCi(pFan0) || pFan0->fMark0 ||
328  Gia_ObjIsCi(pFan1) || pFan1->fMark0 )
329  continue;
330  // skip nodes that are not MUX type
331  if ( !Gia_ObjIsMuxType(pObj) )
332  continue;
333  // the node is MUX type, mark it and its fanins
334  pObj->fMark0 = 1;
335  pFan0->fMark0 = 1;
336  pFan1->fMark0 = 1;
337  // deref the control
338  pObjC = Gia_ObjRecognizeMux( pObj, &pObjD1, &pObjD0 );
339  Gia_ObjRefDec( p, Gia_Regular(pObjC) );
340  if ( Gia_Regular(pObjD0) == Gia_Regular(pObjD1) )
341  Gia_ObjRefDec( p, Gia_Regular(pObjD0) );
342  }
343  Gia_ManForEachAnd( p, pObj, i )
344  assert( Gia_ObjRefNum(p, pObj) > 0 );
345  Gia_ManCleanMark0( p );
346 }
void Gia_ManCreateRefs(Gia_Man_t *p)
Definition: giaUtil.c:715
static Gia_Obj_t * Gia_Regular(Gia_Obj_t *p)
Definition: gia.h:377
void Gia_ManCleanMark0(Gia_Man_t *p)
Definition: giaUtil.c:215
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:521
int * pRefs
Definition: gia.h:114
Definition: gia.h:75
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
#define Gia_ManForEachAnd(p, pObj, i)
Definition: gia.h:1002
static int Gia_ObjRefDec(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:523
int Gia_ObjIsMuxType(Gia_Obj_t *pNode)
Definition: giaUtil.c:885
unsigned fMark0
Definition: gia.h:79
Gia_Obj_t * Gia_ObjRecognizeMux(Gia_Obj_t *pNode, Gia_Obj_t **ppNodeT, Gia_Obj_t **ppNodeE)
Definition: giaUtil.c:959
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
#define assert(ex)
Definition: util_old.h:213
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Definition: gia.h:420
int Frc_ManCrossCut ( Frc_Man_t p,
Vec_Int_t vOrder,
int  fReverse 
)

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

Synopsis [Computes cross cut size for the given order of POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 658 of file giaForce.c.

659 {
660  Frc_Obj_t * pObj;
661  int i;
662  assert( Vec_IntSize(vOrder) == Frc_ManCoNum(p) );
663  p->nCutCur = 0;
664  p->nCutMax = 0;
665  Frc_ManForEachObj( p, pObj, i )
666  pObj->iFanout = pObj->nFanouts;
667  Frc_ManForEachObjVec( vOrder, p, pObj, i )
668  {
669  assert( Frc_ObjIsCo(pObj) );
670  if ( fReverse )
671  p->nCutCur -= Frc_ManCrossCut2_rec( p, Frc_ObjFanin(pObj,0) );
672  else
673  p->nCutCur -= Frc_ManCrossCut_rec( p, Frc_ObjFanin(pObj,0) );
674  }
675  assert( p->nCutCur == 0 );
676 // Frc_ManForEachObj( p, pObj, i )
677 // assert( pObj->iFanout == 0 );
678  return p->nCutMax;
679 }
int nCutMax
Definition: giaForce.c:67
static int Frc_ObjIsCo(Frc_Obj_t *pObj)
Definition: giaForce.c:84
int Frc_ManCrossCut2_rec(Frc_Man_t *p, Frc_Obj_t *pObj)
Definition: giaForce.c:631
int Frc_ManCrossCut_rec(Frc_Man_t *p, Frc_Obj_t *pObj)
Definition: giaForce.c:604
int nCutCur
Definition: giaForce.c:66
static Frc_Obj_t * Frc_ObjFanin(Frc_Obj_t *pObj, int i)
Definition: giaForce.c:93
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
#define Frc_ManForEachObjVec(vVec, p, pObj, i)
Definition: giaForce.c:98
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define Frc_ManForEachObj(p, pObj, i)
Definition: giaForce.c:96
#define assert(ex)
Definition: util_old.h:213
static int Frc_ManCoNum(Frc_Man_t *p)
Definition: giaForce.c:72
int Frc_ManCrossCut2_rec ( Frc_Man_t p,
Frc_Obj_t pObj 
)

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

Synopsis [Computes cross cut size for the given order of POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 631 of file giaForce.c.

632 {
633  assert( pObj->iFanout > 0 );
634  if ( pObj->iFanout-- == pObj->nFanouts )
635  {
636  Frc_Obj_t * pFanin;
637  int i;
638  p->nCutCur++;
639  p->nCutMax = Abc_MaxInt( p->nCutMax, p->nCutCur );
640  if ( !Frc_ObjIsCi(pObj) )
641  Frc_ObjForEachFaninReverse( pObj, pFanin, i )
642  p->nCutCur -= Frc_ManCrossCut2_rec( p, pFanin );
643  }
644  return pObj->iFanout == 0;
645 }
int nCutMax
Definition: giaForce.c:67
int Frc_ManCrossCut2_rec(Frc_Man_t *p, Frc_Obj_t *pObj)
Definition: giaForce.c:631
#define Frc_ObjForEachFaninReverse(pObj, pNext, i)
Definition: giaForce.c:110
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
int nCutCur
Definition: giaForce.c:66
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
static int Frc_ObjIsCi(Frc_Obj_t *pObj)
Definition: giaForce.c:83
#define assert(ex)
Definition: util_old.h:213
int Frc_ManCrossCut_rec ( Frc_Man_t p,
Frc_Obj_t pObj 
)

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

Synopsis [Computes cross cut size for the given order of POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 604 of file giaForce.c.

605 {
606  assert( pObj->iFanout > 0 );
607  if ( pObj->iFanout-- == pObj->nFanouts )
608  {
609  Frc_Obj_t * pFanin;
610  int i;
611  p->nCutCur++;
612  p->nCutMax = Abc_MaxInt( p->nCutMax, p->nCutCur );
613  if ( !Frc_ObjIsCi(pObj) )
614  Frc_ObjForEachFanin( pObj, pFanin, i )
615  p->nCutCur -= Frc_ManCrossCut_rec( p, pFanin );
616  }
617  return pObj->iFanout == 0;
618 }
int nCutMax
Definition: giaForce.c:67
#define Frc_ObjForEachFanin(pObj, pNext, i)
Definition: giaForce.c:108
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
int Frc_ManCrossCut_rec(Frc_Man_t *p, Frc_Obj_t *pObj)
Definition: giaForce.c:604
int nCutCur
Definition: giaForce.c:66
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
static int Frc_ObjIsCi(Frc_Obj_t *pObj)
Definition: giaForce.c:83
#define assert(ex)
Definition: util_old.h:213
void Frc_ManCrossCutTest ( Frc_Man_t p,
Vec_Int_t vOrderInit 
)

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

Synopsis [Computes cross cut size for the given order of POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 714 of file giaForce.c.

715 {
716  Vec_Int_t * vOrder;
717 // abctime clk = Abc_Clock();
718  vOrder = vOrderInit? vOrderInit : Frc_ManCollectCos( p );
719  printf( "CrossCut = %6d\n", Frc_ManCrossCut( p, vOrder, 0 ) );
720  printf( "CrossCut = %6d\n", Frc_ManCrossCut( p, vOrder, 1 ) );
721  Vec_IntReverseOrder( vOrder );
722  printf( "CrossCut = %6d\n", Frc_ManCrossCut( p, vOrder, 0 ) );
723  printf( "CrossCut = %6d\n", Frc_ManCrossCut( p, vOrder, 1 ) );
724  Vec_IntReverseOrder( vOrder );
725  if ( vOrder != vOrderInit )
726  Vec_IntFree( vOrder );
727 // ABC_PRT( "Time", Abc_Clock() - clk );
728 }
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static void Vec_IntReverseOrder(Vec_Int_t *p)
Definition: vecInt.h:1042
Vec_Int_t * Frc_ManCollectCos(Frc_Man_t *p)
Definition: giaForce.c:692
int Frc_ManCrossCut(Frc_Man_t *p, Vec_Int_t *vOrder, int fReverse)
Definition: giaForce.c:658
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static int Frc_ManNodeNum ( Frc_Man_t p)
inlinestatic

Definition at line 76 of file giaForce.c.

76 { return p->nObjs - Vec_IntSize(p->vCis) - Vec_IntSize(p->vCos); }
Vec_Int_t * vCis
Definition: giaForce.c:59
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
Vec_Int_t * vCos
Definition: giaForce.c:60
int nObjs
Definition: giaForce.c:61
static Frc_Obj_t* Frc_ManObj ( Frc_Man_t p,
int  hHandle 
)
inlinestatic

Definition at line 78 of file giaForce.c.

78 { return (Frc_Obj_t *)(p->pObjData + hHandle); }
int * pObjData
Definition: giaForce.c:63
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
static int Frc_ManObjNum ( Frc_Man_t p)
inlinestatic

Definition at line 75 of file giaForce.c.

75 { return p->nObjs; }
int nObjs
Definition: giaForce.c:61
static int Frc_ManPiNum ( Frc_Man_t p)
inlinestatic

Definition at line 73 of file giaForce.c.

73 { return Vec_IntSize(p->vCis) - p->nRegs; }
Vec_Int_t * vCis
Definition: giaForce.c:59
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
int nRegs
Definition: giaForce.c:62
void Frc_ManPlaceDfs ( Frc_Man_t p,
Vec_Int_t vCoOrder 
)

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

Synopsis [Generates DFS placement.]

Description []

SideEffects []

SeeAlso []

Definition at line 823 of file giaForce.c.

824 {
825  Frc_Obj_t * pObj;
826  int i, nPlaces = 0;
827  Frc_ManForEachObj( p, pObj, i )
828  {
829  pObj->iFanout = pObj->nFanouts;
830  if ( pObj->nFanouts == 0 && !Frc_ObjIsCo(pObj) )
831  pObj->pPlace = nPlaces++;
832  }
833  Frc_ManForEachObjVec( vCoOrder, p, pObj, i )
834  {
835  assert( Frc_ObjIsCo(pObj) );
836  Frc_ManPlaceDfs_rec( p, Frc_ObjFanin(pObj,0), &nPlaces );
837  pObj->pPlace = nPlaces++;
838  }
839  assert( nPlaces == p->nObjs );
840 }
static int Frc_ObjIsCo(Frc_Obj_t *pObj)
Definition: giaForce.c:84
void Frc_ManPlaceDfs_rec(Frc_Man_t *p, Frc_Obj_t *pObj, int *piPlace)
Definition: giaForce.c:798
static Frc_Obj_t * Frc_ObjFanin(Frc_Obj_t *pObj, int i)
Definition: giaForce.c:93
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
#define Frc_ManForEachObjVec(vVec, p, pObj, i)
Definition: giaForce.c:98
#define Frc_ManForEachObj(p, pObj, i)
Definition: giaForce.c:96
#define assert(ex)
Definition: util_old.h:213
int nObjs
Definition: giaForce.c:61
void Frc_ManPlaceDfs_rec ( Frc_Man_t p,
Frc_Obj_t pObj,
int *  piPlace 
)

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

Synopsis [Computes cross cut size for the given order of POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 798 of file giaForce.c.

799 {
800  assert( pObj->iFanout > 0 );
801  if ( pObj->iFanout-- == pObj->nFanouts )
802  {
803  Frc_Obj_t * pFanin;
804  int i;
805  if ( !Frc_ObjIsCi(pObj) )
806  Frc_ObjForEachFanin( pObj, pFanin, i )
807  Frc_ManPlaceDfs_rec( p, pFanin, piPlace );
808  pObj->pPlace = (*piPlace)++;
809  }
810 }
#define Frc_ObjForEachFanin(pObj, pNext, i)
Definition: giaForce.c:108
void Frc_ManPlaceDfs_rec(Frc_Man_t *p, Frc_Obj_t *pObj, int *piPlace)
Definition: giaForce.c:798
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
static int Frc_ObjIsCi(Frc_Obj_t *pObj)
Definition: giaForce.c:83
#define assert(ex)
Definition: util_old.h:213
int Frc_ManPlaceDfsBoth ( Frc_Man_t p,
Vec_Int_t vCoOrder,
int *  piCutSize2 
)

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

Synopsis [Generates DFS placement by trying both orders.]

Description [Returns the cross cut size of the best order. ]

SideEffects []

SeeAlso []

Definition at line 853 of file giaForce.c.

854 {
855  int nCutStart1, nCutStart2;
856  nCutStart1 = Frc_ManCrossCut( p, vCoOrder, 0 );
857  Vec_IntReverseOrder( vCoOrder );
858  nCutStart2 = Frc_ManCrossCut( p, vCoOrder, 0 );
859  if ( nCutStart1 <= nCutStart2 )
860  {
861  Vec_IntReverseOrder( vCoOrder ); // undo
862  Frc_ManPlaceDfs( p, vCoOrder );
863  *piCutSize2 = nCutStart2;
864  return nCutStart1;
865  }
866  else
867  {
868  Frc_ManPlaceDfs( p, vCoOrder );
869  Vec_IntReverseOrder( vCoOrder ); // undo
870  *piCutSize2 = nCutStart1;
871  return nCutStart2;
872  }
873 }
static void Vec_IntReverseOrder(Vec_Int_t *p)
Definition: vecInt.h:1042
int Frc_ManCrossCut(Frc_Man_t *p, Vec_Int_t *vOrder, int fReverse)
Definition: giaForce.c:658
void Frc_ManPlaceDfs(Frc_Man_t *p, Vec_Int_t *vCoOrder)
Definition: giaForce.c:823
void Frc_ManPlacementRefine ( Frc_Man_t p,
int  nIters,
int  fVerbose 
)

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

Synopsis [Performs iterative refinement of the given placement.]

Description []

SideEffects []

SeeAlso []

Definition at line 886 of file giaForce.c.

887 {
888  int fRandomize = 0;
889  Vec_Int_t * vCoOrder;
890  Frc_Obj_t * pThis, * pNext;
891  double CostThis, CostPrev;
892  float * pVertX, VertX;
893  int * pPermX, * pHandles;
894  int k, h, Iter, iMinX, iMaxX, Counter, nCutStart, nCutCur, nCutCur2, nCutPrev;
895  abctime clk = Abc_Clock(), clk2, clk2Total = 0;
896  // create starting one-dimensional placement
897  vCoOrder = Frc_ManCollectCos( p );
898  if ( fRandomize )
899  Frc_ManArrayShuffle( vCoOrder );
900  nCutStart = Frc_ManPlaceDfsBoth( p, vCoOrder, &nCutCur2 );
901  // refine placement
902  CostPrev = 0.0;
903  nCutPrev = nCutStart;
904  pHandles = ABC_ALLOC( int, p->nObjs );
905  pVertX = ABC_ALLOC( float, p->nObjs );
906  for ( Iter = 0; Iter < nIters; Iter++ )
907  {
908  // compute centers of hyperedges
909  CostThis = 0.0;
910  Frc_ManForEachObj( p, pThis, h )
911  {
912  iMinX = iMaxX = pThis->pPlace;
913  Frc_ObjForEachFanout( pThis, pNext, k )
914  {
915  iMinX = Abc_MinInt( iMinX, pNext->pPlace );
916  iMaxX = Abc_MaxInt( iMaxX, pNext->pPlace );
917  }
918  pThis->fEdgeCenter = 0.5 * (iMaxX + iMinX);
919  CostThis += (iMaxX - iMinX);
920  }
921  // compute new centers of objects
922  Counter = 0;
923  Frc_ManForEachObj( p, pThis, h )
924  {
925  VertX = pThis->fEdgeCenter;
926  Frc_ObjForEachFanin( pThis, pNext, k )
927  VertX += pNext->fEdgeCenter;
928  pVertX[Counter] = VertX / (Frc_ObjFaninNum(pThis) + 1);
929  pHandles[Counter++] = h;
930  }
931  assert( Counter == Frc_ManObjNum(p) );
932  // sort these numbers
933  clk2 = Abc_Clock();
934  pPermX = Gia_SortFloats( pVertX, pHandles, p->nObjs );
935  clk2Total += Abc_Clock() - clk2;
936  assert( pPermX == pHandles );
937  Vec_IntClear( vCoOrder );
938  for ( k = 0; k < p->nObjs; k++ )
939  {
940  pThis = Frc_ManObj( p, pPermX[k] );
941  pThis->pPlace = k;
942  if ( Frc_ObjIsCo(pThis) )
943  Vec_IntPush( vCoOrder, pThis->hHandle );
944  }
945 /*
946  printf( "Ordering of PIs:\n" );
947  Frc_ManForEachCi( p, pThis, k )
948  printf( "PI number = %7d. Object handle = %7d, Coordinate = %7d.\n",
949  k, pThis->hHandle, pThis->pPlace );
950 */
951  nCutCur = Frc_ManPlaceDfsBoth( p, vCoOrder, &nCutCur2 );
952  // evaluate cost
953  if ( fVerbose )
954  {
955  printf( "%2d : Span = %e ", Iter+1, CostThis );
956  printf( "Cut = %6d (%5.2f %%) CutR = %6d ", nCutCur, 100.0*(nCutStart-nCutCur)/nCutStart, nCutCur2 );
957  ABC_PRTn( "Total", Abc_Clock() - clk );
958  ABC_PRT( "Sort", clk2Total );
959 // Frc_ManCrossCutTest( p, vCoOrder );
960  }
961 // if ( 1.0 * nCutPrev / nCutCur < 1.001 )
962 // break;
963  nCutPrev = nCutCur;
964  }
965  ABC_FREE( pHandles );
966  ABC_FREE( pVertX );
967  Vec_IntFree( vCoOrder );
968 }
#define Frc_ObjForEachFanout(pObj, pNext, i)
Definition: giaForce.c:112
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static Frc_Obj_t * Frc_ManObj(Frc_Man_t *p, int hHandle)
Definition: giaForce.c:78
static int Frc_ObjIsCo(Frc_Obj_t *pObj)
Definition: giaForce.c:84
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
void Frc_ManArrayShuffle(Vec_Int_t *vArray)
Definition: giaForce.c:775
#define Frc_ObjForEachFanin(pObj, pNext, i)
Definition: giaForce.c:108
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
for(p=first;p->value< newval;p=p->next)
int Frc_ManPlaceDfsBoth(Frc_Man_t *p, Vec_Int_t *vCoOrder, int *piCutSize2)
Definition: giaForce.c:853
Vec_Int_t * Frc_ManCollectCos(Frc_Man_t *p)
Definition: giaForce.c:692
static int Abc_MinInt(int a, int b)
Definition: abc_global.h:239
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static int Counter
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define ABC_PRT(a, t)
Definition: abc_global.h:220
#define Frc_ManForEachObj(p, pObj, i)
Definition: giaForce.c:96
int * Gia_SortFloats(float *pArray, int *pPerm, int nSize)
Definition: giaSort.c:251
#define assert(ex)
Definition: util_old.h:213
#define ABC_PRTn(a, t)
Definition: abc_global.h:222
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
ABC_INT64_T abctime
Definition: abc_global.h:278
static int Frc_ObjFaninNum(Frc_Obj_t *pObj)
Definition: giaForce.c:91
int nObjs
Definition: giaForce.c:61
static int Frc_ManObjNum(Frc_Man_t *p)
Definition: giaForce.c:75
void Frc_ManPlaceRandom ( Frc_Man_t p)

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

Synopsis [Generates random placement.]

Description []

SideEffects []

SeeAlso []

Definition at line 743 of file giaForce.c.

744 {
745  Frc_Obj_t * pThis;
746  int * pPlacement;
747  int i, h, Temp, iNext, Counter;
748  pPlacement = ABC_ALLOC( int, p->nObjs );
749  for ( i = 0; i < p->nObjs; i++ )
750  pPlacement[i] = i;
751  for ( i = 0; i < p->nObjs; i++ )
752  {
753  iNext = Gia_ManRandom( 0 ) % p->nObjs;
754  Temp = pPlacement[i];
755  pPlacement[i] = pPlacement[iNext];
756  pPlacement[iNext] = Temp;
757  }
758  Counter = 0;
759  Frc_ManForEachObj( p, pThis, h )
760  pThis->pPlace = pPlacement[Counter++];
761  ABC_FREE( pPlacement );
762 }
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition: giaUtil.c:49
static int Counter
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define Frc_ManForEachObj(p, pObj, i)
Definition: giaForce.c:96
int nObjs
Definition: giaForce.c:61
static int Frc_ManPoNum ( Frc_Man_t p)
inlinestatic

Definition at line 74 of file giaForce.c.

74 { return Vec_IntSize(p->vCos) - p->nRegs; }
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
int nRegs
Definition: giaForce.c:62
Vec_Int_t * vCos
Definition: giaForce.c:60
void Frc_ManPrintStats ( Frc_Man_t p)

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

Synopsis [Creates logic network isomorphic to the given AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 557 of file giaForce.c.

558 {
559 // if ( p->pName )
560 // printf( "%8s : ", p->pName );
561  printf( "i/o =%7d/%7d ", Frc_ManPiNum(p), Frc_ManPoNum(p) );
562  if ( Frc_ManRegNum(p) )
563  printf( "ff =%7d ", Frc_ManRegNum(p) );
564  printf( "node =%8d ", Frc_ManNodeNum(p) );
565  printf( "obj =%8d ", Frc_ManObjNum(p) );
566 // printf( "lev =%5d ", Frc_ManLevelNum(p) );
567 // printf( "cut =%5d ", Frc_ManCrossCut(p) );
568  printf( "mem =%5.2f MB", 4.0*p->nObjData/(1<<20) );
569 // printf( "obj =%5d ", Frc_ManObjNum(p) );
570  printf( "\n" );
571 }
int nObjData
Definition: giaForce.c:64
static int Frc_ManNodeNum(Frc_Man_t *p)
Definition: giaForce.c:76
static int Frc_ManRegNum(Frc_Man_t *p)
Definition: giaForce.c:70
static int Frc_ManPoNum(Frc_Man_t *p)
Definition: giaForce.c:74
static int Frc_ManPiNum(Frc_Man_t *p)
Definition: giaForce.c:73
static int Frc_ManObjNum(Frc_Man_t *p)
Definition: giaForce.c:75
static int Frc_ManRegNum ( Frc_Man_t p)
inlinestatic

Definition at line 70 of file giaForce.c.

70 { return p->nRegs; }
int nRegs
Definition: giaForce.c:62
Frc_Man_t* Frc_ManStart ( Gia_Man_t pGia)

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

Synopsis [Creates logic network isomorphic to the given AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 428 of file giaForce.c.

429 {
430  Frc_Man_t * p;
431  Frc_Obj_t * pObjLog, * pFanLog;
432  Gia_Obj_t * pObj, * pFanin;//, * pObjRi, * pObjRo;
433  Vec_Int_t * vSuper, * vVisit;
434  int nObjs, nFanios, nNodes = 0;
435  int i, k, hHandle = 0;
436  // prepare the AIG
437 // Gia_ManCreateRefs( pGia );
438  Frc_ManCreateRefsSpecial( pGia );
439  Frc_ManTransformRefs( pGia, &nObjs, &nFanios );
440  Gia_ManFillValue( pGia );
441  // create logic network
442  p = ABC_CALLOC( Frc_Man_t, 1 );
443  p->pGia = pGia;
444  p->nRegs = Gia_ManRegNum(pGia);
445  p->vCis = Vec_IntAlloc( Gia_ManCiNum(pGia) );
446  p->vCos = Vec_IntAlloc( Gia_ManCoNum(pGia) );
447  p->nObjData = (sizeof(Frc_Obj_t) / 4) * nObjs + 2 * nFanios;
448  p->pObjData = ABC_CALLOC( int, p->nObjData );
449  // create constant node
450  Gia_ManConst0(pGia)->Value = hHandle;
451  pObjLog = Frc_ManObj( p, hHandle );
452  pObjLog->hHandle = hHandle;
453  pObjLog->nFanins = 0;
454  pObjLog->nFanouts = Gia_ObjRefNum( pGia, Gia_ManConst0(pGia) );
455  // count objects
456  hHandle += Frc_ObjSize( pObjLog );
457  nNodes++;
458  p->nObjs++;
459  // create the PIs
460  Gia_ManForEachCi( pGia, pObj, i )
461  {
462  // create PI object
463  pObj->Value = hHandle;
464  Vec_IntPush( p->vCis, hHandle );
465  pObjLog = Frc_ManObj( p, hHandle );
466  pObjLog->hHandle = hHandle;
467  pObjLog->nFanins = 0;
468  pObjLog->nFanouts = Gia_ObjRefNum( pGia, pObj );
469  pObjLog->fCi = 1;
470  // count objects
471  hHandle += Frc_ObjSize( pObjLog );
472  p->nObjs++;
473  }
474  // create internal nodes
475  vSuper = Vec_IntAlloc( 100 );
476  vVisit = Vec_IntAlloc( 100 );
477  Gia_ManForEachAnd( pGia, pObj, i )
478  {
479  if ( pObj->fMark0 == 0 )
480  {
481  assert( Gia_ObjRefNum( pGia, pObj ) == 0 );
482  continue;
483  }
484  assert( Gia_ObjRefNum( pGia, pObj ) > 0 );
485  Frc_ManCollectSuper( pGia, pObj, vSuper, vVisit );
486  // create node object
487  pObj->Value = hHandle;
488  pObjLog = Frc_ManObj( p, hHandle );
489  pObjLog->hHandle = hHandle;
490  pObjLog->nFanins = Vec_IntSize( vSuper );
491  pObjLog->nFanouts = Gia_ObjRefNum( pGia, pObj );
492  // add fanins
493  Gia_ManForEachObjVec( vSuper, pGia, pFanin, k )
494  {
495  pFanLog = Frc_ManObj( p, Gia_ObjValue(pFanin) );
496  Frc_ObjAddFanin( pObjLog, pFanLog );
497  }
498  // count objects
499  hHandle += Frc_ObjSize( pObjLog );
500  nNodes++;
501  p->nObjs++;
502  }
503  Vec_IntFree( vSuper );
504  Vec_IntFree( vVisit );
505  // create the POs
506  Gia_ManForEachCo( pGia, pObj, i )
507  {
508  // create PO object
509  pObj->Value = hHandle;
510  Vec_IntPush( p->vCos, hHandle );
511  pObjLog = Frc_ManObj( p, hHandle );
512  pObjLog->hHandle = hHandle;
513  pObjLog->nFanins = 1;
514  pObjLog->nFanouts = 0;
515  pObjLog->fCo = 1;
516  // add fanins
517  pFanLog = Frc_ManObj( p, Gia_ObjValue(Gia_ObjFanin0(pObj)) );
518  Frc_ObjAddFanin( pObjLog, pFanLog );
519  // count objects
520  hHandle += Frc_ObjSize( pObjLog );
521  p->nObjs++;
522  }
523  // connect registers
524 // Gia_ManForEachRiRo( pGia, pObjRi, pObjRo, i )
525 // Frc_ObjAddFanin( Frc_ManObj(p,Gia_ObjValue(pObjRo)), Frc_ManObj(p,Gia_ObjValue(pObjRi)) );
526  Gia_ManCleanMark0( pGia );
527  assert( nNodes == Frc_ManNodeNum(p) );
528  assert( nObjs == p->nObjs );
529  assert( hHandle == p->nObjData );
530  if ( hHandle != p->nObjData )
531  printf( "Frc_ManStart(): Fatal error in internal representation.\n" );
532  // make sure the fanin/fanout counters are correct
533  Gia_ManForEachObj( pGia, pObj, i )
534  {
535  if ( !~Gia_ObjValue(pObj) )
536  continue;
537  pObjLog = Frc_ManObj( p, Gia_ObjValue(pObj) );
538  assert( pObjLog->nFanins == pObjLog->iFanin );
539  assert( pObjLog->nFanouts == pObjLog->iFanout );
540  pObjLog->iFanin = pObjLog->iFanout = 0;
541  }
542  ABC_FREE( pGia->pRefs );
543  return p;
544 }
int nObjData
Definition: giaForce.c:64
#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
static Frc_Obj_t * Frc_ManObj(Frc_Man_t *p, int hHandle)
Definition: giaForce.c:78
int * pObjData
Definition: giaForce.c:63
void Gia_ManCleanMark0(Gia_Man_t *p)
Definition: giaUtil.c:215
static int Gia_ObjValue(Gia_Obj_t *pObj)
Definition: gia.h:413
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:521
static int Frc_ManNodeNum(Frc_Man_t *p)
Definition: giaForce.c:76
int * pRefs
Definition: gia.h:114
Definition: gia.h:75
void Frc_ManCollectSuper(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSuper, Vec_Int_t *vVisit)
Definition: giaForce.c:289
#define Gia_ManForEachCi(p, pObj, i)
Definition: gia.h:1016
static int Frc_ObjSize(Frc_Obj_t *pObj)
Definition: giaForce.c:90
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
Gia_Man_t * pGia
Definition: giaForce.c:58
#define Gia_ManForEachAnd(p, pObj, i)
Definition: gia.h:1002
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
void Gia_ManFillValue(Gia_Man_t *p)
Definition: giaUtil.c:328
Vec_Int_t * vCis
Definition: giaForce.c:59
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
Definition: gia.h:988
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
int nRegs
Definition: giaForce.c:62
Vec_Int_t * vCos
Definition: giaForce.c:60
unsigned fMark0
Definition: gia.h:79
#define ABC_FREE(obj)
Definition: abc_global.h:232
void Frc_ManCreateRefsSpecial(Gia_Man_t *p)
Definition: giaForce.c:313
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition: gia.h:984
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
Definition: gia.h:400
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
#define assert(ex)
Definition: util_old.h:213
unsigned Value
Definition: gia.h:87
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
int nObjs
Definition: giaForce.c:61
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
void Frc_ObjAddFanin(Frc_Obj_t *pObj, Frc_Obj_t *pFanin)
FUNCTION DEFINITIONS ///.
Definition: giaForce.c:131
void Frc_ManTransformRefs(Gia_Man_t *p, int *pnObjs, int *pnFanios)
Definition: giaForce.c:359
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
Frc_Man_t* Frc_ManStartSimple ( Gia_Man_t pGia)

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

Synopsis [Creates logic network isomorphic to the given AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 150 of file giaForce.c.

151 {
152  Frc_Man_t * p;
153  Frc_Obj_t * pObjLog, * pFanLog;
154  Gia_Obj_t * pObj;//, * pObjRi, * pObjRo;
155  int i, nNodes, hHandle = 0;
156  // prepare the AIG
157  Gia_ManCreateRefs( pGia );
158  // create logic network
159  p = ABC_CALLOC( Frc_Man_t, 1 );
160  p->pGia = pGia;
161  p->nRegs = Gia_ManRegNum(pGia);
162  p->vCis = Vec_IntAlloc( Gia_ManCiNum(pGia) );
163  p->vCos = Vec_IntAlloc( Gia_ManCoNum(pGia) );
164  p->nObjData = (sizeof(Frc_Obj_t) / 4) * Gia_ManObjNum(pGia) + 2 * (2 * Gia_ManAndNum(pGia) + Gia_ManCoNum(pGia));
165  p->pObjData = ABC_CALLOC( int, p->nObjData );
166  // create constant node
167  Gia_ManConst0(pGia)->Value = hHandle;
168  pObjLog = Frc_ManObj( p, hHandle );
169  pObjLog->hHandle = hHandle;
170  pObjLog->nFanins = 0;
171  pObjLog->nFanouts = Gia_ObjRefNum( pGia, Gia_ManConst0(pGia) );
172  // count objects
173  hHandle += Frc_ObjSize( pObjLog );
174  nNodes = 1;
175  p->nObjs++;
176  // create the PIs
177  Gia_ManForEachCi( pGia, pObj, i )
178  {
179  // create PI object
180  pObj->Value = hHandle;
181  Vec_IntPush( p->vCis, hHandle );
182  pObjLog = Frc_ManObj( p, hHandle );
183  pObjLog->hHandle = hHandle;
184  pObjLog->nFanins = 0;
185  pObjLog->nFanouts = Gia_ObjRefNum( pGia, pObj );
186  pObjLog->fCi = 0;
187  // count objects
188  hHandle += Frc_ObjSize( pObjLog );
189  p->nObjs++;
190  }
191  // create internal nodes
192  Gia_ManForEachAnd( pGia, pObj, i )
193  {
194  assert( Gia_ObjRefNum( pGia, pObj ) > 0 );
195  // create node object
196  pObj->Value = hHandle;
197  pObjLog = Frc_ManObj( p, hHandle );
198  pObjLog->hHandle = hHandle;
199  pObjLog->nFanins = 2;
200  pObjLog->nFanouts = Gia_ObjRefNum( pGia, pObj );
201  // add fanins
202  pFanLog = Frc_ManObj( p, Gia_ObjValue(Gia_ObjFanin0(pObj)) );
203  Frc_ObjAddFanin( pObjLog, pFanLog );
204  pFanLog = Frc_ManObj( p, Gia_ObjValue(Gia_ObjFanin1(pObj)) );
205  Frc_ObjAddFanin( pObjLog, pFanLog );
206  // count objects
207  hHandle += Frc_ObjSize( pObjLog );
208  nNodes++;
209  p->nObjs++;
210  }
211  // create the POs
212  Gia_ManForEachCo( pGia, pObj, i )
213  {
214  // create PO object
215  pObj->Value = hHandle;
216  Vec_IntPush( p->vCos, hHandle );
217  pObjLog = Frc_ManObj( p, hHandle );
218  pObjLog->hHandle = hHandle;
219  pObjLog->nFanins = 1;
220  pObjLog->nFanouts = 0;
221  pObjLog->fCo = 1;
222  // add fanins
223  pFanLog = Frc_ManObj( p, Gia_ObjValue(Gia_ObjFanin0(pObj)) );
224  Frc_ObjAddFanin( pObjLog, pFanLog );
225  // count objects
226  hHandle += Frc_ObjSize( pObjLog );
227  p->nObjs++;
228  }
229  // connect registers
230 // Gia_ManForEachRiRo( pGia, pObjRi, pObjRo, i )
231 // Frc_ObjAddFanin( Frc_ManObj(p,Gia_ObjValue(pObjRo)), Frc_ManObj(p,Gia_ObjValue(pObjRi)) );
232  assert( nNodes == Frc_ManNodeNum(p) );
233  assert( hHandle == p->nObjData );
234  if ( hHandle != p->nObjData )
235  printf( "Frc_ManStartSimple(): Fatal error in internal representation.\n" );
236  // make sure the fanin/fanout counters are correct
237  Gia_ManForEachObj( pGia, pObj, i )
238  {
239  if ( !~Gia_ObjValue(pObj) )
240  continue;
241  pObjLog = Frc_ManObj( p, Gia_ObjValue(pObj) );
242  assert( pObjLog->nFanins == pObjLog->iFanin );
243  assert( pObjLog->nFanouts == pObjLog->iFanout );
244  pObjLog->iFanin = pObjLog->iFanout = 0;
245  }
246  ABC_FREE( pGia->pRefs );
247  return p;
248 }
void Gia_ManCreateRefs(Gia_Man_t *p)
Definition: giaUtil.c:715
int nObjData
Definition: giaForce.c:64
#define Gia_ManForEachCo(p, pObj, i)
Definition: gia.h:1022
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Frc_Obj_t * Frc_ManObj(Frc_Man_t *p, int hHandle)
Definition: giaForce.c:78
int * pObjData
Definition: giaForce.c:63
static int Gia_ObjValue(Gia_Obj_t *pObj)
Definition: gia.h:413
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:521
static int Frc_ManNodeNum(Frc_Man_t *p)
Definition: giaForce.c:76
int * pRefs
Definition: gia.h:114
Definition: gia.h:75
#define Gia_ManForEachCi(p, pObj, i)
Definition: gia.h:1016
static int Gia_ManAndNum(Gia_Man_t *p)
Definition: gia.h:389
static int Frc_ObjSize(Frc_Obj_t *pObj)
Definition: giaForce.c:90
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
Gia_Man_t * pGia
Definition: giaForce.c:58
#define Gia_ManForEachAnd(p, pObj, i)
Definition: gia.h:1002
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
Vec_Int_t * vCis
Definition: giaForce.c:59
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
int nRegs
Definition: giaForce.c:62
Vec_Int_t * vCos
Definition: giaForce.c:60
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition: gia.h:984
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
Definition: gia.h:400
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
#define assert(ex)
Definition: util_old.h:213
unsigned Value
Definition: gia.h:87
int nObjs
Definition: giaForce.c:61
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
void Frc_ObjAddFanin(Frc_Obj_t *pObj, Frc_Obj_t *pFanin)
FUNCTION DEFINITIONS ///.
Definition: giaForce.c:131
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
void Frc_ManStop ( Frc_Man_t p)

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

Synopsis [Creates logic network isomorphic to the given AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 584 of file giaForce.c.

585 {
586  Vec_IntFree( p->vCis );
587  Vec_IntFree( p->vCos );
588  ABC_FREE( p->pObjData );
589  ABC_FREE( p );
590 }
int * pObjData
Definition: giaForce.c:63
Vec_Int_t * vCis
Definition: giaForce.c:59
Vec_Int_t * vCos
Definition: giaForce.c:60
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
void Frc_ManTransformRefs ( Gia_Man_t p,
int *  pnObjs,
int *  pnFanios 
)

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

Synopsis [Assigns references while removing the MUX/XOR ones.]

Description []

SideEffects []

SeeAlso []

Definition at line 359 of file giaForce.c.

360 {
361  Vec_Int_t * vSuper, * vVisit;
362  Gia_Obj_t * pObj, * pFanin;
363  int i, k, Counter;
364  assert( p->pRefs != NULL );
365 
366  // mark nodes to be used in the logic network
367  Gia_ManCleanMark0( p );
368  Gia_ManConst0(p)->fMark0 = 1;
369  // mark the inputs
370  Gia_ManForEachCi( p, pObj, i )
371  pObj->fMark0 = 1;
372  // mark those nodes that have ref count more than 1
373  Gia_ManForEachAnd( p, pObj, i )
374  pObj->fMark0 = (Gia_ObjRefNum(p, pObj) > 1);
375  // mark the output drivers
376  Gia_ManForEachCoDriver( p, pObj, i )
377  pObj->fMark0 = 1;
378 
379  // count the number of nodes
380  Counter = 0;
381  Gia_ManForEachObj( p, pObj, i )
382  Counter += pObj->fMark0;
383  *pnObjs = Counter + Gia_ManCoNum(p);
384 
385  // reset the references
386  ABC_FREE( p->pRefs );
387  p->pRefs = ABC_CALLOC( int, Gia_ManObjNum(p) );
388  // reference from internal nodes
389  Counter = 0;
390  vSuper = Vec_IntAlloc( 100 );
391  vVisit = Vec_IntAlloc( 100 );
392  Gia_ManCleanMark1( p );
393  Gia_ManForEachAnd( p, pObj, i )
394  {
395  if ( pObj->fMark0 == 0 )
396  continue;
397  Frc_ManCollectSuper( p, pObj, vSuper, vVisit );
398  Gia_ManForEachObjVec( vSuper, p, pFanin, k )
399  {
400  assert( pFanin->fMark0 );
401  Gia_ObjRefInc( p, pFanin );
402  }
403  Counter += Vec_IntSize( vSuper );
404  }
405  Gia_ManCheckMark1( p );
406  Vec_IntFree( vSuper );
407  Vec_IntFree( vVisit );
408  // reference from outputs
409  Gia_ManForEachCoDriver( p, pObj, i )
410  {
411  assert( pObj->fMark0 );
412  Gia_ObjRefInc( p, pObj );
413  }
414  *pnFanios = Counter + Gia_ManCoNum(p);
415 }
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
void Gia_ManCleanMark0(Gia_Man_t *p)
Definition: giaUtil.c:215
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:521
#define Gia_ManForEachCoDriver(p, pObj, i)
Definition: gia.h:1030
int * pRefs
Definition: gia.h:114
Definition: gia.h:75
void Gia_ManCleanMark1(Gia_Man_t *p)
Definition: giaUtil.c:272
void Frc_ManCollectSuper(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSuper, Vec_Int_t *vVisit)
Definition: giaForce.c:289
#define Gia_ManForEachCi(p, pObj, i)
Definition: gia.h:1016
void Gia_ManCheckMark1(Gia_Man_t *p)
Definition: giaUtil.c:291
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Gia_ObjRefInc(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:522
#define Gia_ManForEachAnd(p, pObj, i)
Definition: gia.h:1002
static int Counter
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
Definition: gia.h:988
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
unsigned fMark0
Definition: gia.h:79
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition: gia.h:984
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
Definition: gia.h:400
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
void Frc_ObjAddFanin ( Frc_Obj_t pObj,
Frc_Obj_t pFanin 
)

FUNCTION DEFINITIONS ///.

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

Synopsis [Creates fanin/fanout pair.]

Description []

SideEffects []

SeeAlso []

Definition at line 131 of file giaForce.c.

132 {
133  assert( pObj->iFanin < pObj->nFanins );
134  assert( pFanin->iFanout < pFanin->nFanouts );
135  pFanin->Fanios[pFanin->nFanins + pFanin->iFanout++] =
136  pObj->Fanios[pObj->iFanin++] = pObj->hHandle - pFanin->hHandle;
137 }
#define assert(ex)
Definition: util_old.h:213
static Frc_Obj_t* Frc_ObjFanin ( Frc_Obj_t pObj,
int  i 
)
inlinestatic

Definition at line 93 of file giaForce.c.

93 { return (Frc_Obj_t *)(((int *)pObj) - pObj->Fanios[i]); }
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
static int Frc_ObjFaninNum ( Frc_Obj_t pObj)
inlinestatic

Definition at line 91 of file giaForce.c.

91 { return pObj->nFanins; }
static Frc_Obj_t* Frc_ObjFanout ( Frc_Obj_t pObj,
int  i 
)
inlinestatic

Definition at line 94 of file giaForce.c.

94 { return (Frc_Obj_t *)(((int *)pObj) + pObj->Fanios[pObj->nFanins+i]); }
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
static int Frc_ObjFanoutNum ( Frc_Obj_t pObj)
inlinestatic

Definition at line 92 of file giaForce.c.

92 { return pObj->nFanouts; }
int Frc_ObjFanoutsAreCos ( Frc_Obj_t pThis)

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

Synopsis [Returns 1 if all fanouts are COsw.]

Description []

SideEffects []

SeeAlso []

Definition at line 981 of file giaForce.c.

982 {
983  Frc_Obj_t * pNext;
984  int i;
985  Frc_ObjForEachFanout( pThis, pNext, i )
986  if ( !Frc_ObjIsCo(pNext) )
987  return 0;
988  return 1;
989 }
#define Frc_ObjForEachFanout(pObj, pNext, i)
Definition: giaForce.c:112
static int Frc_ObjIsCo(Frc_Obj_t *pObj)
Definition: giaForce.c:84
if(last==0)
Definition: sparse_int.h:34
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36
static int Frc_ObjIsCi ( Frc_Obj_t pObj)
inlinestatic

Definition at line 83 of file giaForce.c.

83 { return pObj->fCi; }
static int Frc_ObjIsCo ( Frc_Obj_t pObj)
inlinestatic

Definition at line 84 of file giaForce.c.

84 { return pObj->fCo; }
static int Frc_ObjIsConst0 ( Frc_Obj_t pObj)
inlinestatic

Definition at line 88 of file giaForce.c.

88 { return!Frc_ObjIsTerm(pObj) && pObj->nFanins == 0; }
static int Frc_ObjIsTerm(Frc_Obj_t *pObj)
Definition: giaForce.c:82
static int Frc_ObjIsNode ( Frc_Obj_t pObj)
inlinestatic

Definition at line 87 of file giaForce.c.

87 { return!Frc_ObjIsTerm(pObj) && pObj->nFanins > 0; }
static int Frc_ObjIsTerm(Frc_Obj_t *pObj)
Definition: giaForce.c:82
static int Frc_ObjIsPi ( Frc_Obj_t pObj)
inlinestatic

Definition at line 85 of file giaForce.c.

85 { return pObj->fCi && pObj->nFanins == 0; }
static int Frc_ObjIsPo ( Frc_Obj_t pObj)
inlinestatic

Definition at line 86 of file giaForce.c.

86 { return pObj->fCo && pObj->nFanouts == 0; }
static int Frc_ObjIsTerm ( Frc_Obj_t pObj)
inlinestatic

Definition at line 82 of file giaForce.c.

82 { return pObj->fCi || pObj->fCo; }
static int Frc_ObjSize ( Frc_Obj_t pObj)
inlinestatic

Definition at line 90 of file giaForce.c.

90 { return sizeof(Frc_Obj_t) / 4 + pObj->nFanins + pObj->nFanouts; }
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition: giaForce.c:36