abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
nwkDfs.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [nwkDfs.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Logic network representation.]
8 
9  Synopsis [DFS traversals.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: nwkDfs.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "nwk.h"
22 
24 
25 
26 ////////////////////////////////////////////////////////////////////////
27 /// DECLARATIONS ///
28 ////////////////////////////////////////////////////////////////////////
29 
30 ////////////////////////////////////////////////////////////////////////
31 /// FUNCTION DEFINITIONS ///
32 ////////////////////////////////////////////////////////////////////////
33 
34 /**Function*************************************************************
35 
36  Synopsis [Verifies that the objects are in a topo order.]
37 
38  Description []
39 
40  SideEffects []
41 
42  SeeAlso []
43 
44 ***********************************************************************/
46 {
47  Nwk_Obj_t * pObj, * pNext;
48  int i, k, iBox, iTerm1, nTerms;
49  Nwk_ManIncrementTravId( pNtk );
50  Nwk_ManForEachObj( pNtk, pObj, i )
51  {
52  if ( Nwk_ObjIsNode(pObj) || Nwk_ObjIsCo(pObj) )
53  {
54  Nwk_ObjForEachFanin( pObj, pNext, k )
55  {
56  if ( !Nwk_ObjIsTravIdCurrent(pNext) )
57  {
58  printf( "Node %d has fanin %d that is not in a topological order.\n", pObj->Id, pNext->Id );
59  return 0;
60  }
61  }
62  }
63  else if ( Nwk_ObjIsCi(pObj) )
64  {
65  if ( pNtk->pManTime )
66  {
67  iBox = Tim_ManBoxForCi( pNtk->pManTime, pObj->PioId );
68  if ( iBox >= 0 ) // this is not a true PI
69  {
70  iTerm1 = Tim_ManBoxInputFirst( pNtk->pManTime, iBox );
71  nTerms = Tim_ManBoxInputNum( pNtk->pManTime, iBox );
72  for ( k = 0; k < nTerms; k++ )
73  {
74  pNext = Nwk_ManCo( pNtk, iTerm1 + k );
75  if ( !Nwk_ObjIsTravIdCurrent(pNext) )
76  {
77  printf( "Box %d has input %d that is not in a topological order.\n", iBox, pNext->Id );
78  return 0;
79  }
80  }
81  }
82  }
83  }
84  else
85  assert( 0 );
87  }
88  return 1;
89 }
90 
91 /**Function*************************************************************
92 
93  Synopsis [Computes the number of logic levels not counting PIs/POs.]
94 
95  Description [Assumes that white boxes have unit level.]
96 
97  SideEffects []
98 
99  SeeAlso []
100 
101 ***********************************************************************/
103 {
104  Tim_Man_t * pManTimeUnit;
105  Nwk_Obj_t * pObj, * pFanin;
106  int i, k, LevelMax, Level;
108  // clean the levels
109  Nwk_ManForEachObj( pNtk, pObj, i )
110  Nwk_ObjSetLevel( pObj, 0 );
111  // perform level computation
112  LevelMax = 0;
113  pManTimeUnit = pNtk->pManTime ? Tim_ManDup( pNtk->pManTime, 1 ) : NULL;
114  if ( pManTimeUnit )
115  Tim_ManIncrementTravId( pManTimeUnit );
116  Nwk_ManForEachObj( pNtk, pObj, i )
117  {
118  if ( Nwk_ObjIsCi(pObj) )
119  {
120  Level = pManTimeUnit? (int)Tim_ManGetCiArrival( pManTimeUnit, pObj->PioId ) : 0;
121  Nwk_ObjSetLevel( pObj, Level );
122  }
123  else if ( Nwk_ObjIsCo(pObj) )
124  {
125  Level = Nwk_ObjLevel( Nwk_ObjFanin0(pObj) );
126  if ( pManTimeUnit )
127  Tim_ManSetCoArrival( pManTimeUnit, pObj->PioId, (float)Level );
128  Nwk_ObjSetLevel( pObj, Level );
129  if ( LevelMax < Nwk_ObjLevel(pObj) )
130  LevelMax = Nwk_ObjLevel(pObj);
131  }
132  else if ( Nwk_ObjIsNode(pObj) )
133  {
134  Level = 0;
135  Nwk_ObjForEachFanin( pObj, pFanin, k )
136  if ( Level < Nwk_ObjLevel(pFanin) )
137  Level = Nwk_ObjLevel(pFanin);
138  Nwk_ObjSetLevel( pObj, Level + 1 );
139  }
140  else
141  assert( 0 );
142  }
143  // set the old timing manager
144  if ( pManTimeUnit )
145  Tim_ManStop( pManTimeUnit );
146  return LevelMax;
147 }
148 
149 /**Function*************************************************************
150 
151  Synopsis [Computes the number of logic levels not counting PIs/POs.]
152 
153  Description []
154 
155  SideEffects []
156 
157  SeeAlso []
158 
159 ***********************************************************************/
161 {
162  Tim_Man_t * pManTime = pObj->pMan->pManTime;
163  Nwk_Obj_t * pNext;
164  int i, iBox, iTerm1, nTerms, LevelMax = 0;
165  if ( Nwk_ObjIsTravIdCurrent( pObj ) )
166  return;
167  Nwk_ObjSetTravIdCurrent( pObj );
168  if ( Nwk_ObjIsCi(pObj) )
169  {
170  if ( pManTime )
171  {
172  iBox = Tim_ManBoxForCi( pManTime, pObj->PioId );
173  if ( iBox >= 0 ) // this is not a true PI
174  {
175  iTerm1 = Tim_ManBoxInputFirst( pManTime, iBox );
176  nTerms = Tim_ManBoxInputNum( pManTime, iBox );
177  for ( i = 0; i < nTerms; i++ )
178  {
179  pNext = Nwk_ManCo(pObj->pMan, iTerm1 + i);
180  Nwk_ManLevel_rec( pNext );
181  if ( LevelMax < Nwk_ObjLevel(pNext) )
182  LevelMax = Nwk_ObjLevel(pNext);
183  }
184  LevelMax++;
185  }
186  }
187  }
188  else if ( Nwk_ObjIsNode(pObj) || Nwk_ObjIsCo(pObj) )
189  {
190  Nwk_ObjForEachFanin( pObj, pNext, i )
191  {
192  Nwk_ManLevel_rec( pNext );
193  if ( LevelMax < Nwk_ObjLevel(pNext) )
194  LevelMax = Nwk_ObjLevel(pNext);
195  }
196  if ( Nwk_ObjIsNode(pObj) && Nwk_ObjFaninNum(pObj) > 0 )
197  LevelMax++;
198  }
199  else
200  assert( 0 );
201  Nwk_ObjSetLevel( pObj, LevelMax );
202 }
203 
204 /**Function*************************************************************
205 
206  Synopsis [Computes the number of logic levels not counting PIs/POs.]
207 
208  Description [Does not assume that the objects are in a topo order.]
209 
210  SideEffects []
211 
212  SeeAlso []
213 
214 ***********************************************************************/
215 int Nwk_ManLevel( Nwk_Man_t * pNtk )
216 {
217  Nwk_Obj_t * pObj;
218  int i, LevelMax = 0;
219  Nwk_ManForEachObj( pNtk, pObj, i )
220  Nwk_ObjSetLevel( pObj, 0 );
221  Nwk_ManIncrementTravId( pNtk );
222  Nwk_ManForEachPo( pNtk, pObj, i )
223  {
224  Nwk_ManLevel_rec( pObj );
225  if ( LevelMax < Nwk_ObjLevel(pObj) )
226  LevelMax = Nwk_ObjLevel(pObj);
227  }
228  Nwk_ManForEachCi( pNtk, pObj, i )
229  {
230  Nwk_ManLevel_rec( pObj );
231  if ( LevelMax < Nwk_ObjLevel(pObj) )
232  LevelMax = Nwk_ObjLevel(pObj);
233  }
234  return LevelMax;
235 }
236 
237 /**Function*************************************************************
238 
239  Synopsis [Computes the number of logic levels not counting PIs/POs.]
240 
241  Description [Does not assume that the objects are in a topo order.]
242 
243  SideEffects []
244 
245  SeeAlso []
246 
247 ***********************************************************************/
249 {
250  Nwk_Obj_t * pObj;
251  int i, LevelMax = 0;
252  Nwk_ManForEachPo( pNtk, pObj, i )
253  if ( LevelMax < Nwk_ObjLevel(pObj) )
254  LevelMax = Nwk_ObjLevel(pObj);
255  return LevelMax;
256 }
257 
258 /**Function*************************************************************
259 
260  Synopsis [Returns the array of objects in the AIG manager ordered by level.]
261 
262  Description []
263 
264  SideEffects []
265 
266  SeeAlso []
267 
268 ***********************************************************************/
270 {
271  Nwk_Obj_t * pObj;
272  Vec_Vec_t * vLevels;
273  int nLevels, i;
274  assert( Nwk_ManVerifyLevel(pNtk) );
275  nLevels = Nwk_ManLevelMax( pNtk );
276  vLevels = Vec_VecStart( nLevels + 1 );
277  Nwk_ManForEachNode( pNtk, pObj, i )
278  {
279  assert( Nwk_ObjLevel(pObj) <= nLevels );
280  Vec_VecPush( vLevels, Nwk_ObjLevel(pObj), pObj );
281  }
282  return vLevels;
283 }
284 
285 
286 
287 /**Function*************************************************************
288 
289  Synopsis [Performs DFS for one node.]
290 
291  Description []
292 
293  SideEffects []
294 
295  SeeAlso []
296 
297 ***********************************************************************/
298 void Nwk_ManDfs_rec( Nwk_Obj_t * pObj, Vec_Ptr_t * vNodes )
299 {
300  Nwk_Obj_t * pNext;
301  int i;
302  if ( Nwk_ObjIsTravIdCurrent( pObj ) )
303  return;
304  Nwk_ObjSetTravIdCurrent( pObj );
305  Nwk_ObjForEachFanin( pObj, pNext, i )
306  Nwk_ManDfs_rec( pNext, vNodes );
307  Vec_PtrPush( vNodes, pObj );
308 }
309 
310 /**Function*************************************************************
311 
312  Synopsis [Returns the DFS ordered array of all objects except latches.]
313 
314  Description []
315 
316  SideEffects []
317 
318  SeeAlso []
319 
320 ***********************************************************************/
322 {
323  Vec_Ptr_t * vNodes;
324  Nwk_Obj_t * pObj;
325  int i;
326  Nwk_ManIncrementTravId( pNtk );
327  vNodes = Vec_PtrAlloc( 100 );
328  Nwk_ManForEachObj( pNtk, pObj, i )
329  {
330  if ( Nwk_ObjIsCi(pObj) )
331  {
332  Nwk_ObjSetTravIdCurrent( pObj );
333  Vec_PtrPush( vNodes, pObj );
334  }
335  else if ( Nwk_ObjIsCo(pObj) )
336  Nwk_ManDfs_rec( pObj, vNodes );
337  }
338  return vNodes;
339 }
340 
341 /**Function*************************************************************
342 
343  Synopsis [Performs DFS for one node.]
344 
345  Description []
346 
347  SideEffects []
348 
349  SeeAlso []
350 
351 ***********************************************************************/
352 void Nwk_ManDfsNodes_rec( Nwk_Obj_t * pObj, Vec_Ptr_t * vNodes )
353 {
354  Nwk_Obj_t * pNext;
355  int i;
356  if ( Nwk_ObjIsTravIdCurrent( pObj ) )
357  return;
358  Nwk_ObjSetTravIdCurrent( pObj );
359  if ( Nwk_ObjIsCi(pObj) )
360  return;
361  assert( Nwk_ObjIsNode(pObj) );
362  Nwk_ObjForEachFanin( pObj, pNext, i )
363  Nwk_ManDfsNodes_rec( pNext, vNodes );
364  Vec_PtrPush( vNodes, pObj );
365 }
366 
367 /**Function*************************************************************
368 
369  Synopsis [Returns the set of internal nodes rooted in the given nodes.]
370 
371  Description []
372 
373  SideEffects []
374 
375  SeeAlso []
376 
377 ***********************************************************************/
378 Vec_Ptr_t * Nwk_ManDfsNodes( Nwk_Man_t * pNtk, Nwk_Obj_t ** ppNodes, int nNodes )
379 {
380  Vec_Ptr_t * vNodes;
381  int i;
382  // set the traversal ID
383  Nwk_ManIncrementTravId( pNtk );
384  // start the array of nodes
385  vNodes = Vec_PtrAlloc( 100 );
386  // go through the PO nodes and call for each of them
387  for ( i = 0; i < nNodes; i++ )
388  if ( Nwk_ObjIsCo(ppNodes[i]) )
389  Nwk_ManDfsNodes_rec( Nwk_ObjFanin0(ppNodes[i]), vNodes );
390  else
391  Nwk_ManDfsNodes_rec( ppNodes[i], vNodes );
392  return vNodes;
393 }
394 
395 /**Function*************************************************************
396 
397  Synopsis [Performs DFS for one node.]
398 
399  Description []
400 
401  SideEffects []
402 
403  SeeAlso []
404 
405 ***********************************************************************/
406 void Nwk_ManDfsReverse_rec( Nwk_Obj_t * pObj, Vec_Ptr_t * vNodes )
407 {
408  Nwk_Obj_t * pNext;
409  int i, iBox, iTerm1, nTerms;
410  if ( Nwk_ObjIsTravIdCurrent( pObj ) )
411  return;
412  Nwk_ObjSetTravIdCurrent( pObj );
413  if ( Nwk_ObjIsCo(pObj) )
414  {
415  if ( pObj->pMan->pManTime )
416  {
417  iBox = Tim_ManBoxForCo( pObj->pMan->pManTime, pObj->PioId );
418  if ( iBox >= 0 ) // this is not a true PO
419  {
420  iTerm1 = Tim_ManBoxOutputFirst( pObj->pMan->pManTime, iBox );
421  nTerms = Tim_ManBoxOutputNum( pObj->pMan->pManTime, iBox );
422  for ( i = 0; i < nTerms; i++ )
423  {
424  pNext = Nwk_ManCi(pObj->pMan, iTerm1 + i);
425  Nwk_ManDfsReverse_rec( pNext, vNodes );
426  }
427  }
428  }
429  }
430  else if ( Nwk_ObjIsNode(pObj) || Nwk_ObjIsCi(pObj) )
431  {
432  Nwk_ObjForEachFanout( pObj, pNext, i )
433  Nwk_ManDfsReverse_rec( pNext, vNodes );
434  }
435  else
436  assert( 0 );
437  Vec_PtrPush( vNodes, pObj );
438 }
439 
440 /**Function*************************************************************
441 
442  Synopsis [Returns the DFS ordered array of all objects except latches.]
443 
444  Description []
445 
446  SideEffects []
447 
448  SeeAlso []
449 
450 ***********************************************************************/
452 {
453  Vec_Ptr_t * vNodes;
454  Nwk_Obj_t * pObj;
455  int i;
456  Nwk_ManIncrementTravId( pNtk );
457  vNodes = Vec_PtrAlloc( 100 );
458  Nwk_ManForEachPi( pNtk, pObj, i )
459  Nwk_ManDfsReverse_rec( pObj, vNodes );
460  // add nodes without fanins
461  Nwk_ManForEachNode( pNtk, pObj, i )
462  if ( Nwk_ObjFaninNum(pObj) == 0 && !Nwk_ObjIsTravIdCurrent(pObj) )
463  Vec_PtrPush( vNodes, pObj );
464  return vNodes;
465 }
466 
467 /**Function*************************************************************
468 
469  Synopsis [Performs DFS for one node.]
470 
471  Description []
472 
473  SideEffects []
474 
475  SeeAlso []
476 
477 ***********************************************************************/
478 void Nwk_ManSupportNodes_rec( Nwk_Obj_t * pNode, Vec_Ptr_t * vNodes )
479 {
480  Nwk_Obj_t * pFanin;
481  int i;
482  // if this node is already visited, skip
483  if ( Nwk_ObjIsTravIdCurrent( pNode ) )
484  return;
485  // mark the node as visited
486  Nwk_ObjSetTravIdCurrent( pNode );
487  // collect the CI
488  if ( Nwk_ObjIsCi(pNode) )
489  {
490  Vec_PtrPush( vNodes, pNode );
491  return;
492  }
493  assert( Nwk_ObjIsNode( pNode ) );
494  // visit the transitive fanin of the node
495  Nwk_ObjForEachFanin( pNode, pFanin, i )
496  Nwk_ManSupportNodes_rec( pFanin, vNodes );
497 }
498 
499 /**Function*************************************************************
500 
501  Synopsis [Returns the set of CI nodes in the support of the given nodes.]
502 
503  Description []
504 
505  SideEffects []
506 
507  SeeAlso []
508 
509 ***********************************************************************/
510 Vec_Ptr_t * Nwk_ManSupportNodes( Nwk_Man_t * pNtk, Nwk_Obj_t ** ppNodes, int nNodes )
511 {
512  Vec_Ptr_t * vNodes;
513  int i;
514  // set the traversal ID
515  Nwk_ManIncrementTravId( pNtk );
516  // start the array of nodes
517  vNodes = Vec_PtrAlloc( 100 );
518  // go through the PO nodes and call for each of them
519  for ( i = 0; i < nNodes; i++ )
520  if ( Nwk_ObjIsCo(ppNodes[i]) )
521  Nwk_ManSupportNodes_rec( Nwk_ObjFanin0(ppNodes[i]), vNodes );
522  else
523  Nwk_ManSupportNodes_rec( ppNodes[i], vNodes );
524  return vNodes;
525 }
526 
527 /**Function*************************************************************
528 
529  Synopsis [Computes the sum total of supports of all outputs.]
530 
531  Description []
532 
533  SideEffects []
534 
535  SeeAlso []
536 
537 ***********************************************************************/
539 {
540  Vec_Ptr_t * vSupp;
541  Nwk_Obj_t * pObj;
542  int i, nTotalSupps = 0;
543  Nwk_ManForEachCo( pNtk, pObj, i )
544  {
545  vSupp = Nwk_ManSupportNodes( pNtk, &pObj, 1 );
546  nTotalSupps += Vec_PtrSize( vSupp );
547  Vec_PtrFree( vSupp );
548  }
549  printf( "Total supports = %d.\n", nTotalSupps );
550 }
551 
552 
553 /**Function*************************************************************
554 
555  Synopsis [Dereferences the node's MFFC.]
556 
557  Description []
558 
559  SideEffects []
560 
561  SeeAlso []
562 
563 ***********************************************************************/
565 {
566  Nwk_Obj_t * pFanin;
567  int i, Counter = 1;
568  if ( Nwk_ObjIsCi(pNode) )
569  return 0;
570  Nwk_ObjForEachFanin( pNode, pFanin, i )
571  {
572  assert( pFanin->nFanouts > 0 );
573  if ( --pFanin->nFanouts == 0 )
574  Counter += Nwk_ObjDeref_rec( pFanin );
575  }
576  return Counter;
577 }
578 
579 /**Function*************************************************************
580 
581  Synopsis [References the node's MFFC.]
582 
583  Description []
584 
585  SideEffects []
586 
587  SeeAlso []
588 
589 ***********************************************************************/
590 int Nwk_ObjRef_rec( Nwk_Obj_t * pNode )
591 {
592  Nwk_Obj_t * pFanin;
593  int i, Counter = 1;
594  if ( Nwk_ObjIsCi(pNode) )
595  return 0;
596  Nwk_ObjForEachFanin( pNode, pFanin, i )
597  {
598  if ( pFanin->nFanouts++ == 0 )
599  Counter += Nwk_ObjRef_rec( pFanin );
600  }
601  return Counter;
602 }
603 
604 /**Function*************************************************************
605 
606  Synopsis [Collects the internal and boundary nodes in the derefed MFFC.]
607 
608  Description []
609 
610  SideEffects []
611 
612  SeeAlso []
613 
614 ***********************************************************************/
615 void Nwk_ObjMffcLabel_rec( Nwk_Obj_t * pNode, int fTopmost )
616 {
617  Nwk_Obj_t * pFanin;
618  int i;
619  // add to the new support nodes
620  if ( !fTopmost && (Nwk_ObjIsCi(pNode) || pNode->nFanouts > 0) )
621  return;
622  // skip visited nodes
623  if ( Nwk_ObjIsTravIdCurrent(pNode) )
624  return;
626  // recur on the children
627  Nwk_ObjForEachFanin( pNode, pFanin, i )
628  Nwk_ObjMffcLabel_rec( pFanin, 0 );
629  // collect the internal node
630 // printf( "%d ", pNode->Id );
631 }
632 
633 /**Function*************************************************************
634 
635  Synopsis [Collects the internal nodes of the MFFC limited by cut.]
636 
637  Description []
638 
639  SideEffects [Increments the trav ID and marks visited nodes.]
640 
641  SeeAlso []
642 
643 ***********************************************************************/
645 {
646  int Count1, Count2;
647  // dereference the node
648  Count1 = Nwk_ObjDeref_rec( pNode );
649  // collect the nodes inside the MFFC
650  Nwk_ManIncrementTravId( pNode->pMan );
651  Nwk_ObjMffcLabel_rec( pNode, 1 );
652  // reference it back
653  Count2 = Nwk_ObjRef_rec( pNode );
654  assert( Count1 == Count2 );
655  return Count1;
656 }
657 
658 ////////////////////////////////////////////////////////////////////////
659 /// END OF FILE ///
660 ////////////////////////////////////////////////////////////////////////
661 
662 
664 
int Tim_ManBoxOutputFirst(Tim_Man_t *p, int iBox)
Definition: timBox.c:154
int Tim_ManBoxForCi(Tim_Man_t *p, int iCo)
Definition: timBox.c:86
static Nwk_Obj_t * Nwk_ManCo(Nwk_Man_t *p, int i)
Definition: nwk.h:132
static int Nwk_ObjIsCi(Nwk_Obj_t *p)
Definition: nwk.h:146
static Nwk_Obj_t * Nwk_ManCi(Nwk_Man_t *p, int i)
Definition: nwk.h:131
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Nwk_ManLevel_rec(Nwk_Obj_t *pObj)
Definition: nwkDfs.c:160
static void Vec_VecPush(Vec_Vec_t *p, int Level, void *Entry)
Definition: vecVec.h:456
ABC_DLL int Nwk_ManVerifyLevel(Nwk_Man_t *pNtk)
Definition: nwkTiming.c:832
#define Nwk_ManForEachCo(p, pObj, i)
Definition: nwk.h:181
void Tim_ManIncrementTravId(Tim_Man_t *p)
DECLARATIONS ///.
Definition: timTrav.c:44
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
typedefABC_NAMESPACE_HEADER_START struct Nwk_Obj_t_ Nwk_Obj_t
INCLUDES ///.
Definition: nwk.h:49
void Nwk_ObjMffcLabel_rec(Nwk_Obj_t *pNode, int fTopmost)
Definition: nwkDfs.c:615
int Nwk_ManLevelMax(Nwk_Man_t *pNtk)
Definition: nwkDfs.c:248
void Nwk_ManSupportNodes_rec(Nwk_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition: nwkDfs.c:478
int Tim_ManBoxForCo(Tim_Man_t *p, int iCi)
Definition: timBox.c:104
#define Nwk_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: nwk.h:179
void Tim_ManSetCoArrival(Tim_Man_t *p, int iCo, float Delay)
Definition: timTime.c:116
#define Nwk_ObjForEachFanout(pObj, pFanout, i)
Definition: nwk.h:201
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
void Nwk_ManSupportSum(Nwk_Man_t *pNtk)
Definition: nwkDfs.c:538
int Tim_ManBoxOutputNum(Tim_Man_t *p, int iBox)
Definition: timBox.c:202
Vec_Ptr_t * Nwk_ManSupportNodes(Nwk_Man_t *pNtk, Nwk_Obj_t **ppNodes, int nNodes)
Definition: nwkDfs.c:510
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
int Nwk_ObjDeref_rec(Nwk_Obj_t *pNode)
Definition: nwkDfs.c:564
#define Nwk_ManForEachPi(p, pObj, i)
Definition: nwk.h:183
int Nwk_ObjRef_rec(Nwk_Obj_t *pNode)
Definition: nwkDfs.c:590
static int Nwk_ObjFaninNum(Nwk_Obj_t *p)
Definition: nwk.h:137
void Nwk_ManDfsNodes_rec(Nwk_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition: nwkDfs.c:352
static void Nwk_ObjSetTravIdCurrent(Nwk_Obj_t *pObj)
Definition: nwk.h:166
static int Nwk_ObjIsCo(Nwk_Obj_t *p)
Definition: nwk.h:147
Definition: nwk.h:61
static int Nwk_ObjIsTravIdCurrent(Nwk_Obj_t *pObj)
Definition: nwk.h:168
void Nwk_ManDfs_rec(Nwk_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition: nwkDfs.c:298
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
#define Nwk_ManForEachPo(p, pObj, i)
Definition: nwk.h:186
Tim_Man_t * Tim_ManDup(Tim_Man_t *p, int fUnitDelay)
Definition: timMan.c:86
ABC_DLL void Nwk_ManIncrementTravId(Nwk_Man_t *pNtk)
DECLARATIONS ///.
Definition: nwkUtil.c:47
Vec_Ptr_t * Nwk_ManDfs(Nwk_Man_t *pNtk)
Definition: nwkDfs.c:321
static int Counter
void Tim_ManStop(Tim_Man_t *p)
Definition: timMan.c:375
static Vec_Vec_t * Vec_VecStart(int nSize)
Definition: vecVec.h:168
Tim_Man_t * pManTime
Definition: nwk.h:74
int Nwk_ManLevelBackup(Nwk_Man_t *pNtk)
Definition: nwkDfs.c:102
ABC_NAMESPACE_IMPL_START int Nwk_ManVerifyTopoOrder(Nwk_Man_t *pNtk)
DECLARATIONS ///.
Definition: nwkDfs.c:45
int Tim_ManBoxInputNum(Tim_Man_t *p, int iBox)
Definition: timBox.c:186
static int Nwk_ObjIsNode(Nwk_Obj_t *p)
Definition: nwk.h:148
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
Vec_Ptr_t * Nwk_ManDfsNodes(Nwk_Man_t *pNtk, Nwk_Obj_t **ppNodes, int nNodes)
Definition: nwkDfs.c:378
void Nwk_ManDfsReverse_rec(Nwk_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition: nwkDfs.c:406
static void Nwk_ObjSetLevel(Nwk_Obj_t *pObj, int Level)
Definition: nwk.h:163
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define Nwk_ObjForEachFanin(pObj, pFanin, i)
Definition: nwk.h:199
int Nwk_ManLevel(Nwk_Man_t *pNtk)
Definition: nwkDfs.c:215
#define Nwk_ManForEachObj(p, pObj, i)
Definition: nwk.h:189
static Nwk_Obj_t * Nwk_ObjFanin0(Nwk_Obj_t *p)
Definition: nwk.h:140
Vec_Vec_t * Nwk_ManLevelize(Nwk_Man_t *pNtk)
Definition: nwkDfs.c:269
static int Nwk_ObjLevel(Nwk_Obj_t *pObj)
Definition: nwk.h:162
Vec_Ptr_t * Nwk_ManDfsReverse(Nwk_Man_t *pNtk)
Definition: nwkDfs.c:451
#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_ManBoxInputFirst(Tim_Man_t *p, int iBox)
Definition: timBox.c:122
int Nwk_ObjMffcLabel(Nwk_Obj_t *pNode)
Definition: nwkDfs.c:644
float Tim_ManGetCiArrival(Tim_Man_t *p, int iCi)
Definition: timTime.c:174
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
#define Nwk_ManForEachNode(p, pObj, i)
Definition: nwk.h:192