abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
aigCuts.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [aigCuts.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [AIG package.]
8 
9  Synopsis [Computation of K-feasible priority cuts.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - April 28, 2007.]
16 
17  Revision [$Id: aigCuts.c,v 1.00 2007/04/28 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "aig.h"
22 #include "bool/kit/kit.h"
23 
25 
26 
27 ////////////////////////////////////////////////////////////////////////
28 /// DECLARATIONS ///
29 ////////////////////////////////////////////////////////////////////////
30 
31 ////////////////////////////////////////////////////////////////////////
32 /// FUNCTION DEFINITIONS ///
33 ////////////////////////////////////////////////////////////////////////
34 
35 /**Function*************************************************************
36 
37  Synopsis [Starts the cut sweeping manager.]
38 
39  Description []
40 
41  SideEffects []
42 
43  SeeAlso []
44 
45 ***********************************************************************/
46 Aig_ManCut_t * Aig_ManCutStart( Aig_Man_t * pMan, int nCutsMax, int nLeafMax, int fTruth, int fVerbose )
47 {
48  Aig_ManCut_t * p;
49  assert( nCutsMax >= 2 );
50  assert( nLeafMax <= 16 );
51  // allocate the fraiging manager
52  p = ABC_ALLOC( Aig_ManCut_t, 1 );
53  memset( p, 0, sizeof(Aig_ManCut_t) );
54  p->nCutsMax = nCutsMax;
55  p->nLeafMax = nLeafMax;
56  p->fTruth = fTruth;
57  p->fVerbose = fVerbose;
58  p->pAig = pMan;
59  p->pCuts = ABC_CALLOC( Aig_Cut_t *, Aig_ManObjNumMax(pMan) );
60  // allocate memory manager
61  p->nTruthWords = Abc_TruthWordNum(nLeafMax);
62  p->nCutSize = sizeof(Aig_Cut_t) + sizeof(int) * nLeafMax + fTruth * sizeof(unsigned) * p->nTruthWords;
63  p->pMemCuts = Aig_MmFixedStart( p->nCutSize * p->nCutsMax, 512 );
64  // room for temporary truth tables
65  if ( fTruth )
66  {
67  p->puTemp[0] = ABC_ALLOC( unsigned, 4 * p->nTruthWords );
68  p->puTemp[1] = p->puTemp[0] + p->nTruthWords;
69  p->puTemp[2] = p->puTemp[1] + p->nTruthWords;
70  p->puTemp[3] = p->puTemp[2] + p->nTruthWords;
71  }
72  return p;
73 }
74 
75 /**Function*************************************************************
76 
77  Synopsis [Stops the fraiging manager.]
78 
79  Description []
80 
81  SideEffects []
82 
83  SeeAlso []
84 
85 ***********************************************************************/
87 {
88  Aig_MmFixedStop( p->pMemCuts, 0 );
89  ABC_FREE( p->puTemp[0] );
90  ABC_FREE( p->pCuts );
91  ABC_FREE( p );
92 }
93 
94 /**Function*************************************************************
95 
96  Synopsis [Prints one cut.]
97 
98  Description []
99 
100  SideEffects []
101 
102  SeeAlso []
103 
104 ***********************************************************************/
105 void Aig_CutPrint( Aig_Cut_t * pCut )
106 {
107  int i;
108  printf( "{" );
109  for ( i = 0; i < pCut->nFanins; i++ )
110  printf( " %d", pCut->pFanins[i] );
111  printf( " }\n" );
112 }
113 
114 /**Function*************************************************************
115 
116  Synopsis [Prints one cut.]
117 
118  Description []
119 
120  SideEffects []
121 
122  SeeAlso []
123 
124 ***********************************************************************/
126 {
127  Aig_Cut_t * pCut;
128  int i;
129  printf( "Cuts for node %d:\n", pObj->Id );
130  Aig_ObjForEachCut( p, pObj, pCut, i )
131  if ( pCut->nFanins )
132  Aig_CutPrint( pCut );
133 // printf( "\n" );
134 }
135 
136 /**Function*************************************************************
137 
138  Synopsis [Computes the total number of cuts.]
139 
140  Description []
141 
142  SideEffects []
143 
144  SeeAlso []
145 
146 ***********************************************************************/
147 int Aig_ManCutCount( Aig_ManCut_t * p, int * pnCutsK )
148 {
149  Aig_Cut_t * pCut;
150  Aig_Obj_t * pObj;
151  int i, k, nCuts = 0, nCutsK = 0;
152  Aig_ManForEachNode( p->pAig, pObj, i )
153  Aig_ObjForEachCut( p, pObj, pCut, k )
154  {
155  if ( pCut->nFanins == 0 )
156  continue;
157  nCuts++;
158  if ( pCut->nFanins == p->nLeafMax )
159  nCutsK++;
160  }
161  if ( pnCutsK )
162  *pnCutsK = nCutsK;
163  return nCuts;
164 }
165 
166 /**Function*************************************************************
167 
168  Synopsis [Compute the cost of the cut.]
169 
170  Description []
171 
172  SideEffects []
173 
174  SeeAlso []
175 
176 ***********************************************************************/
177 static inline int Aig_CutFindCost( Aig_ManCut_t * p, Aig_Cut_t * pCut )
178 {
179  Aig_Obj_t * pLeaf;
180  int i, Cost = 0;
181  assert( pCut->nFanins > 0 );
182  Aig_CutForEachLeaf( p->pAig, pCut, pLeaf, i )
183  Cost += pLeaf->nRefs;
184  return Cost * 1000 / pCut->nFanins;
185 }
186 
187 /**Function*************************************************************
188 
189  Synopsis [Compute the cost of the cut.]
190 
191  Description []
192 
193  SideEffects []
194 
195  SeeAlso []
196 
197 ***********************************************************************/
198 static inline float Aig_CutFindCost2( Aig_ManCut_t * p, Aig_Cut_t * pCut )
199 {
200  Aig_Obj_t * pLeaf;
201  float Cost = 0.0;
202  int i;
203  assert( pCut->nFanins > 0 );
204  Aig_CutForEachLeaf( p->pAig, pCut, pLeaf, i )
205  Cost += (float)1.0/pLeaf->nRefs;
206  return 1/Cost;
207 }
208 
209 /**Function*************************************************************
210 
211  Synopsis [Returns the next free cut to use.]
212 
213  Description []
214 
215  SideEffects []
216 
217  SeeAlso []
218 
219 ***********************************************************************/
220 static inline Aig_Cut_t * Aig_CutFindFree( Aig_ManCut_t * p, Aig_Obj_t * pObj )
221 {
222  Aig_Cut_t * pCut, * pCutMax;
223  int i;
224  pCutMax = NULL;
225  Aig_ObjForEachCut( p, pObj, pCut, i )
226  {
227  if ( pCut->nFanins == 0 )
228  return pCut;
229  if ( pCutMax == NULL || pCutMax->Cost < pCut->Cost )
230  pCutMax = pCut;
231  }
232  assert( pCutMax != NULL );
233  pCutMax->nFanins = 0;
234  return pCutMax;
235 }
236 
237 /**Function*************************************************************
238 
239  Synopsis [Computes the stretching phase of the cut w.r.t. the merged cut.]
240 
241  Description []
242 
243  SideEffects []
244 
245  SeeAlso []
246 
247 ***********************************************************************/
248 static inline unsigned Aig_CutTruthPhase( Aig_Cut_t * pCut, Aig_Cut_t * pCut1 )
249 {
250  unsigned uPhase = 0;
251  int i, k;
252  for ( i = k = 0; i < pCut->nFanins; i++ )
253  {
254  if ( k == pCut1->nFanins )
255  break;
256  if ( pCut->pFanins[i] < pCut1->pFanins[k] )
257  continue;
258  assert( pCut->pFanins[i] == pCut1->pFanins[k] );
259  uPhase |= (1 << i);
260  k++;
261  }
262  return uPhase;
263 }
264 
265 /**Function*************************************************************
266 
267  Synopsis [Performs truth table computation.]
268 
269  Description []
270 
271  SideEffects []
272 
273  SeeAlso []
274 
275 ***********************************************************************/
276 unsigned * Aig_CutComputeTruth( Aig_ManCut_t * p, Aig_Cut_t * pCut, Aig_Cut_t * pCut0, Aig_Cut_t * pCut1, int fCompl0, int fCompl1 )
277 {
278  // permute the first table
279  if ( fCompl0 )
280  Kit_TruthNot( p->puTemp[0], Aig_CutTruth(pCut0), p->nLeafMax );
281  else
282  Kit_TruthCopy( p->puTemp[0], Aig_CutTruth(pCut0), p->nLeafMax );
283  Kit_TruthStretch( p->puTemp[2], p->puTemp[0], pCut0->nFanins, p->nLeafMax, Aig_CutTruthPhase(pCut, pCut0), 0 );
284  // permute the second table
285  if ( fCompl1 )
286  Kit_TruthNot( p->puTemp[1], Aig_CutTruth(pCut1), p->nLeafMax );
287  else
288  Kit_TruthCopy( p->puTemp[1], Aig_CutTruth(pCut1), p->nLeafMax );
289  Kit_TruthStretch( p->puTemp[3], p->puTemp[1], pCut1->nFanins, p->nLeafMax, Aig_CutTruthPhase(pCut, pCut1), 0 );
290  // produce the resulting table
291  Kit_TruthAnd( Aig_CutTruth(pCut), p->puTemp[2], p->puTemp[3], p->nLeafMax );
292 // assert( pCut->nFanins >= Kit_TruthSupportSize( Aig_CutTruth(pCut), p->nLeafMax ) );
293  return Aig_CutTruth(pCut);
294 }
295 
296 /**Function*************************************************************
297 
298  Synopsis [Performs support minimization for the truth table.]
299 
300  Description []
301 
302  SideEffects []
303 
304  SeeAlso []
305 
306 ***********************************************************************/
308 {
309  unsigned * pTruth;
310  int uSupp, nFansNew, i, k;
311  // get truth table
312  pTruth = Aig_CutTruth( pCut );
313  // get support
314  uSupp = Kit_TruthSupport( pTruth, p->nLeafMax );
315  // get the new support size
316  nFansNew = Kit_WordCountOnes( uSupp );
317  // check if there are redundant variables
318  if ( nFansNew == pCut->nFanins )
319  return nFansNew;
320  assert( nFansNew < pCut->nFanins );
321  // minimize support
322  Kit_TruthShrink( p->puTemp[0], pTruth, nFansNew, p->nLeafMax, uSupp, 1 );
323  for ( i = k = 0; i < pCut->nFanins; i++ )
324  if ( uSupp & (1 << i) )
325  pCut->pFanins[k++] = pCut->pFanins[i];
326  assert( k == nFansNew );
327  pCut->nFanins = nFansNew;
328 // assert( nFansNew == Kit_TruthSupportSize( pTruth, p->nLeafMax ) );
329 //Extra_PrintBinary( stdout, pTruth, (1<<p->nLeafMax) ); printf( "\n" );
330  return nFansNew;
331 }
332 
333 /**Function*************************************************************
334 
335  Synopsis [Returns 1 if pDom is contained in pCut.]
336 
337  Description []
338 
339  SideEffects []
340 
341  SeeAlso []
342 
343 ***********************************************************************/
344 static inline int Aig_CutCheckDominance( Aig_Cut_t * pDom, Aig_Cut_t * pCut )
345 {
346  int i, k;
347  for ( i = 0; i < (int)pDom->nFanins; i++ )
348  {
349  for ( k = 0; k < (int)pCut->nFanins; k++ )
350  if ( pDom->pFanins[i] == pCut->pFanins[k] )
351  break;
352  if ( k == (int)pCut->nFanins ) // node i in pDom is not contained in pCut
353  return 0;
354  }
355  // every node in pDom is contained in pCut
356  return 1;
357 }
358 
359 /**Function*************************************************************
360 
361  Synopsis [Returns 1 if the cut is contained.]
362 
363  Description []
364 
365  SideEffects []
366 
367  SeeAlso []
368 
369 ***********************************************************************/
371 {
372  Aig_Cut_t * pTemp;
373  int i;
374  // go through the cuts of the node
375  Aig_ObjForEachCut( p, pObj, pTemp, i )
376  {
377  if ( pTemp->nFanins < 2 )
378  continue;
379  if ( pTemp == pCut )
380  continue;
381  if ( pTemp->nFanins > pCut->nFanins )
382  {
383  // skip the non-contained cuts
384  if ( (pTemp->uSign & pCut->uSign) != pCut->uSign )
385  continue;
386  // check containment seriously
387  if ( Aig_CutCheckDominance( pCut, pTemp ) )
388  {
389  // remove contained cut
390  pTemp->nFanins = 0;
391  }
392  }
393  else
394  {
395  // skip the non-contained cuts
396  if ( (pTemp->uSign & pCut->uSign) != pTemp->uSign )
397  continue;
398  // check containment seriously
399  if ( Aig_CutCheckDominance( pTemp, pCut ) )
400  {
401  // remove the given
402  pCut->nFanins = 0;
403  return 1;
404  }
405  }
406  }
407  return 0;
408 }
409 
410 /**Function*************************************************************
411 
412  Synopsis [Merges two cuts.]
413 
414  Description []
415 
416  SideEffects []
417 
418  SeeAlso []
419 
420 ***********************************************************************/
421 static inline int Aig_CutMergeOrdered( Aig_ManCut_t * p, Aig_Cut_t * pC0, Aig_Cut_t * pC1, Aig_Cut_t * pC )
422 {
423  int i, k, c;
424  assert( pC0->nFanins >= pC1->nFanins );
425  // the case of the largest cut sizes
426  if ( pC0->nFanins == p->nLeafMax && pC1->nFanins == p->nLeafMax )
427  {
428  for ( i = 0; i < pC0->nFanins; i++ )
429  if ( pC0->pFanins[i] != pC1->pFanins[i] )
430  return 0;
431  for ( i = 0; i < pC0->nFanins; i++ )
432  pC->pFanins[i] = pC0->pFanins[i];
433  pC->nFanins = pC0->nFanins;
434  return 1;
435  }
436  // the case when one of the cuts is the largest
437  if ( pC0->nFanins == p->nLeafMax )
438  {
439  for ( i = 0; i < pC1->nFanins; i++ )
440  {
441  for ( k = pC0->nFanins - 1; k >= 0; k-- )
442  if ( pC0->pFanins[k] == pC1->pFanins[i] )
443  break;
444  if ( k == -1 ) // did not find
445  return 0;
446  }
447  for ( i = 0; i < pC0->nFanins; i++ )
448  pC->pFanins[i] = pC0->pFanins[i];
449  pC->nFanins = pC0->nFanins;
450  return 1;
451  }
452 
453  // compare two cuts with different numbers
454  i = k = 0;
455  for ( c = 0; c < p->nLeafMax; c++ )
456  {
457  if ( k == pC1->nFanins )
458  {
459  if ( i == pC0->nFanins )
460  {
461  pC->nFanins = c;
462  return 1;
463  }
464  pC->pFanins[c] = pC0->pFanins[i++];
465  continue;
466  }
467  if ( i == pC0->nFanins )
468  {
469  if ( k == pC1->nFanins )
470  {
471  pC->nFanins = c;
472  return 1;
473  }
474  pC->pFanins[c] = pC1->pFanins[k++];
475  continue;
476  }
477  if ( pC0->pFanins[i] < pC1->pFanins[k] )
478  {
479  pC->pFanins[c] = pC0->pFanins[i++];
480  continue;
481  }
482  if ( pC0->pFanins[i] > pC1->pFanins[k] )
483  {
484  pC->pFanins[c] = pC1->pFanins[k++];
485  continue;
486  }
487  pC->pFanins[c] = pC0->pFanins[i++];
488  k++;
489  }
490  if ( i < pC0->nFanins || k < pC1->nFanins )
491  return 0;
492  pC->nFanins = c;
493  return 1;
494 }
495 
496 /**Function*************************************************************
497 
498  Synopsis [Prepares the object for FPGA mapping.]
499 
500  Description []
501 
502  SideEffects []
503 
504  SeeAlso []
505 
506 ***********************************************************************/
507 int Aig_CutMerge( Aig_ManCut_t * p, Aig_Cut_t * pCut0, Aig_Cut_t * pCut1, Aig_Cut_t * pCut )
508 {
509  assert( p->nLeafMax > 0 );
510  // merge the nodes
511  if ( pCut0->nFanins < pCut1->nFanins )
512  {
513  if ( !Aig_CutMergeOrdered( p, pCut1, pCut0, pCut ) )
514  return 0;
515  }
516  else
517  {
518  if ( !Aig_CutMergeOrdered( p, pCut0, pCut1, pCut ) )
519  return 0;
520  }
521  pCut->uSign = pCut0->uSign | pCut1->uSign;
522  return 1;
523 }
524 
525 /**Function*************************************************************
526 
527  Synopsis []
528 
529  Description []
530 
531  SideEffects []
532 
533  SeeAlso []
534 
535 ***********************************************************************/
537 {
538  Aig_Cut_t * pCutSet, * pCut;
539  int i;
540  // create the cutset of the node
541  pCutSet = (Aig_Cut_t *)Aig_MmFixedEntryFetch( p->pMemCuts );
542  Aig_ObjSetCuts( p, pObj, pCutSet );
543  Aig_ObjForEachCut( p, pObj, pCut, i )
544  {
545  pCut->nFanins = 0;
546  pCut->iNode = pObj->Id;
547  pCut->nCutSize = p->nCutSize;
548  pCut->nLeafMax = p->nLeafMax;
549  }
550  // add unit cut if needed
551  if ( fTriv )
552  {
553  pCut = pCutSet;
554  pCut->Cost = 0;
555  pCut->iNode = pObj->Id;
556  pCut->nFanins = 1;
557  pCut->pFanins[0] = pObj->Id;
558  pCut->uSign = Aig_ObjCutSign( pObj->Id );
559  if ( p->fTruth )
560  memset( Aig_CutTruth(pCut), 0xAA, sizeof(unsigned) * p->nTruthWords );
561  }
562  return pCutSet;
563 }
564 
565 /**Function*************************************************************
566 
567  Synopsis [Derives cuts for one node and sweeps this node.]
568 
569  Description []
570 
571  SideEffects []
572 
573  SeeAlso []
574 
575 ***********************************************************************/
576 void Aig_ObjComputeCuts( Aig_ManCut_t * p, Aig_Obj_t * pObj, int fTriv )
577 {
578  Aig_Cut_t * pCut0, * pCut1, * pCut, * pCutSet;
579  Aig_Obj_t * pFanin0 = Aig_ObjFanin0(pObj);
580  Aig_Obj_t * pFanin1 = Aig_ObjFanin1(pObj);
581  int i, k;
582  // the node is not processed yet
583  assert( Aig_ObjIsNode(pObj) );
584  assert( Aig_ObjCuts(p, pObj) == NULL );
585  // set up the first cut
586  pCutSet = Aig_ObjPrepareCuts( p, pObj, fTriv );
587  // compute pair-wise cut combinations while checking table
588  Aig_ObjForEachCut( p, pFanin0, pCut0, i )
589  if ( pCut0->nFanins > 0 )
590  Aig_ObjForEachCut( p, pFanin1, pCut1, k )
591  if ( pCut1->nFanins > 0 )
592  {
593  // make sure K-feasible cut exists
594  if ( Kit_WordCountOnes(pCut0->uSign | pCut1->uSign) > p->nLeafMax )
595  continue;
596  // get the next cut of this node
597  pCut = Aig_CutFindFree( p, pObj );
598  // assemble the new cut
599  if ( !Aig_CutMerge( p, pCut0, pCut1, pCut ) )
600  {
601  assert( pCut->nFanins == 0 );
602  continue;
603  }
604  // check containment
605  if ( Aig_CutFilter( p, pObj, pCut ) )
606  {
607  assert( pCut->nFanins == 0 );
608  continue;
609  }
610  // create its truth table
611  if ( p->fTruth )
612  Aig_CutComputeTruth( p, pCut, pCut0, pCut1, Aig_ObjFaninC0(pObj), Aig_ObjFaninC1(pObj) );
613  // assign the cost
614  pCut->Cost = Aig_CutFindCost( p, pCut );
615  assert( pCut->nFanins > 0 );
616  assert( pCut->Cost > 0 );
617  }
618 }
619 
620 /**Function*************************************************************
621 
622  Synopsis [Computes the cuts for all nodes in the static AIG.]
623 
624  Description []
625 
626  SideEffects []
627 
628  SeeAlso []
629 
630 ***********************************************************************/
631 Aig_ManCut_t * Aig_ComputeCuts( Aig_Man_t * pAig, int nCutsMax, int nLeafMax, int fTruth, int fVerbose )
632 {
633  Aig_ManCut_t * p;
634  Aig_Obj_t * pObj;
635  int i;
636  abctime clk = Abc_Clock();
637  assert( pAig->pManCuts == NULL );
638  // start the manager
639  p = Aig_ManCutStart( pAig, nCutsMax, nLeafMax, fTruth, fVerbose );
640  // set elementary cuts at the PIs
641  Aig_ManForEachCi( pAig, pObj, i )
642  Aig_ObjPrepareCuts( p, pObj, 1 );
643  // process the nodes
644  Aig_ManForEachNode( pAig, pObj, i )
645  Aig_ObjComputeCuts( p, pObj, 1 );
646  // print stats
647  if ( fVerbose )
648  {
649  int nCuts, nCutsK;
650  nCuts = Aig_ManCutCount( p, &nCutsK );
651  printf( "Nodes = %6d. Total cuts = %6d. %d-input cuts = %6d.\n",
652  Aig_ManObjNum(pAig), nCuts, nLeafMax, nCutsK );
653  printf( "Cut size = %2d. Truth size = %2d. Total mem = %5.2f MB ",
654  p->nCutSize, 4*p->nTruthWords, 1.0*Aig_MmFixedReadMemUsage(p->pMemCuts)/(1<<20) );
655  ABC_PRT( "Runtime", Abc_Clock() - clk );
656 /*
657  Aig_ManForEachNode( pAig, pObj, i )
658  if ( i % 300 == 0 )
659  Aig_ObjCutPrint( p, pObj );
660 */
661  }
662  // remember the cut manager
663  pAig->pManCuts = p;
664  return p;
665 }
666 
667 ////////////////////////////////////////////////////////////////////////
668 /// END OF FILE ///
669 ////////////////////////////////////////////////////////////////////////
670 
671 
673 
char * memset()
void Aig_ObjComputeCuts(Aig_ManCut_t *p, Aig_Obj_t *pObj, int fTriv)
Definition: aigCuts.c:576
int Aig_CutSupportMinimize(Aig_ManCut_t *p, Aig_Cut_t *pCut)
Definition: aigCuts.c:307
int iNode
Definition: aig.h:184
unsigned * puTemp[4]
Definition: aig.h:206
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
int fTruth
Definition: aig.h:200
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int nLeafMax
Definition: aig.h:199
static int Aig_ManObjNum(Aig_Man_t *p)
Definition: aig.h:258
void Aig_MmFixedStop(Aig_MmFixed_t *p, int fVerbose)
Definition: aigMem.c:132
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
Aig_MmFixed_t * pMemCuts
Definition: aig.h:205
short nCutSize
Definition: aig.h:185
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
int Cost
Definition: aig.h:182
static unsigned * Aig_CutTruth(Aig_Cut_t *pCut)
Definition: aig.h:214
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
unsigned * Aig_CutComputeTruth(Aig_ManCut_t *p, Aig_Cut_t *pCut, Aig_Cut_t *pCut0, Aig_Cut_t *pCut1, int fCompl0, int fCompl1)
Definition: aigCuts.c:276
static float Aig_CutFindCost2(Aig_ManCut_t *p, Aig_Cut_t *pCut)
Definition: aigCuts.c:198
static int Abc_TruthWordNum(int nVars)
Definition: abc_global.h:256
static abctime Abc_Clock()
Definition: abc_global.h:279
void Kit_TruthStretch(unsigned *pOut, unsigned *pIn, int nVars, int nVarsAll, unsigned Phase, int fReturnIn)
Definition: kitTruth.c:166
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
Definition: aig.h:309
Aig_MmFixed_t * Aig_MmFixedStart(int nEntrySize, int nEntriesMax)
FUNCTION DEFINITIONS ///.
Definition: aigMem.c:96
void Aig_CutPrint(Aig_Cut_t *pCut)
Definition: aigCuts.c:105
static int Aig_CutCheckDominance(Aig_Cut_t *pDom, Aig_Cut_t *pCut)
Definition: aigCuts.c:344
int fVerbose
Definition: aig.h:201
static unsigned Aig_ObjCutSign(unsigned ObjId)
MACRO DEFINITIONS ///.
Definition: aig.h:228
void Aig_ManCutStop(Aig_ManCut_t *p)
Definition: aigCuts.c:86
static Aig_Cut_t * Aig_CutFindFree(Aig_ManCut_t *p, Aig_Obj_t *pObj)
Definition: aigCuts.c:220
static int Aig_CutFindCost(Aig_ManCut_t *p, Aig_Cut_t *pCut)
Definition: aigCuts.c:177
static void Aig_ObjSetCuts(Aig_ManCut_t *p, Aig_Obj_t *pObj, Aig_Cut_t *pCuts)
Definition: aig.h:210
char nLeafMax
Definition: aig.h:186
static void Kit_TruthAnd(unsigned *pOut, unsigned *pIn0, unsigned *pIn1, int nVars)
Definition: kit.h:379
unsigned uSign
Definition: aig.h:183
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
Definition: aig.h:280
int nTruthWords
Definition: aig.h:204
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
Aig_Cut_t * Aig_ObjPrepareCuts(Aig_ManCut_t *p, Aig_Obj_t *pObj, int fTriv)
Definition: aigCuts.c:536
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
Aig_Man_t * pAig
Definition: aig.h:195
ABC_NAMESPACE_IMPL_START Aig_ManCut_t * Aig_ManCutStart(Aig_Man_t *pMan, int nCutsMax, int nLeafMax, int fTruth, int fVerbose)
DECLARATIONS ///.
Definition: aigCuts.c:46
char * Aig_MmFixedEntryFetch(Aig_MmFixed_t *p)
Definition: aigMem.c:161
Definition: aig.h:69
Aig_Cut_t ** pCuts
Definition: aig.h:196
char nFanins
Definition: aig.h:187
static void Kit_TruthNot(unsigned *pOut, unsigned *pIn, int nVars)
Definition: kit.h:373
int Aig_ManCutCount(Aig_ManCut_t *p, int *pnCutsK)
Definition: aigCuts.c:147
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
Definition: aig.h:306
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
int pFanins[0]
Definition: aig.h:188
#define Aig_CutForEachLeaf(p, pCut, pLeaf, i)
Definition: aig.h:221
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
void Kit_TruthShrink(unsigned *pOut, unsigned *pIn, int nVars, int nVarsAll, unsigned Phase, int fReturnIn)
Definition: kitTruth.c:200
static unsigned Aig_CutTruthPhase(Aig_Cut_t *pCut, Aig_Cut_t *pCut1)
Definition: aigCuts.c:248
struct Aig_Cut_t_ Aig_Cut_t
Definition: aig.h:176
int Aig_CutMerge(Aig_ManCut_t *p, Aig_Cut_t *pCut0, Aig_Cut_t *pCut1, Aig_Cut_t *pCut)
Definition: aigCuts.c:507
int Aig_MmFixedReadMemUsage(Aig_MmFixed_t *p)
Definition: aigMem.c:271
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define ABC_PRT(a, t)
Definition: abc_global.h:220
unsigned Kit_TruthSupport(unsigned *pTruth, int nVars)
Definition: kitTruth.c:346
int nCutSize
Definition: aig.h:203
static int Aig_CutMergeOrdered(Aig_ManCut_t *p, Aig_Cut_t *pC0, Aig_Cut_t *pC1, Aig_Cut_t *pC)
Definition: aigCuts.c:421
static void Kit_TruthCopy(unsigned *pOut, unsigned *pIn, int nVars)
Definition: kit.h:355
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
int nCutsMax
Definition: aig.h:198
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
Definition: aig.h:307
#define assert(ex)
Definition: util_old.h:213
void Aig_ObjCutPrint(Aig_ManCut_t *p, Aig_Obj_t *pObj)
Definition: aigCuts.c:125
static int Kit_WordCountOnes(unsigned uWord)
Definition: kit.h:243
int Aig_CutFilter(Aig_ManCut_t *p, Aig_Obj_t *pObj, Aig_Cut_t *pCut)
Definition: aigCuts.c:370
static Aig_Cut_t * Aig_ObjCuts(Aig_ManCut_t *p, Aig_Obj_t *pObj)
Definition: aig.h:209
Aig_ManCut_t * Aig_ComputeCuts(Aig_Man_t *pAig, int nCutsMax, int nLeafMax, int fTruth, int fVerbose)
Definition: aigCuts.c:631
ABC_INT64_T abctime
Definition: abc_global.h:278
int Id
Definition: aig.h:85
#define Aig_ObjForEachCut(p, pObj, pCut, i)
Definition: aig.h:218
unsigned int nRefs
Definition: aig.h:81