abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
nwkFlow.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [nwkFlow.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Netlist representation.]
8 
9  Synopsis [Max-flow/min-cut computation.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: nwkFlow.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "nwk.h"
22 
24 
25 
26 /*
27  This code is based on the papers:
28  A. Hurst, A. Mishchenko, and R. Brayton, "Fast minimum-register retiming
29  via binary maximum-flow", Proc. FMCAD '07, pp. 181-187.
30  A. Hurst, A. Mishchenko, and R. Brayton, "Scalable min-area retiming
31  under simultaneous delay and initial state constraints". Proc. DAC'08.
32 */
33 
34 ////////////////////////////////////////////////////////////////////////
35 /// DECLARATIONS ///
36 ////////////////////////////////////////////////////////////////////////
37 
38 // predecessors
39 static inline Nwk_Obj_t * Nwk_ObjPred( Nwk_Obj_t * pObj ) { return (Nwk_Obj_t *)pObj->pCopy; }
40 static inline int Nwk_ObjSetPred( Nwk_Obj_t * pObj, Nwk_Obj_t * p ) { pObj->pCopy = p; return 1; }
41 // sink
42 static inline int Nwk_ObjIsSink( Nwk_Obj_t * pObj ) { return pObj->MarkA; }
43 static inline void Nwk_ObjSetSink( Nwk_Obj_t * pObj ) { pObj->MarkA = 1; }
44 // flow
45 static inline int Nwk_ObjHasFlow( Nwk_Obj_t * pObj ) { return pObj->MarkB; }
46 static inline void Nwk_ObjSetFlow( Nwk_Obj_t * pObj ) { pObj->MarkB = 1; }
47 static inline void Nwk_ObjClearFlow( Nwk_Obj_t * pObj ) { pObj->MarkB = 0; }
48 
49 // representation of visited nodes
50 // pObj->TravId < pNtk->nTravIds-2 --- not visited
51 // pObj->TravId == pNtk->nTravIds-2 --- visited bot only
52 // pObj->TravId == pNtk->nTravIds-1 --- visited top only
53 // pObj->TravId == pNtk->nTravIds --- visited bot and top
54 static inline int Nwk_ObjVisitedBotOnly( Nwk_Obj_t * pObj )
55 {
56  return pObj->TravId == pObj->pMan->nTravIds - 2;
57 }
58 static inline int Nwk_ObjVisitedBot( Nwk_Obj_t * pObj )
59 {
60  return pObj->TravId == pObj->pMan->nTravIds - 2 || pObj->TravId == pObj->pMan->nTravIds;
61 }
62 static inline int Nwk_ObjVisitedTop( Nwk_Obj_t * pObj )
63 {
64  return pObj->TravId == pObj->pMan->nTravIds - 1 || pObj->TravId == pObj->pMan->nTravIds;
65 }
66 static inline void Nwk_ObjSetVisitedBot( Nwk_Obj_t * pObj )
67 {
68  if ( pObj->TravId < pObj->pMan->nTravIds - 2 )
69  pObj->TravId = pObj->pMan->nTravIds - 2;
70  else if ( pObj->TravId == pObj->pMan->nTravIds - 1 )
71  pObj->TravId = pObj->pMan->nTravIds;
72  else
73  assert( 0 );
74 }
75 static inline void Nwk_ObjSetVisitedTop( Nwk_Obj_t * pObj )
76 {
77  if ( pObj->TravId < pObj->pMan->nTravIds - 2 )
78  pObj->TravId = pObj->pMan->nTravIds - 1;
79  else if ( pObj->TravId == pObj->pMan->nTravIds - 2 )
80  pObj->TravId = pObj->pMan->nTravIds;
81  else
82  assert( 0 );
83 }
84 static inline void Nwk_ManIncrementTravIdFlow( Nwk_Man_t * pMan )
85 {
86  Nwk_ManIncrementTravId( pMan );
87  Nwk_ManIncrementTravId( pMan );
88  Nwk_ManIncrementTravId( pMan );
89 }
90 
91 static int Nwk_ManPushForwardTop_rec( Nwk_Obj_t * pObj, Nwk_Obj_t * pPred );
92 static int Nwk_ManPushForwardBot_rec( Nwk_Obj_t * pObj, Nwk_Obj_t * pPred );
93 
94 static int Nwk_ManPushBackwardTop_rec( Nwk_Obj_t * pObj, Nwk_Obj_t * pPred );
95 static int Nwk_ManPushBackwardBot_rec( Nwk_Obj_t * pObj, Nwk_Obj_t * pPred );
96 
97 ////////////////////////////////////////////////////////////////////////
98 /// FUNCTION DEFINITIONS ///
99 ////////////////////////////////////////////////////////////////////////
100 
101 /**Function*************************************************************
102 
103  Synopsis [Marks TFI of the node.]
104 
105  Description []
106 
107  SideEffects []
108 
109  SeeAlso []
110 
111 ***********************************************************************/
113 {
114  Nwk_Obj_t * pNext;
115  int i;
116  if ( pObj->MarkA )
117  return;
118  pObj->MarkA = 1;
119  Nwk_ObjForEachFanin( pObj, pNext, i )
120  Nwk_ManMarkTfiCone_rec( pNext );
121 }
122 
123 /**Function*************************************************************
124 
125  Synopsis [Marks TFO of the node.]
126 
127  Description []
128 
129  SideEffects []
130 
131  SeeAlso []
132 
133 ***********************************************************************/
135 {
136  Nwk_Obj_t * pNext;
137  int i;
138  if ( pObj->MarkA )
139  return;
140  pObj->MarkA = 1;
141  Nwk_ObjForEachFanout( pObj, pNext, i )
142  Nwk_ManMarkTfoCone_rec( pNext );
143 }
144 
145 /**Function*************************************************************
146 
147  Synopsis [Fast forward flow pushing.]
148 
149  Description []
150 
151  SideEffects []
152 
153  SeeAlso []
154 
155 ***********************************************************************/
157 {
158  Nwk_Obj_t * pNext;
159  int i;
160  if ( Nwk_ObjIsTravIdCurrent( pObj ) )
161  return 0;
162  Nwk_ObjSetTravIdCurrent( pObj );
163  if ( Nwk_ObjHasFlow(pObj) )
164  return 0;
165  if ( Nwk_ObjIsSink(pObj) )
166  {
167  Nwk_ObjSetFlow(pObj);
168  return Nwk_ObjSetPred( pObj, pPred );
169  }
170  Nwk_ObjForEachFanout( pObj, pNext, i )
171  if ( Nwk_ManPushForwardFast_rec( pNext, pObj ) )
172  {
173  Nwk_ObjSetFlow(pObj);
174  return Nwk_ObjSetPred( pObj, pPred );
175  }
176  return 0;
177 }
178 
179 /**Function*************************************************************
180 
181  Synopsis [Fast backward flow pushing.]
182 
183  Description []
184 
185  SideEffects []
186 
187  SeeAlso []
188 
189 ***********************************************************************/
191 {
192  Nwk_Obj_t * pNext;
193  int i;
194  if ( Nwk_ObjIsTravIdCurrent( pObj ) )
195  return 0;
196  Nwk_ObjSetTravIdCurrent( pObj );
197  if ( Nwk_ObjHasFlow(pObj) )
198  return 0;
199  if ( Nwk_ObjIsSink(pObj) )
200  {
201  Nwk_ObjSetFlow(pObj);
202  return Nwk_ObjSetPred( pObj, pPred );
203  }
204  Nwk_ObjForEachFanin( pObj, pNext, i )
205  if ( Nwk_ManPushBackwardFast_rec( pNext, pObj ) )
206  {
207  Nwk_ObjSetFlow(pObj);
208  return Nwk_ObjSetPred( pObj, pPred );
209  }
210  return 0;
211 }
212 
213 /**Function*************************************************************
214 
215  Synopsis [Pushing the flow through the bottom part of the node.]
216 
217  Description []
218 
219  SideEffects []
220 
221  SeeAlso []
222 
223 ***********************************************************************/
225 {
226  Nwk_Obj_t * pNext;
227  int i;
228  if ( Nwk_ObjVisitedBot(pObj) )
229  return 0;
230  Nwk_ObjSetVisitedBot(pObj);
231  // propagate through the internal edge
232  if ( Nwk_ObjHasFlow(pObj) )
233  {
234  if ( Nwk_ObjPred(pObj) )
235  if ( Nwk_ManPushForwardTop_rec( Nwk_ObjPred(pObj), Nwk_ObjPred(pObj) ) )
236  return Nwk_ObjSetPred( pObj, pPred );
237  }
238  else if ( Nwk_ManPushForwardTop_rec(pObj, pObj) )
239  {
240  Nwk_ObjSetFlow( pObj );
241  return Nwk_ObjSetPred( pObj, pPred );
242  }
243  // try to push through the fanins
244  Nwk_ObjForEachFanin( pObj, pNext, i )
245  if ( Nwk_ManPushForwardBot_rec( pNext, pPred ) )
246  return 1;
247  return 0;
248 }
249 
250 /**Function*************************************************************
251 
252  Synopsis [Pushing the flow through the top part of the node.]
253 
254  Description []
255 
256  SideEffects []
257 
258  SeeAlso []
259 
260 ***********************************************************************/
262 {
263  Nwk_Obj_t * pNext;
264  int i;
265  if ( Nwk_ObjVisitedTop(pObj) )
266  return 0;
267  Nwk_ObjSetVisitedTop(pObj);
268  // check if this is the sink
269  if ( Nwk_ObjIsSink(pObj) )
270  return 1;
271  // try to push through the fanouts
272  Nwk_ObjForEachFanout( pObj, pNext, i )
273  if ( Nwk_ManPushForwardBot_rec( pNext, pPred ) )
274  return 1;
275  // redirect the flow
276  if ( Nwk_ObjHasFlow(pObj) && !Nwk_ObjIsCi(pObj) )
277  if ( Nwk_ManPushForwardBot_rec( pObj, Nwk_ObjPred(pObj) ) )
278  {
279  Nwk_ObjClearFlow( pObj );
280  return Nwk_ObjSetPred( pObj, NULL );
281  }
282  return 0;
283 }
284 
285 /**Function*************************************************************
286 
287  Synopsis [Pushing the flow through the bottom part of the node.]
288 
289  Description []
290 
291  SideEffects []
292 
293  SeeAlso []
294 
295 ***********************************************************************/
297 {
298  if ( Nwk_ObjVisitedBot(pObj) )
299  return 0;
300  Nwk_ObjSetVisitedBot(pObj);
301  // propagate through the internal edge
302  if ( Nwk_ObjHasFlow(pObj) )
303  {
304  if ( Nwk_ObjPred(pObj) )
305  if ( Nwk_ManPushBackwardTop_rec( Nwk_ObjPred(pObj), Nwk_ObjPred(pObj) ) )
306  return Nwk_ObjSetPred( pObj, pPred );
307  }
308  else if ( Nwk_ManPushBackwardTop_rec(pObj, pObj) )
309  {
310  Nwk_ObjSetFlow( pObj );
311  return Nwk_ObjSetPred( pObj, pPred );
312  }
313  return 0;
314 }
315 
316 /**Function*************************************************************
317 
318  Synopsis [Pushing the flow through the top part of the node.]
319 
320  Description []
321 
322  SideEffects []
323 
324  SeeAlso []
325 
326 ***********************************************************************/
328 {
329  Nwk_Obj_t * pNext;
330  int i;
331  if ( Nwk_ObjVisitedTop(pObj) )
332  return 0;
333  Nwk_ObjSetVisitedTop(pObj);
334  // check if this is the sink
335  if ( Nwk_ObjIsSink(pObj) )
336  return 1;
337  // try to push through the fanins
338  Nwk_ObjForEachFanin( pObj, pNext, i )
339  if ( Nwk_ManPushBackwardBot_rec( pNext, pPred ) )
340  return 1;
341  // try to push through the fanouts
342  Nwk_ObjForEachFanout( pObj, pNext, i )
343  if ( !Nwk_ObjIsCo(pObj) && Nwk_ManPushBackwardTop_rec( pNext, pPred ) )
344  return 1;
345  // redirect the flow
346  if ( Nwk_ObjHasFlow(pObj) )
347  if ( Nwk_ObjPred(pObj) && Nwk_ManPushBackwardBot_rec( pObj, Nwk_ObjPred(pObj) ) )
348  {
349  Nwk_ObjClearFlow( pObj );
350  return Nwk_ObjSetPred( pObj, NULL );
351  }
352  return 0;
353 }
354 
355 /**Function*************************************************************
356 
357  Synopsis [Returns 0 if there is an unmarked path to a CI.]
358 
359  Description []
360 
361  SideEffects []
362 
363  SeeAlso []
364 
365 ***********************************************************************/
367 {
368  Nwk_Obj_t * pNext;
369  int i;
370  if ( pObj->MarkA )
371  return 1;
372  if ( Nwk_ObjIsLo(pObj) )
373  return 0;
374  if ( Nwk_ObjIsTravIdCurrent( pObj ) )
375  return 1;
376  Nwk_ObjSetTravIdCurrent( pObj );
377  Nwk_ObjForEachFanin( pObj, pNext, i )
378  if ( !Nwk_ManVerifyCut_rec( pNext ) )
379  return 0;
380  return 1;
381 }
382 
383 /**Function*************************************************************
384 
385  Synopsis [Verifies the forward cut.]
386 
387  Description []
388 
389  SideEffects []
390 
391  SeeAlso []
392 
393 ***********************************************************************/
395 {
396  Nwk_Obj_t * pObj;
397  int i;
398  // mark the nodes
399  Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pObj, i )
400  {
401  assert( pObj->MarkA == 0 );
402  pObj->MarkA = 1;
403  }
404  // traverse from the COs
405  Nwk_ManIncrementTravId( pMan );
406  Nwk_ManForEachCo( pMan, pObj, i )
407  if ( !Nwk_ManVerifyCut_rec( pObj ) )
408  printf( "Nwk_ManRetimeVerifyCutForward(): Internal cut verification failed.\n" );
409  // unmark the nodes
410  Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pObj, i )
411  pObj->MarkA = 0;
412  return 1;
413 }
414 
415 /**Function*************************************************************
416 
417  Synopsis [Verifies the forward cut.]
418 
419  Description []
420 
421  SideEffects []
422 
423  SeeAlso []
424 
425 ***********************************************************************/
427 {
428  return 1;
429 }
430 
431 /**Function*************************************************************
432 
433  Synopsis [Computes minimum cut for forward retiming.]
434 
435  Description []
436 
437  SideEffects []
438 
439  SeeAlso []
440 
441 ***********************************************************************/
442 Vec_Ptr_t * Nwk_ManRetimeCutForward( Nwk_Man_t * pMan, int nLatches, int fVerbose )
443 {
444  Vec_Ptr_t * vNodes;
445  Nwk_Obj_t * pObj;
446  int i, RetValue, Counter = 0, Counter2 = 0;
447  abctime clk = Abc_Clock();
448  // set the sequential parameters
449  pMan->nLatches = nLatches;
450  pMan->nTruePis = Nwk_ManCiNum(pMan) - nLatches;
451  pMan->nTruePos = Nwk_ManCoNum(pMan) - nLatches;
452  // mark the COs and the TFO of PIs
453  Nwk_ManForEachCo( pMan, pObj, i )
454  pObj->MarkA = 1;
455  Nwk_ManForEachPiSeq( pMan, pObj, i )
456  Nwk_ManMarkTfoCone_rec( pObj );
457  // start flow computation from each LO
459  Nwk_ManForEachLoSeq( pMan, pObj, i )
460  {
461  if ( !Nwk_ManPushForwardFast_rec( pObj, NULL ) )
462  continue;
464  Counter++;
465  }
466  if ( fVerbose )
467  printf( "Forward: Max-flow = %4d -> ", Counter );
468  // continue flow computation from each LO
470  Nwk_ManForEachLoSeq( pMan, pObj, i )
471  {
472  if ( !Nwk_ManPushForwardBot_rec( pObj, NULL ) )
473  continue;
475  Counter2++;
476  }
477  if ( fVerbose )
478  printf( "%4d. ", Counter+Counter2 );
479  // repeat flow computation from each LO
480  if ( Counter2 > 0 )
481  {
483  Nwk_ManForEachLoSeq( pMan, pObj, i )
484  {
485  RetValue = Nwk_ManPushForwardBot_rec( pObj, NULL );
486  assert( !RetValue );
487  }
488  }
489  // cut is a set of nodes whose bottom is visited but top is not visited
490  vNodes = Vec_PtrAlloc( Counter+Counter2 );
491  Counter = 0;
492  Nwk_ManForEachObj( pMan, pObj, i )
493  {
494  if ( Nwk_ObjVisitedBotOnly(pObj) )
495  {
496  assert( Nwk_ObjHasFlow(pObj) );
497  assert( !Nwk_ObjIsCo(pObj) );
498  Vec_PtrPush( vNodes, pObj );
499  Counter += Nwk_ObjIsCi(pObj);
500  }
501  }
502  Nwk_ManCleanMarks( pMan );
503 // assert( Nwk_ManRetimeVerifyCutForward(pMan, vNodes) );
504  if ( fVerbose )
505  {
506  printf( "Min-cut = %4d. Unmoved = %4d. ", Vec_PtrSize(vNodes), Counter );
507  ABC_PRT( "Time", Abc_Clock() - clk );
508  }
509  return vNodes;
510 }
511 
512 /**Function*************************************************************
513 
514  Synopsis [Computes minimum cut for backward retiming.]
515 
516  Description []
517 
518  SideEffects []
519 
520  SeeAlso []
521 
522 ***********************************************************************/
523 Vec_Ptr_t * Nwk_ManRetimeCutBackward( Nwk_Man_t * pMan, int nLatches, int fVerbose )
524 {
525  Vec_Ptr_t * vNodes;
526  Nwk_Obj_t * pObj;
527  int i, RetValue, Counter = 0, Counter2 = 0;
528  abctime clk = Abc_Clock();
529  // set the sequential parameters
530  pMan->nLatches = nLatches;
531  pMan->nTruePis = Nwk_ManCiNum(pMan) - nLatches;
532  pMan->nTruePos = Nwk_ManCoNum(pMan) - nLatches;
533  // mark the CIs, the TFI of POs, and the constant nodes
534  Nwk_ManForEachCi( pMan, pObj, i )
535  pObj->MarkA = 1;
536  Nwk_ManForEachPoSeq( pMan, pObj, i )
537  Nwk_ManMarkTfiCone_rec( pObj );
538  Nwk_ManForEachNode( pMan, pObj, i )
539  if ( Nwk_ObjFaninNum(pObj) == 0 )
540  pObj->MarkA = 1;
541  // start flow computation from each LI driver
543  Nwk_ManForEachLiSeq( pMan, pObj, i )
544  {
545  if ( !Nwk_ManPushBackwardFast_rec( Nwk_ObjFanin0(pObj), NULL ) )
546  continue;
548  Counter++;
549  }
550  if ( fVerbose )
551  printf( "Backward: Max-flow = %4d -> ", Counter );
552  // continue flow computation from each LI driver
554  Nwk_ManForEachLiSeq( pMan, pObj, i )
555  {
556  if ( !Nwk_ManPushBackwardBot_rec( Nwk_ObjFanin0(pObj), NULL ) )
557  continue;
559  Counter2++;
560  }
561  if ( fVerbose )
562  printf( "%4d. ", Counter+Counter2 );
563  // repeat flow computation from each LI driver
564  if ( Counter2 > 0 )
565  {
567  Nwk_ManForEachLiSeq( pMan, pObj, i )
568  {
569  RetValue = Nwk_ManPushBackwardBot_rec( Nwk_ObjFanin0(pObj), NULL );
570  assert( !RetValue );
571  }
572  }
573  // cut is a set of nodes whose bottom is visited but top is not visited
574  vNodes = Vec_PtrAlloc( Counter+Counter2 );
575  Nwk_ManForEachObj( pMan, pObj, i )
576  {
577  if ( Nwk_ObjVisitedBotOnly(pObj) )
578  {
579  assert( Nwk_ObjHasFlow(pObj) );
580  assert( !Nwk_ObjIsCo(pObj) );
581  Vec_PtrPush( vNodes, pObj );
582  }
583  }
584  // count CO drivers
585  Counter = 0;
586  Nwk_ManForEachLiSeq( pMan, pObj, i )
587  if ( Nwk_ObjVisitedBotOnly( Nwk_ObjFanin0(pObj) ) )
588  Counter++;
589  Nwk_ManCleanMarks( pMan );
590 // assert( Nwk_ManRetimeVerifyCutBackward(pMan, vNodes) );
591  if ( fVerbose )
592  {
593  printf( "Min-cut = %4d. Unmoved = %4d. ", Vec_PtrSize(vNodes), Counter );
594  ABC_PRT( "Time", Abc_Clock() - clk );
595  }
596  return vNodes;
597 }
598 
599 
600 ////////////////////////////////////////////////////////////////////////
601 /// END OF FILE ///
602 ////////////////////////////////////////////////////////////////////////
603 
604 
606 
static int Nwk_ObjIsCi(Nwk_Obj_t *p)
Definition: nwk.h:146
int Nwk_ManRetimeVerifyCutForward(Nwk_Man_t *pMan, Vec_Ptr_t *vNodes)
Definition: nwkFlow.c:394
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static int Nwk_ObjVisitedBotOnly(Nwk_Obj_t *pObj)
Definition: nwkFlow.c:54
static ABC_NAMESPACE_IMPL_START Nwk_Obj_t * Nwk_ObjPred(Nwk_Obj_t *pObj)
DECLARATIONS ///.
Definition: nwkFlow.c:39
ABC_DLL void Nwk_ManCleanMarks(Nwk_Man_t *pNtk)
Definition: nwkUtil.c:464
#define Nwk_ManForEachCo(p, pObj, i)
Definition: nwk.h:181
static void Nwk_ObjSetSink(Nwk_Obj_t *pObj)
Definition: nwkFlow.c:43
int nTruePis
Definition: nwk.h:82
typedefABC_NAMESPACE_HEADER_START struct Nwk_Obj_t_ Nwk_Obj_t
INCLUDES ///.
Definition: nwk.h:49
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define Nwk_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: nwk.h:179
static void Nwk_ObjClearFlow(Nwk_Obj_t *pObj)
Definition: nwkFlow.c:47
#define Nwk_ObjForEachFanout(pObj, pFanout, i)
Definition: nwk.h:201
int Nwk_ManPushBackwardFast_rec(Nwk_Obj_t *pObj, Nwk_Obj_t *pPred)
Definition: nwkFlow.c:190
#define Nwk_ManForEachLoSeq(p, pObj, i)
Definition: nwk.h:209
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static void Nwk_ObjSetVisitedBot(Nwk_Obj_t *pObj)
Definition: nwkFlow.c:66
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static void Nwk_ObjSetFlow(Nwk_Obj_t *pObj)
Definition: nwkFlow.c:46
static int Nwk_ObjFaninNum(Nwk_Obj_t *p)
Definition: nwk.h:137
#define Nwk_ManForEachPiSeq(p, pObj, i)
Definition: nwk.h:205
int Nwk_ManPushForwardFast_rec(Nwk_Obj_t *pObj, Nwk_Obj_t *pPred)
Definition: nwkFlow.c:156
void Nwk_ManMarkTfoCone_rec(Nwk_Obj_t *pObj)
Definition: nwkFlow.c:134
static void Nwk_ObjSetTravIdCurrent(Nwk_Obj_t *pObj)
Definition: nwk.h:166
static int Nwk_ManPushBackwardTop_rec(Nwk_Obj_t *pObj, Nwk_Obj_t *pPred)
Definition: nwkFlow.c:327
static int Nwk_ObjVisitedBot(Nwk_Obj_t *pObj)
Definition: nwkFlow.c:58
static int Nwk_ObjIsLo(Nwk_Obj_t *p)
Definition: nwk.h:153
static int Nwk_ObjIsSink(Nwk_Obj_t *pObj)
Definition: nwkFlow.c:42
int Nwk_ManRetimeVerifyCutBackward(Nwk_Man_t *pMan, Vec_Ptr_t *vNodes)
Definition: nwkFlow.c:426
static int Nwk_ObjIsCo(Nwk_Obj_t *p)
Definition: nwk.h:147
static int Nwk_ObjVisitedTop(Nwk_Obj_t *pObj)
Definition: nwkFlow.c:62
Definition: nwk.h:61
#define Nwk_ManForEachPoSeq(p, pObj, i)
Definition: nwk.h:207
Vec_Ptr_t * Nwk_ManRetimeCutBackward(Nwk_Man_t *pMan, int nLatches, int fVerbose)
Definition: nwkFlow.c:523
static int Nwk_ObjIsTravIdCurrent(Nwk_Obj_t *pObj)
Definition: nwk.h:168
static int Nwk_ManPushForwardTop_rec(Nwk_Obj_t *pObj, Nwk_Obj_t *pPred)
Definition: nwkFlow.c:261
int Nwk_ManVerifyCut_rec(Nwk_Obj_t *pObj)
Definition: nwkFlow.c:366
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
void Nwk_ManMarkTfiCone_rec(Nwk_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
Definition: nwkFlow.c:112
static void Nwk_ObjSetVisitedTop(Nwk_Obj_t *pObj)
Definition: nwkFlow.c:75
static int Nwk_ManPushForwardBot_rec(Nwk_Obj_t *pObj, Nwk_Obj_t *pPred)
Definition: nwkFlow.c:224
ABC_DLL void Nwk_ManIncrementTravId(Nwk_Man_t *pNtk)
DECLARATIONS ///.
Definition: nwkUtil.c:47
static int Counter
Vec_Ptr_t * Nwk_ManRetimeCutForward(Nwk_Man_t *pMan, int nLatches, int fVerbose)
Definition: nwkFlow.c:442
static int Nwk_ManCiNum(Nwk_Man_t *p)
MACRO DEFINITIONS ///.
Definition: nwk.h:125
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
static int Nwk_ObjHasFlow(Nwk_Obj_t *pObj)
Definition: nwkFlow.c:45
#define Nwk_ManForEachLiSeq(p, pObj, i)
Definition: nwk.h:211
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define Nwk_ObjForEachFanin(pObj, pFanin, i)
Definition: nwk.h:199
#define ABC_PRT(a, t)
Definition: abc_global.h:220
#define Nwk_ManForEachObj(p, pObj, i)
Definition: nwk.h:189
static Nwk_Obj_t * Nwk_ObjFanin0(Nwk_Obj_t *p)
Definition: nwk.h:140
#define assert(ex)
Definition: util_old.h:213
static void Nwk_ManIncrementTravIdFlow(Nwk_Man_t *pMan)
Definition: nwkFlow.c:84
static int Nwk_ManPushBackwardBot_rec(Nwk_Obj_t *pObj, Nwk_Obj_t *pPred)
Definition: nwkFlow.c:296
int nLatches
Definition: nwk.h:81
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
ABC_INT64_T abctime
Definition: abc_global.h:278
static int Nwk_ObjSetPred(Nwk_Obj_t *pObj, Nwk_Obj_t *p)
Definition: nwkFlow.c:40
int nTruePos
Definition: nwk.h:83
static int Nwk_ManCoNum(Nwk_Man_t *p)
Definition: nwk.h:126
#define Nwk_ManForEachNode(p, pObj, i)
Definition: nwk.h:192