abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
retIncrem.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [retIncrem.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Retiming package.]
8 
9  Synopsis [Incremental retiming in one direction.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - Oct 31, 2006.]
16 
17  Revision [$Id: retIncrem.c,v 1.00 2006/10/31 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "retInt.h"
22 
24 
25 
26 ////////////////////////////////////////////////////////////////////////
27 /// DECLARATIONS ///
28 ////////////////////////////////////////////////////////////////////////
29 
30 static int Abc_NtkRetimeOneWay( Abc_Ntk_t * pNtk, int fForward, int fVerbose );
31 
32 ////////////////////////////////////////////////////////////////////////
33 /// FUNCTION DEFINITIONS ///
34 ////////////////////////////////////////////////////////////////////////
35 
36 /**Function*************************************************************
37 
38  Synopsis [Performs retiming in one direction.]
39 
40  Description [Currently does not retime over black boxes.]
41 
42  SideEffects []
43 
44  SeeAlso []
45 
46 ***********************************************************************/
47 int Abc_NtkRetimeIncremental( Abc_Ntk_t * pNtk, int nDelayLim, int fForward, int fMinDelay, int fOneStep, int fVerbose )
48 {
49  Abc_Ntk_t * pNtkCopy = NULL;
50  Vec_Ptr_t * vBoxes;
51  st__table * tLatches;
52  int nLatches = Abc_NtkLatchNum(pNtk);
53  int nIdMaxStart = Abc_NtkObjNumMax(pNtk);
54  int RetValue;
55  int nIterLimit = -1; // Suppress "might be used uninitialized"
56  if ( Abc_NtkNodeNum(pNtk) == 0 )
57  return 0;
58  // reorder CI/CO/latch inputs
59  Abc_NtkOrderCisCos( pNtk );
60  if ( fMinDelay )
61  {
62  nIterLimit = fOneStep? 1 : 2 * Abc_NtkLevel(pNtk);
63  pNtkCopy = Abc_NtkDup( pNtk );
64  tLatches = Abc_NtkRetimePrepareLatches( pNtkCopy );
65  st__free_table( tLatches );
66  }
67  // collect latches and remove CIs/COs
68  tLatches = Abc_NtkRetimePrepareLatches( pNtk );
69  // share the latches
70  Abc_NtkRetimeShareLatches( pNtk, 0 );
71  // save boxes
72  vBoxes = pNtk->vBoxes; pNtk->vBoxes = NULL;
73  // perform the retiming
74  if ( fMinDelay )
75  Abc_NtkRetimeMinDelay( pNtk, pNtkCopy, nDelayLim, nIterLimit, fForward, fVerbose );
76  else
77  Abc_NtkRetimeOneWay( pNtk, fForward, fVerbose );
78  if ( fMinDelay )
79  Abc_NtkDelete( pNtkCopy );
80  // share the latches
81  Abc_NtkRetimeShareLatches( pNtk, 0 );
82  // restore boxes
83  pNtk->vBoxes = vBoxes;
84  // finalize the latches
85  RetValue = Abc_NtkRetimeFinalizeLatches( pNtk, tLatches, nIdMaxStart );
86  st__free_table( tLatches );
87  if ( RetValue == 0 )
88  return 0;
89  // fix the COs
90 // Abc_NtkLogicMakeSimpleCos( pNtk, 0 );
91  // check for correctness
92  if ( !Abc_NtkCheck( pNtk ) )
93  fprintf( stdout, "Abc_NtkRetimeForward(): Network check has failed.\n" );
94  // return the number of latches saved
95  return nLatches - Abc_NtkLatchNum(pNtk);
96 }
97 
98 /**Function*************************************************************
99 
100  Synopsis [Prepares the network for retiming.]
101 
102  Description [Hash latches into their number in the original network.]
103 
104  SideEffects []
105 
106  SeeAlso []
107 
108 ***********************************************************************/
110 {
111  st__table * tLatches;
112  Abc_Obj_t * pLatch, * pLatchIn, * pLatchOut, * pFanin;
113  int i, nOffSet = Abc_NtkBoxNum(pNtk) - Abc_NtkLatchNum(pNtk);
114  // collect latches and remove CIs/COs
115  tLatches = st__init_table( st__ptrcmp, st__ptrhash );
116  Abc_NtkForEachLatch( pNtk, pLatch, i )
117  {
118  // map latch into its true number
119  st__insert( tLatches, (char *)(ABC_PTRUINT_T)pLatch, (char *)(ABC_PTRUINT_T)(i-nOffSet) );
120  // disconnect LI
121  pLatchIn = Abc_ObjFanin0(pLatch);
122  pFanin = Abc_ObjFanin0(pLatchIn);
123  Abc_ObjTransferFanout( pLatchIn, pFanin );
124  Abc_ObjDeleteFanin( pLatchIn, pFanin );
125  // disconnect LO
126  pLatchOut = Abc_ObjFanout0(pLatch);
127  pFanin = Abc_ObjFanin0(pLatchOut);
128  if ( Abc_ObjFanoutNum(pLatchOut) > 0 )
129  Abc_ObjTransferFanout( pLatchOut, pFanin );
130  Abc_ObjDeleteFanin( pLatchOut, pFanin );
131  }
132  return tLatches;
133 }
134 
135 /**Function*************************************************************
136 
137  Synopsis [Finalizes the latches after retiming.]
138 
139  Description [Reuses the LIs/LOs for old latches.]
140 
141  SideEffects []
142 
143  SeeAlso []
144 
145 ***********************************************************************/
146 int Abc_NtkRetimeFinalizeLatches( Abc_Ntk_t * pNtk, st__table * tLatches, int nIdMaxStart )
147 {
148  Vec_Ptr_t * vCisOld, * vCosOld, * vBoxesOld, * vCisNew, * vCosNew, * vBoxesNew;
149  Abc_Obj_t * pObj, * pLatch, * pLatchIn, * pLatchOut;
150  int i, Index;
151  // create new arrays
152  vCisOld = pNtk->vCis; pNtk->vCis = NULL; vCisNew = Vec_PtrAlloc( 100 );
153  vCosOld = pNtk->vCos; pNtk->vCos = NULL; vCosNew = Vec_PtrAlloc( 100 );
154  vBoxesOld = pNtk->vBoxes; pNtk->vBoxes = NULL; vBoxesNew = Vec_PtrAlloc( 100 );
155  // copy boxes and their CIs/COs
156  Vec_PtrForEachEntryStop( Abc_Obj_t *, vCisOld, pObj, i, Vec_PtrSize(vCisOld) - st__count(tLatches) )
157  Vec_PtrPush( vCisNew, pObj );
158  Vec_PtrForEachEntryStop( Abc_Obj_t *, vCosOld, pObj, i, Vec_PtrSize(vCosOld) - st__count(tLatches) )
159  Vec_PtrPush( vCosNew, pObj );
160  Vec_PtrForEachEntryStop( Abc_Obj_t *, vBoxesOld, pObj, i, Vec_PtrSize(vBoxesOld) - st__count(tLatches) )
161  Vec_PtrPush( vBoxesNew, pObj );
162  // go through the latches
163  Abc_NtkForEachObj( pNtk, pLatch, i )
164  {
165  if ( !Abc_ObjIsLatch(pLatch) )
166  continue;
167  if ( Abc_ObjId(pLatch) >= (unsigned)nIdMaxStart )
168  {
169  // this is a new latch
170  pLatchIn = Abc_NtkCreateBi(pNtk);
171  pLatchOut = Abc_NtkCreateBo(pNtk);
172  Abc_ObjAssignName( pLatchOut, Abc_ObjName(pLatch), "_out" );
173  Abc_ObjAssignName( pLatchIn, Abc_ObjName(pLatch), "_in" );
174  }
175  else
176  {
177  // this is an old latch
178  // get its number in the original order
179  if ( ! st__lookup( tLatches, (char *)pLatch, (char **)&Index ) )
180  {
181  printf( "Abc_NtkRetimeFinalizeLatches(): Internal error.\n" );
182  return 0;
183  }
184  assert( pLatch == Vec_PtrEntry(vBoxesOld, Vec_PtrSize(vBoxesOld) - st__count(tLatches) + Index) );
185  // reconnect with the old LIs/LOs
186  pLatchIn = (Abc_Obj_t *)Vec_PtrEntry( vCosOld, Vec_PtrSize(vCosOld) - st__count(tLatches) + Index );
187  pLatchOut = (Abc_Obj_t *)Vec_PtrEntry( vCisOld, Vec_PtrSize(vCisOld) - st__count(tLatches) + Index );
188  }
189  // connect
190  Abc_ObjAddFanin( pLatchIn, Abc_ObjFanin0(pLatch) );
191  Abc_ObjPatchFanin( pLatch, Abc_ObjFanin0(pLatch), pLatchIn );
192  if ( Abc_ObjFanoutNum(pLatch) > 0 )
193  Abc_ObjTransferFanout( pLatch, pLatchOut );
194  Abc_ObjAddFanin( pLatchOut, pLatch );
195  // add to the arrays
196  Vec_PtrPush( vCisNew, pLatchOut );
197  Vec_PtrPush( vCosNew, pLatchIn );
198  Vec_PtrPush( vBoxesNew, pLatch );
199  }
200  // free useless Cis/Cos
201  Vec_PtrForEachEntry( Abc_Obj_t *, vCisOld, pObj, i )
202  if ( !Abc_ObjIsPi(pObj) && Abc_ObjFaninNum(pObj) == 0 && Abc_ObjFanoutNum(pObj) == 0 )
203  Abc_NtkDeleteObj(pObj);
204  Vec_PtrForEachEntry( Abc_Obj_t *, vCosOld, pObj, i )
205  if ( !Abc_ObjIsPo(pObj) && Abc_ObjFaninNum(pObj) == 0 && Abc_ObjFanoutNum(pObj) == 0 )
206  Abc_NtkDeleteObj(pObj);
207  // set the new arrays
208  pNtk->vCis = vCisNew; Vec_PtrFree( vCisOld );
209  pNtk->vCos = vCosNew; Vec_PtrFree( vCosOld );
210  pNtk->vBoxes = vBoxesNew; Vec_PtrFree( vBoxesOld );
211  return 1;
212 }
213 
214 /**Function*************************************************************
215 
216  Synopsis [Performs retiming one way, forward or backward.]
217 
218  Description []
219 
220  SideEffects []
221 
222  SeeAlso []
223 
224 ***********************************************************************/
225 int Abc_NtkRetimeOneWay( Abc_Ntk_t * pNtk, int fForward, int fVerbose )
226 {
227  Abc_Ntk_t * pNtkNew = NULL; // Suppress "might be used uninitialized"
228  Vec_Int_t * vValues = NULL; // Suppress "might be used uninitialized"
229  Abc_Obj_t * pObj;
230  int i, fChanges, nTotalMoves = 0, nTotalMovesLimit = 10000;
231  if ( fForward )
233  else
234  {
235  // save initial values of the latches
236  vValues = Abc_NtkRetimeCollectLatchValues( pNtk );
237  // start the network for initial value computation
238  pNtkNew = Abc_NtkRetimeBackwardInitialStart( pNtk );
239  }
240  // try to move latches forward whenever possible
241  do {
242  fChanges = 0;
243  Abc_NtkForEachObj( pNtk, pObj, i )
244  {
245  if ( !Abc_ObjIsNode(pObj) )
246  continue;
247  if ( Abc_NtkRetimeNodeIsEnabled( pObj, fForward ) )
248  {
249  Abc_NtkRetimeNode( pObj, fForward, 1 );
250  fChanges = 1;
251  nTotalMoves++;
252  if ( nTotalMoves >= nTotalMovesLimit )
253  {
254  printf( "Stopped after %d latch moves.\n", nTotalMoves );
255  break;
256  }
257  }
258  }
259  } while ( fChanges && nTotalMoves < nTotalMovesLimit );
260  // transfer the initial state back to the latches
261  if ( fForward )
263  else
264  {
265  Abc_NtkRetimeBackwardInitialFinish( pNtk, pNtkNew, vValues, fVerbose );
266  Abc_NtkDelete( pNtkNew );
267  Vec_IntFree( vValues );
268  }
269  return 0;
270 }
271 
272 
273 /**Function*************************************************************
274 
275  Synopsis [Returns 1 if retiming forward/backward is possible.]
276 
277  Description []
278 
279  SideEffects []
280 
281  SeeAlso []
282 
283 ***********************************************************************/
284 int Abc_NtkRetimeNodeIsEnabled( Abc_Obj_t * pObj, int fForward )
285 {
286  Abc_Obj_t * pNext;
287  int i;
288  assert( Abc_ObjIsNode(pObj) );
289  if ( fForward )
290  {
291  Abc_ObjForEachFanin( pObj, pNext, i )
292  if ( !Abc_ObjIsLatch(pNext) )
293  return 0;
294  }
295  else
296  {
297  Abc_ObjForEachFanout( pObj, pNext, i )
298  if ( !Abc_ObjIsLatch(pNext) )
299  return 0;
300  }
301  return 1;
302 }
303 
304 /**Function*************************************************************
305 
306  Synopsis [Retimes the node backward or forward.]
307 
308  Description []
309 
310  SideEffects []
311 
312  SeeAlso []
313 
314 ***********************************************************************/
315 void Abc_NtkRetimeNode( Abc_Obj_t * pObj, int fForward, int fInitial )
316 {
317  Abc_Ntk_t * pNtkNew = NULL;
318  Vec_Ptr_t * vNodes;
319  Abc_Obj_t * pNext, * pLatch;
320  int i;
321  vNodes = Vec_PtrAlloc( 10 );
322  if ( fForward )
323  {
324  // compute the initial value
325  if ( fInitial )
326  pObj->pCopy = (Abc_Obj_t *)(ABC_PTRUINT_T)Abc_ObjSopSimulate( pObj );
327  // collect fanins
328  Abc_NodeCollectFanins( pObj, vNodes );
329  // make the node point to the fanins fanins
330  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNext, i )
331  {
332  assert( Abc_ObjIsLatch(pNext) );
333  Abc_ObjPatchFanin( pObj, pNext, Abc_ObjFanin0(pNext) );
334  if ( Abc_ObjFanoutNum(pNext) == 0 )
335  Abc_NtkDeleteObj(pNext);
336  }
337  // add a new latch on top
338  pNext = Abc_NtkCreateLatch(pObj->pNtk);
339  if ( Abc_ObjFanoutNum(pObj) > 0 )
340  Abc_ObjTransferFanout( pObj, pNext );
341  Abc_ObjAddFanin( pNext, pObj );
342  // set the initial value
343  if ( fInitial )
344  pNext->pCopy = pObj->pCopy;
345  }
346  else
347  {
348  // compute the initial value
349  if ( fInitial )
350  {
351  pNtkNew = Abc_ObjFanout0(pObj)->pCopy->pNtk;
352  Abc_NtkDupObj( pNtkNew, pObj, 0 );
353  Abc_ObjForEachFanout( pObj, pNext, i )
354  {
355  assert( Abc_ObjFaninNum(pNext->pCopy) == 0 );
356  Abc_ObjAddFanin( pNext->pCopy, pObj->pCopy );
357  }
358  }
359  // collect fanouts
360  Abc_NodeCollectFanouts( pObj, vNodes );
361  // make the fanouts fanouts point to the node
362  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNext, i )
363  {
364  assert( Abc_ObjIsLatch(pNext) );
365  Abc_ObjTransferFanout( pNext, pObj );
366  Abc_NtkDeleteObj( pNext );
367  }
368  // add new latches to the fanins
369  Abc_ObjForEachFanin( pObj, pNext, i )
370  {
371  pLatch = Abc_NtkCreateLatch(pObj->pNtk);
372  Abc_ObjPatchFanin( pObj, pNext, pLatch );
373  Abc_ObjAddFanin( pLatch, pNext );
374  // create buffer isomorphic to this latch
375  if ( fInitial )
376  {
377  pLatch->pCopy = Abc_NtkCreateNodeBuf( pNtkNew, NULL );
378  Abc_ObjAddFanin( pObj->pCopy, pLatch->pCopy );
379  }
380  }
381  }
382  Vec_PtrFree( vNodes );
383 }
384 
385 /**Function*************************************************************
386 
387  Synopsis [Returns the number of compatible fanout latches.]
388 
389  Description []
390 
391  SideEffects []
392 
393  SeeAlso []
394 
395 ***********************************************************************/
397 {
398  Abc_Obj_t * pFanout;
399  int i, nLatches = 0, Init = -1;
400  Abc_ObjForEachFanout( pObj, pFanout, i )
401  {
402  if ( !Abc_ObjIsLatch(pFanout) )
403  continue;
404  if ( Init == -1 )
405  {
406  Init = (int)(ABC_PTRUINT_T)pObj->pData;
407  nLatches++;
408  }
409  else if ( Init == (int)(ABC_PTRUINT_T)pObj->pData )
410  nLatches++;
411  }
412  return nLatches;
413 }
414 
415 /**Function*************************************************************
416 
417  Synopsis [Retimes the node backward or forward.]
418 
419  Description []
420 
421  SideEffects []
422 
423  SeeAlso []
424 
425 ***********************************************************************/
426 void Abc_NtkRetimeShareLatches( Abc_Ntk_t * pNtk, int fInitial )
427 {
428  Vec_Ptr_t * vNodes;
429  Abc_Obj_t * pFanin, * pLatchTop, * pLatchCur;
430  int i, k;
431  vNodes = Vec_PtrAlloc( 10 );
432  // consider latch fanins
433  Abc_NtkForEachObj( pNtk, pFanin, i )
434  {
435  if ( Abc_NtkRetimeCheckCompatibleLatchFanouts(pFanin) <= 1 )
436  continue;
437  // get the first latch
438  pLatchTop = NULL;
439  Abc_ObjForEachFanout( pFanin, pLatchTop, k )
440  if ( Abc_ObjIsLatch(pLatchTop) )
441  break;
442  assert( pLatchTop && Abc_ObjIsLatch(pLatchTop) );
443  // redirect compatible fanout latches to the first latch
444  Abc_NodeCollectFanouts( pFanin, vNodes );
445  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pLatchCur, k )
446  {
447  if ( !Abc_ObjIsLatch(pLatchCur) )
448  continue;
449  if ( pLatchCur == pLatchTop )
450  continue;
451  if ( pLatchCur->pData != pLatchTop->pData )
452  continue;
453  // connect the initial state
454  if ( fInitial )
455  Abc_ObjAddFanin( pLatchCur->pCopy, pLatchTop->pCopy );
456  // redirect the fanouts
457  Abc_ObjTransferFanout( pLatchCur, pLatchTop );
458  Abc_NtkDeleteObj(pLatchCur);
459  }
460  }
461  Vec_PtrFree( vNodes );
462 }
463 
464 ////////////////////////////////////////////////////////////////////////
465 /// END OF FILE ///
466 ////////////////////////////////////////////////////////////////////////
467 
468 
470 
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
void st__free_table(st__table *table)
Definition: st.c:81
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static int Abc_NtkObjNumMax(Abc_Ntk_t *pNtk)
Definition: abc.h:284
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
Vec_Ptr_t * vBoxes
Definition: abc.h:168
int st__insert(st__table *table, const char *key, char *value)
Definition: st.c:171
int Abc_NtkRetimeCheckCompatibleLatchFanouts(Abc_Obj_t *pObj)
Definition: retIncrem.c:396
static int Abc_ObjIsLatch(Abc_Obj_t *pObj)
Definition: abc.h:356
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
static int Abc_NtkBoxNum(Abc_Ntk_t *pNtk)
Definition: abc.h:289
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
int st__ptrcmp(const char *, const char *)
Definition: st.c:480
int Abc_NtkRetimeMinDelay(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkCopy, int nDelayLim, int nIterLimit, int fForward, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: retDelay.c:50
ABC_DLL Abc_Obj_t * Abc_NtkDupObj(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj, int fCopyName)
Definition: abcObj.c:337
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
static int Abc_ObjIsPi(Abc_Obj_t *pObj)
Definition: abc.h:347
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition: abcNames.c:68
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
st__table * Abc_NtkRetimePrepareLatches(Abc_Ntk_t *pNtk)
Definition: retIncrem.c:109
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
Vec_Ptr_t * vCis
Definition: abc.h:165
void Abc_NtkRetimeShareLatches(Abc_Ntk_t *pNtk, int fInitial)
Definition: retIncrem.c:426
st__table * st__init_table(st__compare_func_type compare, st__hash_func_type hash)
Definition: st.c:72
static Abc_Obj_t * Abc_NtkCreateBo(Abc_Ntk_t *pNtk)
Definition: abc.h:306
ABC_DLL void Abc_ObjPatchFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew)
Definition: abcFanio.c:172
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
Abc_Ntk_t * Abc_NtkRetimeBackwardInitialStart(Abc_Ntk_t *pNtk)
Definition: retInit.c:254
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
#define st__count(table)
Definition: st.h:71
Abc_Obj_t * pCopy
Definition: abc.h:148
ABC_DLL void Abc_NtkDeleteObj(Abc_Obj_t *pObj)
Definition: abcObj.c:167
void Abc_NtkRetimeTranferToCopy(Abc_Ntk_t *pNtk)
Definition: retInit.c:168
Vec_Ptr_t * vCos
Definition: abc.h:166
Definition: st.h:52
Vec_Int_t * Abc_NtkRetimeCollectLatchValues(Abc_Ntk_t *pNtk)
Definition: retInit.c:208
void Abc_NtkRetimeNode(Abc_Obj_t *pObj, int fForward, int fInitial)
Definition: retIncrem.c:315
int Abc_ObjSopSimulate(Abc_Obj_t *pObj)
Definition: retInit.c:93
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeBuf(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
Definition: abcObj.c:692
static Abc_Obj_t * Abc_NtkCreateLatch(Abc_Ntk_t *pNtk)
Definition: abc.h:309
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition: abc.h:497
static ABC_NAMESPACE_IMPL_START int Abc_NtkRetimeOneWay(Abc_Ntk_t *pNtk, int fForward, int fVerbose)
DECLARATIONS ///.
Definition: retIncrem.c:225
int Abc_NtkRetimeNodeIsEnabled(Abc_Obj_t *pObj, int fForward)
Definition: retIncrem.c:284
ABC_DLL void Abc_ObjTransferFanout(Abc_Obj_t *pObjOld, Abc_Obj_t *pObjNew)
Definition: abcFanio.c:264
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
int st__lookup(st__table *table, const char *key, char **value)
Definition: st.c:114
Abc_Ntk_t * pNtk
Definition: abc.h:130
#define Vec_PtrForEachEntryStop(Type, vVec, pEntry, i, Stop)
Definition: vecPtr.h:59
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
void Abc_NtkRetimeBackwardInitialFinish(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew, Vec_Int_t *vValuesOld, int fVerbose)
Definition: retInit.c:279
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
int Abc_NtkRetimeIncremental(Abc_Ntk_t *pNtk, int nDelayLim, int fForward, int fMinDelay, int fOneStep, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: retIncrem.c:47
ABC_DLL void Abc_NodeCollectFanins(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition: abcUtil.c:1587
static int Abc_ObjIsPo(Abc_Obj_t *pObj)
Definition: abc.h:348
ABC_DLL void Abc_ObjDeleteFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:111
#define assert(ex)
Definition: util_old.h:213
void Abc_NtkRetimeTranferFromCopy(Abc_Ntk_t *pNtk)
Definition: retInit.c:188
void * pData
Definition: abc.h:145
int Abc_NtkRetimeFinalizeLatches(Abc_Ntk_t *pNtk, st__table *tLatches, int nIdMaxStart)
Definition: retIncrem.c:146
static Abc_Obj_t * Abc_NtkCreateBi(Abc_Ntk_t *pNtk)
Definition: abc.h:305
ABC_DLL void Abc_NodeCollectFanouts(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition: abcUtil.c:1607
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition: abc.h:446
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
Definition: abcDfs.c:1265
ABC_DLL void Abc_NtkOrderCisCos(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:71
int st__ptrhash(const char *, int)
Definition: st.c:468
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
Definition: abc.h:371
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223