src/base/abci/abcPlace.c File Reference

#include "abc.h"
#include "place_base.h"
Include dependency graph for abcPlace.c:

Go to the source code of this file.

Functions

static void Abc_PlaceCreateCell (Abc_Obj_t *pObj, int fAnd)
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

AbstractCell * abstractCells = NULL
ConcreteCell * cells = NULL
ConcreteNet * nets = 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 175 of file abcPlace.c.

00176 {
00177     Abc_Obj_t * pObj;
00178     int i;
00179 
00180     // allocate and clean internal storage
00181     nAllocSize = 5 * Abc_NtkObjNumMax(pNtk);
00182     cells = REALLOC(ConcreteCell, cells, nAllocSize);
00183     nets  = REALLOC(ConcreteNet, nets, nAllocSize);
00184     memset( cells, 0, sizeof(ConcreteCell) * nAllocSize );
00185     memset( nets, 0, sizeof(ConcreteNet) * nAllocSize );
00186 
00187     // create AbstractCells
00188     //   1: pad
00189     //   2: and
00190     if (!abstractCells)
00191         abstractCells = ALLOC(AbstractCell,2);
00192 
00193     abstractCells[0].m_height = 1.0;
00194     abstractCells[0].m_width = 1.0;
00195     abstractCells[0].m_label = "pio";
00196     abstractCells[0].m_pad = 1;
00197 
00198     abstractCells[1].m_height = 1.0;
00199     abstractCells[1].m_width = 1.0;
00200     abstractCells[1].m_label = "and";
00201     abstractCells[1].m_pad = 0;
00202 
00203     // input pads
00204     Abc_NtkForEachCi( pNtk, pObj, i )
00205         Abc_PlaceCreateCell( pObj, 0 );
00206 
00207     // ouput pads
00208     Abc_NtkForEachCo( pNtk, pObj, i )
00209         Abc_PlaceCreateCell( pObj, 0 );
00210 
00211     // AND nodes
00212     Abc_AigForEachAnd( pNtk, pObj, i )
00213         Abc_PlaceCreateCell( pObj, 1 );
00214 
00215     // all nets
00216     Abc_NtkForEachObj( pNtk, pObj, i )
00217     {
00218         if ( !Abc_ObjIsCi(pObj) && !Abc_ObjIsNode(pObj) )
00219             continue;
00220         Abc_PlaceUpdateNet( pObj );
00221     }
00222 
00223     globalPreplace((float)0.8);
00224     globalPlace();
00225 }

static void Abc_PlaceCreateCell ( Abc_Obj_t pObj,
int  fAnd 
) [inline, static]

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

Synopsis [Creates a new cell.]

Description []

SideEffects []

SeeAlso []

Definition at line 50 of file abcPlace.c.

00051 {
00052     assert( cells[pObj->Id].m_id == 0 );
00053 
00054     cells[pObj->Id].m_id = pObj->Id;
00055     cells[pObj->Id].m_label = "";
00056     cells[pObj->Id].m_parent = &(abstractCells[fAnd]);
00057     cells[pObj->Id].m_fixed = 0;
00058     addConcreteCell(&(cells[pObj->Id]));
00059 }

void Abc_PlaceEnd ( Abc_Ntk_t pNtk  ) 

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

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

Description []

SideEffects []

SeeAlso []

Definition at line 238 of file abcPlace.c.

00239 {
00240     int i;
00241 
00242 
00243     // clean up
00244     for ( i = 0; i < nAllocSize; i++ )
00245         FREE( nets[i].m_terms );
00246     FREE( abstractCells );
00247     FREE( cells );
00248     FREE( nets );
00249 }

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 100 of file abcPlace.c.

00101 {
00102     Abc_Obj_t * pObj;
00103 //    double x, y;
00104     int i;
00105     Vec_PtrForEachEntry( vFanins, pObj, i )
00106     {
00107 //        pObj->Id
00108     }
00109     return 0.0;
00110 }

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 123 of file abcPlace.c.

00124 {
00125     Abc_Obj_t * pObj, * pFanin;
00126     int i, k;
00127     Vec_Ptr_t * vCells, * vNets;
00128 
00129     // start the arrays of new cells and nets
00130     vCells = Vec_PtrAlloc( 16 );
00131     vNets = Vec_PtrAlloc( 32 );
00132 
00133     // go through the new nodes
00134     Vec_PtrForEachEntry( vAddedCells, pObj, i )
00135     {
00136         assert( !Abc_ObjIsComplement(pObj) );
00137         Abc_PlaceCreateCell( pObj, 1 );
00138         Abc_PlaceUpdateNet( pObj );
00139 
00140         // add the new cell and its fanin nets to temporary storage
00141         Vec_PtrPush( vCells, &(cells[pObj->Id]) );
00142         Abc_ObjForEachFanin( pObj, pFanin, k )
00143             Vec_PtrPushUnique( vNets, &(nets[pFanin->Id]) );
00144     }
00145 
00146     // go through the modified nets
00147     Vec_PtrForEachEntry( vUpdatedNets, pObj, i )
00148     {
00149         assert( !Abc_ObjIsComplement(pObj) );
00150         if ( Abc_ObjType(pObj) == ABC_OBJ_NONE ) // dead node
00151             continue;
00152         Abc_PlaceUpdateNet( pObj );
00153     }
00154 
00155     // update the placement
00156 //    fastPlace( Vec_PtrSize(vCells), (ConcreteCell **)Vec_PtrArray(vCells), 
00157 //               Vec_PtrSize(vNets), (ConcreteNet **)Vec_PtrArray(vNets) );
00158 
00159     // clean up
00160     Vec_PtrFree( vCells );
00161     Vec_PtrFree( vNets );
00162 }

static void Abc_PlaceUpdateNet ( Abc_Obj_t pObj  )  [inline, static]

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

Synopsis [Updates the net.]

Description []

SideEffects []

SeeAlso []

Definition at line 72 of file abcPlace.c.

00073 {
00074     Abc_Obj_t * pFanout;
00075     int k;
00076     // free the old array of net terminals
00077     if ( nets[pObj->Id].m_terms )
00078         free( nets[pObj->Id].m_terms );
00079     // fill in the net with the new information
00080     nets[pObj->Id].m_id = pObj->Id;
00081     nets[pObj->Id].m_weight = 1.0;
00082     nets[pObj->Id].m_numTerms = Abc_ObjFanoutNum(pObj); //fanout
00083     nets[pObj->Id].m_terms = ALLOC(ConcreteCell*, Abc_ObjFanoutNum(pObj));
00084     Abc_ObjForEachFanout( pObj, pFanout, k )
00085         nets[pObj->Id].m_terms[k] = &(cells[pFanout->Id]);
00086     addConcreteNet(&(nets[pObj->Id]));
00087 }


Variable Documentation

AbstractCell* abstractCells = NULL

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

] DECLARATIONS ///

Definition at line 30 of file abcPlace.c.

ConcreteCell* cells = NULL

Definition at line 31 of file abcPlace.c.

int nAllocSize = 0

Definition at line 33 of file abcPlace.c.

ConcreteNet* nets = NULL

Definition at line 32 of file abcPlace.c.


Generated on Tue Jan 5 12:18:39 2010 for abc70930 by  doxygen 1.6.1