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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Tim_ManInitPiArrival (Tim_Man_t *p, int iPi, float Delay)
 DECLARATIONS ///. More...
 
void Tim_ManInitPoRequired (Tim_Man_t *p, int iPo, float Delay)
 
void Tim_ManInitPiArrivalAll (Tim_Man_t *p, float Delay)
 
void Tim_ManInitPoRequiredAll (Tim_Man_t *p, float Delay)
 
void Tim_ManSetCoArrival (Tim_Man_t *p, int iCo, float Delay)
 
void Tim_ManSetCiRequired (Tim_Man_t *p, int iCi, float Delay)
 
void Tim_ManSetCoRequired (Tim_Man_t *p, int iCo, float Delay)
 
float Tim_ManGetCiArrival (Tim_Man_t *p, int iCi)
 
float Tim_ManGetCoRequired (Tim_Man_t *p, int iCo)
 

Function Documentation

float Tim_ManGetCiArrival ( Tim_Man_t p,
int  iCi 
)

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

Synopsis [Returns CO arrival time.]

Description []

SideEffects []

SeeAlso []

Definition at line 174 of file timTime.c.

175 {
176  Tim_Box_t * pBox;
177  Tim_Obj_t * pObjThis, * pObj, * pObjRes;
178  float * pTable, * pDelays, DelayBest;
179  int i, k;
180  // consider the already processed PI
181  pObjThis = Tim_ManCi( p, iCi );
182  if ( p->fUseTravId && pObjThis->TravId == p->nTravIds )
183  return pObjThis->timeArr;
184  pObjThis->TravId = p->nTravIds;
185  // consider the main PI
186  pBox = Tim_ManCiBox( p, iCi );
187  if ( pBox == NULL )
188  return pObjThis->timeArr;
189  // update box timing
190  pBox->TravId = p->nTravIds;
191  // get the arrival times of the inputs of the box (POs)
192  if ( p->fUseTravId )
193  Tim_ManBoxForEachInput( p, pBox, pObj, i )
194  if ( pObj->TravId != p->nTravIds )
195  printf( "Tim_ManGetCiArrival(): Input arrival times of the box are not up to date!\n" );
196  // compute the arrival times for each output of the box (PIs)
197  pTable = Tim_ManBoxDelayTable( p, pBox->iBox );
198  Tim_ManBoxForEachOutput( p, pBox, pObjRes, i )
199  {
200  pDelays = pTable + 3 + i * pBox->nInputs;
201  DelayBest = -TIM_ETERNITY;
202  Tim_ManBoxForEachInput( p, pBox, pObj, k )
203  if ( pDelays[k] != -ABC_INFINITY )
204  DelayBest = Abc_MaxInt( DelayBest, pObj->timeArr + pDelays[k] );
205  pObjRes->timeArr = DelayBest;
206  pObjRes->TravId = p->nTravIds;
207  }
208  return pObjThis->timeArr;
209 }
float timeArr
Definition: timInt.h:85
#define Tim_ManBoxForEachOutput(p, pBox, pObj, i)
Definition: timInt.h:122
static Llb_Mgr_t * p
Definition: llb3Image.c:950
float Tim_ManGetCiArrival(Tim_Man_t *p, int iCi)
Definition: timTime.c:174
static Tim_Box_t * Tim_ManCiBox(Tim_Man_t *p, int i)
Definition: timInt.h:97
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
#define Tim_ManBoxForEachInput(p, pBox, pObj, i)
Definition: timInt.h:120
if(last==0)
Definition: sparse_int.h:34
static Tim_Obj_t * Tim_ManCi(Tim_Man_t *p, int i)
MACRO DEFINITIONS ///.
Definition: timInt.h:93
int TravId
Definition: timInt.h:82
#define TIM_ETERNITY
MACRO DEFINITIONS ///.
Definition: tim.h:98
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
typedefABC_NAMESPACE_HEADER_START struct Tim_Box_t_ Tim_Box_t
INCLUDES ///.
Definition: timInt.h:48
float * Tim_ManBoxDelayTable(Tim_Man_t *p, int iBox)
Definition: timBox.c:234
float Tim_ManGetCoRequired ( Tim_Man_t p,
int  iCo 
)

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

Synopsis [Returns CO required time.]

Description []

SideEffects []

SeeAlso []

Definition at line 222 of file timTime.c.

223 {
224  Tim_Box_t * pBox;
225  Tim_Obj_t * pObjThis, * pObj, * pObjRes;
226  float * pTable, * pDelays, DelayBest;
227  int i, k;
228  // consider the already processed PO
229  pObjThis = Tim_ManCo( p, iCo );
230  if ( p->fUseTravId && pObjThis->TravId == p->nTravIds )
231  return pObjThis->timeReq;
232  pObjThis->TravId = p->nTravIds;
233  // consider the main PO
234  pBox = Tim_ManCoBox( p, iCo );
235  if ( pBox == NULL )
236  return pObjThis->timeReq;
237  // update box timing
238  pBox->TravId = p->nTravIds;
239  // get the required times of the outputs of the box (PIs)
240  if ( p->fUseTravId )
241  Tim_ManBoxForEachOutput( p, pBox, pObj, i )
242  if ( pObj->TravId != p->nTravIds )
243  printf( "Tim_ManGetCoRequired(): Output required times of output %d the box %d are not up to date!\n", i, pBox->iBox );
244  // compute the required times for each input of the box (POs)
245  pTable = Tim_ManBoxDelayTable( p, pBox->iBox );
246  Tim_ManBoxForEachInput( p, pBox, pObjRes, i )
247  {
248  DelayBest = TIM_ETERNITY;
249  Tim_ManBoxForEachOutput( p, pBox, pObj, k )
250  {
251  pDelays = pTable + 3 + k * pBox->nInputs;
252  if ( pDelays[k] != -ABC_INFINITY )
253  DelayBest = Abc_MinFloat( DelayBest, pObj->timeReq - pDelays[i] );
254  }
255  pObjRes->timeReq = DelayBest;
256  pObjRes->TravId = p->nTravIds;
257  }
258  return pObjThis->timeReq;
259 }
static float Abc_MinFloat(float a, float b)
Definition: abc_global.h:244
#define Tim_ManBoxForEachOutput(p, pBox, pObj, i)
Definition: timInt.h:122
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Tim_Box_t * Tim_ManCoBox(Tim_Man_t *p, int i)
Definition: timInt.h:98
float timeReq
Definition: timInt.h:86
#define Tim_ManBoxForEachInput(p, pBox, pObj, i)
Definition: timInt.h:120
if(last==0)
Definition: sparse_int.h:34
int TravId
Definition: timInt.h:82
float Tim_ManGetCoRequired(Tim_Man_t *p, int iCo)
Definition: timTime.c:222
#define TIM_ETERNITY
MACRO DEFINITIONS ///.
Definition: tim.h:98
static Tim_Obj_t * Tim_ManCo(Tim_Man_t *p, int i)
Definition: timInt.h:94
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
typedefABC_NAMESPACE_HEADER_START struct Tim_Box_t_ Tim_Box_t
INCLUDES ///.
Definition: timInt.h:48
float * Tim_ManBoxDelayTable(Tim_Man_t *p, int iBox)
Definition: timBox.c:234
ABC_NAMESPACE_IMPL_START void Tim_ManInitPiArrival ( Tim_Man_t p,
int  iPi,
float  Delay 
)

DECLARATIONS ///.

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

FileName [timTime.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Hierarchy/timing manager.]

Synopsis [Setting and resetting timing information of the boxes.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Initializes arrival time of the PI.]

Description []

SideEffects []

SeeAlso []

Definition at line 44 of file timTime.c.

45 {
46  assert( iPi < p->nCis );
47  p->pCis[iPi].timeArr = Delay;
48 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
void Tim_ManInitPiArrivalAll ( Tim_Man_t p,
float  Delay 
)

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

Synopsis [Sets arrival times of all PIs.]

Description []

SideEffects []

SeeAlso []

Definition at line 78 of file timTime.c.

79 {
80  Tim_Obj_t * pObj;
81  int i;
82  Tim_ManForEachPi( p, pObj, i )
83  Tim_ManInitPiArrival( p, i, Delay );
84 }
ABC_NAMESPACE_IMPL_START void Tim_ManInitPiArrival(Tim_Man_t *p, int iPi, float Delay)
DECLARATIONS ///.
Definition: timTime.c:44
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define Tim_ManForEachPi(p, pObj, i)
Definition: timInt.h:112
void Tim_ManInitPoRequired ( Tim_Man_t p,
int  iPo,
float  Delay 
)

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

Synopsis [Initializes required time of the PO.]

Description []

SideEffects []

SeeAlso []

Definition at line 61 of file timTime.c.

62 {
63  assert( iPo < p->nCos );
64  p->pCos[iPo].timeReq = Delay;
65 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
void Tim_ManInitPoRequiredAll ( Tim_Man_t p,
float  Delay 
)

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

Synopsis [Sets required times of all POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 97 of file timTime.c.

98 {
99  Tim_Obj_t * pObj;
100  int i;
101  Tim_ManForEachPo( p, pObj, i )
102  Tim_ManSetCoRequired( p, i, Delay );
103 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define Tim_ManForEachPo(p, pObj, i)
Definition: timInt.h:114
void Tim_ManSetCoRequired(Tim_Man_t *p, int iCo, float Delay)
Definition: timTime.c:154
void Tim_ManSetCiRequired ( Tim_Man_t p,
int  iCi,
float  Delay 
)

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

Synopsis [Updates required time of the CI.]

Description []

SideEffects []

SeeAlso []

Definition at line 135 of file timTime.c.

136 {
137  assert( iCi < p->nCis );
138  assert( !p->fUseTravId || p->pCis[iCi].TravId != p->nTravIds );
139  p->pCis[iCi].timeReq = Delay;
140  p->pCis[iCi].TravId = p->nTravIds;
141 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
void Tim_ManSetCoArrival ( Tim_Man_t p,
int  iCo,
float  Delay 
)

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

Synopsis [Updates arrival time of the CO.]

Description []

SideEffects []

SeeAlso []

Definition at line 116 of file timTime.c.

117 {
118  assert( iCo < p->nCos );
119  assert( !p->fUseTravId || p->pCos[iCo].TravId != p->nTravIds );
120  p->pCos[iCo].timeArr = Delay;
121  p->pCos[iCo].TravId = p->nTravIds;
122 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
void Tim_ManSetCoRequired ( Tim_Man_t p,
int  iCo,
float  Delay 
)

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

Synopsis [Updates required time of the CO.]

Description []

SideEffects []

SeeAlso []

Definition at line 154 of file timTime.c.

155 {
156  assert( iCo < p->nCos );
157  assert( !p->fUseTravId || !p->nTravIds || p->pCos[iCo].TravId != p->nTravIds );
158  p->pCos[iCo].timeReq = Delay;
159  p->pCos[iCo].TravId = p->nTravIds;
160 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213