src/aig/aig/aigTime.c File Reference

#include "aig.h"
Include dependency graph for aigTime.c:

Go to the source code of this file.

Data Structures

struct  Aig_TMan_t_
struct  Aig_TBox_t_
struct  Aig_TObj_t_

Typedefs

typedef struct Aig_TBox_t_ Aig_TBox_t
typedef struct Aig_TObj_t_ Aig_TObj_t

Functions

Aig_TMan_tAig_TManStart (int nPis, int nPos)
void Aig_TManStop (Aig_TMan_t *p)
void Aig_TManCreateBox (Aig_TMan_t *p, int *pPis, int nPis, int *pPos, int nPos, float *pPiTimes, float *pPoTimes)
void Aig_TManSetPiDelay (Aig_TMan_t *p, int iPi, float Delay)
void Aig_TManSetPoDelay (Aig_TMan_t *p, int iPo, float Delay)
void Aig_TManSetPiArrival (Aig_TMan_t *p, int iPi, float Delay)
void Aig_TManSetPoRequired (Aig_TMan_t *p, int iPo, float Delay)
void Aig_TManIncrementTravId (Aig_TMan_t *p)
float Aig_TManGetPiArrival (Aig_TMan_t *p, int iPi)
float Aig_TManGetPoRequired (Aig_TMan_t *p, int iPo)

Typedef Documentation

typedef struct Aig_TBox_t_ Aig_TBox_t

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

FileName [aigTime.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [AIG package.]

Synopsis [Representation of timing information.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - April 28, 2007.]

Revision [

Id
aigTime.c,v 1.00 2007/04/28 00:00:00 alanmi Exp

] DECLARATIONS ///

Definition at line 27 of file aigTime.c.

typedef struct Aig_TObj_t_ Aig_TObj_t

Definition at line 28 of file aigTime.c.


Function Documentation

void Aig_TManCreateBox ( Aig_TMan_t p,
int *  pPis,
int  nPis,
int *  pPos,
int  nPos,
float *  pPiTimes,
float *  pPoTimes 
)

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

Synopsis [Creates the new timing box.]

Description []

SideEffects []

SeeAlso []

Definition at line 128 of file aigTime.c.

00129 {
00130     Aig_TBox_t * pBox;
00131     int i;
00132     pBox = (Aig_TBox_t *)Aig_MmFlexEntryFetch( p->pMemObj, sizeof(Aig_TBox_t) + sizeof(int) * (nPis+nPos) );
00133     memset( pBox, 0, sizeof(Aig_TBox_t) );
00134     pBox->iBox = Vec_PtrSize( p->vBoxes );
00135     Vec_PtrPush( p->vBoxes, pBox );
00136     pBox->nInputs = nPis;
00137     pBox->nOutputs = nPos;
00138     for ( i = 0; i < nPis; i++ )
00139     {
00140         assert( pPis[i] < p->nPis );
00141         pBox->Inouts[i] = pPis[i];
00142         Aig_TManSetPiArrival( p, pPis[i], pPiTimes[i] );
00143         p->pPis[pPis[i]].iObj2Box = pBox->iBox;
00144     }
00145     for ( i = 0; i < nPos; i++ )
00146     {
00147         assert( pPos[i] < p->nPos );
00148         pBox->Inouts[nPis+i] = pPos[i];
00149         Aig_TManSetPoRequired( p, pPos[i], pPoTimes[i] );
00150         p->pPos[pPos[i]].iObj2Box = pBox->iBox;
00151     }
00152 }

float Aig_TManGetPiArrival ( Aig_TMan_t p,
int  iPi 
)

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

Synopsis [Returns PI arrival time.]

Description []

SideEffects []

SeeAlso []

Definition at line 249 of file aigTime.c.

00250 {
00251     Aig_TBox_t * pBox;
00252     Aig_TObj_t * pObj;
00253     float DelayMax;
00254     int i;
00255     assert( iPi < p->nPis );
00256     if ( p->pPis[iPi].iObj2Box < 0 )
00257         return p->pPis[iPi].timeOffset;
00258     pBox = Vec_PtrEntry( p->vBoxes, p->pPis[iPi].iObj2Box );
00259     // check if box timing is updated
00260     if ( pBox->TravId == p->nTravIds )
00261         return p->pPis[iPi].timeOffset;
00262     pBox->TravId = p->nTravIds;
00263     // update box timing
00264     DelayMax = -1.0e+20F;
00265     for ( i = 0; i < pBox->nOutputs; i++ )
00266     {
00267         pObj = p->pPos + pBox->Inouts[pBox->nInputs+i];
00268         DelayMax = AIG_MAX( DelayMax, pObj->timeActual + pObj->timeOffset );
00269     }
00270     for ( i = 0; i < pBox->nInputs; i++ )
00271     {
00272         pObj = p->pPis + pBox->Inouts[i];
00273         pObj->timeActual = DelayMax + pObj->timeOffset;
00274     }
00275     return p->pPis[iPi].timeActual;
00276 }

float Aig_TManGetPoRequired ( Aig_TMan_t p,
int  iPo 
)

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

Synopsis [Returns PO required time.]

Description []

SideEffects []

SeeAlso []

Definition at line 289 of file aigTime.c.

00290 {
00291     return 0.0;
00292 }

void Aig_TManIncrementTravId ( Aig_TMan_t p  ) 

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

Synopsis [Increments the trav ID of the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 233 of file aigTime.c.

00234 {
00235     p->nTravIds++;
00236 }

void Aig_TManSetPiArrival ( Aig_TMan_t p,
int  iPi,
float  Delay 
)

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

Synopsis [Creates the new timing box.]

Description []

SideEffects []

SeeAlso []

Definition at line 199 of file aigTime.c.

00200 {
00201     assert( iPi < p->nPis );
00202     p->pPis[iPi].timeOffset = Delay;
00203 }

void Aig_TManSetPiDelay ( Aig_TMan_t p,
int  iPi,
float  Delay 
)

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

Synopsis [Creates the new timing box.]

Description []

SideEffects []

SeeAlso []

Definition at line 165 of file aigTime.c.

00166 {
00167     assert( iPi < p->nPis );
00168     p->pPis[iPi].timeActual = Delay;
00169 }

void Aig_TManSetPoDelay ( Aig_TMan_t p,
int  iPo,
float  Delay 
)

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

Synopsis [Creates the new timing box.]

Description []

SideEffects []

SeeAlso []

Definition at line 182 of file aigTime.c.

00183 {
00184     assert( iPo < p->nPos );
00185     p->pPos[iPo].timeActual = Delay;
00186 }

void Aig_TManSetPoRequired ( Aig_TMan_t p,
int  iPo,
float  Delay 
)

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

Synopsis [Creates the new timing box.]

Description []

SideEffects []

SeeAlso []

Definition at line 216 of file aigTime.c.

00217 {
00218     assert( iPo < p->nPos );
00219     p->pPos[iPo].timeOffset = Delay;
00220 }

Aig_TMan_t* Aig_TManStart ( int  nPis,
int  nPos 
)

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

Synopsis [Starts the network manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 75 of file aigTime.c.

00076 {
00077     Aig_TMan_t * p;
00078     int i;
00079     p = ALLOC( Aig_TMan_t, 1 );
00080     memset( p, 0, sizeof(Aig_TMan_t) );
00081     p->pMemObj = Aig_MmFlexStart();
00082     p->vBoxes  = Vec_PtrAlloc( 100 );
00083     Vec_PtrPush( p->vBoxes, NULL );
00084     p->nPis = nPis;
00085     p->nPos = nPos;
00086     p->pPis = ALLOC( Aig_TObj_t, nPis );
00087     memset( p->pPis, 0, sizeof(Aig_TObj_t) * nPis );
00088     p->pPos = ALLOC( Aig_TObj_t, nPos );
00089     memset( p->pPos, 0, sizeof(Aig_TObj_t) * nPos );
00090     for ( i = 0; i < nPis; i++ )
00091         p->pPis[i].iObj2Box = -1;
00092     for ( i = 0; i < nPos; i++ )
00093         p->pPos[i].iObj2Box = -1;
00094     return p;
00095 }

void Aig_TManStop ( Aig_TMan_t p  ) 

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

Synopsis [Stops the network manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 108 of file aigTime.c.

00109 {
00110     Vec_PtrFree( p->vBoxes );
00111     Aig_MmFlexStop( p->pMemObj, 0 );
00112     free( p->pPis );
00113     free( p->pPos );
00114     free( p );
00115 }


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