abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
timTrav.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [timTrav.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Hierarchy/timing manager.]
8 
9  Synopsis [Manipulation of traversal IDs.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - April 28, 2007.]
16 
17  Revision [$Id: timTrav.c,v 1.00 2007/04/28 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "timInt.h"
22 
24 
25 ////////////////////////////////////////////////////////////////////////
26 /// DECLARATIONS ///
27 ////////////////////////////////////////////////////////////////////////
28 
29 ////////////////////////////////////////////////////////////////////////
30 /// FUNCTION DEFINITIONS ///
31 ////////////////////////////////////////////////////////////////////////
32 
33 /**Function*************************************************************
34 
35  Synopsis [Increments the trav ID of the manager.]
36 
37  Description []
38 
39  SideEffects []
40 
41  SeeAlso []
42 
43 ***********************************************************************/
45 {
46  int i;
47  if ( p->nTravIds >= (1<<30)-1 )
48  {
49  p->nTravIds = 0;
50  for ( i = 0; i < p->nCis; i++ )
51  p->pCis[i].TravId = 0;
52  for ( i = 0; i < p->nCos; i++ )
53  p->pCos[i].TravId = 0;
54  }
55  assert( p->nTravIds < (1<<30)-1 );
56  p->nTravIds++;
57 }
58 
59 /**Function*************************************************************
60 
61  Synopsis [Label box inputs.]
62 
63  Description []
64 
65  SideEffects []
66 
67  SeeAlso []
68 
69 ***********************************************************************/
71 {
72  Tim_Box_t * pBox;
73  Tim_Obj_t * pObj;
74  int i;
75  pBox = Tim_ManBox( p, iBox );
76  Tim_ManBoxForEachInput( p, pBox, pObj, i )
77  pObj->TravId = p->nTravIds;
78 }
79 
80 /**Function*************************************************************
81 
82  Synopsis [Label box outputs.]
83 
84  Description []
85 
86  SideEffects []
87 
88  SeeAlso []
89 
90 ***********************************************************************/
92 {
93  Tim_Box_t * pBox;
94  Tim_Obj_t * pObj;
95  int i;
96  pBox = Tim_ManBox( p, iBox );
97  Tim_ManBoxForEachOutput( p, pBox, pObj, i )
98  pObj->TravId = p->nTravIds;
99 }
100 
101 /**Function*************************************************************
102 
103  Synopsis [Label box inputs.]
104 
105  Description []
106 
107  SideEffects []
108 
109  SeeAlso []
110 
111 ***********************************************************************/
113 {
114  Tim_Box_t * pBox;
115  Tim_Obj_t * pObj;
116  int i;
117  pBox = Tim_ManBox( p, iBox );
118  Tim_ManBoxForEachInput( p, pBox, pObj, i )
119  pObj->TravId = p->nTravIds - 1;
120 }
121 
122 /**Function*************************************************************
123 
124  Synopsis [Label box outputs.]
125 
126  Description []
127 
128  SideEffects []
129 
130  SeeAlso []
131 
132 ***********************************************************************/
134 {
135  Tim_Box_t * pBox;
136  Tim_Obj_t * pObj;
137  int i;
138  pBox = Tim_ManBox( p, iBox );
139  Tim_ManBoxForEachOutput( p, pBox, pObj, i )
140  pObj->TravId = p->nTravIds - 1;
141 }
142 
143 /**Function*************************************************************
144 
145  Synopsis [Updates required time of the CI.]
146 
147  Description []
148 
149  SideEffects []
150 
151  SeeAlso []
152 
153 ***********************************************************************/
155 {
156  assert( iCi < p->nCis );
157  assert( p->fUseTravId );
158  return p->pCis[iCi].TravId == p->nTravIds;
159 }
160 
161 /**Function*************************************************************
162 
163  Synopsis [Updates required time of the CO.]
164 
165  Description []
166 
167  SideEffects []
168 
169  SeeAlso []
170 
171 ***********************************************************************/
173 {
174  assert( iCo < p->nCos );
175  assert( p->fUseTravId );
176  return p->pCos[iCo].TravId == p->nTravIds;
177 }
178 
179 ////////////////////////////////////////////////////////////////////////
180 /// END OF FILE ///
181 ////////////////////////////////////////////////////////////////////////
182 
183 
185 
#define Tim_ManBoxForEachOutput(p, pBox, pObj, i)
Definition: timInt.h:122
ABC_NAMESPACE_IMPL_START void Tim_ManIncrementTravId(Tim_Man_t *p)
DECLARATIONS ///.
Definition: timTrav.c:44
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Tim_ManSetPreviousTravIdBoxOutputs(Tim_Man_t *p, int iBox)
Definition: timTrav.c:133
int Tim_ManIsCiTravIdCurrent(Tim_Man_t *p, int iCi)
Definition: timTrav.c:154
for(p=first;p->value< newval;p=p->next)
void Tim_ManSetPreviousTravIdBoxInputs(Tim_Man_t *p, int iBox)
Definition: timTrav.c:112
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
#define Tim_ManBoxForEachInput(p, pBox, pObj, i)
Definition: timInt.h:120
void Tim_ManSetCurrentTravIdBoxInputs(Tim_Man_t *p, int iBox)
Definition: timTrav.c:70
void Tim_ManSetCurrentTravIdBoxOutputs(Tim_Man_t *p, int iBox)
Definition: timTrav.c:91
static Tim_Box_t * Tim_ManBox(Tim_Man_t *p, int i)
Definition: timInt.h:95
int TravId
Definition: timInt.h:82
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
#define assert(ex)
Definition: util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition: tim.h:92
int Tim_ManIsCoTravIdCurrent(Tim_Man_t *p, int iCo)
Definition: timTrav.c:172
typedefABC_NAMESPACE_HEADER_START struct Tim_Box_t_ Tim_Box_t
INCLUDES ///.
Definition: timInt.h:48