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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Dch_DeriveTotalAig_rec (Aig_Man_t *p, Aig_Obj_t *pObj)
 DECLARATIONS ///. More...
 
Aig_Man_tDch_DeriveTotalAig (Vec_Ptr_t *vAigs)
 MACRO DEFINITIONS ///. More...
 

Function Documentation

Aig_Man_t* Dch_DeriveTotalAig ( Vec_Ptr_t vAigs)

MACRO DEFINITIONS ///.

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

Synopsis [Derives the cumulative AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 65 of file dchAig.c.

66 {
67  Aig_Man_t * pAig, * pAig2, * pAigTotal;
68  Aig_Obj_t * pObj, * pObjPi, * pObjPo;
69  int i, k, nNodes;
70  assert( Vec_PtrSize(vAigs) > 0 );
71  // make sure they have the same number of PIs/POs
72  nNodes = 0;
73  pAig = (Aig_Man_t *)Vec_PtrEntry( vAigs, 0 );
74  Vec_PtrForEachEntry( Aig_Man_t *, vAigs, pAig2, i )
75  {
76  assert( Aig_ManCiNum(pAig) == Aig_ManCiNum(pAig2) );
77  assert( Aig_ManCoNum(pAig) == Aig_ManCoNum(pAig2) );
78  nNodes += Aig_ManNodeNum(pAig2);
79  Aig_ManCleanData( pAig2 );
80  }
81  // map constant nodes
82  pAigTotal = Aig_ManStart( nNodes );
83  Vec_PtrForEachEntry( Aig_Man_t *, vAigs, pAig2, k )
84  Aig_ManConst1(pAig2)->pData = Aig_ManConst1(pAigTotal);
85  // map primary inputs
86  Aig_ManForEachCi( pAig, pObj, i )
87  {
88  pObjPi = Aig_ObjCreateCi( pAigTotal );
89  Vec_PtrForEachEntry( Aig_Man_t *, vAigs, pAig2, k )
90  Aig_ManCi( pAig2, i )->pData = pObjPi;
91  }
92  // construct the AIG in the order of POs
93  Aig_ManForEachCo( pAig, pObj, i )
94  {
95  Vec_PtrForEachEntry( Aig_Man_t *, vAigs, pAig2, k )
96  {
97  pObjPo = Aig_ManCo( pAig2, i );
98  Dch_DeriveTotalAig_rec( pAigTotal, Aig_ObjFanin0(pObjPo) );
99  }
100  Aig_ObjCreateCo( pAigTotal, Aig_ObjChild0Copy(pObj) );
101  }
102 /*
103  // mark the cone of the first AIG
104  Aig_ManIncrementTravId( pAigTotal );
105  Aig_ManForEachObj( pAig, pObj, i )
106  if ( pObj->pData )
107  Aig_ObjSetTravIdCurrent( pAigTotal, pObj->pData );
108 */
109  // cleanup should not be done
110  return pAigTotal;
111 }
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition: aigObj.c:66
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition: aigMan.c:47
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
#define Aig_ManForEachCo(p, pObj, i)
Definition: aig.h:398
ABC_NAMESPACE_IMPL_START void Dch_DeriveTotalAig_rec(Aig_Man_t *p, Aig_Obj_t *pObj)
DECLARATIONS ///.
Definition: dchAig.c:45
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
static Aig_Obj_t * Aig_ManCi(Aig_Man_t *p, int i)
Definition: aig.h:266
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
Definition: aig.h:69
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
Definition: aig.h:312
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
Definition: aig.h:267
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void Aig_ManCleanData(Aig_Man_t *p)
Definition: aigUtil.c:205
ABC_NAMESPACE_IMPL_START void Dch_DeriveTotalAig_rec ( Aig_Man_t p,
Aig_Obj_t pObj 
)

DECLARATIONS ///.

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

FileName [dchAig.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Choice computation for tech-mapping.]

Synopsis [AIG manipulation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 29, 2008.]

Revision [

Id:
dchAig.c,v 1.00 2008/07/29 00:00:00 alanmi Exp

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

Synopsis [Derives the cumulative AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file dchAig.c.

46 {
47  if ( pObj->pData )
48  return;
51  pObj->pData = Aig_And( p, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
52 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void * pData
Definition: aig.h:87
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
Definition: aig.h:309
ABC_NAMESPACE_IMPL_START void Dch_DeriveTotalAig_rec(Aig_Man_t *p, Aig_Obj_t *pObj)
DECLARATIONS ///.
Definition: dchAig.c:45
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
Definition: aig.h:313
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
Definition: aig.h:312