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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Cut_Cut_t
Cut_NodeReadCutsNew (Cut_Man_t *p, int Node)
 DECLARATIONS ///. More...
 
Cut_Cut_tCut_NodeReadCutsOld (Cut_Man_t *p, int Node)
 
Cut_Cut_tCut_NodeReadCutsTemp (Cut_Man_t *p, int Node)
 
void Cut_NodeWriteCutsNew (Cut_Man_t *p, int Node, Cut_Cut_t *pList)
 
void Cut_NodeWriteCutsOld (Cut_Man_t *p, int Node, Cut_Cut_t *pList)
 
void Cut_NodeWriteCutsTemp (Cut_Man_t *p, int Node, Cut_Cut_t *pList)
 
void Cut_NodeSetTriv (Cut_Man_t *p, int Node)
 
void Cut_NodeTryDroppingCuts (Cut_Man_t *p, int Node)
 
void Cut_NodeFreeCuts (Cut_Man_t *p, int Node)
 

Function Documentation

void Cut_NodeFreeCuts ( Cut_Man_t p,
int  Node 
)

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

Synopsis [Deallocates the cuts at the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 184 of file cutApi.c.

185 {
186  Cut_Cut_t * pList, * pCut, * pCut2;
187  pList = Cut_NodeReadCutsNew( p, Node );
188  if ( pList == NULL )
189  return;
190  Cut_ListForEachCutSafe( pList, pCut, pCut2 )
191  Cut_CutRecycle( p, pCut );
192  Cut_NodeWriteCutsNew( p, Node, NULL );
193 }
#define Cut_ListForEachCutSafe(pList, pCut, pCut2)
Definition: cutInt.h:112
void Cut_NodeWriteCutsNew(Cut_Man_t *p, int Node, Cut_Cut_t *pList)
Definition: cutApi.c:97
void Cut_CutRecycle(Cut_Man_t *p, Cut_Cut_t *pCut)
Definition: cutCut.c:72
ABC_NAMESPACE_IMPL_START Cut_Cut_t * Cut_NodeReadCutsNew(Cut_Man_t *p, int Node)
DECLARATIONS ///.
Definition: cutApi.c:45
ABC_NAMESPACE_IMPL_START Cut_Cut_t* Cut_NodeReadCutsNew ( Cut_Man_t p,
int  Node 
)

DECLARATIONS ///.

MACRO DEFINITIONS ///.

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

FileName [cutNode.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [K-feasible cut computation package.]

Synopsis [Procedures to compute cuts for a node.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Returns the pointer to the linked list of cuts.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file cutApi.c.

46 {
47  if ( Node >= p->vCutsNew->nSize )
48  return NULL;
49  return (Cut_Cut_t *)Vec_PtrEntry( p->vCutsNew, Node );
50 }
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
Vec_Ptr_t * vCutsNew
Definition: cutInt.h:55
Cut_Cut_t* Cut_NodeReadCutsOld ( Cut_Man_t p,
int  Node 
)

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

Synopsis [Returns the pointer to the linked list of cuts.]

Description []

SideEffects []

SeeAlso []

Definition at line 63 of file cutApi.c.

64 {
65  assert( Node < p->vCutsOld->nSize );
66  return (Cut_Cut_t *)Vec_PtrEntry( p->vCutsOld, Node );
67 }
Vec_Ptr_t * vCutsOld
Definition: cutInt.h:56
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
#define assert(ex)
Definition: util_old.h:213
Cut_Cut_t* Cut_NodeReadCutsTemp ( Cut_Man_t p,
int  Node 
)

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

Synopsis [Returns the pointer to the linked list of cuts.]

Description []

SideEffects []

SeeAlso []

Definition at line 80 of file cutApi.c.

81 {
82  assert( Node < p->vCutsTemp->nSize );
83  return (Cut_Cut_t *)Vec_PtrEntry( p->vCutsTemp, Node );
84 }
Vec_Ptr_t * vCutsTemp
Definition: cutInt.h:57
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
#define assert(ex)
Definition: util_old.h:213
void Cut_NodeSetTriv ( Cut_Man_t p,
int  Node 
)

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

Synopsis [Sets the trivial cut for the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 145 of file cutApi.c.

146 {
147  assert( Cut_NodeReadCutsNew(p, Node) == NULL );
148  Cut_NodeWriteCutsNew( p, Node, Cut_CutCreateTriv(p, Node) );
149 }
void Cut_NodeWriteCutsNew(Cut_Man_t *p, int Node, Cut_Cut_t *pList)
Definition: cutApi.c:97
Cut_Cut_t * Cut_CutCreateTriv(Cut_Man_t *p, int Node)
Definition: cutCut.c:238
#define assert(ex)
Definition: util_old.h:213
ABC_NAMESPACE_IMPL_START Cut_Cut_t * Cut_NodeReadCutsNew(Cut_Man_t *p, int Node)
DECLARATIONS ///.
Definition: cutApi.c:45
void Cut_NodeTryDroppingCuts ( Cut_Man_t p,
int  Node 
)

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

Synopsis [Consider dropping cuts if they are useless by now.]

Description []

SideEffects []

SeeAlso []

Definition at line 162 of file cutApi.c.

163 {
164  int nFanouts;
165  assert( p->vFanCounts );
166  nFanouts = Vec_IntEntry( p->vFanCounts, Node );
167  assert( nFanouts > 0 );
168  if ( --nFanouts == 0 )
169  Cut_NodeFreeCuts( p, Node );
170  Vec_IntWriteEntry( p->vFanCounts, Node, nFanouts );
171 }
Vec_Int_t * vFanCounts
Definition: cutInt.h:52
void Cut_NodeFreeCuts(Cut_Man_t *p, int Node)
Definition: cutApi.c:184
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
#define assert(ex)
Definition: util_old.h:213
void Cut_NodeWriteCutsNew ( Cut_Man_t p,
int  Node,
Cut_Cut_t pList 
)

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

Synopsis [Returns the pointer to the linked list of cuts.]

Description []

SideEffects []

SeeAlso []

Definition at line 97 of file cutApi.c.

98 {
99  Vec_PtrWriteEntry( p->vCutsNew, Node, pList );
100 }
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
Definition: vecPtr.h:396
Vec_Ptr_t * vCutsNew
Definition: cutInt.h:55
void Cut_NodeWriteCutsOld ( Cut_Man_t p,
int  Node,
Cut_Cut_t pList 
)

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

Synopsis [Returns the pointer to the linked list of cuts.]

Description []

SideEffects []

SeeAlso []

Definition at line 113 of file cutApi.c.

114 {
115  Vec_PtrWriteEntry( p->vCutsOld, Node, pList );
116 }
Vec_Ptr_t * vCutsOld
Definition: cutInt.h:56
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
Definition: vecPtr.h:396
void Cut_NodeWriteCutsTemp ( Cut_Man_t p,
int  Node,
Cut_Cut_t pList 
)

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

Synopsis [Returns the pointer to the linked list of cuts.]

Description []

SideEffects []

SeeAlso []

Definition at line 129 of file cutApi.c.

130 {
131  Vec_PtrWriteEntry( p->vCutsTemp, Node, pList );
132 }
Vec_Ptr_t * vCutsTemp
Definition: cutInt.h:57
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
Definition: vecPtr.h:396