abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ifReduce.c File Reference
#include "if.h"

Go to the source code of this file.

Functions

static
ABC_NAMESPACE_IMPL_START void 
If_ManImproveExpand (If_Man_t *p, int nLimit)
 DECLARATIONS ///. More...
 
static void If_ManImproveNodeExpand (If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vFrontOld, Vec_Ptr_t *vVisited)
 
static void If_ManImproveNodePrepare (If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vFrontOld, Vec_Ptr_t *vVisited)
 
static void If_ManImproveNodeUpdate (If_Man_t *p, If_Obj_t *pObj, Vec_Ptr_t *vFront)
 
static void If_ManImproveNodeFaninCompact (If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
 
void If_ManImproveMapping (If_Man_t *p)
 FUNCTION DEFINITIONS ///. More...
 
int If_ManImproveCutCost (If_Man_t *p, Vec_Ptr_t *vFront)
 
void If_ManImproveMark_rec (If_Man_t *p, If_Obj_t *pObj, Vec_Ptr_t *vVisited)
 
int If_ManImproveNodeWillGrow (If_Man_t *p, If_Obj_t *pObj)
 
int If_ManImproveNodeFaninCost (If_Man_t *p, If_Obj_t *pObj)
 
void If_ManImproveNodeFaninUpdate (If_Man_t *p, If_Obj_t *pObj, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
 
int If_ManImproveNodeFaninCompact0 (If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
 
int If_ManImproveNodeFaninCompact1 (If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
 
int If_ManImproveNodeFaninCompact2 (If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
 
int If_ManImproveNodeFaninCompact_int (If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
 

Function Documentation

int If_ManImproveCutCost ( If_Man_t p,
Vec_Ptr_t vFront 
)

Function*************************************************************

Synopsis [Counts the number of nodes with no external fanout.]

Description []

SideEffects []

SeeAlso []

Definition at line 107 of file ifReduce.c.

108 {
109  If_Obj_t * pFanin;
110  int i, Counter = 0;
111  Vec_PtrForEachEntry( If_Obj_t *, vFront, pFanin, i )
112  if ( pFanin->nRefs == 0 )
113  Counter++;
114  return Counter;
115 }
Definition: if.h:303
if(last==0)
Definition: sparse_int.h:34
static int Counter
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void If_ManImproveExpand ( If_Man_t p,
int  nLimit 
)
static

DECLARATIONS ///.

CFile****************************************************************

FileName [ifExpand.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [FPGA mapping based on priority cuts.]

Synopsis [Incremental improvement of current mapping.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - November 21, 2006.]

Revision [

Id:
ifExpand.c,v 1.00 2006/11/21 00:00:00 alanmi Exp

]

Function*************************************************************

Synopsis [Performs area recovery for each node.]

Description []

SideEffects []

SeeAlso []

Definition at line 80 of file ifReduce.c.

81 {
82  Vec_Ptr_t * vFront, * vFrontOld, * vVisited;
83  If_Obj_t * pObj;
84  int i;
85  vFront = Vec_PtrAlloc( nLimit );
86  vFrontOld = Vec_PtrAlloc( nLimit );
87  vVisited = Vec_PtrAlloc( 100 );
88  // iterate through all nodes in the topological order
89  If_ManForEachNode( p, pObj, i )
90  If_ManImproveNodeExpand( p, pObj, nLimit, vFront, vFrontOld, vVisited );
91  Vec_PtrFree( vFront );
92  Vec_PtrFree( vFrontOld );
93  Vec_PtrFree( vVisited );
94 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
#define If_ManForEachNode(p, pObj, i)
Definition: if.h:468
Definition: if.h:303
static void If_ManImproveNodeExpand(If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vFrontOld, Vec_Ptr_t *vVisited)
Definition: ifReduce.c:128
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
void If_ManImproveMapping ( If_Man_t p)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Improves current mapping using expand/Expand of one cut.]

Description [Assumes current mapping assigned and required times computed.]

SideEffects []

SeeAlso []

Definition at line 51 of file ifReduce.c.

52 {
53  abctime clk;
54 
55  clk = Abc_Clock();
58  if ( p->pPars->fVerbose )
59  {
60  Abc_Print( 1, "E: Del = %7.2f. Ar = %9.1f. Edge = %8d. ",
61  p->RequiredGlo, p->AreaGlo, p->nNets );
62  if ( p->dPower )
63  Abc_Print( 1, "Switch = %7.2f. ", p->dPower );
64  Abc_Print( 1, "Cut = %8d. ", p->nCutsMerged );
65  Abc_PrintTime( 1, "T", Abc_Clock() - clk );
66  }
67 }
float dPower
Definition: if.h:200
int nLutSize
Definition: if.h:103
int fVerbose
Definition: if.h:140
void If_ManComputeRequired(If_Man_t *p)
Definition: ifTime.c:294
int nCutsMerged
Definition: if.h:202
static abctime Abc_Clock()
Definition: abc_global.h:279
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
float AreaGlo
Definition: if.h:198
float RequiredGlo
Definition: if.h:196
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
If_Par_t * pPars
Definition: if.h:184
static ABC_NAMESPACE_IMPL_START void If_ManImproveExpand(If_Man_t *p, int nLimit)
DECLARATIONS ///.
Definition: ifReduce.c:80
int nNets
Definition: if.h:199
ABC_INT64_T abctime
Definition: abc_global.h:278
void If_ManImproveMark_rec ( If_Man_t p,
If_Obj_t pObj,
Vec_Ptr_t vVisited 
)

Function*************************************************************

Synopsis [Performs area recovery for each node.]

Description []

SideEffects []

SeeAlso []

Definition at line 182 of file ifReduce.c.

183 {
184  if ( pObj->fMark )
185  return;
186  assert( If_ObjIsAnd(pObj) );
187  If_ManImproveMark_rec( p, If_ObjFanin0(pObj), vVisited );
188  If_ManImproveMark_rec( p, If_ObjFanin1(pObj), vVisited );
189  Vec_PtrPush( vVisited, pObj );
190  pObj->fMark = 1;
191 }
static int If_ObjIsAnd(If_Obj_t *pObj)
Definition: if.h:377
void If_ManImproveMark_rec(If_Man_t *p, If_Obj_t *pObj, Vec_Ptr_t *vVisited)
Definition: ifReduce.c:182
static If_Obj_t * If_ObjFanin0(If_Obj_t *pObj)
Definition: if.h:380
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static If_Obj_t * If_ObjFanin1(If_Obj_t *pObj)
Definition: if.h:381
#define assert(ex)
Definition: util_old.h:213
unsigned fMark
Definition: if.h:310
void If_ManImproveNodeExpand ( If_Man_t p,
If_Obj_t pObj,
int  nLimit,
Vec_Ptr_t vFront,
Vec_Ptr_t vFrontOld,
Vec_Ptr_t vVisited 
)
static

Function*************************************************************

Synopsis [Performs area recovery for each node.]

Description []

SideEffects []

SeeAlso []

Definition at line 128 of file ifReduce.c.

129 {
130  If_Obj_t * pFanin;
131  If_Cut_t * pCut;
132  int CostBef, CostAft, i;
133  float DelayOld, AreaBef, AreaAft;
134  pCut = If_ObjCutBest(pObj);
135  pCut->Delay = If_CutDelay( p, pObj, pCut );
136  assert( pCut->Delay <= pObj->Required + p->fEpsilon );
137  if ( pObj->nRefs == 0 )
138  return;
139  // get the delay
140  DelayOld = pCut->Delay;
141  // get the area
142  AreaBef = If_CutAreaRefed( p, pCut );
143 // if ( AreaBef == 1 )
144 // return;
145  // the cut is non-trivial
146  If_ManImproveNodePrepare( p, pObj, nLimit, vFront, vFrontOld, vVisited );
147  // iteratively modify the cut
148  If_CutAreaDeref( p, pCut );
149  CostBef = If_ManImproveCutCost( p, vFront );
150  If_ManImproveNodeFaninCompact( p, pObj, nLimit, vFront, vVisited );
151  CostAft = If_ManImproveCutCost( p, vFront );
152  If_CutAreaRef( p, pCut );
153  assert( CostBef >= CostAft );
154  // clean up
155  Vec_PtrForEachEntry( If_Obj_t *, vVisited, pFanin, i )
156  pFanin->fMark = 0;
157  // update the node
158  If_ManImproveNodeUpdate( p, pObj, vFront );
159  pCut->Delay = If_CutDelay( p, pObj, pCut );
160  // get the new area
161  AreaAft = If_CutAreaRefed( p, pCut );
162  if ( AreaAft > AreaBef || pCut->Delay > pObj->Required + p->fEpsilon )
163  {
164  If_ManImproveNodeUpdate( p, pObj, vFrontOld );
165  AreaAft = If_CutAreaRefed( p, pCut );
166  assert( AreaAft == AreaBef );
167  pCut->Delay = DelayOld;
168  }
169 }
static void If_ManImproveNodeUpdate(If_Man_t *p, If_Obj_t *pObj, Vec_Ptr_t *vFront)
Definition: ifReduce.c:236
float If_CutAreaDeref(If_Man_t *p, If_Cut_t *pCut)
Definition: ifCut.c:1032
static void If_ManImproveNodePrepare(If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vFrontOld, Vec_Ptr_t *vVisited)
Definition: ifReduce.c:204
Definition: if.h:303
Definition: if.h:275
float Required
Definition: if.h:325
static If_Cut_t * If_ObjCutBest(If_Obj_t *pObj)
Definition: if.h:401
int nRefs
Definition: if.h:318
if(last==0)
Definition: sparse_int.h:34
float fEpsilon
Definition: if.h:195
int If_ManImproveCutCost(If_Man_t *p, Vec_Ptr_t *vFront)
Definition: ifReduce.c:107
static void If_ManImproveNodeFaninCompact(If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
Definition: ifReduce.c:454
float If_CutDelay(If_Man_t *p, If_Obj_t *pObj, If_Cut_t *pCut)
Definition: ifTime.c:91
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
float If_CutAreaRefed(If_Man_t *p, If_Cut_t *pCut)
Definition: ifCut.c:1109
float If_CutAreaRef(If_Man_t *p, If_Cut_t *pCut)
Definition: ifCut.c:1059
float Delay
Definition: if.h:280
void If_ManImproveNodeFaninCompact ( If_Man_t p,
If_Obj_t pObj,
int  nLimit,
Vec_Ptr_t vFront,
Vec_Ptr_t vVisited 
)
static

Function*************************************************************

Synopsis [Compacts the number of external refs.]

Description []

SideEffects []

SeeAlso []

Definition at line 454 of file ifReduce.c.

455 {
456  while ( If_ManImproveNodeFaninCompact_int( p, pObj, nLimit, vFront, vVisited ) );
457 }
int If_ManImproveNodeFaninCompact_int(If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
Definition: ifReduce.c:431
int If_ManImproveNodeFaninCompact0 ( If_Man_t p,
If_Obj_t pObj,
int  nLimit,
Vec_Ptr_t vFront,
Vec_Ptr_t vVisited 
)

Function*************************************************************

Synopsis [Compacts the number of external refs.]

Description []

SideEffects []

SeeAlso []

Definition at line 345 of file ifReduce.c.

346 {
347  If_Obj_t * pFanin;
348  int i;
349  Vec_PtrForEachEntry( If_Obj_t *, vFront, pFanin, i )
350  {
351  if ( If_ObjIsCi(pFanin) )
352  continue;
353  if ( If_ManImproveNodeWillGrow(p, pFanin) )
354  continue;
355  if ( If_ManImproveNodeFaninCost(p, pFanin) <= 0 )
356  {
357  If_ManImproveNodeFaninUpdate( p, pFanin, vFront, vVisited );
358  return 1;
359  }
360  }
361  return 0;
362 }
int If_ManImproveNodeWillGrow(If_Man_t *p, If_Obj_t *pObj)
Definition: ifReduce.c:266
Definition: if.h:303
static int If_ObjIsCi(If_Obj_t *pObj)
Definition: if.h:373
void If_ManImproveNodeFaninUpdate(If_Man_t *p, If_Obj_t *pObj, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
Definition: ifReduce.c:313
int If_ManImproveNodeFaninCost(If_Man_t *p, If_Obj_t *pObj)
Definition: ifReduce.c:286
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
int If_ManImproveNodeFaninCompact1 ( If_Man_t p,
If_Obj_t pObj,
int  nLimit,
Vec_Ptr_t vFront,
Vec_Ptr_t vVisited 
)

Function*************************************************************

Synopsis [Compacts the number of external refs.]

Description []

SideEffects []

SeeAlso []

Definition at line 375 of file ifReduce.c.

376 {
377  If_Obj_t * pFanin;
378  int i;
379  Vec_PtrForEachEntry( If_Obj_t *, vFront, pFanin, i )
380  {
381  if ( If_ObjIsCi(pFanin) )
382  continue;
383  if ( If_ManImproveNodeFaninCost(p, pFanin) < 0 )
384  {
385  If_ManImproveNodeFaninUpdate( p, pFanin, vFront, vVisited );
386  return 1;
387  }
388  }
389  return 0;
390 }
Definition: if.h:303
static int If_ObjIsCi(If_Obj_t *pObj)
Definition: if.h:373
void If_ManImproveNodeFaninUpdate(If_Man_t *p, If_Obj_t *pObj, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
Definition: ifReduce.c:313
int If_ManImproveNodeFaninCost(If_Man_t *p, If_Obj_t *pObj)
Definition: ifReduce.c:286
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
int If_ManImproveNodeFaninCompact2 ( If_Man_t p,
If_Obj_t pObj,
int  nLimit,
Vec_Ptr_t vFront,
Vec_Ptr_t vVisited 
)

Function*************************************************************

Synopsis [Compacts the number of external refs.]

Description []

SideEffects []

SeeAlso []

Definition at line 403 of file ifReduce.c.

404 {
405  If_Obj_t * pFanin;
406  int i;
407  Vec_PtrForEachEntry( If_Obj_t *, vFront, pFanin, i )
408  {
409  if ( If_ObjIsCi(pFanin) )
410  continue;
411  if ( If_ManImproveNodeFaninCost(p, pFanin) <= 0 )
412  {
413  If_ManImproveNodeFaninUpdate( p, pFanin, vFront, vVisited );
414  return 1;
415  }
416  }
417  return 0;
418 }
Definition: if.h:303
static int If_ObjIsCi(If_Obj_t *pObj)
Definition: if.h:373
void If_ManImproveNodeFaninUpdate(If_Man_t *p, If_Obj_t *pObj, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
Definition: ifReduce.c:313
int If_ManImproveNodeFaninCost(If_Man_t *p, If_Obj_t *pObj)
Definition: ifReduce.c:286
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
int If_ManImproveNodeFaninCompact_int ( If_Man_t p,
If_Obj_t pObj,
int  nLimit,
Vec_Ptr_t vFront,
Vec_Ptr_t vVisited 
)

Function*************************************************************

Synopsis [Compacts the number of external refs.]

Description []

SideEffects []

SeeAlso []

Definition at line 431 of file ifReduce.c.

432 {
433  if ( If_ManImproveNodeFaninCompact0(p, pObj, nLimit, vFront, vVisited) )
434  return 1;
435  if ( Vec_PtrSize(vFront) < nLimit && If_ManImproveNodeFaninCompact1(p, pObj, nLimit, vFront, vVisited) )
436  return 1;
437 // if ( Vec_PtrSize(vFront) < nLimit && If_ManImproveNodeFaninCompact2(p, pObj, nLimit, vFront, vVisited) )
438 // return 1;
439  assert( Vec_PtrSize(vFront) <= nLimit );
440  return 0;
441 }
int If_ManImproveNodeFaninCompact0(If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
Definition: ifReduce.c:345
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
int If_ManImproveNodeFaninCompact1(If_Man_t *p, If_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited)
Definition: ifReduce.c:375
#define assert(ex)
Definition: util_old.h:213
int If_ManImproveNodeFaninCost ( If_Man_t p,
If_Obj_t pObj 
)

Function*************************************************************

Synopsis [Returns the increase in the number of fanins with no external refs.]

Description []

SideEffects []

SeeAlso []

Definition at line 286 of file ifReduce.c.

287 {
288  int Counter = 0;
289  assert( If_ObjIsAnd(pObj) );
290  // check if the node has external refs
291  if ( pObj->nRefs == 0 )
292  Counter--;
293  // increment the number of fanins without external refs
294  if ( !If_ObjFanin0(pObj)->fMark && If_ObjFanin0(pObj)->nRefs == 0 )
295  Counter++;
296  // increment the number of fanins without external refs
297  if ( !If_ObjFanin1(pObj)->fMark && If_ObjFanin1(pObj)->nRefs == 0 )
298  Counter++;
299  return Counter;
300 }
static int If_ObjIsAnd(If_Obj_t *pObj)
Definition: if.h:377
static If_Obj_t * If_ObjFanin0(If_Obj_t *pObj)
Definition: if.h:380
int nRefs
Definition: if.h:318
static If_Obj_t * If_ObjFanin1(If_Obj_t *pObj)
Definition: if.h:381
static int Counter
#define assert(ex)
Definition: util_old.h:213
void If_ManImproveNodeFaninUpdate ( If_Man_t p,
If_Obj_t pObj,
Vec_Ptr_t vFront,
Vec_Ptr_t vVisited 
)

Function*************************************************************

Synopsis [Updates the frontier.]

Description []

SideEffects []

SeeAlso []

Definition at line 313 of file ifReduce.c.

314 {
315  If_Obj_t * pFanin;
316  assert( If_ObjIsAnd(pObj) );
317  Vec_PtrRemove( vFront, pObj );
318  pFanin = If_ObjFanin0(pObj);
319  if ( !pFanin->fMark )
320  {
321  Vec_PtrPush( vFront, pFanin );
322  Vec_PtrPush( vVisited, pFanin );
323  pFanin->fMark = 1;
324  }
325  pFanin = If_ObjFanin1(pObj);
326  if ( !pFanin->fMark )
327  {
328  Vec_PtrPush( vFront, pFanin );
329  Vec_PtrPush( vVisited, pFanin );
330  pFanin->fMark = 1;
331  }
332 }
Definition: if.h:303
static int If_ObjIsAnd(If_Obj_t *pObj)
Definition: if.h:377
static If_Obj_t * If_ObjFanin0(If_Obj_t *pObj)
Definition: if.h:380
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static void Vec_PtrRemove(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:714
static If_Obj_t * If_ObjFanin1(If_Obj_t *pObj)
Definition: if.h:381
#define assert(ex)
Definition: util_old.h:213
unsigned fMark
Definition: if.h:310
void If_ManImproveNodePrepare ( If_Man_t p,
If_Obj_t pObj,
int  nLimit,
Vec_Ptr_t vFront,
Vec_Ptr_t vFrontOld,
Vec_Ptr_t vVisited 
)
static

Function*************************************************************

Synopsis [Prepares node mapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 204 of file ifReduce.c.

205 {
206  If_Cut_t * pCut;
207  If_Obj_t * pLeaf;
208  int i;
209  Vec_PtrClear( vFront );
210  Vec_PtrClear( vFrontOld );
211  Vec_PtrClear( vVisited );
212  // expand the cut downwards from the given place
213  pCut = If_ObjCutBest(pObj);
214  If_CutForEachLeaf( p, pCut, pLeaf, i )
215  {
216  Vec_PtrPush( vFront, pLeaf );
217  Vec_PtrPush( vFrontOld, pLeaf );
218  Vec_PtrPush( vVisited, pLeaf );
219  pLeaf->fMark = 1;
220  }
221  // mark the nodes in the cone
222  If_ManImproveMark_rec( p, pObj, vVisited );
223 }
Definition: if.h:303
Definition: if.h:275
#define If_CutForEachLeaf(p, pCut, pLeaf, i)
Definition: if.h:474
void If_ManImproveMark_rec(If_Man_t *p, If_Obj_t *pObj, Vec_Ptr_t *vVisited)
Definition: ifReduce.c:182
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static If_Cut_t * If_ObjCutBest(If_Obj_t *pObj)
Definition: if.h:401
static void Vec_PtrClear(Vec_Ptr_t *p)
Definition: vecPtr.h:545
unsigned fMark
Definition: if.h:310
void If_ManImproveNodeUpdate ( If_Man_t p,
If_Obj_t pObj,
Vec_Ptr_t vFront 
)
static

Function*************************************************************

Synopsis [Updates the frontier.]

Description []

SideEffects []

SeeAlso []

Definition at line 236 of file ifReduce.c.

237 {
238  If_Cut_t * pCut;
239  If_Obj_t * pFanin;
240  int i;
241  pCut = If_ObjCutBest(pObj);
242  // deref node's cut
243  If_CutAreaDeref( p, pCut );
244  // update the node's cut
245  pCut->nLeaves = Vec_PtrSize(vFront);
246  Vec_PtrForEachEntry( If_Obj_t *, vFront, pFanin, i )
247  pCut->pLeaves[i] = pFanin->Id;
248  If_CutOrder( pCut );
249  pCut->uSign = If_ObjCutSignCompute(pCut);
250  // ref the new cut
251  If_CutAreaRef( p, pCut );
252 }
unsigned nLeaves
Definition: if.h:289
float If_CutAreaDeref(If_Man_t *p, If_Cut_t *pCut)
Definition: ifCut.c:1032
Definition: if.h:303
Definition: if.h:275
static If_Cut_t * If_ObjCutBest(If_Obj_t *pObj)
Definition: if.h:401
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
void If_CutOrder(If_Cut_t *pCut)
Definition: ifCut.c:797
static unsigned If_ObjCutSignCompute(If_Cut_t *p)
Definition: if.h:403
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
float If_CutAreaRef(If_Man_t *p, If_Cut_t *pCut)
Definition: ifCut.c:1059
int If_ManImproveNodeWillGrow ( If_Man_t p,
If_Obj_t pObj 
)

Function*************************************************************

Synopsis [Returns 1 if the number of fanins will grow.]

Description []

SideEffects []

SeeAlso []

Definition at line 266 of file ifReduce.c.

267 {
268  If_Obj_t * pFanin0, * pFanin1;
269  assert( If_ObjIsAnd(pObj) );
270  pFanin0 = If_ObjFanin0(pObj);
271  pFanin1 = If_ObjFanin1(pObj);
272  return !pFanin0->fMark && !pFanin1->fMark;
273 }
Definition: if.h:303
static int If_ObjIsAnd(If_Obj_t *pObj)
Definition: if.h:377
static If_Obj_t * If_ObjFanin0(If_Obj_t *pObj)
Definition: if.h:380
static If_Obj_t * If_ObjFanin1(If_Obj_t *pObj)
Definition: if.h:381
#define assert(ex)
Definition: util_old.h:213
unsigned fMark
Definition: if.h:310