abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
aigDfs.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [aigDfs.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [AIG package.]
8 
9  Synopsis [DFS traversal procedures.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - April 28, 2007.]
16 
17  Revision [$Id: aigDfs.c,v 1.00 2007/04/28 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "aig.h"
22 #include "misc/tim/tim.h"
23 
25 
26 
27 ////////////////////////////////////////////////////////////////////////
28 /// DECLARATIONS ///
29 ////////////////////////////////////////////////////////////////////////
30 
31 ////////////////////////////////////////////////////////////////////////
32 /// FUNCTION DEFINITIONS ///
33 ////////////////////////////////////////////////////////////////////////
34 
35 /**Function*************************************************************
36 
37  Synopsis [Verifies that the objects are in a topo order.]
38 
39  Description []
40 
41  SideEffects []
42 
43  SeeAlso []
44 
45 ***********************************************************************/
47 {
48  Aig_Obj_t * pObj, * pNext;
49  int i, k, iBox, iTerm1, nTerms;
50  Aig_ManSetCioIds( p );
52  Aig_ManForEachObj( p, pObj, i )
53  {
54  if ( Aig_ObjIsNode(pObj) )
55  {
56  pNext = Aig_ObjFanin0(pObj);
57  if ( !Aig_ObjIsTravIdCurrent(p,pNext) )
58  {
59  printf( "Node %d has fanin %d that is not in a topological order.\n", pObj->Id, pNext->Id );
60  return 0;
61  }
62  pNext = Aig_ObjFanin1(pObj);
63  if ( !Aig_ObjIsTravIdCurrent(p,pNext) )
64  {
65  printf( "Node %d has fanin %d that is not in a topological order.\n", pObj->Id, pNext->Id );
66  return 0;
67  }
68  }
69  else if ( Aig_ObjIsCo(pObj) || Aig_ObjIsBuf(pObj) )
70  {
71  pNext = Aig_ObjFanin0(pObj);
72  if ( !Aig_ObjIsTravIdCurrent(p,pNext) )
73  {
74  printf( "Node %d has fanin %d that is not in a topological order.\n", pObj->Id, pNext->Id );
75  return 0;
76  }
77  }
78  else if ( Aig_ObjIsCi(pObj) )
79  {
80  if ( p->pManTime )
81  {
82  iBox = Tim_ManBoxForCi( (Tim_Man_t *)p->pManTime, Aig_ObjCioId(pObj) );
83  if ( iBox >= 0 ) // this is not a true PI
84  {
85  iTerm1 = Tim_ManBoxInputFirst( (Tim_Man_t *)p->pManTime, iBox );
86  nTerms = Tim_ManBoxInputNum( (Tim_Man_t *)p->pManTime, iBox );
87  for ( k = 0; k < nTerms; k++ )
88  {
89  pNext = Aig_ManCo( p, iTerm1 + k );
90  assert( Tim_ManBoxForCo( (Tim_Man_t *)p->pManTime, Aig_ObjCioId(pNext) ) == iBox );
91  if ( !Aig_ObjIsTravIdCurrent(p,pNext) )
92  {
93  printf( "Box %d has input %d that is not in a topological order.\n", iBox, pNext->Id );
94  return 0;
95  }
96  }
97  }
98  }
99  }
100  else if ( !Aig_ObjIsConst1(pObj) )
101  assert( 0 );
102  Aig_ObjSetTravIdCurrent( p, pObj );
103  }
104  Aig_ManCleanCioIds( p );
105  return 1;
106 }
107 
108 /**Function*************************************************************
109 
110  Synopsis [Collects internal nodes in the DFS order.]
111 
112  Description []
113 
114  SideEffects []
115 
116  SeeAlso []
117 
118 ***********************************************************************/
119 void Aig_ManDfs_rec( Aig_Man_t * p, Aig_Obj_t * pObj, Vec_Ptr_t * vNodes )
120 {
121  if ( pObj == NULL )
122  return;
123  assert( !Aig_IsComplement(pObj) );
124  if ( Aig_ObjIsTravIdCurrent(p, pObj) )
125  return;
126  Aig_ObjSetTravIdCurrent(p, pObj);
127  if ( p->pEquivs && Aig_ObjEquiv(p, pObj) )
128  Aig_ManDfs_rec( p, Aig_ObjEquiv(p, pObj), vNodes );
129  Aig_ManDfs_rec( p, Aig_ObjFanin0(pObj), vNodes );
130  Aig_ManDfs_rec( p, Aig_ObjFanin1(pObj), vNodes );
131  Vec_PtrPush( vNodes, pObj );
132 }
133 
134 /**Function*************************************************************
135 
136  Synopsis [Collects objects of the AIG in the DFS order.]
137 
138  Description [Works with choice nodes.]
139 
140  SideEffects []
141 
142  SeeAlso []
143 
144 ***********************************************************************/
145 Vec_Ptr_t * Aig_ManDfs( Aig_Man_t * p, int fNodesOnly )
146 {
147  Vec_Ptr_t * vNodes;
148  Aig_Obj_t * pObj;
149  int i;
152  // start the array of nodes
153  vNodes = Vec_PtrAlloc( Aig_ManObjNumMax(p) );
154  // mark PIs if they should not be collected
155  if ( fNodesOnly )
156  Aig_ManForEachCi( p, pObj, i )
157  Aig_ObjSetTravIdCurrent( p, pObj );
158  else
159  Vec_PtrPush( vNodes, Aig_ManConst1(p) );
160  // collect nodes reachable in the DFS order
161  Aig_ManForEachCo( p, pObj, i )
162  Aig_ManDfs_rec( p, fNodesOnly? Aig_ObjFanin0(pObj): pObj, vNodes );
163  if ( fNodesOnly )
164  assert( Vec_PtrSize(vNodes) == Aig_ManNodeNum(p) );
165  else
166  assert( Vec_PtrSize(vNodes) == Aig_ManObjNum(p) );
167  return vNodes;
168 }
169 
170 /**Function*************************************************************
171 
172  Synopsis [Collects internal nodes in the DFS order.]
173 
174  Description []
175 
176  SideEffects []
177 
178  SeeAlso []
179 
180 ***********************************************************************/
181 void Aig_ManDfsAll_rec( Aig_Man_t * p, Aig_Obj_t * pObj, Vec_Ptr_t * vNodes )
182 {
183  if ( Aig_ObjIsTravIdCurrent(p, pObj) )
184  return;
185  Aig_ObjSetTravIdCurrent(p, pObj);
186  if ( Aig_ObjIsCi(pObj) )
187  {
188  Vec_PtrPush( vNodes, pObj );
189  return;
190  }
191  if ( Aig_ObjIsCo(pObj) )
192  {
193  Aig_ManDfsAll_rec( p, Aig_ObjFanin0(pObj), vNodes );
194  Vec_PtrPush( vNodes, pObj );
195  return;
196  }
197  assert( Aig_ObjIsNode(pObj) );
198  Aig_ManDfsAll_rec( p, Aig_ObjFanin0(pObj), vNodes );
199  Aig_ManDfsAll_rec( p, Aig_ObjFanin1(pObj), vNodes );
200  Vec_PtrPush( vNodes, pObj );
201 }
202 
203 /**Function*************************************************************
204 
205  Synopsis [Collects objects of the AIG in the DFS order.]
206 
207  Description []
208 
209  SideEffects []
210 
211  SeeAlso []
212 
213 ***********************************************************************/
215 {
216  Vec_Ptr_t * vNodes;
217  Aig_Obj_t * pObj;
218  int i;
220  vNodes = Vec_PtrAlloc( Aig_ManObjNumMax(p) );
221  // add constant
223  Vec_PtrPush( vNodes, Aig_ManConst1(p) );
224  // collect nodes reachable in the DFS order
225  Aig_ManForEachCo( p, pObj, i )
226  Aig_ManDfsAll_rec( p, pObj, vNodes );
227  Aig_ManForEachCi( p, pObj, i )
228  if ( !Aig_ObjIsTravIdCurrent(p, pObj) )
229  Vec_PtrPush( vNodes, pObj );
230  assert( Vec_PtrSize(vNodes) == Aig_ManObjNum(p) );
231  return vNodes;
232 }
233 
234 /**Function*************************************************************
235 
236  Synopsis [Collects internal nodes in the DFS order.]
237 
238  Description []
239 
240  SideEffects []
241 
242  SeeAlso []
243 
244 ***********************************************************************/
246 {
247  if ( pObj == NULL )
248  return;
249  assert( !Aig_IsComplement(pObj) );
250  if ( Aig_ObjIsTravIdCurrent(p, pObj) )
251  return;
252  Aig_ObjSetTravIdCurrent(p, pObj);
253  Vec_PtrPush( vNodes, pObj );
254  if ( p->pEquivs && Aig_ObjEquiv(p, pObj) )
255  Aig_ManDfs_rec( p, Aig_ObjEquiv(p, pObj), vNodes );
256  Aig_ManDfsPreorder_rec( p, Aig_ObjFanin0(pObj), vNodes );
257  Aig_ManDfsPreorder_rec( p, Aig_ObjFanin1(pObj), vNodes );
258 }
259 
260 /**Function*************************************************************
261 
262  Synopsis [Collects objects of the AIG in the DFS order.]
263 
264  Description [Works with choice nodes.]
265 
266  SideEffects []
267 
268  SeeAlso []
269 
270 ***********************************************************************/
271 Vec_Ptr_t * Aig_ManDfsPreorder( Aig_Man_t * p, int fNodesOnly )
272 {
273  Vec_Ptr_t * vNodes;
274  Aig_Obj_t * pObj;
275  int i;
278  // start the array of nodes
279  vNodes = Vec_PtrAlloc( Aig_ManObjNumMax(p) );
280  // mark PIs if they should not be collected
281  if ( fNodesOnly )
282  Aig_ManForEachCi( p, pObj, i )
283  Aig_ObjSetTravIdCurrent( p, pObj );
284  else
285  Vec_PtrPush( vNodes, Aig_ManConst1(p) );
286  // collect nodes reachable in the DFS order
287  Aig_ManForEachCo( p, pObj, i )
288  Aig_ManDfsPreorder_rec( p, fNodesOnly? Aig_ObjFanin0(pObj): pObj, vNodes );
289  if ( fNodesOnly )
290  assert( Vec_PtrSize(vNodes) == Aig_ManNodeNum(p) );
291  else
292  assert( Vec_PtrSize(vNodes) == Aig_ManObjNum(p) );
293  return vNodes;
294 }
295 
296 /**Function*************************************************************
297 
298  Synopsis [Levelizes the nodes.]
299 
300  Description []
301 
302  SideEffects []
303 
304  SeeAlso []
305 
306 ***********************************************************************/
308 {
309  Aig_Obj_t * pObj;
310  Vec_Vec_t * vLevels;
311  int nLevels, i;
312  nLevels = Aig_ManLevelNum( p );
313  vLevels = Vec_VecStart( nLevels + 1 );
314  Aig_ManForEachObj( p, pObj, i )
315  {
316  assert( (int)pObj->Level <= nLevels );
317  Vec_VecPush( vLevels, pObj->Level, pObj );
318  }
319  return vLevels;
320 }
321 
322 /**Function*************************************************************
323 
324  Synopsis [Collects internal nodes and PIs in the DFS order.]
325 
326  Description []
327 
328  SideEffects []
329 
330  SeeAlso []
331 
332 ***********************************************************************/
333 Vec_Ptr_t * Aig_ManDfsNodes( Aig_Man_t * p, Aig_Obj_t ** ppNodes, int nNodes )
334 {
335  Vec_Ptr_t * vNodes;
336 // Aig_Obj_t * pObj;
337  int i;
339  // mark constant and PIs
341 // Aig_ManForEachCi( p, pObj, i )
342 // Aig_ObjSetTravIdCurrent( p, pObj );
343  // go through the nodes
344  vNodes = Vec_PtrAlloc( Aig_ManNodeNum(p) );
345  for ( i = 0; i < nNodes; i++ )
346  if ( Aig_ObjIsCo(ppNodes[i]) )
347  Aig_ManDfs_rec( p, Aig_ObjFanin0(ppNodes[i]), vNodes );
348  else
349  Aig_ManDfs_rec( p, ppNodes[i], vNodes );
350  return vNodes;
351 }
352 
353 /**Function*************************************************************
354 
355  Synopsis [Collects internal nodes in the DFS order.]
356 
357  Description []
358 
359  SideEffects []
360 
361  SeeAlso []
362 
363 ***********************************************************************/
365 {
366  if ( pObj == NULL )
367  return;
368  assert( !Aig_IsComplement(pObj) );
369  if ( Aig_ObjIsTravIdCurrent(p, pObj) )
370  return;
371  assert( Aig_ObjIsNode(pObj) );
372  Aig_ManDfsChoices_rec( p, Aig_ObjFanin0(pObj), vNodes );
373  Aig_ManDfsChoices_rec( p, Aig_ObjFanin1(pObj), vNodes );
374  Aig_ManDfsChoices_rec( p, Aig_ObjEquiv(p, pObj), vNodes );
375  assert( !Aig_ObjIsTravIdCurrent(p, pObj) ); // loop detection
376  Aig_ObjSetTravIdCurrent(p, pObj);
377  Vec_PtrPush( vNodes, pObj );
378 }
379 
380 /**Function*************************************************************
381 
382  Synopsis [Collects internal nodes in the DFS order.]
383 
384  Description []
385 
386  SideEffects []
387 
388  SeeAlso []
389 
390 ***********************************************************************/
392 {
393  Vec_Ptr_t * vNodes;
394  Aig_Obj_t * pObj;
395  int i, Counter = 0;
396 
397  Aig_ManForEachNode( p, pObj, i )
398  {
399  if ( Aig_ObjEquiv(p, pObj) == NULL )
400  continue;
401  Counter = 0;
402  for ( pObj = Aig_ObjEquiv(p, pObj) ; pObj; pObj = Aig_ObjEquiv(p, pObj) )
403  Counter++;
404 // printf( "%d ", Counter );
405  }
406 // printf( "\n" );
407 
408  assert( p->pEquivs != NULL );
410  // mark constant and PIs
412  Aig_ManForEachCi( p, pObj, i )
413  Aig_ObjSetTravIdCurrent( p, pObj );
414  // go through the nodes
415  vNodes = Vec_PtrAlloc( Aig_ManNodeNum(p) );
416  Aig_ManForEachCo( p, pObj, i )
417  Aig_ManDfsChoices_rec( p, Aig_ObjFanin0(pObj), vNodes );
418  return vNodes;
419 }
420 
421 /**Function*************************************************************
422 
423  Synopsis [Collects internal nodes in the reverse DFS order.]
424 
425  Description []
426 
427  SideEffects []
428 
429  SeeAlso []
430 
431 ***********************************************************************/
433 {
434  Aig_Obj_t * pFanout;
435  int iFanout = -1, i;
436  assert( !Aig_IsComplement(pObj) );
437  if ( Aig_ObjIsTravIdCurrent(p, pObj) )
438  return;
439  assert( Aig_ObjIsNode(pObj) || Aig_ObjIsBuf(pObj) );
440  Aig_ObjForEachFanout( p, pObj, pFanout, iFanout, i )
441  Aig_ManDfsReverse_rec( p, pFanout, vNodes );
442  assert( !Aig_ObjIsTravIdCurrent(p, pObj) ); // loop detection
443  Aig_ObjSetTravIdCurrent(p, pObj);
444  Vec_PtrPush( vNodes, pObj );
445 }
446 
447 /**Function*************************************************************
448 
449  Synopsis [Collects internal nodes in the reverse DFS order.]
450 
451  Description []
452 
453  SideEffects []
454 
455  SeeAlso []
456 
457 ***********************************************************************/
459 {
460  Vec_Ptr_t * vNodes;
461  Aig_Obj_t * pObj;
462  int i;
464  // mark POs
465  Aig_ManForEachCo( p, pObj, i )
466  Aig_ObjSetTravIdCurrent( p, pObj );
467  // go through the nodes
468  vNodes = Vec_PtrAlloc( Aig_ManNodeNum(p) );
469  Aig_ManForEachObj( p, pObj, i )
470  if ( Aig_ObjIsNode(pObj) || Aig_ObjIsBuf(pObj) )
471  Aig_ManDfsReverse_rec( p, pObj, vNodes );
472  return vNodes;
473 }
474 
475 /**Function*************************************************************
476 
477  Synopsis [Computes the max number of levels in the manager.]
478 
479  Description []
480 
481  SideEffects []
482 
483  SeeAlso []
484 
485 ***********************************************************************/
487 {
488  Aig_Obj_t * pObj;
489  int i, LevelsMax;
490  LevelsMax = 0;
491  Aig_ManForEachCo( p, pObj, i )
492  LevelsMax = Abc_MaxInt( LevelsMax, (int)Aig_ObjFanin0(pObj)->Level );
493  return LevelsMax;
494 }
495 
496 //#if 0
497 
498 /**Function*************************************************************
499 
500  Synopsis [Computes levels for AIG with choices and white boxes.]
501 
502  Description []
503 
504  SideEffects []
505 
506  SeeAlso []
507 
508 ***********************************************************************/
510 {
511  Aig_Obj_t * pNext;
512  int i, iBox, iTerm1, nTerms, LevelMax = 0;
513  if ( Aig_ObjIsTravIdCurrent( p, pObj ) )
514  return;
515  Aig_ObjSetTravIdCurrent( p, pObj );
516  if ( Aig_ObjIsCi(pObj) )
517  {
518  if ( p->pManTime )
519  {
520  iBox = Tim_ManBoxForCi( (Tim_Man_t *)p->pManTime, Aig_ObjCioId(pObj) );
521  if ( iBox >= 0 ) // this is not a true PI
522  {
523  iTerm1 = Tim_ManBoxInputFirst( (Tim_Man_t *)p->pManTime, iBox );
524  nTerms = Tim_ManBoxInputNum( (Tim_Man_t *)p->pManTime, iBox );
525  for ( i = 0; i < nTerms; i++ )
526  {
527  pNext = Aig_ManCo(p, iTerm1 + i);
528  Aig_ManChoiceLevel_rec( p, pNext );
529  if ( LevelMax < Aig_ObjLevel(pNext) )
530  LevelMax = Aig_ObjLevel(pNext);
531  }
532  LevelMax++;
533  }
534  }
535 // printf( "%d ", pObj->Level );
536  }
537  else if ( Aig_ObjIsCo(pObj) )
538  {
539  pNext = Aig_ObjFanin0(pObj);
540  Aig_ManChoiceLevel_rec( p, pNext );
541  if ( LevelMax < Aig_ObjLevel(pNext) )
542  LevelMax = Aig_ObjLevel(pNext);
543  }
544  else if ( Aig_ObjIsNode(pObj) )
545  {
546  // get the maximum level of the two fanins
547  pNext = Aig_ObjFanin0(pObj);
548  Aig_ManChoiceLevel_rec( p, pNext );
549  if ( LevelMax < Aig_ObjLevel(pNext) )
550  LevelMax = Aig_ObjLevel(pNext);
551  pNext = Aig_ObjFanin1(pObj);
552  Aig_ManChoiceLevel_rec( p, pNext );
553  if ( LevelMax < Aig_ObjLevel(pNext) )
554  LevelMax = Aig_ObjLevel(pNext);
555  LevelMax++;
556 
557  // get the level of the nodes in the choice node
558  if ( p->pEquivs && (pNext = Aig_ObjEquiv(p, pObj)) )
559  {
560  Aig_ManChoiceLevel_rec( p, pNext );
561  if ( LevelMax < Aig_ObjLevel(pNext) )
562  LevelMax = Aig_ObjLevel(pNext);
563  }
564  }
565  else if ( !Aig_ObjIsConst1(pObj) )
566  assert( 0 );
567  Aig_ObjSetLevel( pObj, LevelMax );
568 }
569 
570 /**Function*************************************************************
571 
572  Synopsis [Computes levels for AIG with choices and white boxes.]
573 
574  Description []
575 
576  SideEffects []
577 
578  SeeAlso []
579 
580 ***********************************************************************/
582 {
583  Aig_Obj_t * pObj;
584  int i, LevelMax = 0;
585  Aig_ManForEachObj( p, pObj, i )
586  Aig_ObjSetLevel( pObj, 0 );
587  Aig_ManSetCioIds( p );
589  Aig_ManForEachCo( p, pObj, i )
590  {
591  Aig_ManChoiceLevel_rec( p, pObj );
592  if ( LevelMax < Aig_ObjLevel(pObj) )
593  LevelMax = Aig_ObjLevel(pObj);
594  }
595  // account for dangling boxes
596  Aig_ManForEachCi( p, pObj, i )
597  {
598  Aig_ManChoiceLevel_rec( p, pObj );
599  if ( LevelMax < Aig_ObjLevel(pObj) )
600  LevelMax = Aig_ObjLevel(pObj);
601  }
602  Aig_ManCleanCioIds( p );
603 // Aig_ManForEachNode( p, pObj, i )
604 // assert( Aig_ObjLevel(pObj) > 0 );
605  return LevelMax;
606 }
607 
608 //#endif
609 
610 /**Function*************************************************************
611 
612  Synopsis [Counts the number of AIG nodes rooted at this cone.]
613 
614  Description []
615 
616  SideEffects []
617 
618  SeeAlso []
619 
620 ***********************************************************************/
622 {
623  assert( !Aig_IsComplement(pObj) );
624  if ( !Aig_ObjIsNode(pObj) || Aig_ObjIsMarkA(pObj) )
625  return;
628  assert( !Aig_ObjIsMarkA(pObj) ); // loop detection
629  Aig_ObjSetMarkA( pObj );
630 }
631 
632 /**Function*************************************************************
633 
634  Synopsis [Counts the number of AIG nodes rooted at this cone.]
635 
636  Description []
637 
638  SideEffects []
639 
640  SeeAlso []
641 
642 ***********************************************************************/
644 {
645  assert( !Aig_IsComplement(pObj) );
646  if ( !Aig_ObjIsNode(pObj) || Aig_ObjIsMarkA(pObj) )
647  return;
650  assert( !Aig_ObjIsMarkA(pObj) ); // loop detection
651  Aig_ObjSetMarkA( pObj );
652  pObj->pData = NULL;
653 }
654 
655 /**Function*************************************************************
656 
657  Synopsis [Counts the number of AIG nodes rooted at this cone.]
658 
659  Description []
660 
661  SideEffects []
662 
663  SeeAlso []
664 
665 ***********************************************************************/
667 {
668  int Counter;
669  assert( !Aig_IsComplement(pObj) );
670  if ( !Aig_ObjIsNode(pObj) || Aig_ObjIsMarkA(pObj) )
671  return 0;
672  Counter = 1 + Aig_ConeCountAndMark_rec( Aig_ObjFanin0(pObj) ) +
674  assert( !Aig_ObjIsMarkA(pObj) ); // loop detection
675  Aig_ObjSetMarkA( pObj );
676  return Counter;
677 }
678 
679 /**Function*************************************************************
680 
681  Synopsis [Counts the number of AIG nodes rooted at this cone.]
682 
683  Description []
684 
685  SideEffects []
686 
687  SeeAlso []
688 
689 ***********************************************************************/
691 {
692  assert( !Aig_IsComplement(pObj) );
693  if ( !Aig_ObjIsNode(pObj) || !Aig_ObjIsMarkA(pObj) )
694  return;
697  assert( Aig_ObjIsMarkA(pObj) ); // loop detection
698  Aig_ObjClearMarkA( pObj );
699 }
700 
701 /**Function*************************************************************
702 
703  Synopsis [Counts the number of AIG nodes rooted at this cone.]
704 
705  Description []
706 
707  SideEffects []
708 
709  SeeAlso []
710 
711 ***********************************************************************/
712 int Aig_DagSize( Aig_Obj_t * pObj )
713 {
714  int Counter;
715  Counter = Aig_ConeCountAndMark_rec( Aig_Regular(pObj) );
717  return Counter;
718 }
719 
720 /**Function*************************************************************
721 
722  Synopsis [Counts the support size of the node.]
723 
724  Description []
725 
726  SideEffects []
727 
728  SeeAlso []
729 
730 ***********************************************************************/
731 void Aig_SupportSize_rec( Aig_Man_t * p, Aig_Obj_t * pObj, int * pCounter )
732 {
733  if ( Aig_ObjIsTravIdCurrent(p, pObj) )
734  return;
735  Aig_ObjSetTravIdCurrent(p, pObj);
736  if ( Aig_ObjIsCi(pObj) )
737  {
738  (*pCounter)++;
739  return;
740  }
741  assert( Aig_ObjIsNode(pObj) || Aig_ObjIsBuf(pObj) );
742  Aig_SupportSize_rec( p, Aig_ObjFanin0(pObj), pCounter );
743  if ( Aig_ObjFanin1(pObj) )
744  Aig_SupportSize_rec( p, Aig_ObjFanin1(pObj), pCounter );
745 }
746 
747 /**Function*************************************************************
748 
749  Synopsis [Counts the support size of the node.]
750 
751  Description []
752 
753  SideEffects []
754 
755  SeeAlso []
756 
757 ***********************************************************************/
759 {
760  int Counter = 0;
761  assert( !Aig_IsComplement(pObj) );
762  assert( !Aig_ObjIsCo(pObj) );
764  Aig_SupportSize_rec( p, pObj, &Counter );
765  return Counter;
766 }
767 
768 /**Function*************************************************************
769 
770  Synopsis [Counts the support size of the node.]
771 
772  Description []
773 
774  SideEffects []
775 
776  SeeAlso []
777 
778 ***********************************************************************/
780 {
781  Aig_Obj_t * pObj;
782  int i, Counter = 0;
783  abctime clk = Abc_Clock();
784  Aig_ManForEachObj( p, pObj, i )
785  if ( Aig_ObjIsNode(pObj) )
786  Counter += (Aig_SupportSize(p, pObj) <= 16);
787  printf( "Nodes with small support %d (out of %d)\n", Counter, Aig_ManNodeNum(p) );
788  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
789  return Counter;
790 }
791 
792 /**Function*************************************************************
793 
794  Synopsis [Counts the support size of the node.]
795 
796  Description []
797 
798  SideEffects []
799 
800  SeeAlso []
801 
802 ***********************************************************************/
803 void Aig_Support_rec( Aig_Man_t * p, Aig_Obj_t * pObj, Vec_Ptr_t * vSupp )
804 {
805  if ( Aig_ObjIsTravIdCurrent(p, pObj) )
806  return;
807  Aig_ObjSetTravIdCurrent(p, pObj);
808  if ( Aig_ObjIsConst1(pObj) )
809  return;
810  if ( Aig_ObjIsCi(pObj) )
811  {
812  Vec_PtrPush( vSupp, pObj );
813  return;
814  }
815  assert( Aig_ObjIsNode(pObj) || Aig_ObjIsBuf(pObj) );
816  Aig_Support_rec( p, Aig_ObjFanin0(pObj), vSupp );
817  if ( Aig_ObjFanin1(pObj) )
818  Aig_Support_rec( p, Aig_ObjFanin1(pObj), vSupp );
819 }
820 
821 /**Function*************************************************************
822 
823  Synopsis [Counts the support size of the node.]
824 
825  Description []
826 
827  SideEffects []
828 
829  SeeAlso []
830 
831 ***********************************************************************/
833 {
834  Vec_Ptr_t * vSupp;
835  assert( !Aig_IsComplement(pObj) );
836  assert( !Aig_ObjIsCo(pObj) );
838  vSupp = Vec_PtrAlloc( 100 );
839  Aig_Support_rec( p, pObj, vSupp );
840  return vSupp;
841 }
842 
843 /**Function*************************************************************
844 
845  Synopsis [Counts the support size of the node.]
846 
847  Description []
848 
849  SideEffects []
850 
851  SeeAlso []
852 
853 ***********************************************************************/
854 void Aig_SupportNodes( Aig_Man_t * p, Aig_Obj_t ** ppObjs, int nObjs, Vec_Ptr_t * vSupp )
855 {
856  int i;
857  Vec_PtrClear( vSupp );
860  for ( i = 0; i < nObjs; i++ )
861  {
862  assert( !Aig_IsComplement(ppObjs[i]) );
863  if ( Aig_ObjIsCo(ppObjs[i]) )
864  Aig_Support_rec( p, Aig_ObjFanin0(ppObjs[i]), vSupp );
865  else
866  Aig_Support_rec( p, ppObjs[i], vSupp );
867  }
868 }
869 
870 /**Function*************************************************************
871 
872  Synopsis [Transfers the AIG from one manager into another.]
873 
874  Description []
875 
876  SideEffects []
877 
878  SeeAlso []
879 
880 ***********************************************************************/
881 void Aig_Transfer_rec( Aig_Man_t * pDest, Aig_Obj_t * pObj )
882 {
883  assert( !Aig_IsComplement(pObj) );
884  if ( !Aig_ObjIsNode(pObj) || Aig_ObjIsMarkA(pObj) )
885  return;
886  Aig_Transfer_rec( pDest, Aig_ObjFanin0(pObj) );
887  Aig_Transfer_rec( pDest, Aig_ObjFanin1(pObj) );
888  pObj->pData = Aig_And( pDest, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
889  assert( !Aig_ObjIsMarkA(pObj) ); // loop detection
890  Aig_ObjSetMarkA( pObj );
891 }
892 
893 /**Function*************************************************************
894 
895  Synopsis [Transfers the AIG from one manager into another.]
896 
897  Description []
898 
899  SideEffects []
900 
901  SeeAlso []
902 
903 ***********************************************************************/
904 Aig_Obj_t * Aig_Transfer( Aig_Man_t * pSour, Aig_Man_t * pDest, Aig_Obj_t * pRoot, int nVars )
905 {
906  Aig_Obj_t * pObj;
907  int i;
908  // solve simple cases
909  if ( pSour == pDest )
910  return pRoot;
911  if ( Aig_ObjIsConst1( Aig_Regular(pRoot) ) )
912  return Aig_NotCond( Aig_ManConst1(pDest), Aig_IsComplement(pRoot) );
913  // set the PI mapping
914  Aig_ManForEachCi( pSour, pObj, i )
915  {
916  if ( i == nVars )
917  break;
918  pObj->pData = Aig_IthVar(pDest, i);
919  }
920  // transfer and set markings
921  Aig_Transfer_rec( pDest, Aig_Regular(pRoot) );
922  // clear the markings
924  return Aig_NotCond( (Aig_Obj_t *)Aig_Regular(pRoot)->pData, Aig_IsComplement(pRoot) );
925 }
926 
927 /**Function*************************************************************
928 
929  Synopsis [Composes the AIG (pRoot) with the function (pFunc) using PI var (iVar).]
930 
931  Description []
932 
933  SideEffects []
934 
935  SeeAlso []
936 
937 ***********************************************************************/
938 void Aig_Compose_rec( Aig_Man_t * p, Aig_Obj_t * pObj, Aig_Obj_t * pFunc, Aig_Obj_t * pVar )
939 {
940  assert( !Aig_IsComplement(pObj) );
941  if ( Aig_ObjIsMarkA(pObj) )
942  return;
943  if ( Aig_ObjIsConst1(pObj) || Aig_ObjIsCi(pObj) )
944  {
945  pObj->pData = pObj == pVar ? pFunc : pObj;
946  return;
947  }
948  Aig_Compose_rec( p, Aig_ObjFanin0(pObj), pFunc, pVar );
949  Aig_Compose_rec( p, Aig_ObjFanin1(pObj), pFunc, pVar );
950  pObj->pData = Aig_And( p, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
951  assert( !Aig_ObjIsMarkA(pObj) ); // loop detection
952  Aig_ObjSetMarkA( pObj );
953 }
954 
955 /**Function*************************************************************
956 
957  Synopsis [Composes the AIG (pRoot) with the function (pFunc) using PI var (iVar).]
958 
959  Description []
960 
961  SideEffects []
962 
963  SeeAlso []
964 
965 ***********************************************************************/
966 Aig_Obj_t * Aig_Compose( Aig_Man_t * p, Aig_Obj_t * pRoot, Aig_Obj_t * pFunc, int iVar )
967 {
968  // quit if the PI variable is not defined
969  if ( iVar >= Aig_ManCiNum(p) )
970  {
971  printf( "Aig_Compose(): The PI variable %d is not defined.\n", iVar );
972  return NULL;
973  }
974  // recursively perform composition
975  Aig_Compose_rec( p, Aig_Regular(pRoot), pFunc, Aig_ManCi(p, iVar) );
976  // clear the markings
978  return Aig_NotCond( (Aig_Obj_t *)Aig_Regular(pRoot)->pData, Aig_IsComplement(pRoot) );
979 }
980 
981 /**Function*************************************************************
982 
983  Synopsis [Computes the internal nodes of the cut.]
984 
985  Description []
986 
987  SideEffects []
988 
989  SeeAlso []
990 
991 ***********************************************************************/
992 void Aig_ObjCollectCut_rec( Aig_Obj_t * pNode, Vec_Ptr_t * vNodes )
993 {
994 // Aig_Obj_t * pFan0 = Aig_ObjFanin0(pNode);
995 // Aig_Obj_t * pFan1 = Aig_ObjFanin1(pNode);
996  if ( pNode->fMarkA )
997  return;
998  pNode->fMarkA = 1;
999  assert( Aig_ObjIsNode(pNode) );
1000  Aig_ObjCollectCut_rec( Aig_ObjFanin0(pNode), vNodes );
1001  Aig_ObjCollectCut_rec( Aig_ObjFanin1(pNode), vNodes );
1002  Vec_PtrPush( vNodes, pNode );
1003 //printf( "added %d ", pNode->Id );
1004 }
1005 
1006 /**Function*************************************************************
1007 
1008  Synopsis [Computes the internal nodes of the cut.]
1009 
1010  Description [Does not include the leaves of the cut.]
1011 
1012  SideEffects []
1013 
1014  SeeAlso []
1015 
1016 ***********************************************************************/
1017 void Aig_ObjCollectCut( Aig_Obj_t * pRoot, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vNodes )
1018 {
1019  Aig_Obj_t * pObj;
1020  int i;
1021  // collect and mark the leaves
1022  Vec_PtrClear( vNodes );
1023  Vec_PtrForEachEntry( Aig_Obj_t *, vLeaves, pObj, i )
1024  {
1025  assert( pObj->fMarkA == 0 );
1026  pObj->fMarkA = 1;
1027 // printf( "%d " , pObj->Id );
1028  }
1029 //printf( "\n" );
1030  // collect and mark the nodes
1031  Aig_ObjCollectCut_rec( pRoot, vNodes );
1032  // clean the nodes
1033  Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
1034  pObj->fMarkA = 0;
1035  Vec_PtrForEachEntry( Aig_Obj_t *, vLeaves, pObj, i )
1036  pObj->fMarkA = 0;
1037 }
1038 
1039 
1040 /**Function*************************************************************
1041 
1042  Synopsis [Collects the nodes of the supergate.]
1043 
1044  Description []
1045 
1046  SideEffects []
1047 
1048  SeeAlso []
1049 
1050 ***********************************************************************/
1051 int Aig_ObjCollectSuper_rec( Aig_Obj_t * pRoot, Aig_Obj_t * pObj, Vec_Ptr_t * vSuper )
1052 {
1053  int RetValue1, RetValue2, i;
1054  // check if the node is visited
1055  if ( Aig_Regular(pObj)->fMarkA )
1056  {
1057  // check if the node occurs in the same polarity
1058  for ( i = 0; i < vSuper->nSize; i++ )
1059  if ( vSuper->pArray[i] == pObj )
1060  return 1;
1061  // check if the node is present in the opposite polarity
1062  for ( i = 0; i < vSuper->nSize; i++ )
1063  if ( vSuper->pArray[i] == Aig_Not(pObj) )
1064  return -1;
1065  assert( 0 );
1066  return 0;
1067  }
1068  // if the new node is complemented or a PI, another gate begins
1069  if ( pObj != pRoot && (Aig_IsComplement(pObj) || Aig_ObjType(pObj) != Aig_ObjType(pRoot) || Aig_ObjRefs(pObj) > 1) )
1070  {
1071  Vec_PtrPush( vSuper, pObj );
1072  Aig_Regular(pObj)->fMarkA = 1;
1073  return 0;
1074  }
1075  assert( !Aig_IsComplement(pObj) );
1076  assert( Aig_ObjIsNode(pObj) );
1077  // go through the branches
1078  RetValue1 = Aig_ObjCollectSuper_rec( pRoot, Aig_ObjReal_rec( Aig_ObjChild0(pObj) ), vSuper );
1079  RetValue2 = Aig_ObjCollectSuper_rec( pRoot, Aig_ObjReal_rec( Aig_ObjChild1(pObj) ), vSuper );
1080  if ( RetValue1 == -1 || RetValue2 == -1 )
1081  return -1;
1082  // return 1 if at least one branch has a duplicate
1083  return RetValue1 || RetValue2;
1084 }
1085 
1086 /**Function*************************************************************
1087 
1088  Synopsis [Collects the nodes of the supergate.]
1089 
1090  Description []
1091 
1092  SideEffects []
1093 
1094  SeeAlso []
1095 
1096 ***********************************************************************/
1097 int Aig_ObjCollectSuper( Aig_Obj_t * pObj, Vec_Ptr_t * vSuper )
1098 {
1099  int RetValue, i;
1100  assert( !Aig_IsComplement(pObj) );
1101  assert( Aig_ObjIsNode(pObj) );
1102  // collect the nodes in the implication supergate
1103  Vec_PtrClear( vSuper );
1104  RetValue = Aig_ObjCollectSuper_rec( pObj, pObj, vSuper );
1105  assert( Vec_PtrSize(vSuper) > 1 );
1106  // unmark the visited nodes
1107  Vec_PtrForEachEntry( Aig_Obj_t *, vSuper, pObj, i )
1108  Aig_Regular(pObj)->fMarkA = 0;
1109  // if we found the node and its complement in the same implication supergate,
1110  // return empty set of nodes (meaning that we should use constant-0 node)
1111  if ( RetValue == -1 )
1112  vSuper->nSize = 0;
1113  return RetValue;
1114 }
1115 
1116 ////////////////////////////////////////////////////////////////////////
1117 /// END OF FILE ///
1118 ////////////////////////////////////////////////////////////////////////
1119 
1120 
1122 
Aig_Obj_t * Aig_Transfer(Aig_Man_t *pSour, Aig_Man_t *pDest, Aig_Obj_t *pRoot, int nVars)
Definition: aigDfs.c:904
int Tim_ManBoxForCi(Tim_Man_t *p, int iCo)
Definition: timBox.c:86
static int Aig_ObjIsMarkA(Aig_Obj_t *pObj)
Definition: aig.h:288
#define Aig_ObjForEachFanout(p, pObj, pFanout, iFan, i)
Definition: aig.h:427
static int Aig_ObjSetLevel(Aig_Obj_t *pObj, int i)
Definition: aig.h:325
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
unsigned Level
Definition: aig.h:82
ABC_NAMESPACE_IMPL_START int Aig_ManVerifyTopoOrder(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigDfs.c:46
Vec_Ptr_t * Aig_ManDfsReverse(Aig_Man_t *p)
Definition: aigDfs.c:458
static void Vec_VecPush(Vec_Vec_t *p, int Level, void *Entry)
Definition: vecVec.h:456
static Aig_Type_t Aig_ObjType(Aig_Obj_t *pObj)
Definition: aig.h:272
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Aig_Obj_t * Aig_ObjChild0(Aig_Obj_t *pObj)
Definition: aig.h:310
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Aig_ObjIsTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aig.h:295
Aig_Obj_t * Aig_ObjReal_rec(Aig_Obj_t *pObj)
Definition: aigUtil.c:476
static int Aig_ManObjNum(Aig_Man_t *p)
Definition: aig.h:258
int Tim_ManBoxForCo(Tim_Man_t *p, int iCi)
Definition: timBox.c:104
int Aig_ObjCollectSuper(Aig_Obj_t *pObj, Vec_Ptr_t *vSuper)
Definition: aigDfs.c:1097
void * pData
Definition: aig.h:87
void Aig_ManDfsChoices_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition: aigDfs.c:364
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
static int Aig_IsComplement(Aig_Obj_t *p)
Definition: aig.h:249
Vec_Ptr_t * Aig_ManDfsPreorder(Aig_Man_t *p, int fNodesOnly)
Definition: aigDfs.c:271
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Definition: aig.h:246
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
unsigned int fMarkA
Definition: aig.h:79
#define Aig_ManForEachCo(p, pObj, i)
Definition: aig.h:398
static Aig_Obj_t * Aig_Not(Aig_Obj_t *p)
Definition: aig.h:247
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
Definition: aig.h:309
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
int Aig_ManChoiceLevel(Aig_Man_t *p)
Definition: aigDfs.c:581
static void Aig_ObjSetTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aig.h:293
void Aig_ManChoiceLevel_rec(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aigDfs.c:509
static void Aig_ObjSetMarkA(Aig_Obj_t *pObj)
Definition: aig.h:289
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
Vec_Ptr_t * Aig_ManDfsChoices(Aig_Man_t *p)
Definition: aigDfs.c:391
static void Aig_ObjClearMarkA(Aig_Obj_t *pObj)
Definition: aig.h:290
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigUtil.c:44
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
Definition: aig.h:280
static int Aig_ObjIsBuf(Aig_Obj_t *pObj)
Definition: aig.h:277
void Aig_ManDfsAll_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition: aigDfs.c:181
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
Vec_Ptr_t * Aig_ManDfsNodes(Aig_Man_t *p, Aig_Obj_t **ppNodes, int nNodes)
Definition: aigDfs.c:333
Vec_Ptr_t * Aig_ManDfsAll(Aig_Man_t *p)
Definition: aigDfs.c:214
Aig_Obj_t * Aig_IthVar(Aig_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition: aigOper.c:63
static Aig_Obj_t * Aig_ManCi(Aig_Man_t *p, int i)
Definition: aig.h:266
Aig_Obj_t * Aig_Compose(Aig_Man_t *p, Aig_Obj_t *pRoot, Aig_Obj_t *pFunc, int iVar)
Definition: aigDfs.c:966
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
static Aig_Obj_t * Aig_ObjChild1(Aig_Obj_t *pObj)
Definition: aig.h:311
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
Definition: aig.h:274
Vec_Ptr_t * Aig_Support(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aigDfs.c:832
static Aig_Obj_t * Aig_ObjEquiv(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aig.h:328
int Aig_ConeCountAndMark_rec(Aig_Obj_t *pObj)
Definition: aigDfs.c:666
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
Definition: aig.h:313
void Aig_Support_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vSupp)
Definition: aigDfs.c:803
Definition: aig.h:69
static int Counter
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
Definition: aig.h:312
void Aig_ConeUnmark_rec(Aig_Obj_t *pObj)
Definition: aigDfs.c:690
static Vec_Vec_t * Vec_VecStart(int nSize)
Definition: vecVec.h:168
void Aig_ManSetCioIds(Aig_Man_t *p)
Definition: aigUtil.c:965
void Aig_SupportSize_rec(Aig_Man_t *p, Aig_Obj_t *pObj, int *pCounter)
Definition: aigDfs.c:731
void Aig_ConeMark_rec(Aig_Obj_t *pObj)
Definition: aigDfs.c:621
int Aig_SupportSizeTest(Aig_Man_t *p)
Definition: aigDfs.c:779
int Tim_ManBoxInputNum(Tim_Man_t *p, int iBox)
Definition: timBox.c:186
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
void Aig_ManDfsReverse_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition: aigDfs.c:432
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
int Aig_ObjCollectSuper_rec(Aig_Obj_t *pRoot, Aig_Obj_t *pObj, Vec_Ptr_t *vSuper)
Definition: aigDfs.c:1051
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
Definition: aig.h:267
void Aig_ManDfsPreorder_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition: aigDfs.c:245
void Aig_Compose_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pFunc, Aig_Obj_t *pVar)
Definition: aigDfs.c:938
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
Vec_Ptr_t * Aig_ManDfs(Aig_Man_t *p, int fNodesOnly)
Definition: aigDfs.c:145
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
void Aig_Transfer_rec(Aig_Man_t *pDest, Aig_Obj_t *pObj)
Definition: aigDfs.c:881
int Aig_SupportSize(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aigDfs.c:758
void Aig_ConeCleanAndMark_rec(Aig_Obj_t *pObj)
Definition: aigDfs.c:643
static int Aig_ObjLevel(Aig_Obj_t *pObj)
Definition: aig.h:323
void Aig_ManCleanCioIds(Aig_Man_t *p)
Definition: aigUtil.c:986
void Aig_ManDfs_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition: aigDfs.c:119
void Aig_ObjCollectCut(Aig_Obj_t *pRoot, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vNodes)
Definition: aigDfs.c:1017
#define assert(ex)
Definition: util_old.h:213
static void Vec_PtrClear(Vec_Ptr_t *p)
Definition: vecPtr.h:545
void Aig_SupportNodes(Aig_Man_t *p, Aig_Obj_t **ppObjs, int nObjs, Vec_Ptr_t *vSupp)
Definition: aigDfs.c:854
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition: tim.h:92
static int Aig_ObjRefs(Aig_Obj_t *pObj)
Definition: aig.h:300
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
Definition: aig.h:248
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
int Tim_ManBoxInputFirst(Tim_Man_t *p, int iBox)
Definition: timBox.c:122
void Aig_ObjCollectCut_rec(Aig_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition: aigDfs.c:992
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
Definition: aig.h:275
int Aig_DagSize(Aig_Obj_t *pObj)
Definition: aigDfs.c:712
ABC_INT64_T abctime
Definition: abc_global.h:278
int Id
Definition: aig.h:85
static int Aig_ObjIsCo(Aig_Obj_t *pObj)
Definition: aig.h:276
int Aig_ManLevelNum(Aig_Man_t *p)
Definition: aigDfs.c:486
Vec_Vec_t * Aig_ManLevelize(Aig_Man_t *p)
Definition: aigDfs.c:307
static int Aig_ObjCioId(Aig_Obj_t *pObj)
Definition: aig.h:285