abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcMulti.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [abcMulti.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Network and node package.]
8 
9  Synopsis [Procedures which transform an AIG into multi-input AND-graph.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: abcMulti.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "base/abc/abc.h"
22 #include "misc/extra/extraBdd.h"
23 
25 
26 
27 ////////////////////////////////////////////////////////////////////////
28 /// DECLARATIONS ///
29 ////////////////////////////////////////////////////////////////////////
30 
31 static void Abc_NtkMultiInt( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew );
32 static Abc_Obj_t * Abc_NtkMulti_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld );
33 
34 static DdNode * Abc_NtkMultiDeriveBdd_rec( DdManager * dd, Abc_Obj_t * pNodeOld, Vec_Ptr_t * vFanins );
35 static DdNode * Abc_NtkMultiDeriveBdd( DdManager * dd, Abc_Obj_t * pNodeOld, Vec_Ptr_t * vFaninsOld );
36 
37 static void Abc_NtkMultiSetBounds( Abc_Ntk_t * pNtk, int nThresh, int nFaninMax );
38 static void Abc_NtkMultiSetBoundsCnf( Abc_Ntk_t * pNtk );
39 static void Abc_NtkMultiSetBoundsMulti( Abc_Ntk_t * pNtk, int nThresh );
40 static void Abc_NtkMultiSetBoundsSimple( Abc_Ntk_t * pNtk );
41 static void Abc_NtkMultiSetBoundsFactor( Abc_Ntk_t * pNtk );
42 static void Abc_NtkMultiCone( Abc_Obj_t * pNode, Vec_Ptr_t * vCone );
43 
44 ////////////////////////////////////////////////////////////////////////
45 /// FUNCTION DEFINITIONS ///
46 ////////////////////////////////////////////////////////////////////////
47 
48 /**Function*************************************************************
49 
50  Synopsis [Transforms the AIG into nodes.]
51 
52  Description [Threhold is the max number of nodes duplicated at a node.]
53 
54  SideEffects []
55 
56  SeeAlso []
57 
58 ***********************************************************************/
59 Abc_Ntk_t * Abc_NtkMulti( Abc_Ntk_t * pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor )
60 {
61  Abc_Ntk_t * pNtkNew;
62 
63  assert( Abc_NtkIsStrash(pNtk) );
64  assert( nThresh >= 0 );
65  assert( nFaninMax > 1 );
66 
67  // print a warning about choice nodes
68  if ( Abc_NtkGetChoiceNum( pNtk ) )
69  printf( "Warning: The choice nodes in the AIG are removed by renoding.\n" );
70 
71  // define the boundary
72  if ( fCnf )
74  else if ( fMulti )
75  Abc_NtkMultiSetBoundsMulti( pNtk, nThresh );
76  else if ( fSimple )
78  else if ( fFactor )
80  else
81  Abc_NtkMultiSetBounds( pNtk, nThresh, nFaninMax );
82 
83  // perform renoding for this boundary
84  pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_BDD );
85  Abc_NtkMultiInt( pNtk, pNtkNew );
86  Abc_NtkFinalize( pNtk, pNtkNew );
87 
88  // make the network minimum base
89  Abc_NtkMinimumBase( pNtkNew );
90 
91  // fix the problem with complemented and duplicated CO edges
92  Abc_NtkLogicMakeSimpleCos( pNtkNew, 0 );
93 
94  // report the number of CNF objects
95  if ( fCnf )
96  {
97 // int nClauses = Abc_NtkGetClauseNum(pNtkNew) + 2*Abc_NtkPoNum(pNtkNew) + 2*Abc_NtkLatchNum(pNtkNew);
98 // printf( "CNF variables = %d. CNF clauses = %d.\n", Abc_NtkNodeNum(pNtkNew), nClauses );
99  }
100 //printf( "Maximum fanin = %d.\n", Abc_NtkGetFaninMax(pNtkNew) );
101 
102  if ( pNtk->pExdc )
103  pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc );
104  // make sure everything is okay
105  if ( !Abc_NtkCheck( pNtkNew ) )
106  {
107  printf( "Abc_NtkMulti: The network check has failed.\n" );
108  Abc_NtkDelete( pNtkNew );
109  return NULL;
110  }
111  return pNtkNew;
112 }
113 
114 /**Function*************************************************************
115 
116  Synopsis [Transforms the AIG into nodes.]
117 
118  Description [Threhold is the max number of nodes duplicated at a node.]
119 
120  SideEffects []
121 
122  SeeAlso []
123 
124 ***********************************************************************/
125 void Abc_NtkMultiInt( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew )
126 {
127  ProgressBar * pProgress;
128  Abc_Obj_t * pNode, * pConst1, * pNodeNew;
129  int i;
130 
131  // set the constant node
132  pConst1 = Abc_AigConst1(pNtk);
133  if ( Abc_ObjFanoutNum(pConst1) > 0 )
134  {
135  pNodeNew = Abc_NtkCreateNode( pNtkNew );
136  pNodeNew->pData = Cudd_ReadOne( (DdManager *)pNtkNew->pManFunc ); Cudd_Ref( (DdNode *)pNodeNew->pData );
137  pConst1->pCopy = pNodeNew;
138  }
139 
140  // perform renoding for POs
141  pProgress = Extra_ProgressBarStart( stdout, Abc_NtkCoNum(pNtk) );
142  Abc_NtkForEachCo( pNtk, pNode, i )
143  {
144  Extra_ProgressBarUpdate( pProgress, i, NULL );
145  if ( Abc_ObjIsCi(Abc_ObjFanin0(pNode)) )
146  continue;
147  Abc_NtkMulti_rec( pNtkNew, Abc_ObjFanin0(pNode) );
148  }
149  Extra_ProgressBarStop( pProgress );
150 
151  // clean the boundaries and data field in the old network
152  Abc_NtkForEachObj( pNtk, pNode, i )
153  {
154  pNode->fMarkA = 0;
155  pNode->pData = NULL;
156  }
157 }
158 
159 /**Function*************************************************************
160 
161  Synopsis [Find the best multi-input node rooted at the given node.]
162 
163  Description []
164 
165  SideEffects []
166 
167  SeeAlso []
168 
169 ***********************************************************************/
170 Abc_Obj_t * Abc_NtkMulti_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld )
171 {
172  Vec_Ptr_t * vCone;
173  Abc_Obj_t * pNodeNew;
174  int i;
175 
176  assert( !Abc_ObjIsComplement(pNodeOld) );
177  // return if the result if known
178  if ( pNodeOld->pCopy )
179  return pNodeOld->pCopy;
180  assert( Abc_ObjIsNode(pNodeOld) );
181  assert( !Abc_AigNodeIsConst(pNodeOld) );
182  assert( pNodeOld->fMarkA );
183 
184 //printf( "%d ", Abc_NodeMffcSizeSupp(pNodeOld) );
185 
186  // collect the renoding cone
187  vCone = Vec_PtrAlloc( 10 );
188  Abc_NtkMultiCone( pNodeOld, vCone );
189 
190  // create a new node
191  pNodeNew = Abc_NtkCreateNode( pNtkNew );
192  for ( i = 0; i < vCone->nSize; i++ )
193  Abc_ObjAddFanin( pNodeNew, Abc_NtkMulti_rec(pNtkNew, (Abc_Obj_t *)vCone->pArray[i]) );
194 
195  // derive the function of this node
196  pNodeNew->pData = Abc_NtkMultiDeriveBdd( (DdManager *)pNtkNew->pManFunc, pNodeOld, vCone );
197  Cudd_Ref( (DdNode *)pNodeNew->pData );
198  Vec_PtrFree( vCone );
199 
200  // remember the node
201  pNodeOld->pCopy = pNodeNew;
202  return pNodeOld->pCopy;
203 }
204 
205 
206 /**Function*************************************************************
207 
208  Synopsis [Derives the local BDD of the node.]
209 
210  Description []
211 
212  SideEffects []
213 
214  SeeAlso []
215 
216 ***********************************************************************/
217 DdNode * Abc_NtkMultiDeriveBdd( DdManager * dd, Abc_Obj_t * pNodeOld, Vec_Ptr_t * vFaninsOld )
218 {
219  Abc_Obj_t * pFaninOld;
220  DdNode * bFunc;
221  int i;
222  assert( !Abc_AigNodeIsConst(pNodeOld) );
223  assert( Abc_ObjIsNode(pNodeOld) );
224  // set the elementary BDD variables for the input nodes
225  for ( i = 0; i < vFaninsOld->nSize; i++ )
226  {
227  pFaninOld = (Abc_Obj_t *)vFaninsOld->pArray[i];
228  pFaninOld->pData = Cudd_bddIthVar( dd, i ); Cudd_Ref( (DdNode *)pFaninOld->pData );
229  pFaninOld->fMarkC = 1;
230  }
231  // call the recursive BDD computation
232  bFunc = Abc_NtkMultiDeriveBdd_rec( dd, pNodeOld, vFaninsOld ); Cudd_Ref( bFunc );
233  // dereference the intermediate nodes
234  for ( i = 0; i < vFaninsOld->nSize; i++ )
235  {
236  pFaninOld = (Abc_Obj_t *)vFaninsOld->pArray[i];
237  Cudd_RecursiveDeref( dd, (DdNode *)pFaninOld->pData );
238  pFaninOld->fMarkC = 0;
239  }
240  Cudd_Deref( bFunc );
241  return bFunc;
242 }
243 
244 /**Function*************************************************************
245 
246  Synopsis [Derives the local BDD of the node.]
247 
248  Description []
249 
250  SideEffects []
251 
252  SeeAlso []
253 
254 ***********************************************************************/
256 {
257  DdNode * bFunc, * bFunc0, * bFunc1;
258  assert( !Abc_ObjIsComplement(pNode) );
259  // if the result is available return
260  if ( pNode->fMarkC )
261  {
262  assert( pNode->pData ); // network has a cycle
263  return (DdNode *)pNode->pData;
264  }
265  // mark the node as visited
266  pNode->fMarkC = 1;
267  Vec_PtrPush( vFanins, pNode );
268  // compute the result for both branches
269  bFunc0 = Abc_NtkMultiDeriveBdd_rec( dd, Abc_ObjFanin(pNode,0), vFanins ); Cudd_Ref( bFunc0 );
270  bFunc1 = Abc_NtkMultiDeriveBdd_rec( dd, Abc_ObjFanin(pNode,1), vFanins ); Cudd_Ref( bFunc1 );
271  bFunc0 = Cudd_NotCond( bFunc0, (long)Abc_ObjFaninC0(pNode) );
272  bFunc1 = Cudd_NotCond( bFunc1, (long)Abc_ObjFaninC1(pNode) );
273  // get the final result
274  bFunc = Cudd_bddAnd( dd, bFunc0, bFunc1 ); Cudd_Ref( bFunc );
275  Cudd_RecursiveDeref( dd, bFunc0 );
276  Cudd_RecursiveDeref( dd, bFunc1 );
277  // set the result
278  pNode->pData = bFunc;
279  assert( pNode->pData );
280  return bFunc;
281 }
282 
283 
284 
285 /**Function*************************************************************
286 
287  Synopsis [Limits the cones to be no more than the given size.]
288 
289  Description [Returns 1 if the last cone was limited. Returns 0 if no changes.]
290 
291  SideEffects []
292 
293  SeeAlso []
294 
295 ***********************************************************************/
296 int Abc_NtkMultiLimit_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vCone, int nFaninMax, int fCanStop, int fFirst )
297 {
298  int nNodes0, nNodes1;
299  assert( !Abc_ObjIsComplement(pNode) );
300  // check if the node should be added to the fanins
301  if ( !fFirst && (pNode->fMarkA || !Abc_ObjIsNode(pNode)) )
302  {
303  Vec_PtrPushUnique( vCone, pNode );
304  return 0;
305  }
306  // if we cannot stop in this branch, collect all nodes
307  if ( !fCanStop )
308  {
309  Abc_NtkMultiLimit_rec( Abc_ObjFanin(pNode,0), vCone, nFaninMax, 0, 0 );
310  Abc_NtkMultiLimit_rec( Abc_ObjFanin(pNode,1), vCone, nFaninMax, 0, 0 );
311  return 0;
312  }
313  // if we can stop, try the left branch first, and return if we stopped
314  assert( vCone->nSize == 0 );
315  if ( Abc_NtkMultiLimit_rec( Abc_ObjFanin(pNode,0), vCone, nFaninMax, 1, 0 ) )
316  return 1;
317  // save the number of nodes in the left branch and call for the right branch
318  nNodes0 = vCone->nSize;
319  assert( nNodes0 <= nFaninMax );
320  Abc_NtkMultiLimit_rec( Abc_ObjFanin(pNode,1), vCone, nFaninMax, 0, 0 );
321  // check the number of nodes
322  if ( vCone->nSize <= nFaninMax )
323  return 0;
324  // the number of nodes exceeds the limit
325 
326  // get the number of nodes in the right branch
327  vCone->nSize = 0;
328  Abc_NtkMultiLimit_rec( Abc_ObjFanin(pNode,1), vCone, nFaninMax, 0, 0 );
329  // if this number exceeds the limit, solve the problem for this branch
330  if ( vCone->nSize > nFaninMax )
331  {
332  int RetValue;
333  vCone->nSize = 0;
334  RetValue = Abc_NtkMultiLimit_rec( Abc_ObjFanin(pNode,1), vCone, nFaninMax, 1, 0 );
335  assert( RetValue == 1 );
336  return 1;
337  }
338 
339  nNodes1 = vCone->nSize;
340  assert( nNodes1 <= nFaninMax );
341  if ( nNodes0 >= nNodes1 )
342  { // the left branch is larger - cut it
343  assert( Abc_ObjFanin(pNode,0)->fMarkA == 0 );
344  Abc_ObjFanin(pNode,0)->fMarkA = 1;
345  }
346  else
347  { // the right branch is larger - cut it
348  assert( Abc_ObjFanin(pNode,1)->fMarkA == 0 );
349  Abc_ObjFanin(pNode,1)->fMarkA = 1;
350  }
351  return 1;
352 }
353 
354 /**Function*************************************************************
355 
356  Synopsis [Limits the cones to be no more than the given size.]
357 
358  Description [Returns 1 if the last cone was limited. Returns 0 if no changes.]
359 
360  SideEffects []
361 
362  SeeAlso []
363 
364 ***********************************************************************/
365 int Abc_NtkMultiLimit( Abc_Obj_t * pNode, Vec_Ptr_t * vCone, int nFaninMax )
366 {
367  vCone->nSize = 0;
368  return Abc_NtkMultiLimit_rec( pNode, vCone, nFaninMax, 1, 1 );
369 }
370 
371 /**Function*************************************************************
372 
373  Synopsis [Sets the expansion boundary for multi-input nodes.]
374 
375  Description [The boundary includes the set of PIs and all nodes such that
376  when expanding over the node we duplicate no more than nThresh nodes.]
377 
378  SideEffects []
379 
380  SeeAlso []
381 
382 ***********************************************************************/
383 void Abc_NtkMultiSetBounds( Abc_Ntk_t * pNtk, int nThresh, int nFaninMax )
384 {
385  Vec_Ptr_t * vCone = Vec_PtrAlloc(10);
386  Abc_Obj_t * pNode;
387  int i, nFanouts, nConeSize;
388 
389  // make sure the mark is not set
390  Abc_NtkForEachObj( pNtk, pNode, i )
391  assert( pNode->fMarkA == 0 );
392 
393  // mark the nodes where expansion stops using pNode->fMarkA
394  Abc_NtkForEachNode( pNtk, pNode, i )
395  {
396  // skip PI/PO nodes
397 // if ( Abc_NodeIsConst(pNode) )
398 // continue;
399  // mark the nodes with multiple fanouts
400  nFanouts = Abc_ObjFanoutNum(pNode);
401  nConeSize = Abc_NodeMffcSize(pNode);
402  if ( (nFanouts - 1) * nConeSize > nThresh )
403  pNode->fMarkA = 1;
404  }
405 
406  // mark the PO drivers
407  Abc_NtkForEachCo( pNtk, pNode, i )
408  Abc_ObjFanin0(pNode)->fMarkA = 1;
409 
410  // make sure the fanin limit is met
411  Abc_NtkForEachNode( pNtk, pNode, i )
412  {
413  // skip PI/PO nodes
414 // if ( Abc_NodeIsConst(pNode) )
415 // continue;
416  if ( pNode->fMarkA == 0 )
417  continue;
418  // continue cutting branches until it meets the fanin limit
419  while ( Abc_NtkMultiLimit(pNode, vCone, nFaninMax) );
420  assert( vCone->nSize <= nFaninMax );
421  }
422  Vec_PtrFree(vCone);
423 /*
424  // make sure the fanin limit is met
425  Abc_NtkForEachNode( pNtk, pNode, i )
426  {
427  // skip PI/PO nodes
428 // if ( Abc_NodeIsConst(pNode) )
429 // continue;
430  if ( pNode->fMarkA == 0 )
431  continue;
432  Abc_NtkMultiCone( pNode, vCone );
433  assert( vCone->nSize <= nFaninMax );
434  }
435 */
436 }
437 
438 /**Function*************************************************************
439 
440  Synopsis [Sets the expansion boundary for conversion into CNF.]
441 
442  Description [The boundary includes the set of PIs, the roots of MUXes,
443  the nodes with multiple fanouts and the nodes with complemented outputs.]
444 
445  SideEffects []
446 
447  SeeAlso []
448 
449 ***********************************************************************/
451 {
452  Abc_Obj_t * pNode;
453  int i, nMuxes;
454 
455  // make sure the mark is not set
456  Abc_NtkForEachObj( pNtk, pNode, i )
457  assert( pNode->fMarkA == 0 );
458 
459  // mark the nodes where expansion stops using pNode->fMarkA
460  Abc_NtkForEachNode( pNtk, pNode, i )
461  {
462  // skip PI/PO nodes
463 // if ( Abc_NodeIsConst(pNode) )
464 // continue;
465  // mark the nodes with multiple fanouts
466  if ( Abc_ObjFanoutNum(pNode) > 1 )
467  pNode->fMarkA = 1;
468  // mark the nodes that are roots of MUXes
469  if ( Abc_NodeIsMuxType( pNode ) )
470  {
471  pNode->fMarkA = 1;
472  Abc_ObjFanin0( Abc_ObjFanin0(pNode) )->fMarkA = 1;
473  Abc_ObjFanin0( Abc_ObjFanin1(pNode) )->fMarkA = 1;
474  Abc_ObjFanin1( Abc_ObjFanin0(pNode) )->fMarkA = 1;
475  Abc_ObjFanin1( Abc_ObjFanin1(pNode) )->fMarkA = 1;
476  }
477  else // mark the complemented edges
478  {
479  if ( Abc_ObjFaninC0(pNode) )
480  Abc_ObjFanin0(pNode)->fMarkA = 1;
481  if ( Abc_ObjFaninC1(pNode) )
482  Abc_ObjFanin1(pNode)->fMarkA = 1;
483  }
484  }
485 
486  // mark the PO drivers
487  Abc_NtkForEachCo( pNtk, pNode, i )
488  Abc_ObjFanin0(pNode)->fMarkA = 1;
489 
490  // count the number of MUXes
491  nMuxes = 0;
492  Abc_NtkForEachNode( pNtk, pNode, i )
493  {
494  // skip PI/PO nodes
495 // if ( Abc_NodeIsConst(pNode) )
496 // continue;
497  if ( Abc_NodeIsMuxType(pNode) &&
498  Abc_ObjFanin0(pNode)->fMarkA == 0 &&
499  Abc_ObjFanin1(pNode)->fMarkA == 0 )
500  nMuxes++;
501  }
502 // printf( "The number of MUXes detected = %d (%5.2f %% of logic).\n", nMuxes, 300.0*nMuxes/Abc_NtkNodeNum(pNtk) );
503 }
504 
505 /**Function*************************************************************
506 
507  Synopsis [Sets the expansion boundary for conversion into multi-input AND graph.]
508 
509  Description []
510 
511  SideEffects []
512 
513  SeeAlso []
514 
515 ***********************************************************************/
516 void Abc_NtkMultiSetBoundsMulti( Abc_Ntk_t * pNtk, int nThresh )
517 {
518  Abc_Obj_t * pNode;
519  int i, nFanouts, nConeSize;
520 
521  // make sure the mark is not set
522  Abc_NtkForEachObj( pNtk, pNode, i )
523  assert( pNode->fMarkA == 0 );
524 
525  // mark the nodes where expansion stops using pNode->fMarkA
526  Abc_NtkForEachNode( pNtk, pNode, i )
527  {
528  // skip PI/PO nodes
529 // if ( Abc_NodeIsConst(pNode) )
530 // continue;
531  // mark the nodes with multiple fanouts
532 // if ( Abc_ObjFanoutNum(pNode) > 1 )
533 // pNode->fMarkA = 1;
534  // mark the nodes with multiple fanouts
535  nFanouts = Abc_ObjFanoutNum(pNode);
536  nConeSize = Abc_NodeMffcSizeStop(pNode);
537  if ( (nFanouts - 1) * nConeSize > nThresh )
538  pNode->fMarkA = 1;
539  // mark the children if they are pointed by the complemented edges
540  if ( Abc_ObjFaninC0(pNode) )
541  Abc_ObjFanin0(pNode)->fMarkA = 1;
542  if ( Abc_ObjFaninC1(pNode) )
543  Abc_ObjFanin1(pNode)->fMarkA = 1;
544  }
545 
546  // mark the PO drivers
547  Abc_NtkForEachCo( pNtk, pNode, i )
548  Abc_ObjFanin0(pNode)->fMarkA = 1;
549 }
550 
551 /**Function*************************************************************
552 
553  Synopsis [Sets a simple boundary.]
554 
555  Description []
556 
557  SideEffects []
558 
559  SeeAlso []
560 
561 ***********************************************************************/
563 {
564  Abc_Obj_t * pNode;
565  int i;
566  // make sure the mark is not set
567  Abc_NtkForEachObj( pNtk, pNode, i )
568  assert( pNode->fMarkA == 0 );
569  // mark the nodes where expansion stops using pNode->fMarkA
570  Abc_NtkForEachNode( pNtk, pNode, i )
571  pNode->fMarkA = 1;
572 }
573 
574 /**Function*************************************************************
575 
576  Synopsis [Sets a factor-cut boundary.]
577 
578  Description []
579 
580  SideEffects []
581 
582  SeeAlso []
583 
584 ***********************************************************************/
586 {
587  Abc_Obj_t * pNode;
588  int i;
589  // make sure the mark is not set
590  Abc_NtkForEachObj( pNtk, pNode, i )
591  assert( pNode->fMarkA == 0 );
592  // mark the nodes where expansion stops using pNode->fMarkA
593  Abc_NtkForEachNode( pNtk, pNode, i )
594  pNode->fMarkA = (pNode->vFanouts.nSize > 1 && !Abc_NodeIsMuxControlType(pNode));
595  // mark the PO drivers
596  Abc_NtkForEachCo( pNtk, pNode, i )
597  Abc_ObjFanin0(pNode)->fMarkA = 1;
598 }
599 
600 /**Function*************************************************************
601 
602  Synopsis [Collects the fanins of a large node.]
603 
604  Description []
605 
606  SideEffects []
607 
608  SeeAlso []
609 
610 ***********************************************************************/
611 void Abc_NtkMultiCone_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vCone )
612 {
613  assert( !Abc_ObjIsComplement(pNode) );
614  if ( pNode->fMarkA || !Abc_ObjIsNode(pNode) )
615  {
616  Vec_PtrPushUnique( vCone, pNode );
617  return;
618  }
619  Abc_NtkMultiCone_rec( Abc_ObjFanin(pNode,0), vCone );
620  Abc_NtkMultiCone_rec( Abc_ObjFanin(pNode,1), vCone );
621 }
622 
623 /**Function*************************************************************
624 
625  Synopsis [Collects the fanins of a large node.]
626 
627  Description []
628 
629  SideEffects []
630 
631  SeeAlso []
632 
633 ***********************************************************************/
634 void Abc_NtkMultiCone( Abc_Obj_t * pNode, Vec_Ptr_t * vCone )
635 {
636  assert( !Abc_ObjIsComplement(pNode) );
637  assert( Abc_ObjIsNode(pNode) );
638  vCone->nSize = 0;
639  Abc_NtkMultiCone_rec( Abc_ObjFanin(pNode,0), vCone );
640  Abc_NtkMultiCone_rec( Abc_ObjFanin(pNode,1), vCone );
641 }
642 
643 ////////////////////////////////////////////////////////////////////////
644 /// END OF FILE ///
645 ////////////////////////////////////////////////////////////////////////
646 
647 
649 
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
Definition: abc.h:374
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
Definition: abc.h:351
static DdNode * Abc_NtkMultiDeriveBdd(DdManager *dd, Abc_Obj_t *pNodeOld, Vec_Ptr_t *vFaninsOld)
Definition: abcMulti.c:217
unsigned fMarkA
Definition: abc.h:134
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
Definition: cuddRef.c:154
Definition: cudd.h:278
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
ABC_DLL int Abc_NtkMinimumBase(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcMinBase.c:48
Abc_Ntk_t * pExdc
Definition: abc.h:201
static int Abc_ObjFaninC1(Abc_Obj_t *pObj)
Definition: abc.h:378
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:656
void Cudd_Deref(DdNode *node)
Definition: cuddRef.c:438
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
Abc_Ntk_t * Abc_NtkMulti(Abc_Ntk_t *pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor)
FUNCTION DEFINITIONS ///.
Definition: abcMulti.c:59
void Abc_NtkMultiCone_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vCone)
Definition: abcMulti.c:611
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
Definition: abc.h:377
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
static int Abc_AigNodeIsConst(Abc_Obj_t *pNode)
Definition: abc.h:396
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
static Abc_Obj_t * Abc_NtkMulti_rec(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNodeOld)
Definition: abcMulti.c:170
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL int Abc_NodeIsMuxControlType(Abc_Obj_t *pNode)
Definition: abcUtil.c:1357
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
void * pManFunc
Definition: abc.h:191
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static DdNode * Abc_NtkMultiDeriveBdd_rec(DdManager *dd, Abc_Obj_t *pNodeOld, Vec_Ptr_t *vFanins)
Definition: abcMulti.c:255
DECLARATIONS ///.
ABC_DLL Abc_Ntk_t * Abc_NtkStartFrom(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
Definition: abcNtk.c:106
Abc_Obj_t * pCopy
Definition: abc.h:148
ABC_DLL int Abc_NodeIsMuxType(Abc_Obj_t *pNode)
Definition: abcUtil.c:1301
static void Abc_NtkMultiSetBoundsSimple(Abc_Ntk_t *pNtk)
Definition: abcMulti.c:562
static void Abc_NtkMultiSetBoundsCnf(Abc_Ntk_t *pNtk)
Definition: abcMulti.c:450
unsigned fMarkC
Definition: abc.h:136
static int nMuxes
Definition: abcSat.c:36
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
ABC_DLL int Abc_NodeMffcSize(Abc_Obj_t *pNode)
FUNCTION DEFINITIONS ///.
Definition: abcRefs.c:48
ABC_DLL void Abc_NtkFinalize(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
Definition: abcNtk.c:302
static void Abc_NtkMultiSetBoundsFactor(Abc_Ntk_t *pNtk)
Definition: abcMulti.c:585
int Abc_NtkMultiLimit(Abc_Obj_t *pNode, Vec_Ptr_t *vCone, int nFaninMax)
Definition: abcMulti.c:365
void Extra_ProgressBarStop(ProgressBar *p)
static ABC_NAMESPACE_IMPL_START void Abc_NtkMultiInt(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
DECLARATIONS ///.
Definition: abcMulti.c:125
int Abc_NtkMultiLimit_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vCone, int nFaninMax, int fCanStop, int fFirst)
Definition: abcMulti.c:296
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
Vec_Int_t vFanouts
Definition: abc.h:144
ABC_DLL int Abc_NtkLogicMakeSimpleCos(Abc_Ntk_t *pNtk, int fDuplicate)
Definition: abcUtil.c:1047
DdNode * Cudd_ReadOne(DdManager *dd)
Definition: cuddAPI.c:987
static void Abc_NtkMultiCone(Abc_Obj_t *pNode, Vec_Ptr_t *vCone)
Definition: abcMulti.c:634
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
ABC_DLL int Abc_NodeMffcSizeStop(Abc_Obj_t *pNode)
Definition: abcRefs.c:74
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
Definition: cuddAPI.c:416
static Abc_Obj_t * Abc_NtkCreateNode(Abc_Ntk_t *pNtk)
Definition: abc.h:308
ProgressBar * Extra_ProgressBarStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
#define Cudd_NotCond(node, c)
Definition: cudd.h:383
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
Definition: cuddBddIte.c:314
#define assert(ex)
Definition: util_old.h:213
static void Extra_ProgressBarUpdate(ProgressBar *p, int nItemsCur, char *pString)
Definition: extra.h:243
static void Abc_NtkMultiSetBoundsMulti(Abc_Ntk_t *pNtk, int nThresh)
Definition: abcMulti.c:516
void * pData
Definition: abc.h:145
void Cudd_Ref(DdNode *n)
Definition: cuddRef.c:129
static Abc_Obj_t * Abc_ObjFanin(Abc_Obj_t *pObj, int i)
Definition: abc.h:372
static int Abc_ObjIsComplement(Abc_Obj_t *p)
Definition: abc.h:322
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition: abc.h:446
static void Abc_NtkMultiSetBounds(Abc_Ntk_t *pNtk, int nThresh, int nFaninMax)
Definition: abcMulti.c:383
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223