abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcPlace.c File Reference

Go to the source code of this file.

Functions

static void Abc_PlaceCreateCell (Abc_Obj_t *pObj, int fAnd)
 FUNCTION DEFINITIONS ///. More...
 
static void Abc_PlaceUpdateNet (Abc_Obj_t *pObj)
 
float Abc_PlaceEvaluateCut (Abc_Obj_t *pRoot, Vec_Ptr_t *vFanins)
 
void Abc_PlaceUpdate (Vec_Ptr_t *vAddedCells, Vec_Ptr_t *vUpdatedNets)
 
void Abc_PlaceBegin (Abc_Ntk_t *pNtk)
 
void Abc_PlaceEnd (Abc_Ntk_t *pNtk)
 

Variables

ABC_NAMESPACE_IMPL_START
AbstractCell
abstractCells = NULL
 DECLARATIONS ///. More...
 
ConcreteCellcells = NULL
 
ConcreteNetnets = NULL
 
int nAllocSize = 0
 

Function Documentation

void Abc_PlaceBegin ( Abc_Ntk_t pNtk)

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

Synopsis [This procedure is called before the writing start.]

Description []

SideEffects []

SeeAlso []

Definition at line 178 of file abcPlace.c.

179 {
180  Abc_Obj_t * pObj;
181  int i;
182 
183  // allocate and clean internal storage
184  nAllocSize = 5 * Abc_NtkObjNumMax(pNtk);
187  memset( cells, 0, sizeof(ConcreteCell) * nAllocSize );
188  memset( nets, 0, sizeof(ConcreteNet) * nAllocSize );
189 
190  // create AbstractCells
191  // 1: pad
192  // 2: and
193  if (!abstractCells)
195 
196  abstractCells[0].m_height = 1.0;
197  abstractCells[0].m_width = 1.0;
198  abstractCells[0].m_label = "pio";
199  abstractCells[0].m_pad = 1;
200 
201  abstractCells[1].m_height = 1.0;
202  abstractCells[1].m_width = 1.0;
203  abstractCells[1].m_label = "and";
204  abstractCells[1].m_pad = 0;
205 
206  // input pads
207  Abc_NtkForEachCi( pNtk, pObj, i )
208  Abc_PlaceCreateCell( pObj, 0 );
209 
210  // ouput pads
211  Abc_NtkForEachCo( pNtk, pObj, i )
212  Abc_PlaceCreateCell( pObj, 0 );
213 
214  // AND nodes
215  Abc_AigForEachAnd( pNtk, pObj, i )
216  Abc_PlaceCreateCell( pObj, 1 );
217 
218  // all nets
219  Abc_NtkForEachObj( pNtk, pObj, i )
220  {
221  if ( !Abc_ObjIsCi(pObj) && !Abc_ObjIsNode(pObj) )
222  continue;
223  Abc_PlaceUpdateNet( pObj );
224  }
225 
226  globalPreplace((float)0.8);
227  globalPlace();
228 }
char * memset()
ConcreteCell * cells
Definition: abcPlace.c:34
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
Definition: abc.h:351
void globalPlace()
Performs analytic placement using a GORDIAN-like algorithm.
Definition: place_gordian.c:39
static int Abc_NtkObjNumMax(Abc_Ntk_t *pNtk)
Definition: abc.h:284
float m_width
Definition: place_base.h:45
ABC_NAMESPACE_IMPL_START AbstractCell * abstractCells
DECLARATIONS ///.
Definition: abcPlace.c:33
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
ConcreteNet * nets
Definition: abcPlace.c:35
#define Abc_AigForEachAnd(pNtk, pNode, i)
Definition: abc.h:485
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
#define ALLOC(type, num)
Definition: avl.h:27
float m_height
Definition: place_base.h:45
void globalPreplace(float utilization)
Place pad ring, leaving a core area to meet a desired utilization.
Definition: place_pads.c:31
#define REALLOC(type, obj, num)
Definition: avl.h:29
char * m_label
Definition: place_base.h:43
static void Abc_PlaceCreateCell(Abc_Obj_t *pObj, int fAnd)
FUNCTION DEFINITIONS ///.
Definition: abcPlace.c:53
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition: abc.h:446
static void Abc_PlaceUpdateNet(Abc_Obj_t *pObj)
Definition: abcPlace.c:75
int nAllocSize
Definition: abcPlace.c:36
static void Abc_PlaceCreateCell ( Abc_Obj_t pObj,
int  fAnd 
)
inlinestatic

FUNCTION DEFINITIONS ///.

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

Synopsis [Creates a new cell.]

Description []

SideEffects []

SeeAlso []

Definition at line 53 of file abcPlace.c.

54 {
55  assert( cells[pObj->Id].m_id == 0 );
56 
57  cells[pObj->Id].m_id = pObj->Id;
58  cells[pObj->Id].m_label = "";
59  cells[pObj->Id].m_parent = &(abstractCells[fAnd]);
60  cells[pObj->Id].m_fixed = 0;
61  addConcreteCell(&(cells[pObj->Id]));
62 }
AbstractCell * m_parent
Definition: place_base.h:57
ConcreteCell * cells
Definition: abcPlace.c:34
ABC_NAMESPACE_IMPL_START AbstractCell * abstractCells
DECLARATIONS ///.
Definition: abcPlace.c:33
char * m_label
Definition: place_base.h:55
bool m_fixed
Definition: place_base.h:59
void addConcreteCell(ConcreteCell *cell)
Definition: place_base.c:155
int Id
Definition: abc.h:132
#define assert(ex)
Definition: util_old.h:213
void Abc_PlaceEnd ( Abc_Ntk_t pNtk)

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

Synopsis [This procedure is called after the writing completes.]

Description []

SideEffects []

SeeAlso []

Definition at line 241 of file abcPlace.c.

242 {
243  int i;
244 
245 
246  // clean up
247  for ( i = 0; i < nAllocSize; i++ )
248  FREE( nets[i].m_terms );
249  FREE( abstractCells );
250  FREE( cells );
251  FREE( nets );
252 }
ConcreteCell * cells
Definition: abcPlace.c:34
ABC_NAMESPACE_IMPL_START AbstractCell * abstractCells
DECLARATIONS ///.
Definition: abcPlace.c:33
ConcreteNet * nets
Definition: abcPlace.c:35
#define FREE(obj)
Definition: avl.h:31
int nAllocSize
Definition: abcPlace.c:36
float Abc_PlaceEvaluateCut ( Abc_Obj_t pRoot,
Vec_Ptr_t vFanins 
)

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

Synopsis [Returns the placement cost of the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 103 of file abcPlace.c.

104 {
105  Abc_Obj_t * pObj;
106 // double x, y;
107  int i;
108  Vec_PtrForEachEntry( Abc_Obj_t *, vFanins, pObj, i )
109  {
110 // pObj->Id
111  }
112  return 0.0;
113 }
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void Abc_PlaceUpdate ( Vec_Ptr_t vAddedCells,
Vec_Ptr_t vUpdatedNets 
)

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

Synopsis [Updates placement after one step of rewriting.]

Description []

SideEffects []

SeeAlso []

Definition at line 126 of file abcPlace.c.

127 {
128  Abc_Obj_t * pObj, * pFanin;
129  int i, k;
130  Vec_Ptr_t * vCells, * vNets;
131 
132  // start the arrays of new cells and nets
133  vCells = Vec_PtrAlloc( 16 );
134  vNets = Vec_PtrAlloc( 32 );
135 
136  // go through the new nodes
137  Vec_PtrForEachEntry( Abc_Obj_t *, vAddedCells, pObj, i )
138  {
139  assert( !Abc_ObjIsComplement(pObj) );
140  Abc_PlaceCreateCell( pObj, 1 );
141  Abc_PlaceUpdateNet( pObj );
142 
143  // add the new cell and its fanin nets to temporary storage
144  Vec_PtrPush( vCells, &(cells[pObj->Id]) );
145  Abc_ObjForEachFanin( pObj, pFanin, k )
146  Vec_PtrPushUnique( vNets, &(nets[pFanin->Id]) );
147  }
148 
149  // go through the modified nets
150  Vec_PtrForEachEntry( Abc_Obj_t *, vUpdatedNets, pObj, i )
151  {
152  assert( !Abc_ObjIsComplement(pObj) );
153  if ( Abc_ObjType(pObj) == ABC_OBJ_NONE ) // dead node
154  continue;
155  Abc_PlaceUpdateNet( pObj );
156  }
157 
158  // update the placement
159 // fastPlace( Vec_PtrSize(vCells), (ConcreteCell **)Vec_PtrArray(vCells),
160 // Vec_PtrSize(vNets), (ConcreteNet **)Vec_PtrArray(vNets) );
161 
162  // clean up
163  Vec_PtrFree( vCells );
164  Vec_PtrFree( vNets );
165 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
ConcreteCell * cells
Definition: abcPlace.c:34
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:656
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
ConcreteNet * nets
Definition: abcPlace.c:35
static unsigned Abc_ObjType(Abc_Obj_t *pObj)
Definition: abc.h:328
static void Abc_PlaceCreateCell(Abc_Obj_t *pObj, int fAnd)
FUNCTION DEFINITIONS ///.
Definition: abcPlace.c:53
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
int Id
Definition: abc.h:132
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static int Abc_ObjIsComplement(Abc_Obj_t *p)
Definition: abc.h:322
static void Abc_PlaceUpdateNet(Abc_Obj_t *pObj)
Definition: abcPlace.c:75
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
static void Abc_PlaceUpdateNet ( Abc_Obj_t pObj)
inlinestatic

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

Synopsis [Updates the net.]

Description []

SideEffects []

SeeAlso []

Definition at line 75 of file abcPlace.c.

76 {
77  Abc_Obj_t * pFanout;
78  int k;
79  // free the old array of net terminals
80  if ( nets[pObj->Id].m_terms )
81  free( nets[pObj->Id].m_terms );
82  // fill in the net with the new information
83  nets[pObj->Id].m_id = pObj->Id;
84  nets[pObj->Id].m_weight = 1.0;
85  nets[pObj->Id].m_numTerms = Abc_ObjFanoutNum(pObj); //fanout
87  Abc_ObjForEachFanout( pObj, pFanout, k )
88  nets[pObj->Id].m_terms[k] = &(cells[pFanout->Id]);
89  addConcreteNet(&(nets[pObj->Id]));
90 }
VOID_HACK free()
ConcreteCell * cells
Definition: abcPlace.c:34
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
void addConcreteNet(ConcreteNet *net)
Adds a net to the placement database.
Definition: place_base.c:114
float m_weight
Definition: place_base.h:74
ConcreteNet * nets
Definition: abcPlace.c:35
ConcreteCell ** m_terms
Definition: place_base.h:72
#define ALLOC(type, num)
Definition: avl.h:27
int m_numTerms
Definition: place_base.h:71
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
int Id
Definition: abc.h:132

Variable Documentation

ABC_NAMESPACE_IMPL_START AbstractCell* abstractCells = NULL

DECLARATIONS ///.

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

FileName [abcPlace.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Interface with a placer.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 33 of file abcPlace.c.

ConcreteCell* cells = NULL

Definition at line 34 of file abcPlace.c.

int nAllocSize = 0

Definition at line 36 of file abcPlace.c.

ConcreteNet* nets = NULL

Definition at line 35 of file abcPlace.c.