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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Vec_Int_t
Llb_AigMap (Aig_Man_t *pAig, int nLutSize, int nLutMin)
 DECLARATIONS ///. More...
 

Function Documentation

ABC_NAMESPACE_IMPL_START Vec_Int_t* Llb_AigMap ( Aig_Man_t pAig,
int  nLutSize,
int  nLutMin 
)

DECLARATIONS ///.

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

FileName [llb2Map.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD based reachability.]

Synopsis [Non-linear quantification scheduling.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Returns internal nodes used in the mapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 47 of file llb4Map.c.

48 {
49  extern Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan );
50  extern If_Man_t * Abc_NtkToIf( Abc_Ntk_t * pNtk, If_Par_t * pPars );
51  extern void Gia_ManSetIfParsDefault( void * pPars );
52  If_Par_t Pars, * pPars = &Pars;
53  If_Man_t * pIfMan;
54  If_Obj_t * pAnd;
55  Abc_Ntk_t * pNtk;
56  Abc_Obj_t * pNode;
57  Vec_Int_t * vNodes;
58  Aig_Obj_t * pObj;
59  int i;
60 
61  // create ABC network
62  pNtk = Abc_NtkFromAigPhase( pAig );
63  assert( Abc_NtkIsStrash(pNtk) );
64 
65  // derive mapping parameters
66  Gia_ManSetIfParsDefault( pPars );
67  pPars->nLutSize = nLutSize;
68 
69  // get timing information
70  pPars->pTimesArr = Abc_NtkGetCiArrivalFloats(pNtk);
72 
73  // perform LUT mapping
74  pIfMan = Abc_NtkToIf( pNtk, pPars );
75  if ( pIfMan == NULL )
76  {
77  Abc_NtkDelete( pNtk );
78  return NULL;
79  }
80  if ( !If_ManPerformMapping( pIfMan ) )
81  {
82  Abc_NtkDelete( pNtk );
83  If_ManStop( pIfMan );
84  return NULL;
85  }
86 
87  // mark nodes in the AIG used in the mapping
88  Aig_ManCleanMarkA( pAig );
89  Aig_ManForEachNode( pAig, pObj, i )
90  {
91  pNode = (Abc_Obj_t *)pObj->pData;
92  if ( pNode == NULL )
93  continue;
94  pAnd = (If_Obj_t *)pNode->pCopy;
95  if ( pAnd == NULL )
96  continue;
97  if ( pAnd->nRefs > 0 && (int)If_ObjCutBest(pAnd)->nLeaves >= nLutMin )
98  pObj->fMarkA = 1;
99  }
100  Abc_NtkDelete( pNtk );
101  If_ManStop( pIfMan );
102 
103  // unmark flop drivers
104  Saig_ManForEachLi( pAig, pObj, i )
105  Aig_ObjFanin0(pObj)->fMarkA = 0;
106 
107  // collect mapping
108  vNodes = Vec_IntAlloc( 100 );
109  Aig_ManForEachNode( pAig, pObj, i )
110  if ( pObj->fMarkA )
111  Vec_IntPush( vNodes, Aig_ObjId(pObj) );
112  Aig_ManCleanMarkA( pAig );
113  return vNodes;
114 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
unsigned nLeaves
Definition: if.h:289
int nLutSize
Definition: if.h:103
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
Definition: if.h:100
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
Definition: if.h:303
void * pData
Definition: aig.h:87
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
ABC_DLL float * Abc_NtkGetCoRequiredFloats(Abc_Ntk_t *pNtk)
Definition: abcTiming.c:676
unsigned int fMarkA
Definition: aig.h:79
static If_Cut_t * If_ObjCutBest(If_Obj_t *pObj)
Definition: if.h:401
int nRefs
Definition: if.h:318
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
void Gia_ManSetIfParsDefault(void *pIfPars)
FUNCTION DEFINITIONS ///.
Definition: giaIf.c:57
Abc_Obj_t * pCopy
Definition: abc.h:148
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
ABC_NAMESPACE_IMPL_START If_Man_t * Abc_NtkToIf(Abc_Ntk_t *pNtk, If_Par_t *pPars)
DECLARATIONS ///.
Definition: abcIf.c:188
#define Saig_ManForEachLi(p, pObj, i)
Definition: saig.h:98
Definition: if.h:180
if(last==0)
Definition: sparse_int.h:34
float * pTimesArr
Definition: if.h:161
Definition: aig.h:69
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
float * pTimesReq
Definition: if.h:162
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
ABC_DLL float * Abc_NtkGetCiArrivalFloats(Abc_Ntk_t *pNtk)
Definition: abcTiming.c:658
int If_ManPerformMapping(If_Man_t *p)
Definition: ifCore.c:80
void Aig_ManCleanMarkA(Aig_Man_t *p)
Definition: aigUtil.c:148
static int Aig_ObjId(Aig_Obj_t *pObj)
Definition: aig.h:286
#define assert(ex)
Definition: util_old.h:213
void If_ManStop(If_Man_t *p)
Definition: ifMan.c:205