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

Go to the source code of this file.

Functions

static ABC_NAMESPACE_IMPL_START int Abc_MfsComputeRootsCheck (Abc_Obj_t *pNode, int nLevelMax, int nFanoutLimit)
 DECLARATIONS ///. More...
 
void Abc_MfsComputeRoots_rec (Abc_Obj_t *pNode, int nLevelMax, int nFanoutLimit, Vec_Ptr_t *vRoots)
 
Vec_Ptr_tAbc_MfsComputeRoots (Abc_Obj_t *pNode, int nWinTfoMax, int nFanoutLimit)
 

Function Documentation

Vec_Ptr_t* Abc_MfsComputeRoots ( Abc_Obj_t pNode,
int  nWinTfoMax,
int  nFanoutLimit 
)

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

Synopsis [Recursively collects the root candidates.]

Description [Returns 1 if the only root is this node.]

SideEffects []

SeeAlso []

Definition at line 99 of file mfsWin.c.

100 {
101  Vec_Ptr_t * vRoots;
102  vRoots = Vec_PtrAlloc( 10 );
103  Abc_NtkIncrementTravId( pNode->pNtk );
104  Abc_MfsComputeRoots_rec( pNode, pNode->Level + nWinTfoMax, nFanoutLimit, vRoots );
105  assert( Vec_PtrSize(vRoots) > 0 );
106 // if ( Vec_PtrSize(vRoots) == 1 && Vec_PtrEntry(vRoots, 0) == pNode )
107 // return 0;
108  return vRoots;
109 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
unsigned Level
Definition: abc.h:142
Abc_Ntk_t * pNtk
Definition: abc.h:130
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
static void Abc_NtkIncrementTravId(Abc_Ntk_t *p)
Definition: abc.h:406
void Abc_MfsComputeRoots_rec(Abc_Obj_t *pNode, int nLevelMax, int nFanoutLimit, Vec_Ptr_t *vRoots)
Definition: mfsWin.c:72
#define assert(ex)
Definition: util_old.h:213
void Abc_MfsComputeRoots_rec ( Abc_Obj_t pNode,
int  nLevelMax,
int  nFanoutLimit,
Vec_Ptr_t vRoots 
)

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

Synopsis [Recursively collects the root candidates.]

Description []

SideEffects []

SeeAlso []

Definition at line 72 of file mfsWin.c.

73 {
74  Abc_Obj_t * pFanout;
75  int i;
76  assert( Abc_ObjIsNode(pNode) );
77  if ( Abc_NodeIsTravIdCurrent(pNode) )
78  return;
79  Abc_NodeSetTravIdCurrent( pNode );
80  // check if the node should be the root
81  if ( Abc_MfsComputeRootsCheck( pNode, nLevelMax, nFanoutLimit ) )
82  Vec_PtrPush( vRoots, pNode );
83  else // if not, explore its fanouts
84  Abc_ObjForEachFanout( pNode, pFanout, i )
85  Abc_MfsComputeRoots_rec( pFanout, nLevelMax, nFanoutLimit, vRoots );
86 }
static ABC_NAMESPACE_IMPL_START int Abc_MfsComputeRootsCheck(Abc_Obj_t *pNode, int nLevelMax, int nFanoutLimit)
DECLARATIONS ///.
Definition: mfsWin.c:45
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:411
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
void Abc_MfsComputeRoots_rec(Abc_Obj_t *pNode, int nLevelMax, int nFanoutLimit, Vec_Ptr_t *vRoots)
Definition: mfsWin.c:72
#define assert(ex)
Definition: util_old.h:213
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:409
static ABC_NAMESPACE_IMPL_START int Abc_MfsComputeRootsCheck ( Abc_Obj_t pNode,
int  nLevelMax,
int  nFanoutLimit 
)
inlinestatic

DECLARATIONS ///.

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

FileName [mfsWin.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [The good old minimization with complete don't-cares.]

Synopsis [Procedures to compute windows stretching to the PIs.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
mfsWin.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Returns 1 if the node should be a root.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file mfsWin.c.

46 {
47  Abc_Obj_t * pFanout;
48  int i;
49  // the node is the root if one of the following is true:
50  // (1) the node has more than fanouts than the limit
51  if ( Abc_ObjFanoutNum(pNode) > nFanoutLimit )
52  return 1;
53  // (2) the node has CO fanouts
54  // (3) the node has fanouts above the cutoff level
55  Abc_ObjForEachFanout( pNode, pFanout, i )
56  if ( Abc_ObjIsCo(pFanout) || (int)pFanout->Level > nLevelMax )
57  return 1;
58  return 0;
59 }
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
static int Abc_ObjIsCo(Abc_Obj_t *pObj)
Definition: abc.h:352
if(last==0)
Definition: sparse_int.h:34
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526